2019-05-30 23:11:13 +01:00
|
|
|
package env
|
|
|
|
|
|
|
|
import (
|
2020-07-27 13:22:00 +01:00
|
|
|
"github.com/micro/go-micro/v3/config/source"
|
2019-05-30 23:11:13 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
type watcher struct {
|
|
|
|
exit chan struct{}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *watcher) Next() (*source.ChangeSet, error) {
|
|
|
|
<-w.exit
|
|
|
|
|
2019-08-20 22:32:47 +01:00
|
|
|
return nil, source.ErrWatcherStopped
|
2019-05-30 23:11:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func (w *watcher) Stop() error {
|
|
|
|
close(w.exit)
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func newWatcher() (source.Watcher, error) {
|
|
|
|
return &watcher{exit: make(chan struct{})}, nil
|
|
|
|
}
|