Documentation ¶
Index ¶
- type Array
- type Boolean
- type Config
- func (c *Config) Get(path string) Value
- func (c *Config) GetArray(path string) Array
- func (c *Config) GetBoolean(path string) bool
- func (c *Config) GetConfig(path string) *Config
- func (c *Config) GetDuration(path string) time.Duration
- func (c *Config) GetFloat32(path string) float32
- func (c *Config) GetFloat64(path string) float64
- func (c *Config) GetInt(path string) int
- func (c *Config) GetIntSlice(path string) []int
- func (c *Config) GetObject(path string) Object
- func (c *Config) GetRoot() Value
- func (c *Config) GetString(path string) string
- func (c *Config) GetStringMap(path string) map[string]Value
- func (c *Config) GetStringMapString(path string) map[string]string
- func (c *Config) GetStringSlice(path string) []string
- func (c *Config) String() string
- func (c *Config) WithFallback(fallback *Config) *Config
- type Duration
- type Float32
- type Float64
- type Int
- type Null
- type Object
- type ParseError
- type String
- type Substitution
- type Type
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
type Array []Value
Array represents an array node in the configuration tree
func (Array) String ¶
String method returns the string representation of the Array
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config stores the root of the configuration tree and provides an API to retrieve configuration values with the path expressions
func ParseResource ¶
ParseResource parses the resource at the given path, creates the configuration tree and returns a pointer to the Config, returns the error if any error occurs while parsing
func ParseString ¶
ParseString function parses the given hocon string, creates the configuration tree and returns a pointer to the Config, returns a ParseError if any error occurs while parsing
func (*Config) Get ¶
Get method finds the value at the given path and returns it without casting to any type returns nil if the value is not found
func (*Config) GetArray ¶
GetArray method finds the value at the given path and returns it as an Array, returns nil if the value is not found
func (*Config) GetBoolean ¶
GetBoolean method finds the value at the given path and returns it as a Boolean returns false if the value is not found
func (*Config) GetConfig ¶ added in v1.2.3
GetConfig method finds the value at the given path and returns it as a Config, returns nil if the value is not found
func (*Config) GetDuration ¶
GetDuration method finds the value at the given path and returns it as a time.Duration returns 0 if the value is not found
func (*Config) GetFloat32 ¶
GetFloat32 method finds the value at the given path and returns it as a Float32 returns float32(0.0) if the value is not found
func (*Config) GetFloat64 ¶
GetFloat64 method finds the value at the given path and returns it as a Float64 returns 0.0 if the value is not found
func (*Config) GetInt ¶
GetInt method finds the value at the given path and returns it as an Int, returns zero if the value is not found
func (*Config) GetIntSlice ¶ added in v1.1.0
GetIntSlice method finds the value at the given path and returns it as []int, returns nil if the value is not found
func (*Config) GetObject ¶
GetObject method finds the value at the given path and returns it as an Object, returns nil if the value is not found
func (*Config) GetRoot ¶ added in v1.2.2
GetRoot method returns the root value of the configuration
func (*Config) GetString ¶
GetString method finds the value at the given path and returns it as a String returns empty string if the value is not found
func (*Config) GetStringMap ¶ added in v1.1.0
GetStringMap method finds the value at the given path and returns it as a map[string]Value returns nil if the value is not found
func (*Config) GetStringMapString ¶ added in v1.1.0
GetStringMapString method finds the value at the given path and returns it as a map[string]string returns nil if the value is not found
func (*Config) GetStringSlice ¶ added in v1.1.0
GetStringSlice method finds the value at the given path and returns it as []string returns nil if the value is not found
func (*Config) String ¶
String method returns the string representation of the Config object
func (*Config) WithFallback ¶ added in v1.2.0
WithFallback method returns a new *Config (or the current config, if the given fallback doesn't get used) 1. merges the values of the current and fallback *Configs, if the root of both of them are of type Object for the same keys current values overrides the fallback values 2. if any of the *Configs has non-object root then returns the current *Config ignoring the fallback parameter
type Duration ¶
Duration represents a duration value
type Object ¶
Object represents an object node in the configuration tree
func (Object) String ¶
String method returns the string representation of the Object
func (Object) ToConfig ¶ added in v1.2.3
ToConfig method converts object to *Config
type ParseError ¶
type ParseError struct {
// contains filtered or unexported fields
}
ParseError represents an error occurred while parsing a resource or string to a hocon configuration
func (*ParseError) Error ¶
func (p *ParseError) Error() string
type Substitution ¶
type Substitution struct {
// contains filtered or unexported fields
}
Substitution refers to another value in the configuration tree
func (*Substitution) String ¶
func (s *Substitution) String() string
String method returns the string representation of the Substitution