Documentation ¶
Index ¶
- type Ezbunt
- func (ez *Ezbunt) DeleteKey(key string) (string, error)
- func (ez *Ezbunt) GetPairs(keyPrefix string) (map[string]string, error)
- func (ez *Ezbunt) GetVal(key string) (string, error)
- func (ez *Ezbunt) GetValAsBool(key string) (bool, error)
- func (ez *Ezbunt) GetValAsBoolDefault(key string, defaultVal bool) bool
- func (ez *Ezbunt) GetValAsBytes(key string) ([]byte, error)
- func (ez *Ezbunt) GetValAsInt(key string) (int, error)
- func (ez *Ezbunt) GetValAsIntDefault(key string, defaultVal int) int
- func (ez *Ezbunt) GetValAsTime(key string) (time.Time, error)
- func (ez *Ezbunt) GetValAsTimeDefault(key string, defaultVal time.Time) time.Time
- func (ez *Ezbunt) GetValDefault(key string, defaultVal string) string
- func (ez *Ezbunt) WriteKeyVal(key string, val string) error
- func (ez *Ezbunt) WriteKeyValAsBool(key string, val bool) error
- func (ez *Ezbunt) WriteKeyValAsBoolTTL(key string, val bool, ttlSeconds int) error
- func (ez *Ezbunt) WriteKeyValAsInt(key string, val int) error
- func (ez *Ezbunt) WriteKeyValAsIntTTL(key string, val int, ttlSeconds int) error
- func (ez *Ezbunt) WriteKeyValAsJSON(key string, val interface{}) error
- func (ez *Ezbunt) WriteKeyValAsJSONTTL(key string, val interface{}, ttlSeconds int) error
- func (ez *Ezbunt) WriteKeyValAsTime(key string, val time.Time) error
- func (ez *Ezbunt) WriteKeyValAsTimeTTL(key string, val time.Time, ttlSeconds int) error
- func (ez *Ezbunt) WriteKeyValTTL(key string, val string, ttlSeconds int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ezbunt ¶
type Ezbunt struct {
// contains filtered or unexported fields
}
Ezbunt encapsulates and extends a buntdb instance
func New ¶ added in v0.1.2
New creates and returns an Ezbunt with a new buntdb (with a backing file at the path provided)
func (*Ezbunt) DeleteKey ¶
DeleteKey removes a key-value pair and returns the value of the removed key
func (*Ezbunt) GetValAsBool ¶ added in v0.1.1
GetValAsBool retrieves the value as a `bool` type, and possible error, for the corresponding key.
func (*Ezbunt) GetValAsBoolDefault ¶ added in v0.1.1
GetValAsBoolDefault retrieves the value for the corresponding key. If the key is not found, the value is not found, or an error is returned from the db, the provided default is returned.
func (*Ezbunt) GetValAsBytes ¶
GetValAsBytes retrieves the value as []byte, and possible error, for the corresponding key. Useful for retrieving JSON objects.
func (*Ezbunt) GetValAsInt ¶ added in v0.1.1
GetValAsInt retrieves the value as an `int` type, and possible error, for the corresponding key.
func (*Ezbunt) GetValAsIntDefault ¶ added in v0.1.1
GetValAsIntDefault retrieves the value for the corresponding key. If the key is not found, the value is not found, or an error is returned from the db, the provided default is returned.
func (*Ezbunt) GetValAsTime ¶ added in v0.1.3
GetValAsTime retrieves the value as a `time.Time` type, and possible error, for the corresponding key.
func (*Ezbunt) GetValAsTimeDefault ¶ added in v0.1.3
GetValAsTimeDefault retrieves the value for the corresponding key. If the key is not found, the value is not found, or an error is returned from the db, the provided default is returned.
func (*Ezbunt) GetValDefault ¶
GetValDefault retrieves the value for the corresponding key. If the key is not found, the value is not found, or an error is returned from the db, the provided default is returned.
func (*Ezbunt) WriteKeyVal ¶
WriteKeyVal persists a key-value string pair indefinitley
func (*Ezbunt) WriteKeyValAsBool ¶
WriteKeyValAsBool persists a key-value string/bool pair indefinitley
func (*Ezbunt) WriteKeyValAsBoolTTL ¶
WriteKeyValAsBoolTTL persists a key-value string/bool pair with a TTL in seconds
func (*Ezbunt) WriteKeyValAsInt ¶
WriteKeyValAsInt persists a key-value string/int pair indefinitley
func (*Ezbunt) WriteKeyValAsIntTTL ¶
WriteKeyValAsIntTTL persists a key-value string/int pair with a TTL in seconds
func (*Ezbunt) WriteKeyValAsJSON ¶
WriteKeyValAsJSON persists a key-value pair with a string key, and converts the val to a json []byte, and stores it as the value. Useful for complex types.
func (*Ezbunt) WriteKeyValAsJSONTTL ¶
WriteKeyValAsJSONTTL persists a key-value pair with a string key, and converts the val to a json []byte, and stores it as the value, with a TTL in seconds. Useful for complex types.
func (*Ezbunt) WriteKeyValAsTime ¶ added in v0.1.3
WriteKeyValAsTime persists a key-value string/time.Time pair indefinitley
func (*Ezbunt) WriteKeyValAsTimeTTL ¶ added in v0.1.3
WriteKeyValAsTimeTTL persists a key-value string/time.Time pair with a TTL in seconds