Documentation
¶
Index ¶
- type AutoConfig
- type Data
- type Yaml
- func (t *Yaml) GetBool(key string, def bool) bool
- func (t *Yaml) GetConfigItem(typeName string, name string) map[string]interface{}
- func (t *Yaml) GetFloat(key string, def float64) float64
- func (t *Yaml) GetInt(key string, def int) int
- func (t *Yaml) GetMapBool(key string, def map[string]bool) map[string]bool
- func (t *Yaml) GetMapFloat(key string, def map[string]float64) map[string]float64
- func (t *Yaml) GetMapInt(key string, def map[string]int) map[string]int
- func (t *Yaml) GetMapInterface(key string, def map[string]interface{}) map[string]interface{}
- func (t *Yaml) GetMapString(key string, def map[string]string) map[string]string
- func (t *Yaml) GetSliceBool(key string, def []bool) []bool
- func (t *Yaml) GetSliceFloat(key string, def []float64) []float64
- func (t *Yaml) GetSliceInt(key string, def []int) []int
- func (t *Yaml) GetSliceInterface(key string, def []interface{}) []interface{}
- func (t *Yaml) GetSliceString(key string, def []string) []string
- func (t *Yaml) GetString(key string, def string) string
- func (t *Yaml) Has(key string) bool
- func (t *Yaml) Init(app interfaces.IEngine) error
- func (t *Yaml) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutoConfig ¶
type AutoConfig struct {
FName string `yaml:"filename"` // Filename of the YAML configuration file.
}
AutoConfig represents the configuration for the YAML file.
type Data ¶
type Data struct {
Engine []map[string]interface{} `yaml:"engine"` // Engine configurations.
Cfg map[string]interface{} `yaml:"cfg"` // General configurations.
}
Data represents the structure of the YAML data.
type Yaml ¶
type Yaml struct {
// contains filtered or unexported fields
}
Yaml handles the loading and parsing of YAML configuration files.
func New ¶
func New(cfg AutoConfig) *Yaml
New creates a new Yaml instance with the given configuration.
func (*Yaml) GetBool ¶
GetBool returns the boolean value for the given key, or the default value if the key does not exist.
func (*Yaml) GetConfigItem ¶
GetConfigItem returns the configuration item for the given type and name.
func (*Yaml) GetFloat ¶
GetFloat returns the float64 value for the given key, or the default value if the key does not exist.
func (*Yaml) GetInt ¶
GetInt returns the integer value for the given key, or the default value if the key does not exist.
func (*Yaml) GetMapBool ¶
GetMapBool returns the map[string]bool value for the given key, or the default value if the key does not exist.
func (*Yaml) GetMapFloat ¶
GetMapFloat returns the map[string]float64 value for the given key, or the default value if the key does not exist.
func (*Yaml) GetMapInt ¶
GetMapInt returns the map[string]int value for the given key, or the default value if the key does not exist.
func (*Yaml) GetMapInterface ¶
GetMapInterface returns the map[string]interface{} value for the given key, or the default value if the key does not exist.
func (*Yaml) GetMapString ¶
GetMapString returns the map[string]string value for the given key, or the default value if the key does not exist.
func (*Yaml) GetSliceBool ¶
GetSliceBool returns the []bool value for the given key, or the default value if the key does not exist.
func (*Yaml) GetSliceFloat ¶
GetSliceFloat returns the []float64 value for the given key, or the default value if the key does not exist.
func (*Yaml) GetSliceInt ¶
GetSliceInt returns the []int value for the given key, or the default value if the key does not exist.
func (*Yaml) GetSliceInterface ¶
GetSliceInterface returns the []interface{} value for the given key, or the default value if the key does not exist.
func (*Yaml) GetSliceString ¶
GetSliceString returns the []string value for the given key, or the default value if the key does not exist.
func (*Yaml) GetString ¶
GetString returns the string value for the given key, or the default value if the key does not exist.