Documentation ¶
Index ¶
- type Base
- type Callback
- type Config
- func (c *Config) Array(key string, b ...Callback) []interface{}
- func (c *Config) Bool(key string, b ...Callback) bool
- func (c *Config) Get(key string, b ...Callback) interface{}
- func (c *Config) Int(key string, b ...Callback) int
- func (c *Config) Load(file string) (e error)
- func (c *Config) Map(key string, b ...Callback) map[string]interface{}
- func (c *Config) String(key string, b ...Callback) string
- func (c *Config) Struct(key string, s interface{}, b ...Callback) interface{}
- func (c *Config) StructArray(key string, s interface{}, b ...Callback) []interface{}
- type ExtractorConstruct
- type IExtractor
- type ILoader
- type IProcessor
- type Ini
- type Json
- type Loader
- type Option
- type ProcessorConstruct
- type Reload
- type Value
- func (v *Value) Array(key string, b ...Callback) []interface{}
- func (v *Value) Bool(key string, b ...Callback) bool
- func (v *Value) Get(key string, b ...Callback) interface{}
- func (v *Value) Int(key string, b ...Callback) int
- func (v *Value) Load(m interface{}, name string)
- func (v *Value) Map(key string, b ...Callback) map[string]interface{}
- func (v *Value) String(key string, b ...Callback) string
- func (v *Value) Struct(key string, s interface{}, b ...Callback) interface{}
- func (v *Value) StructArray(key string, s interface{}, b ...Callback) []interface{}
- type Yaml
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Callback ¶ added in v1.1.0
type Callback interface {
// contains filtered or unexported methods
}
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func (*Config) StructArray ¶ added in v1.2.1
type ExtractorConstruct ¶
type ExtractorConstruct func() IExtractor
ExtractorConstruct is the type for a function capable of constructing new IExtractor.
type IExtractor ¶
type IExtractor interface { Load(interface{}, string) Get(string, ...Callback) interface{} String(string, ...Callback) string Int(string, ...Callback) int Bool(string, ...Callback) bool Array(string, ...Callback) []interface{} Map(string, ...Callback) map[string]interface{} Struct(string, interface{}, ...Callback) interface{} StructArray(string, interface{}, ...Callback) []interface{} }
type ILoader ¶ added in v1.1.0
type ILoader interface {
// contains filtered or unexported methods
}
type IProcessor ¶
func IniProcessor ¶
func IniProcessor() IProcessor
IniProcessor returns a Processor which load ini config
func JsonProcessor ¶
func JsonProcessor() IProcessor
JsonProcessor returns a Processor which load json config
func YamlProcessor ¶
func YamlProcessor() IProcessor
YamlProcessor returns a Processor which load yaml config
type Option ¶
type Option struct { File string Processor ProcessorConstruct Extractor ExtractorConstruct }
Option is used to pass multiple configuration options to Config's constructors.
type ProcessorConstruct ¶
type ProcessorConstruct func() IProcessor
ProcessorConstruct is the type for a function capable of constructing new IProcessor.
type Value ¶ added in v1.1.0
type Value struct { Key string Type string Value interface{} Child map[string]*Value Callback []Callback }
func DefaultExtractor ¶
func DefaultExtractor() *Value
func (*Value) StructArray ¶ added in v1.2.1
Source Files ¶
Click to show internal directories.
Click to hide internal directories.