github.com/annwntech/go-micro/v2@v2.9.5/config/options.go (about)

     1  package config
     2  
     3  import (
     4  	"github.com/annwntech/go-micro/v2/config/loader"
     5  	"github.com/annwntech/go-micro/v2/config/reader"
     6  	"github.com/annwntech/go-micro/v2/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  }