go-micro.dev/v5@v5.12.0/config/options.go (about) 1 package config 2 3 import ( 4 "go-micro.dev/v5/config/loader" 5 "go-micro.dev/v5/config/reader" 6 "go-micro.dev/v5/config/source" 7 ) 8 9 // WithLoader sets the loader for manager config. 10 func WithLoader(l loader.Loader) Option { 11 return func(o *Options) { 12 o.Loader = l 13 } 14 } 15 16 // WithSource appends a source to list of sources. 17 func WithSource(s source.Source) Option { 18 return func(o *Options) { 19 o.Source = append(o.Source, s) 20 } 21 } 22 23 // WithReader sets the config reader. 24 func WithReader(r reader.Reader) Option { 25 return func(o *Options) { 26 o.Reader = r 27 } 28 } 29 30 func WithWatcherDisabled() Option { 31 return func(o *Options) { 32 o.WithWatcherDisabled = true 33 } 34 }