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
// LookupConfigObject returns a object value for the specified path.
LookupConfigObject(paths ...string) (any, error)
// LookupConfigString returns a string value for the specified path.
LookupConfigString(paths ...string) (string, error)
// LookupConfigInt returns an integer value for the specified path.
LookupConfigInt(paths ...string) (int, error)
// LookupConfigBool returns a boolean value for the specified path.
LookupConfigBool(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.