Documentation
¶
Overview ¶
Package store is a dead simple configuration manager for Go applications.
Index ¶
- Constants
- Variables
- func Init(application string)
- 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
- func SetApplicationName(handle string)
- type MarshalFunc
- type UnmarshalFunc
Constants ¶
View Source
const StoreInLocalDirectory = "%LOCAL%"
Variables ¶
View Source
var ErrAppNameNotFound = errors.New("store: application name not defined")
View Source
var ErrUnknownFormat = errors.New("store: unknown configuration format")
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.
func SetApplicationName ¶
func SetApplicationName(handle string)
SetApplicationName is DEPRECATED (use Init instead).
Types ¶
type MarshalFunc ¶
MarshalFunc is any marshaler.
type UnmarshalFunc ¶
UnmarshalFunc is any unmarshaler.
Click to show internal directories.
Click to hide internal directories.