Documentation ¶
Index ¶
Constants ¶
View Source
const (
Sep = "."
)
Variables ¶
View Source
var ErrInvalid = errors.New("invalid")
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
func NewPathWith ¶
NewPath returns a new path with the specified elements.
Types ¶
type Config ¶
type Config interface { // UseConfigFile uses the specified file as the configuration. UsedConfigFile() string // GetConfigObject returns a object value for the specified path. GetConfigObject(paths ...string) (any, error) // GetConfigString returns a string value for the specified path. GetConfigString(paths ...string) (string, error) // GetConfigInt returns an integer value for the specified path. GetConfigInt(paths ...string) (int, error) // GetConfigBool returns a boolean value for the specified path. GetConfigBool(paths ...string) (bool, error) // UnmarshallConfig unmarshalls the specified path object to the specified object. UnmarshallConfig(paths []string, v any) error // SetConfigObject sets a object value to the specified path. SetConfigObject(paths []string, v any) error // SetConfigString sets a string value to the specified path. SetConfigString(paths []string, v string) error // SetConfigInt sets an integer value to the specified path. SetConfigInt(paths []string, v int) error // String returns a string representation of the configuration. String() string }
Config represents a configuration interface.
func NewConfigWith ¶
NewConfigWith creates a new configuration with the specified product name.
Click to show internal directories.
Click to hide internal directories.