The environ config is not fresh, it comes from the state object that was passed to NewEnvironObserver.
// NewEnvironObserver waits for the environment to have a valid
// environment configuration and returns a new environment observer.
// While waiting for the first environment configuration, it will
// return with tomb.ErrDying if it receives a value on dying.
func NewEnvironObserver(st EnvironConfigObserver) (*EnvironObserver, error) {
config, err := st.EnvironConfig()
if err != nil { return nil, err
}
environ, err := environs.New(config)
if err != nil {
The config returned from st.EnvironConfig is the State.config field. If you hold a reference to that State value, then you can retrieve the same config that is later retrieved, then mutated,
func (obs *EnvironObserver) loop() error {
for { select { case <-obs.tomb.Dying(): return nil case _, ok := <-obs.environWatcher.Changes(): if !ok { return watcher.EnsureErr(obs.environWatcher) }
} config, err := obs.st.EnvironConfig()
The environ config is not fresh, it comes from the state object that was passed to NewEnvironObserver.
// NewEnvironObserver waits for the environment to have a valid ver(st EnvironConfigOb server) (*EnvironObserver, error) {
return nil, err New(config)
// environment configuration and returns a new environment observer.
// While waiting for the first environment configuration, it will
// return with tomb.ErrDying if it receives a value on dying.
func NewEnvironObser
config, err := st.EnvironConfig()
if err != nil {
}
environ, err := environs.
if err != nil {
The config returned from st.EnvironConfig is the State.config field. If you hold a reference to that State value, then you can retrieve the same config that is later retrieved, then mutated,
func (obs *EnvironObserver) loop() error {
select {
case <-obs.tomb.Dying():
return nil
case _, ok := <-obs.environWa tcher.Changes( ):
if !ok {
return watcher. EnsureErr( obs.environWatc her)
}
config, err := obs.st. EnvironConfig( )
for {
}