Documentation ¶
Overview ¶
Package store is a dead simple configuration manager for Go applications.
Index ¶
- Variables
- func Load(path string, v interface{}) error
- func LoadWith(path string, v interface{}, um UnmarshalFunc) error
- func Register(extension string, m MarshalFunc, um UnmarshalFunc)
- func Save(path string, v interface{}) error
- func SaveWith(path string, v interface{}, m MarshalFunc) error
- type MarshalFunc
- type UnmarshalFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnknownFormat = errors.New("store: unknown configuration format")
ErrUnknownFormat is used when we can't automatically determine the file format type (or it is a type we don't support)
Functions ¶
func LoadWith ¶
func LoadWith(path string, v interface{}, um UnmarshalFunc) error
LoadWith loads the configuration using any unmarshaler at all.
func Register ¶
func Register(extension string, m MarshalFunc, um UnmarshalFunc)
Register is the way you register configuration formats, by mapping some file name extension to corresponding marshal and unmarshal functions. Once registered, the format given would be compatible with Load and Save.
func SaveWith ¶
func SaveWith(path string, v interface{}, m MarshalFunc) error
SaveWith saves the configuration using any marshaler at all.
Types ¶
type MarshalFunc ¶
MarshalFunc is any marshaler.
type UnmarshalFunc ¶
UnmarshalFunc is any unmarshaler.
Click to show internal directories.
Click to hide internal directories.