gitee.com/sasukebo/go-micro/v4@v4.7.1/config/loader/memory/options.go (about) 1 package memory 2 3 import ( 4 "gitee.com/sasukebo/go-micro/v4/config/loader" 5 "gitee.com/sasukebo/go-micro/v4/config/reader" 6 "gitee.com/sasukebo/go-micro/v4/config/source" 7 ) 8 9 // WithSource appends a source to list of sources 10 func WithSource(s source.Source) loader.Option { 11 return func(o *loader.Options) { 12 o.Source = append(o.Source, s) 13 } 14 } 15 16 // WithReader sets the config reader 17 func WithReader(r reader.Reader) loader.Option { 18 return func(o *loader.Options) { 19 o.Reader = r 20 } 21 } 22 23 func WithWatcherDisabled() loader.Option { 24 return func(o *loader.Options) { 25 o.WithWatcherDisabled = true 26 } 27 }