mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-24 10:07:04 +02:00
27 lines
393 B
Go
27 lines
393 B
Go
package env
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"github.com/micro/go-micro/config/source"
|
|
)
|
|
|
|
type watcher struct {
|
|
exit chan struct{}
|
|
}
|
|
|
|
func (w *watcher) Next() (*source.ChangeSet, error) {
|
|
<-w.exit
|
|
|
|
return nil, errors.New("watcher stopped")
|
|
}
|
|
|
|
func (w *watcher) Stop() error {
|
|
close(w.exit)
|
|
return nil
|
|
}
|
|
|
|
func newWatcher() (source.Watcher, error) {
|
|
return &watcher{exit: make(chan struct{})}, nil
|
|
}
|