Documentation ¶
Index ¶
- Variables
- func Array16RangeKeys(name string, length, from, to uint16) []kv.Key
- func Array32ElemKey(name string, idx uint32) kv.Key
- func Array32RangeKeys(name string, length, from, to uint32) []kv.Key
- func Array32SizeKey(name string) kv.Key
- func MapElemKey(mapName string, keyInMap []byte) []byte
- func MapSizeKey(mapName string) []byte
- type Array16
- type Array32
- type ImmutableArray16
- type ImmutableArray32
- type ImmutableMap
- func (m *ImmutableMap) GetAt(key []byte) []byte
- func (m *ImmutableMap) HasAt(key []byte) bool
- func (m *ImmutableMap) Iterate(f func(elemKey []byte, value []byte) bool)
- func (m *ImmutableMap) IterateKeys(f func(elemKey []byte) bool)
- func (m *ImmutableMap) Len() uint32
- func (m *ImmutableMap) Name() string
- type Map
Constants ¶
This section is empty.
Variables ¶
var ErrArray16Overflow = errors.New("Array16 overflow")
var ErrArray32Overflow = errors.New("Array32 overflow")
Functions ¶
func Array16RangeKeys ¶ added in v0.2.0
Array16RangeKeys returns the KVStore keys for the items between [from, to) (`to` being not inclusive), assuming it has `length` elements.
func Array32RangeKeys ¶ added in v0.2.0
Array32RangeKeys returns the KVStore keys for the items between [from, to) (`to` being not inclusive), assuming it has `length` elements.
func Array32SizeKey ¶ added in v0.3.0
func MapElemKey ¶ added in v0.3.0
func MapSizeKey ¶ added in v0.3.0
Types ¶
type Array16 ¶ added in v0.2.0
type Array16 struct { *ImmutableArray16 // contains filtered or unexported fields }
Array16 represents a dynamic array stored in a kv.KVStore
func (*Array16) Extend ¶ added in v0.2.0
func (a *Array16) Extend(other *ImmutableArray16)
func (*Array16) Immutable ¶ added in v0.2.0
func (a *Array16) Immutable() *ImmutableArray16
type Array32 ¶ added in v0.2.0
type Array32 struct { *ImmutableArray32 // contains filtered or unexported fields }
Array32 represents a dynamic array stored in a kv.KVStore
func (*Array32) Extend ¶ added in v0.2.0
func (a *Array32) Extend(other *ImmutableArray32)
func (*Array32) Immutable ¶ added in v0.2.0
func (a *Array32) Immutable() *ImmutableArray32
type ImmutableArray16 ¶ added in v0.2.0
type ImmutableArray16 struct {
// contains filtered or unexported fields
}
ImmutableArray16 provides read-only access to an Array16 in a kv.KVStoreReader.
func NewArray16ReadOnly ¶ added in v0.2.0
func NewArray16ReadOnly(kvReader kv.KVStoreReader, name string) *ImmutableArray16
func (*ImmutableArray16) GetAt ¶ added in v0.2.0
func (a *ImmutableArray16) GetAt(idx uint16) []byte
func (*ImmutableArray16) Len ¶ added in v0.2.0
func (a *ImmutableArray16) Len() uint16
Len == 0/empty/non-existent are equivalent
type ImmutableArray32 ¶ added in v0.2.0
type ImmutableArray32 struct {
// contains filtered or unexported fields
}
ImmutableArray32 provides read-only access to an Array32 in a kv.KVStoreReader.
func NewArray32ReadOnly ¶ added in v0.2.0
func NewArray32ReadOnly(kvReader kv.KVStoreReader, name string) *ImmutableArray32
func (*ImmutableArray32) GetAt ¶ added in v0.2.0
func (a *ImmutableArray32) GetAt(idx uint32) []byte
func (*ImmutableArray32) Len ¶ added in v0.2.0
func (a *ImmutableArray32) Len() uint32
Len == 0/empty/non-existent are equivalent
type ImmutableMap ¶
type ImmutableMap struct {
// contains filtered or unexported fields
}
ImmutableMap provides read-only access to a Map in a kv.KVStoreReader.
func NewMapReadOnly ¶
func NewMapReadOnly(kvReader kv.KVStoreReader, name string) *ImmutableMap
func (*ImmutableMap) GetAt ¶
func (m *ImmutableMap) GetAt(key []byte) []byte
func (*ImmutableMap) HasAt ¶
func (m *ImmutableMap) HasAt(key []byte) bool
func (*ImmutableMap) Iterate ¶
func (m *ImmutableMap) Iterate(f func(elemKey []byte, value []byte) bool)
Iterate non-deterministic
func (*ImmutableMap) IterateKeys ¶
func (m *ImmutableMap) IterateKeys(f func(elemKey []byte) bool)
IterateKeys non-deterministic
func (*ImmutableMap) Len ¶
func (m *ImmutableMap) Len() uint32
func (*ImmutableMap) Name ¶
func (m *ImmutableMap) Name() string
type Map ¶
type Map struct { *ImmutableMap // contains filtered or unexported fields }
Map represents a dynamic key-value collection in a kv.KVStore.
func (*Map) Immutable ¶
func (m *Map) Immutable() *ImmutableMap