Documentation ¶
Index ¶
- func GetConfig(opts ...FileConfigOption) config.Config
- type DefaultFileParser
- type FileConfig
- func (this *FileConfig) ApplyConfig(m map[string]string)
- func (this *FileConfig) ApplyDefault()
- func (this *FileConfig) Destroy()
- func (this *FileConfig) GetBoolean(key string, def bool) bool
- func (this *FileConfig) GetConfFile() string
- func (this *FileConfig) GetFloat(key string, def float32) float32
- func (this *FileConfig) GetInt(key string, def int) int32
- func (this *FileConfig) GetIntSet(key, defaultValue, deli string) []int32
- func (this *FileConfig) GetKeys() []string
- func (this *FileConfig) GetLong(key string, def int64) int64
- func (this *FileConfig) GetStringArray(key, def, deli string) []string
- func (this *FileConfig) GetStringHashCodeSet(key, defaultValue, deli string) []int32
- func (this *FileConfig) GetStringHashSet(key, defaultValue, deli string) []int32
- func (this *FileConfig) GetValue(key string) string
- func (this *FileConfig) GetValueDef(key, def string) string
- func (this *FileConfig) GetWhatapHome() string
- func (this *FileConfig) InArray(str string, list []string) bool
- func (this *FileConfig) SetValues(keyValues *map[string]string)
- func (this *FileConfig) String() string
- func (this *FileConfig) ToString() string
- type FileConfigOption
- func WithConfigObserver(obj *config.ConfigObserver) FileConfigOption
- func WithContext(ctx context.Context, cancel context.CancelFunc) FileConfigOption
- func WithExcludeKeys(keys []string) FileConfigOption
- func WithHomePath(home string) FileConfigOption
- func WithLogger(logger logger.Logger) FileConfigOption
- func WithParser(ps FileParser) FileConfigOption
- func WithPrefix(prefix string) FileConfigOption
- func WithSuffix(suffix string) FileConfigOption
- type FileParser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConfig ¶
func GetConfig(opts ...FileConfigOption) config.Config
Types ¶
type DefaultFileParser ¶
type DefaultFileParser struct { }
func NewDefaultFileParser ¶
func NewDefaultFileParser() *DefaultFileParser
type FileConfig ¶
type FileConfig struct { Debug bool // contains filtered or unexported fields }
func (*FileConfig) ApplyConfig ¶
func (this *FileConfig) ApplyConfig(m map[string]string)
interface ConfigObaserver
func (*FileConfig) ApplyDefault ¶
func (this *FileConfig) ApplyDefault()
func (*FileConfig) Destroy ¶
func (this *FileConfig) Destroy()
func (*FileConfig) GetBoolean ¶
func (this *FileConfig) GetBoolean(key string, def bool) bool
func (*FileConfig) GetConfFile ¶
func (this *FileConfig) GetConfFile() string
func (*FileConfig) GetIntSet ¶
func (this *FileConfig) GetIntSet(key, defaultValue, deli string) []int32
func (*FileConfig) GetKeys ¶
func (this *FileConfig) GetKeys() []string
func (*FileConfig) GetStringArray ¶
func (this *FileConfig) GetStringArray(key, def, deli string) []string
func (*FileConfig) GetStringHashCodeSet ¶
func (this *FileConfig) GetStringHashCodeSet(key, defaultValue, deli string) []int32
func (*FileConfig) GetStringHashSet ¶
func (this *FileConfig) GetStringHashSet(key, defaultValue, deli string) []int32
func (*FileConfig) GetValue ¶
func (this *FileConfig) GetValue(key string) string
func (*FileConfig) GetValueDef ¶
func (this *FileConfig) GetValueDef(key, def string) string
func (*FileConfig) GetWhatapHome ¶
func (this *FileConfig) GetWhatapHome() string
func (*FileConfig) SetValues ¶
func (this *FileConfig) SetValues(keyValues *map[string]string)
func (*FileConfig) String ¶
func (this *FileConfig) String() string
func (*FileConfig) ToString ¶
func (this *FileConfig) ToString() string
type FileConfigOption ¶
type FileConfigOption interface {
// contains filtered or unexported methods
}
func WithConfigObserver ¶
func WithConfigObserver(obj *config.ConfigObserver) FileConfigOption
func WithContext ¶
func WithContext(ctx context.Context, cancel context.CancelFunc) FileConfigOption
func WithExcludeKeys ¶
func WithExcludeKeys(keys []string) FileConfigOption
func WithHomePath ¶
func WithHomePath(home string) FileConfigOption
func WithLogger ¶
func WithLogger(logger logger.Logger) FileConfigOption
func WithParser ¶
func WithParser(ps FileParser) FileConfigOption
func WithPrefix ¶
func WithPrefix(prefix string) FileConfigOption
func WithSuffix ¶
func WithSuffix(suffix string) FileConfigOption
Click to show internal directories.
Click to hide internal directories.