Documentation ¶
Overview ¶
Package config implements a simple key-value store used to securely store game save data and high scores in a non-human readable binary format. It's basically a gob encoded map[string]interface{} .
Index ¶
- Variables
- func LoadDefaultOptions(cfg *Config)
- func Register(value interface{})
- type Config
- func (cfg *Config) Append(m map[string]interface{})
- func (cfg *Config) Close() error
- func (cfg *Config) Data() map[string]interface{}
- func (cfg *Config) Delete(key string)
- func (cfg *Config) Exists(key string) bool
- func (cfg *Config) Flush() error
- func (cfg *Config) Get(key string) (interface{}, error)
- func (cfg *Config) GetWithFallback(key string, fallback interface{}) interface{}
- func (cfg *Config) GobBytes() []byte
- func (cfg *Config) Map(fn MapFunc)
- func (cfg *Config) MustGet(key string) interface{}
- func (cfg *Config) Set(key string, value interface{})
- func (cfg *Config) SetData(m map[string]interface{})
- func (cfg *Config) Toggle(key string)
- func (cfg *Config) Wipe()
- type KeyError
- type MapFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrKeyNotExist error = errors.New("key does not exist")
Functions ¶
func LoadDefaultOptions ¶
func LoadDefaultOptions(cfg *Config)
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Self-explanatory.
func (*Config) Get ¶
Get gets a value from the map. If there is an error, it will be of type *KeyError.
func (*Config) GetWithFallback ¶
GetWithFallback gets a value from the map and returns the given fallback if not found.
Click to show internal directories.
Click to hide internal directories.