add Write method to config source
This commit is contained in:
parent
1781542964
commit
ef95b28e3d
@ -78,6 +78,11 @@ func (c *cliSource) Watch() (source.Watcher, error) {
|
||||
return source.NewNoopWatcher()
|
||||
}
|
||||
|
||||
// Write is unsupported
|
||||
func (c *cliSource) Write(cs *source.ChangeSet) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *cliSource) String() string {
|
||||
return "cli"
|
||||
}
|
||||
|
4
config/source/env/env.go
vendored
4
config/source/env/env.go
vendored
@ -105,6 +105,10 @@ func (e *env) Watch() (source.Watcher, error) {
|
||||
return newWatcher()
|
||||
}
|
||||
|
||||
func (e *env) Write(cs *source.ChangeSet) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e *env) String() string {
|
||||
return "env"
|
||||
}
|
||||
|
@ -76,6 +76,10 @@ func (c *etcd) Watch() (source.Watcher, error) {
|
||||
return newWatcher(c.prefix, c.stripPrefix, c.client.Watcher, cs, c.opts)
|
||||
}
|
||||
|
||||
func (c *etcd) Write(cs *source.ChangeSet) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func NewSource(opts ...source.Option) source.Source {
|
||||
options := source.NewOptions(opts...)
|
||||
|
||||
|
@ -54,6 +54,10 @@ func (f *file) Watch() (source.Watcher, error) {
|
||||
return newWatcher(f)
|
||||
}
|
||||
|
||||
func (f *file) Write(cs *source.ChangeSet) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func NewSource(opts ...source.Option) source.Source {
|
||||
options := source.NewOptions(opts...)
|
||||
path := DefaultPath
|
||||
|
@ -77,6 +77,10 @@ func (fs *flagsrc) Watch() (source.Watcher, error) {
|
||||
return source.NewNoopWatcher()
|
||||
}
|
||||
|
||||
func (fs *flagsrc) Write(cs *source.ChangeSet) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (fs *flagsrc) String() string {
|
||||
return "flag"
|
||||
}
|
||||
|
@ -41,6 +41,10 @@ func (s *memory) Watch() (source.Watcher, error) {
|
||||
return w, nil
|
||||
}
|
||||
|
||||
func (m *memory) Write(cs *source.ChangeSet) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Update allows manual updates of the config data.
|
||||
func (s *memory) Update(c *source.ChangeSet) {
|
||||
// don't process nil
|
||||
|
@ -15,6 +15,7 @@ var (
|
||||
type Source interface {
|
||||
Read() (*ChangeSet, error)
|
||||
Watch() (Watcher, error)
|
||||
Write(*ChangeSet) error
|
||||
String() string
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user