gitee.com/liuxuezhan/go-micro-v1.18.0@v1.0.0/config/options.go (about) 1 package config 2 3 import ( 4 "gitee.com/liuxuezhan/go-micro-v1.18.0/config/loader" 5 "gitee.com/liuxuezhan/go-micro-v1.18.0/config/reader" 6 "gitee.com/liuxuezhan/go-micro-v1.18.0/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 }