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 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) 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 MapFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound error = errors.New("key not found")
Functions ¶
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
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.