Documentation
¶
Overview ¶
Package appsettings provides simple key/value store functionality
Index ¶
- Variables
- type AppSettings
- func (a AppSettings) Delete(key string)
- func (a AppSettings) DeleteTree(key string)
- func (a AppSettings) GetInt(key string) (int, error)
- func (a AppSettings) GetInt64(key string) (int64, error)
- func (a AppSettings) GetLeaves() map[string]string
- func (a AppSettings) GetString(key string) (string, error)
- func (a AppSettings) GetTree(key string) DataTree
- func (a AppSettings) GetTrees() map[string]*tree
- func (a *AppSettings) Persist() error
- func (a AppSettings) SetInt(key string, val int)
- func (a AppSettings) SetInt64(key string, val int64)
- func (a AppSettings) SetString(key string, val string)
- type DataTree
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUndefinedKey = errors.New("undefined key")
ErrUndefinedKey is returned when the key requested from get is undefined.
Functions ¶
This section is empty.
Types ¶
type AppSettings ¶
type AppSettings struct {
// contains filtered or unexported fields
}
AppSettings is the root most DataTree
func NewAppSettings ¶
func NewAppSettings(dbFilename string) (*AppSettings, error)
NewAppSettings gets a new AppSettings struct
func (AppSettings) DeleteTree ¶ added in v0.2.0
func (a AppSettings) DeleteTree(key string)
func (*AppSettings) Persist ¶
func (a *AppSettings) Persist() error
Persist causes the current state of the app settings to be persisted.
type DataTree ¶
type DataTree interface { GetString(key string) (string, error) SetString(key string, val string) GetInt(key string) (int, error) SetInt(key string, val int) GetInt64(key string) (int64, error) SetInt64(key string, val int64) Delete(key string) DeleteTree(key string) GetTree(key string) DataTree GetTrees() map[string]*tree GetLeaves() map[string]string }
DataTree is the host of key and branches of values
Click to show internal directories.
Click to hide internal directories.