Documentation ¶
Index ¶
- Variables
- type Bytes
- type BytesDB
- type BytesMutexed
- type EncodedBytesDB
- type Generic
- type ID
- type IDSet
- type Key
- type KeyNotFound
- type NoRegisteredType
- type NoSuchID
- type OverwriteDisallowed
- type Parts
- type PartsTransformer
- type Serial
- type SerialMut
- type StringKeyConfig
- type StringSeparator
- type TypeID
- type TypeMap
- type TypeMapMut
- type TypeMapOverwrite
Constants ¶
This section is empty.
Variables ¶
View Source
var DotSeparated = NewStringSeparator(".")
Functions ¶
This section is empty.
Types ¶
type Bytes ¶
type Bytes interface { // Get retreives the value stored at key. Get(key ID) (value []byte, ok bool) // Set sets the value stored at key. Set(key ID, value []byte) error }
Byte is a database that holds bytes as values at keys indexed by uint64.
type BytesMutexed ¶
type BytesMutexed struct {
// contains filtered or unexported fields
}
func NewBytesMutexed ¶
func NewBytesMutexed(db Bytes) (b BytesMutexed)
type EncodedBytesDB ¶
type EncodedBytesDB struct {
// contains filtered or unexported fields
}
func (EncodedBytesDB) Get ¶
func (e EncodedBytesDB) Get(key ID, v interface{}) (err error)
func (*EncodedBytesDB) Set ¶
func (e *EncodedBytesDB) Set(key ID, v interface{}) (err error)
type Generic ¶
type Generic interface { /*Get attempts to write the value stored at key into value. It may or may not check whether the type of the passed in value is consistent with the given key.*/ Get(key ID, value interface{}) error /*Set sets value at key.*/ Set(key ID, value interface{}) error }
Generic is meant to be uncomplicated storage of key and value pairs where key.
type IDSet ¶
type IDSet struct {
// contains filtered or unexported fields
}
IDSet is a set of IDs that can be used to track which IDs are associated with which types or to disallow overwriting existing values associated with a key in a database.
type Key ¶
type Key = string
func TransformKey ¶
func TransformKey(cfg StringKeyConfig, key Key, pt PartsTransformer) (out Key, err error)
type KeyNotFound ¶
type KeyNotFound struct {
// contains filtered or unexported fields
}
func NewKeyNotFound ¶
func NewKeyNotFound(s fmt.Stringer) (k KeyNotFound)
func StringKeyNotFound ¶
func StringKeyNotFound(s string) (k KeyNotFound)
func (KeyNotFound) Error ¶
func (k KeyNotFound) Error() (s string)
type NoRegisteredType ¶
type NoRegisteredType struct {
TypeID
}
func (NoRegisteredType) Error ¶
func (n NoRegisteredType) Error() (s string)
type OverwriteDisallowed ¶
type OverwriteDisallowed struct {
// contains filtered or unexported fields
}
func (OverwriteDisallowed) Error ¶
func (o OverwriteDisallowed) Error() (s string)
type PartsTransformer ¶
type StringKeyConfig ¶
type StringSeparator ¶
type StringSeparator struct {
// contains filtered or unexported fields
}
func NewStringSeparator ¶
func NewStringSeparator(sep string) (s StringSeparator)
func (StringSeparator) JoinParts ¶
func (s StringSeparator) JoinParts(parts Parts) Key
func (StringSeparator) SplitParts ¶
func (s StringSeparator) SplitParts(key Key) (p Parts, err error)
type TypeMap ¶
type TypeMap struct {
// contains filtered or unexported fields
}
func NewTypeMap ¶
func NewTypeMap() (t TypeMap)
func (TypeMap) MustContain ¶
type TypeMapMut ¶
type TypeMapMut struct {
// contains filtered or unexported fields
}
func (*TypeMapMut) AllowOverwrite ¶
func (t *TypeMapMut) AllowOverwrite() (tm *TypeMapOverwrite)
func (*TypeMapMut) Register ¶
func (t *TypeMapMut) Register(id TypeID) (err error)
type TypeMapOverwrite ¶
type TypeMapOverwrite struct {
// contains filtered or unexported fields
}
func (*TypeMapOverwrite) Register ¶
func (t *TypeMapOverwrite) Register(id TypeID) (err error)
Click to show internal directories.
Click to hide internal directories.