Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
13918 lines (12139 sloc) 578 KB
package bolttype
// ForEachBytesToBytes is a for each with key of type []byte and value of type []byte.
func (b *Bucket) ForEachBytesToBytes(fn func(key []byte, value []byte) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := (rawKey)
value := (rawValue)
return fn(key, value)
},
)
}
// GetBytesToBytes is a get with key of type []byte and value of type []byte.
func (b *Bucket) GetBytesToBytes(key []byte) []byte {
return (b.Get((key)))
}
// GetRequiredBytesToBytes is a get with key of type []byte and value of type []byte that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredBytesToBytes(key []byte) ([]byte, error) {
value := b.Get((key))
if value == nil {
return nil, NewKeyNotFoundError(key)
}
return (value), nil
}
// PutBytesToBytes is a put with key of type []byte and value of type []byte.
func (b *Bucket) PutBytesToBytes(key []byte, value []byte) error {
return b.Put((key), (value))
}
// FirstBytesToBytes is first with key of type []byte and value of type []byte.
func (c *Cursor) FirstBytesToBytes() ([]byte, []byte) {
rawKey, rawValue := c.First()
key := (rawKey)
value := (rawValue)
return key, value
}
// LastBytesToBytes is first with key of type []byte and value of type []byte.
func (c *Cursor) LastBytesToBytes() ([]byte, []byte) {
rawKey, rawValue := c.Last()
key := (rawKey)
value := (rawValue)
return key, value
}
// NextBytesToBytes is first with key of type []byte and value of type []byte.
func (c *Cursor) NextBytesToBytes() ([]byte, []byte) {
rawKey, rawValue := c.Next()
key := (rawKey)
value := (rawValue)
return key, value
}
// PrevBytesToBytes is first with key of type []byte and value of type []byte.
func (c *Cursor) PrevBytesToBytes() ([]byte, []byte) {
rawKey, rawValue := c.Prev()
key := (rawKey)
value := (rawValue)
return key, value
}
// SeekBytesToBytes is first with key of type []byte and value of type []byte.
func (c *Cursor) SeekBytesToBytes(key []byte) ([]byte, []byte) {
rawKey, rawValue := c.Seek((key))
key = (rawKey)
value := (rawValue)
return key, value
}
// ForEachBytesToString is a for each with key of type []byte and value of type string.
func (b *Bucket) ForEachBytesToString(fn func(key []byte, value string) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := (rawKey)
value := string(rawValue)
return fn(key, value)
},
)
}
// GetBytesToString is a get with key of type []byte and value of type string.
func (b *Bucket) GetBytesToString(key []byte) string {
return string(b.Get((key)))
}
// GetRequiredBytesToString is a get with key of type []byte and value of type string that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredBytesToString(key []byte) (string, error) {
value := b.Get((key))
if value == nil {
return "", NewKeyNotFoundError(key)
}
return string(value), nil
}
// PutBytesToString is a put with key of type []byte and value of type string.
func (b *Bucket) PutBytesToString(key []byte, value string) error {
return b.Put((key), []byte(value))
}
// FirstBytesToString is first with key of type []byte and value of type string.
func (c *Cursor) FirstBytesToString() ([]byte, string) {
rawKey, rawValue := c.First()
key := (rawKey)
value := string(rawValue)
return key, value
}
// LastBytesToString is first with key of type []byte and value of type string.
func (c *Cursor) LastBytesToString() ([]byte, string) {
rawKey, rawValue := c.Last()
key := (rawKey)
value := string(rawValue)
return key, value
}
// NextBytesToString is first with key of type []byte and value of type string.
func (c *Cursor) NextBytesToString() ([]byte, string) {
rawKey, rawValue := c.Next()
key := (rawKey)
value := string(rawValue)
return key, value
}
// PrevBytesToString is first with key of type []byte and value of type string.
func (c *Cursor) PrevBytesToString() ([]byte, string) {
rawKey, rawValue := c.Prev()
key := (rawKey)
value := string(rawValue)
return key, value
}
// SeekBytesToString is first with key of type []byte and value of type string.
func (c *Cursor) SeekBytesToString(key []byte) ([]byte, string) {
rawKey, rawValue := c.Seek((key))
key = (rawKey)
value := string(rawValue)
return key, value
}
// ForEachBytesToUint16 is a for each with key of type []byte and value of type uint16.
func (b *Bucket) ForEachBytesToUint16(fn func(key []byte, value uint16) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := (rawKey)
value := bytesTouint16(rawValue)
return fn(key, value)
},
)
}
// GetBytesToUint16 is a get with key of type []byte and value of type uint16.
func (b *Bucket) GetBytesToUint16(key []byte) uint16 {
return bytesTouint16(b.Get((key)))
}
// GetRequiredBytesToUint16 is a get with key of type []byte and value of type uint16 that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredBytesToUint16(key []byte) (uint16, error) {
value := b.Get((key))
if value == nil {
return 0, NewKeyNotFoundError(key)
}
return bytesTouint16(value), nil
}
// PutBytesToUint16 is a put with key of type []byte and value of type uint16.
func (b *Bucket) PutBytesToUint16(key []byte, value uint16) error {
return b.Put((key), uint16Tobytes(value))
}
// FirstBytesToUint16 is first with key of type []byte and value of type uint16.
func (c *Cursor) FirstBytesToUint16() ([]byte, uint16) {
rawKey, rawValue := c.First()
key := (rawKey)
value := bytesTouint16(rawValue)
return key, value
}
// LastBytesToUint16 is first with key of type []byte and value of type uint16.
func (c *Cursor) LastBytesToUint16() ([]byte, uint16) {
rawKey, rawValue := c.Last()
key := (rawKey)
value := bytesTouint16(rawValue)
return key, value
}
// NextBytesToUint16 is first with key of type []byte and value of type uint16.
func (c *Cursor) NextBytesToUint16() ([]byte, uint16) {
rawKey, rawValue := c.Next()
key := (rawKey)
value := bytesTouint16(rawValue)
return key, value
}
// PrevBytesToUint16 is first with key of type []byte and value of type uint16.
func (c *Cursor) PrevBytesToUint16() ([]byte, uint16) {
rawKey, rawValue := c.Prev()
key := (rawKey)
value := bytesTouint16(rawValue)
return key, value
}
// SeekBytesToUint16 is first with key of type []byte and value of type uint16.
func (c *Cursor) SeekBytesToUint16(key []byte) ([]byte, uint16) {
rawKey, rawValue := c.Seek((key))
key = (rawKey)
value := bytesTouint16(rawValue)
return key, value
}
// ForEachBytesToUint32 is a for each with key of type []byte and value of type uint32.
func (b *Bucket) ForEachBytesToUint32(fn func(key []byte, value uint32) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := (rawKey)
value := bytesTouint32(rawValue)
return fn(key, value)
},
)
}
// GetBytesToUint32 is a get with key of type []byte and value of type uint32.
func (b *Bucket) GetBytesToUint32(key []byte) uint32 {
return bytesTouint32(b.Get((key)))
}
// GetRequiredBytesToUint32 is a get with key of type []byte and value of type uint32 that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredBytesToUint32(key []byte) (uint32, error) {
value := b.Get((key))
if value == nil {
return 0, NewKeyNotFoundError(key)
}
return bytesTouint32(value), nil
}
// PutBytesToUint32 is a put with key of type []byte and value of type uint32.
func (b *Bucket) PutBytesToUint32(key []byte, value uint32) error {
return b.Put((key), uint32Tobytes(value))
}
// FirstBytesToUint32 is first with key of type []byte and value of type uint32.
func (c *Cursor) FirstBytesToUint32() ([]byte, uint32) {
rawKey, rawValue := c.First()
key := (rawKey)
value := bytesTouint32(rawValue)
return key, value
}
// LastBytesToUint32 is first with key of type []byte and value of type uint32.
func (c *Cursor) LastBytesToUint32() ([]byte, uint32) {
rawKey, rawValue := c.Last()
key := (rawKey)
value := bytesTouint32(rawValue)
return key, value
}
// NextBytesToUint32 is first with key of type []byte and value of type uint32.
func (c *Cursor) NextBytesToUint32() ([]byte, uint32) {
rawKey, rawValue := c.Next()
key := (rawKey)
value := bytesTouint32(rawValue)
return key, value
}
// PrevBytesToUint32 is first with key of type []byte and value of type uint32.
func (c *Cursor) PrevBytesToUint32() ([]byte, uint32) {
rawKey, rawValue := c.Prev()
key := (rawKey)
value := bytesTouint32(rawValue)
return key, value
}
// SeekBytesToUint32 is first with key of type []byte and value of type uint32.
func (c *Cursor) SeekBytesToUint32(key []byte) ([]byte, uint32) {
rawKey, rawValue := c.Seek((key))
key = (rawKey)
value := bytesTouint32(rawValue)
return key, value
}
// ForEachBytesToUint64 is a for each with key of type []byte and value of type uint64.
func (b *Bucket) ForEachBytesToUint64(fn func(key []byte, value uint64) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := (rawKey)
value := bytesTouint64(rawValue)
return fn(key, value)
},
)
}
// GetBytesToUint64 is a get with key of type []byte and value of type uint64.
func (b *Bucket) GetBytesToUint64(key []byte) uint64 {
return bytesTouint64(b.Get((key)))
}
// GetRequiredBytesToUint64 is a get with key of type []byte and value of type uint64 that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredBytesToUint64(key []byte) (uint64, error) {
value := b.Get((key))
if value == nil {
return 0, NewKeyNotFoundError(key)
}
return bytesTouint64(value), nil
}
// PutBytesToUint64 is a put with key of type []byte and value of type uint64.
func (b *Bucket) PutBytesToUint64(key []byte, value uint64) error {
return b.Put((key), uint64Tobytes(value))
}
// FirstBytesToUint64 is first with key of type []byte and value of type uint64.
func (c *Cursor) FirstBytesToUint64() ([]byte, uint64) {
rawKey, rawValue := c.First()
key := (rawKey)
value := bytesTouint64(rawValue)
return key, value
}
// LastBytesToUint64 is first with key of type []byte and value of type uint64.
func (c *Cursor) LastBytesToUint64() ([]byte, uint64) {
rawKey, rawValue := c.Last()
key := (rawKey)
value := bytesTouint64(rawValue)
return key, value
}
// NextBytesToUint64 is first with key of type []byte and value of type uint64.
func (c *Cursor) NextBytesToUint64() ([]byte, uint64) {
rawKey, rawValue := c.Next()
key := (rawKey)
value := bytesTouint64(rawValue)
return key, value
}
// PrevBytesToUint64 is first with key of type []byte and value of type uint64.
func (c *Cursor) PrevBytesToUint64() ([]byte, uint64) {
rawKey, rawValue := c.Prev()
key := (rawKey)
value := bytesTouint64(rawValue)
return key, value
}
// SeekBytesToUint64 is first with key of type []byte and value of type uint64.
func (c *Cursor) SeekBytesToUint64(key []byte) ([]byte, uint64) {
rawKey, rawValue := c.Seek((key))
key = (rawKey)
value := bytesTouint64(rawValue)
return key, value
}
// ForEachBytesToUint16Uint16 is a for each with key of type []byte and value of type pair(uint16,uint16).
func (b *Bucket) ForEachBytesToUint16Uint16(fn func(key []byte, value1 uint16, value2 uint16) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := (rawKey)
value1, value2 := bytesTouint16uint16(rawValue)
return fn(key, value1, value2)
},
)
}
// GetBytesToUint16Uint16 is a get with key of type []byte and value of type pair(uint16,uint16).
func (b *Bucket) GetBytesToUint16Uint16(key []byte) (uint16, uint16) {
return bytesTouint16uint16(b.Get((key)))
}
// GetRequiredBytesToUint16Uint16 is a get with key of type []byte and value of type pair(uint16,uint16) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredBytesToUint16Uint16(key []byte) (uint16, uint16, error) {
value := b.Get((key))
if value == nil {
return 0, 0, NewKeyNotFoundError(key)
}
value1, value2 := bytesTouint16uint16(value)
return value1, value2, nil
}
// PutBytesToUint16Uint16 is a put with key of type []byte and value of type pair(uint16,uint16).
func (b *Bucket) PutBytesToUint16Uint16(key []byte, value1 uint16, value2 uint16) error {
return b.Put((key), uint16uint16Tobytes(value1, value2))
}
// FirstBytesToUint16Uint16 is first with key of type []byte and value of type pair(uint16,uint16).
func (c *Cursor) FirstBytesToUint16Uint16() ([]byte, uint16, uint16) {
rawKey, rawValue := c.First()
key := (rawKey)
value1, value2 := bytesTouint16uint16(rawValue)
return key, value1, value2
}
// LastBytesToUint16Uint16 is first with key of type []byte and value of type pair(uint16,uint16).
func (c *Cursor) LastBytesToUint16Uint16() ([]byte, uint16, uint16) {
rawKey, rawValue := c.Last()
key := (rawKey)
value1, value2 := bytesTouint16uint16(rawValue)
return key, value1, value2
}
// NextBytesToUint16Uint16 is first with key of type []byte and value of type pair(uint16,uint16).
func (c *Cursor) NextBytesToUint16Uint16() ([]byte, uint16, uint16) {
rawKey, rawValue := c.Next()
key := (rawKey)
value1, value2 := bytesTouint16uint16(rawValue)
return key, value1, value2
}
// PrevBytesToUint16Uint16 is first with key of type []byte and value of type pair(uint16,uint16).
func (c *Cursor) PrevBytesToUint16Uint16() ([]byte, uint16, uint16) {
rawKey, rawValue := c.Prev()
key := (rawKey)
value1, value2 := bytesTouint16uint16(rawValue)
return key, value1, value2
}
// SeekBytesToUint16Uint16 is first with key of type []byte and value of type pair(uint16,uint16).
func (c *Cursor) SeekBytesToUint16Uint16(key []byte) ([]byte, uint16, uint16) {
rawKey, rawValue := c.Seek((key))
key = (rawKey)
value1, value2 := bytesTouint16uint16(rawValue)
return key, value1, value2
}
// ForEachBytesToUint32Uint32 is a for each with key of type []byte and value of type pair(uint32,uint32).
func (b *Bucket) ForEachBytesToUint32Uint32(fn func(key []byte, value1 uint32, value2 uint32) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := (rawKey)
value1, value2 := bytesTouint32uint32(rawValue)
return fn(key, value1, value2)
},
)
}
// GetBytesToUint32Uint32 is a get with key of type []byte and value of type pair(uint32,uint32).
func (b *Bucket) GetBytesToUint32Uint32(key []byte) (uint32, uint32) {
return bytesTouint32uint32(b.Get((key)))
}
// GetRequiredBytesToUint32Uint32 is a get with key of type []byte and value of type pair(uint32,uint32) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredBytesToUint32Uint32(key []byte) (uint32, uint32, error) {
value := b.Get((key))
if value == nil {
return 0, 0, NewKeyNotFoundError(key)
}
value1, value2 := bytesTouint32uint32(value)
return value1, value2, nil
}
// PutBytesToUint32Uint32 is a put with key of type []byte and value of type pair(uint32,uint32).
func (b *Bucket) PutBytesToUint32Uint32(key []byte, value1 uint32, value2 uint32) error {
return b.Put((key), uint32uint32Tobytes(value1, value2))
}
// FirstBytesToUint32Uint32 is first with key of type []byte and value of type pair(uint32,uint32).
func (c *Cursor) FirstBytesToUint32Uint32() ([]byte, uint32, uint32) {
rawKey, rawValue := c.First()
key := (rawKey)
value1, value2 := bytesTouint32uint32(rawValue)
return key, value1, value2
}
// LastBytesToUint32Uint32 is first with key of type []byte and value of type pair(uint32,uint32).
func (c *Cursor) LastBytesToUint32Uint32() ([]byte, uint32, uint32) {
rawKey, rawValue := c.Last()
key := (rawKey)
value1, value2 := bytesTouint32uint32(rawValue)
return key, value1, value2
}
// NextBytesToUint32Uint32 is first with key of type []byte and value of type pair(uint32,uint32).
func (c *Cursor) NextBytesToUint32Uint32() ([]byte, uint32, uint32) {
rawKey, rawValue := c.Next()
key := (rawKey)
value1, value2 := bytesTouint32uint32(rawValue)
return key, value1, value2
}
// PrevBytesToUint32Uint32 is first with key of type []byte and value of type pair(uint32,uint32).
func (c *Cursor) PrevBytesToUint32Uint32() ([]byte, uint32, uint32) {
rawKey, rawValue := c.Prev()
key := (rawKey)
value1, value2 := bytesTouint32uint32(rawValue)
return key, value1, value2
}
// SeekBytesToUint32Uint32 is first with key of type []byte and value of type pair(uint32,uint32).
func (c *Cursor) SeekBytesToUint32Uint32(key []byte) ([]byte, uint32, uint32) {
rawKey, rawValue := c.Seek((key))
key = (rawKey)
value1, value2 := bytesTouint32uint32(rawValue)
return key, value1, value2
}
// ForEachBytesToUint64Uint64 is a for each with key of type []byte and value of type pair(uint64,uint64).
func (b *Bucket) ForEachBytesToUint64Uint64(fn func(key []byte, value1 uint64, value2 uint64) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := (rawKey)
value1, value2 := bytesTouint64uint64(rawValue)
return fn(key, value1, value2)
},
)
}
// GetBytesToUint64Uint64 is a get with key of type []byte and value of type pair(uint64,uint64).
func (b *Bucket) GetBytesToUint64Uint64(key []byte) (uint64, uint64) {
return bytesTouint64uint64(b.Get((key)))
}
// GetRequiredBytesToUint64Uint64 is a get with key of type []byte and value of type pair(uint64,uint64) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredBytesToUint64Uint64(key []byte) (uint64, uint64, error) {
value := b.Get((key))
if value == nil {
return 0, 0, NewKeyNotFoundError(key)
}
value1, value2 := bytesTouint64uint64(value)
return value1, value2, nil
}
// PutBytesToUint64Uint64 is a put with key of type []byte and value of type pair(uint64,uint64).
func (b *Bucket) PutBytesToUint64Uint64(key []byte, value1 uint64, value2 uint64) error {
return b.Put((key), uint64uint64Tobytes(value1, value2))
}
// FirstBytesToUint64Uint64 is first with key of type []byte and value of type pair(uint64,uint64).
func (c *Cursor) FirstBytesToUint64Uint64() ([]byte, uint64, uint64) {
rawKey, rawValue := c.First()
key := (rawKey)
value1, value2 := bytesTouint64uint64(rawValue)
return key, value1, value2
}
// LastBytesToUint64Uint64 is first with key of type []byte and value of type pair(uint64,uint64).
func (c *Cursor) LastBytesToUint64Uint64() ([]byte, uint64, uint64) {
rawKey, rawValue := c.Last()
key := (rawKey)
value1, value2 := bytesTouint64uint64(rawValue)
return key, value1, value2
}
// NextBytesToUint64Uint64 is first with key of type []byte and value of type pair(uint64,uint64).
func (c *Cursor) NextBytesToUint64Uint64() ([]byte, uint64, uint64) {
rawKey, rawValue := c.Next()
key := (rawKey)
value1, value2 := bytesTouint64uint64(rawValue)
return key, value1, value2
}
// PrevBytesToUint64Uint64 is first with key of type []byte and value of type pair(uint64,uint64).
func (c *Cursor) PrevBytesToUint64Uint64() ([]byte, uint64, uint64) {
rawKey, rawValue := c.Prev()
key := (rawKey)
value1, value2 := bytesTouint64uint64(rawValue)
return key, value1, value2
}
// SeekBytesToUint64Uint64 is first with key of type []byte and value of type pair(uint64,uint64).
func (c *Cursor) SeekBytesToUint64Uint64(key []byte) ([]byte, uint64, uint64) {
rawKey, rawValue := c.Seek((key))
key = (rawKey)
value1, value2 := bytesTouint64uint64(rawValue)
return key, value1, value2
}
// ForEachBytesToUint16Bytes is a for each with key of type []byte and value of type pair(uint16,[]byte).
func (b *Bucket) ForEachBytesToUint16Bytes(fn func(key []byte, value1 uint16, value2 []byte) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := (rawKey)
value1, value2 := bytesTouint16bytes(rawValue)
return fn(key, value1, value2)
},
)
}
// GetBytesToUint16Bytes is a get with key of type []byte and value of type pair(uint16,[]byte).
func (b *Bucket) GetBytesToUint16Bytes(key []byte) (uint16, []byte) {
return bytesTouint16bytes(b.Get((key)))
}
// GetRequiredBytesToUint16Bytes is a get with key of type []byte and value of type pair(uint16,[]byte) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredBytesToUint16Bytes(key []byte) (uint16, []byte, error) {
value := b.Get((key))
if value == nil {
return 0, nil, NewKeyNotFoundError(key)
}
value1, value2 := bytesTouint16bytes(value)
return value1, value2, nil
}
// PutBytesToUint16Bytes is a put with key of type []byte and value of type pair(uint16,[]byte).
func (b *Bucket) PutBytesToUint16Bytes(key []byte, value1 uint16, value2 []byte) error {
return b.Put((key), uint16bytesTobytes(value1, value2))
}
// FirstBytesToUint16Bytes is first with key of type []byte and value of type pair(uint16,[]byte).
func (c *Cursor) FirstBytesToUint16Bytes() ([]byte, uint16, []byte) {
rawKey, rawValue := c.First()
key := (rawKey)
value1, value2 := bytesTouint16bytes(rawValue)
return key, value1, value2
}
// LastBytesToUint16Bytes is first with key of type []byte and value of type pair(uint16,[]byte).
func (c *Cursor) LastBytesToUint16Bytes() ([]byte, uint16, []byte) {
rawKey, rawValue := c.Last()
key := (rawKey)
value1, value2 := bytesTouint16bytes(rawValue)
return key, value1, value2
}
// NextBytesToUint16Bytes is first with key of type []byte and value of type pair(uint16,[]byte).
func (c *Cursor) NextBytesToUint16Bytes() ([]byte, uint16, []byte) {
rawKey, rawValue := c.Next()
key := (rawKey)
value1, value2 := bytesTouint16bytes(rawValue)
return key, value1, value2
}
// PrevBytesToUint16Bytes is first with key of type []byte and value of type pair(uint16,[]byte).
func (c *Cursor) PrevBytesToUint16Bytes() ([]byte, uint16, []byte) {
rawKey, rawValue := c.Prev()
key := (rawKey)
value1, value2 := bytesTouint16bytes(rawValue)
return key, value1, value2
}
// SeekBytesToUint16Bytes is first with key of type []byte and value of type pair(uint16,[]byte).
func (c *Cursor) SeekBytesToUint16Bytes(key []byte) ([]byte, uint16, []byte) {
rawKey, rawValue := c.Seek((key))
key = (rawKey)
value1, value2 := bytesTouint16bytes(rawValue)
return key, value1, value2
}
// ForEachBytesToUint32Bytes is a for each with key of type []byte and value of type pair(uint32,[]byte).
func (b *Bucket) ForEachBytesToUint32Bytes(fn func(key []byte, value1 uint32, value2 []byte) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := (rawKey)
value1, value2 := bytesTouint32bytes(rawValue)
return fn(key, value1, value2)
},
)
}
// GetBytesToUint32Bytes is a get with key of type []byte and value of type pair(uint32,[]byte).
func (b *Bucket) GetBytesToUint32Bytes(key []byte) (uint32, []byte) {
return bytesTouint32bytes(b.Get((key)))
}
// GetRequiredBytesToUint32Bytes is a get with key of type []byte and value of type pair(uint32,[]byte) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredBytesToUint32Bytes(key []byte) (uint32, []byte, error) {
value := b.Get((key))
if value == nil {
return 0, nil, NewKeyNotFoundError(key)
}
value1, value2 := bytesTouint32bytes(value)
return value1, value2, nil
}
// PutBytesToUint32Bytes is a put with key of type []byte and value of type pair(uint32,[]byte).
func (b *Bucket) PutBytesToUint32Bytes(key []byte, value1 uint32, value2 []byte) error {
return b.Put((key), uint32bytesTobytes(value1, value2))
}
// FirstBytesToUint32Bytes is first with key of type []byte and value of type pair(uint32,[]byte).
func (c *Cursor) FirstBytesToUint32Bytes() ([]byte, uint32, []byte) {
rawKey, rawValue := c.First()
key := (rawKey)
value1, value2 := bytesTouint32bytes(rawValue)
return key, value1, value2
}
// LastBytesToUint32Bytes is first with key of type []byte and value of type pair(uint32,[]byte).
func (c *Cursor) LastBytesToUint32Bytes() ([]byte, uint32, []byte) {
rawKey, rawValue := c.Last()
key := (rawKey)
value1, value2 := bytesTouint32bytes(rawValue)
return key, value1, value2
}
// NextBytesToUint32Bytes is first with key of type []byte and value of type pair(uint32,[]byte).
func (c *Cursor) NextBytesToUint32Bytes() ([]byte, uint32, []byte) {
rawKey, rawValue := c.Next()
key := (rawKey)
value1, value2 := bytesTouint32bytes(rawValue)
return key, value1, value2
}
// PrevBytesToUint32Bytes is first with key of type []byte and value of type pair(uint32,[]byte).
func (c *Cursor) PrevBytesToUint32Bytes() ([]byte, uint32, []byte) {
rawKey, rawValue := c.Prev()
key := (rawKey)
value1, value2 := bytesTouint32bytes(rawValue)
return key, value1, value2
}
// SeekBytesToUint32Bytes is first with key of type []byte and value of type pair(uint32,[]byte).
func (c *Cursor) SeekBytesToUint32Bytes(key []byte) ([]byte, uint32, []byte) {
rawKey, rawValue := c.Seek((key))
key = (rawKey)
value1, value2 := bytesTouint32bytes(rawValue)
return key, value1, value2
}
// ForEachBytesToUint64Bytes is a for each with key of type []byte and value of type pair(uint64,[]byte).
func (b *Bucket) ForEachBytesToUint64Bytes(fn func(key []byte, value1 uint64, value2 []byte) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := (rawKey)
value1, value2 := bytesTouint64bytes(rawValue)
return fn(key, value1, value2)
},
)
}
// GetBytesToUint64Bytes is a get with key of type []byte and value of type pair(uint64,[]byte).
func (b *Bucket) GetBytesToUint64Bytes(key []byte) (uint64, []byte) {
return bytesTouint64bytes(b.Get((key)))
}
// GetRequiredBytesToUint64Bytes is a get with key of type []byte and value of type pair(uint64,[]byte) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredBytesToUint64Bytes(key []byte) (uint64, []byte, error) {
value := b.Get((key))
if value == nil {
return 0, nil, NewKeyNotFoundError(key)
}
value1, value2 := bytesTouint64bytes(value)
return value1, value2, nil
}
// PutBytesToUint64Bytes is a put with key of type []byte and value of type pair(uint64,[]byte).
func (b *Bucket) PutBytesToUint64Bytes(key []byte, value1 uint64, value2 []byte) error {
return b.Put((key), uint64bytesTobytes(value1, value2))
}
// FirstBytesToUint64Bytes is first with key of type []byte and value of type pair(uint64,[]byte).
func (c *Cursor) FirstBytesToUint64Bytes() ([]byte, uint64, []byte) {
rawKey, rawValue := c.First()
key := (rawKey)
value1, value2 := bytesTouint64bytes(rawValue)
return key, value1, value2
}
// LastBytesToUint64Bytes is first with key of type []byte and value of type pair(uint64,[]byte).
func (c *Cursor) LastBytesToUint64Bytes() ([]byte, uint64, []byte) {
rawKey, rawValue := c.Last()
key := (rawKey)
value1, value2 := bytesTouint64bytes(rawValue)
return key, value1, value2
}
// NextBytesToUint64Bytes is first with key of type []byte and value of type pair(uint64,[]byte).
func (c *Cursor) NextBytesToUint64Bytes() ([]byte, uint64, []byte) {
rawKey, rawValue := c.Next()
key := (rawKey)
value1, value2 := bytesTouint64bytes(rawValue)
return key, value1, value2
}
// PrevBytesToUint64Bytes is first with key of type []byte and value of type pair(uint64,[]byte).
func (c *Cursor) PrevBytesToUint64Bytes() ([]byte, uint64, []byte) {
rawKey, rawValue := c.Prev()
key := (rawKey)
value1, value2 := bytesTouint64bytes(rawValue)
return key, value1, value2
}
// SeekBytesToUint64Bytes is first with key of type []byte and value of type pair(uint64,[]byte).
func (c *Cursor) SeekBytesToUint64Bytes(key []byte) ([]byte, uint64, []byte) {
rawKey, rawValue := c.Seek((key))
key = (rawKey)
value1, value2 := bytesTouint64bytes(rawValue)
return key, value1, value2
}
// ForEachBytesToBytesUint16 is a for each with key of type []byte and value of type pair([]byte,uint16).
func (b *Bucket) ForEachBytesToBytesUint16(fn func(key []byte, value1 []byte, value2 uint16) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := (rawKey)
value1, value2 := bytesTobytesuint16(rawValue)
return fn(key, value1, value2)
},
)
}
// GetBytesToBytesUint16 is a get with key of type []byte and value of type pair([]byte,uint16).
func (b *Bucket) GetBytesToBytesUint16(key []byte) ([]byte, uint16) {
return bytesTobytesuint16(b.Get((key)))
}
// GetRequiredBytesToBytesUint16 is a get with key of type []byte and value of type pair([]byte,uint16) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredBytesToBytesUint16(key []byte) ([]byte, uint16, error) {
value := b.Get((key))
if value == nil {
return nil, 0, NewKeyNotFoundError(key)
}
value1, value2 := bytesTobytesuint16(value)
return value1, value2, nil
}
// PutBytesToBytesUint16 is a put with key of type []byte and value of type pair([]byte,uint16).
func (b *Bucket) PutBytesToBytesUint16(key []byte, value1 []byte, value2 uint16) error {
return b.Put((key), bytesuint16Tobytes(value1, value2))
}
// FirstBytesToBytesUint16 is first with key of type []byte and value of type pair([]byte,uint16).
func (c *Cursor) FirstBytesToBytesUint16() ([]byte, []byte, uint16) {
rawKey, rawValue := c.First()
key := (rawKey)
value1, value2 := bytesTobytesuint16(rawValue)
return key, value1, value2
}
// LastBytesToBytesUint16 is first with key of type []byte and value of type pair([]byte,uint16).
func (c *Cursor) LastBytesToBytesUint16() ([]byte, []byte, uint16) {
rawKey, rawValue := c.Last()
key := (rawKey)
value1, value2 := bytesTobytesuint16(rawValue)
return key, value1, value2
}
// NextBytesToBytesUint16 is first with key of type []byte and value of type pair([]byte,uint16).
func (c *Cursor) NextBytesToBytesUint16() ([]byte, []byte, uint16) {
rawKey, rawValue := c.Next()
key := (rawKey)
value1, value2 := bytesTobytesuint16(rawValue)
return key, value1, value2
}
// PrevBytesToBytesUint16 is first with key of type []byte and value of type pair([]byte,uint16).
func (c *Cursor) PrevBytesToBytesUint16() ([]byte, []byte, uint16) {
rawKey, rawValue := c.Prev()
key := (rawKey)
value1, value2 := bytesTobytesuint16(rawValue)
return key, value1, value2
}
// SeekBytesToBytesUint16 is first with key of type []byte and value of type pair([]byte,uint16).
func (c *Cursor) SeekBytesToBytesUint16(key []byte) ([]byte, []byte, uint16) {
rawKey, rawValue := c.Seek((key))
key = (rawKey)
value1, value2 := bytesTobytesuint16(rawValue)
return key, value1, value2
}
// ForEachBytesToBytesUint32 is a for each with key of type []byte and value of type pair([]byte,uint32).
func (b *Bucket) ForEachBytesToBytesUint32(fn func(key []byte, value1 []byte, value2 uint32) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := (rawKey)
value1, value2 := bytesTobytesuint32(rawValue)
return fn(key, value1, value2)
},
)
}
// GetBytesToBytesUint32 is a get with key of type []byte and value of type pair([]byte,uint32).
func (b *Bucket) GetBytesToBytesUint32(key []byte) ([]byte, uint32) {
return bytesTobytesuint32(b.Get((key)))
}
// GetRequiredBytesToBytesUint32 is a get with key of type []byte and value of type pair([]byte,uint32) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredBytesToBytesUint32(key []byte) ([]byte, uint32, error) {
value := b.Get((key))
if value == nil {
return nil, 0, NewKeyNotFoundError(key)
}
value1, value2 := bytesTobytesuint32(value)
return value1, value2, nil
}
// PutBytesToBytesUint32 is a put with key of type []byte and value of type pair([]byte,uint32).
func (b *Bucket) PutBytesToBytesUint32(key []byte, value1 []byte, value2 uint32) error {
return b.Put((key), bytesuint32Tobytes(value1, value2))
}
// FirstBytesToBytesUint32 is first with key of type []byte and value of type pair([]byte,uint32).
func (c *Cursor) FirstBytesToBytesUint32() ([]byte, []byte, uint32) {
rawKey, rawValue := c.First()
key := (rawKey)
value1, value2 := bytesTobytesuint32(rawValue)
return key, value1, value2
}
// LastBytesToBytesUint32 is first with key of type []byte and value of type pair([]byte,uint32).
func (c *Cursor) LastBytesToBytesUint32() ([]byte, []byte, uint32) {
rawKey, rawValue := c.Last()
key := (rawKey)
value1, value2 := bytesTobytesuint32(rawValue)
return key, value1, value2
}
// NextBytesToBytesUint32 is first with key of type []byte and value of type pair([]byte,uint32).
func (c *Cursor) NextBytesToBytesUint32() ([]byte, []byte, uint32) {
rawKey, rawValue := c.Next()
key := (rawKey)
value1, value2 := bytesTobytesuint32(rawValue)
return key, value1, value2
}
// PrevBytesToBytesUint32 is first with key of type []byte and value of type pair([]byte,uint32).
func (c *Cursor) PrevBytesToBytesUint32() ([]byte, []byte, uint32) {
rawKey, rawValue := c.Prev()
key := (rawKey)
value1, value2 := bytesTobytesuint32(rawValue)
return key, value1, value2
}
// SeekBytesToBytesUint32 is first with key of type []byte and value of type pair([]byte,uint32).
func (c *Cursor) SeekBytesToBytesUint32(key []byte) ([]byte, []byte, uint32) {
rawKey, rawValue := c.Seek((key))
key = (rawKey)
value1, value2 := bytesTobytesuint32(rawValue)
return key, value1, value2
}
// ForEachBytesToBytesUint64 is a for each with key of type []byte and value of type pair([]byte,uint64).
func (b *Bucket) ForEachBytesToBytesUint64(fn func(key []byte, value1 []byte, value2 uint64) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := (rawKey)
value1, value2 := bytesTobytesuint64(rawValue)
return fn(key, value1, value2)
},
)
}
// GetBytesToBytesUint64 is a get with key of type []byte and value of type pair([]byte,uint64).
func (b *Bucket) GetBytesToBytesUint64(key []byte) ([]byte, uint64) {
return bytesTobytesuint64(b.Get((key)))
}
// GetRequiredBytesToBytesUint64 is a get with key of type []byte and value of type pair([]byte,uint64) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredBytesToBytesUint64(key []byte) ([]byte, uint64, error) {
value := b.Get((key))
if value == nil {
return nil, 0, NewKeyNotFoundError(key)
}
value1, value2 := bytesTobytesuint64(value)
return value1, value2, nil
}
// PutBytesToBytesUint64 is a put with key of type []byte and value of type pair([]byte,uint64).
func (b *Bucket) PutBytesToBytesUint64(key []byte, value1 []byte, value2 uint64) error {
return b.Put((key), bytesuint64Tobytes(value1, value2))
}
// FirstBytesToBytesUint64 is first with key of type []byte and value of type pair([]byte,uint64).
func (c *Cursor) FirstBytesToBytesUint64() ([]byte, []byte, uint64) {
rawKey, rawValue := c.First()
key := (rawKey)
value1, value2 := bytesTobytesuint64(rawValue)
return key, value1, value2
}
// LastBytesToBytesUint64 is first with key of type []byte and value of type pair([]byte,uint64).
func (c *Cursor) LastBytesToBytesUint64() ([]byte, []byte, uint64) {
rawKey, rawValue := c.Last()
key := (rawKey)
value1, value2 := bytesTobytesuint64(rawValue)
return key, value1, value2
}
// NextBytesToBytesUint64 is first with key of type []byte and value of type pair([]byte,uint64).
func (c *Cursor) NextBytesToBytesUint64() ([]byte, []byte, uint64) {
rawKey, rawValue := c.Next()
key := (rawKey)
value1, value2 := bytesTobytesuint64(rawValue)
return key, value1, value2
}
// PrevBytesToBytesUint64 is first with key of type []byte and value of type pair([]byte,uint64).
func (c *Cursor) PrevBytesToBytesUint64() ([]byte, []byte, uint64) {
rawKey, rawValue := c.Prev()
key := (rawKey)
value1, value2 := bytesTobytesuint64(rawValue)
return key, value1, value2
}
// SeekBytesToBytesUint64 is first with key of type []byte and value of type pair([]byte,uint64).
func (c *Cursor) SeekBytesToBytesUint64(key []byte) ([]byte, []byte, uint64) {
rawKey, rawValue := c.Seek((key))
key = (rawKey)
value1, value2 := bytesTobytesuint64(rawValue)
return key, value1, value2
}
// DeleteBytes is a delete with key of type []byte.
func (b *Bucket) DeleteBytes(key []byte) error {
return b.Delete((key))
}
// ForEachStringToBytes is a for each with key of type string and value of type []byte.
func (b *Bucket) ForEachStringToBytes(fn func(key string, value []byte) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := string(rawKey)
value := (rawValue)
return fn(key, value)
},
)
}
// GetStringToBytes is a get with key of type string and value of type []byte.
func (b *Bucket) GetStringToBytes(key string) []byte {
return (b.Get([]byte(key)))
}
// GetRequiredStringToBytes is a get with key of type string and value of type []byte that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredStringToBytes(key string) ([]byte, error) {
value := b.Get([]byte(key))
if value == nil {
return nil, NewKeyNotFoundError(key)
}
return (value), nil
}
// PutStringToBytes is a put with key of type string and value of type []byte.
func (b *Bucket) PutStringToBytes(key string, value []byte) error {
return b.Put([]byte(key), (value))
}
// FirstStringToBytes is first with key of type string and value of type []byte.
func (c *Cursor) FirstStringToBytes() (string, []byte) {
rawKey, rawValue := c.First()
key := string(rawKey)
value := (rawValue)
return key, value
}
// LastStringToBytes is first with key of type string and value of type []byte.
func (c *Cursor) LastStringToBytes() (string, []byte) {
rawKey, rawValue := c.Last()
key := string(rawKey)
value := (rawValue)
return key, value
}
// NextStringToBytes is first with key of type string and value of type []byte.
func (c *Cursor) NextStringToBytes() (string, []byte) {
rawKey, rawValue := c.Next()
key := string(rawKey)
value := (rawValue)
return key, value
}
// PrevStringToBytes is first with key of type string and value of type []byte.
func (c *Cursor) PrevStringToBytes() (string, []byte) {
rawKey, rawValue := c.Prev()
key := string(rawKey)
value := (rawValue)
return key, value
}
// SeekStringToBytes is first with key of type string and value of type []byte.
func (c *Cursor) SeekStringToBytes(key string) (string, []byte) {
rawKey, rawValue := c.Seek([]byte(key))
key = string(rawKey)
value := (rawValue)
return key, value
}
// ForEachStringToString is a for each with key of type string and value of type string.
func (b *Bucket) ForEachStringToString(fn func(key string, value string) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := string(rawKey)
value := string(rawValue)
return fn(key, value)
},
)
}
// GetStringToString is a get with key of type string and value of type string.
func (b *Bucket) GetStringToString(key string) string {
return string(b.Get([]byte(key)))
}
// GetRequiredStringToString is a get with key of type string and value of type string that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredStringToString(key string) (string, error) {
value := b.Get([]byte(key))
if value == nil {
return "", NewKeyNotFoundError(key)
}
return string(value), nil
}
// PutStringToString is a put with key of type string and value of type string.
func (b *Bucket) PutStringToString(key string, value string) error {
return b.Put([]byte(key), []byte(value))
}
// FirstStringToString is first with key of type string and value of type string.
func (c *Cursor) FirstStringToString() (string, string) {
rawKey, rawValue := c.First()
key := string(rawKey)
value := string(rawValue)
return key, value
}
// LastStringToString is first with key of type string and value of type string.
func (c *Cursor) LastStringToString() (string, string) {
rawKey, rawValue := c.Last()
key := string(rawKey)
value := string(rawValue)
return key, value
}
// NextStringToString is first with key of type string and value of type string.
func (c *Cursor) NextStringToString() (string, string) {
rawKey, rawValue := c.Next()
key := string(rawKey)
value := string(rawValue)
return key, value
}
// PrevStringToString is first with key of type string and value of type string.
func (c *Cursor) PrevStringToString() (string, string) {
rawKey, rawValue := c.Prev()
key := string(rawKey)
value := string(rawValue)
return key, value
}
// SeekStringToString is first with key of type string and value of type string.
func (c *Cursor) SeekStringToString(key string) (string, string) {
rawKey, rawValue := c.Seek([]byte(key))
key = string(rawKey)
value := string(rawValue)
return key, value
}
// ForEachStringToUint16 is a for each with key of type string and value of type uint16.
func (b *Bucket) ForEachStringToUint16(fn func(key string, value uint16) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := string(rawKey)
value := bytesTouint16(rawValue)
return fn(key, value)
},
)
}
// GetStringToUint16 is a get with key of type string and value of type uint16.
func (b *Bucket) GetStringToUint16(key string) uint16 {
return bytesTouint16(b.Get([]byte(key)))
}
// GetRequiredStringToUint16 is a get with key of type string and value of type uint16 that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredStringToUint16(key string) (uint16, error) {
value := b.Get([]byte(key))
if value == nil {
return 0, NewKeyNotFoundError(key)
}
return bytesTouint16(value), nil
}
// PutStringToUint16 is a put with key of type string and value of type uint16.
func (b *Bucket) PutStringToUint16(key string, value uint16) error {
return b.Put([]byte(key), uint16Tobytes(value))
}
// FirstStringToUint16 is first with key of type string and value of type uint16.
func (c *Cursor) FirstStringToUint16() (string, uint16) {
rawKey, rawValue := c.First()
key := string(rawKey)
value := bytesTouint16(rawValue)
return key, value
}
// LastStringToUint16 is first with key of type string and value of type uint16.
func (c *Cursor) LastStringToUint16() (string, uint16) {
rawKey, rawValue := c.Last()
key := string(rawKey)
value := bytesTouint16(rawValue)
return key, value
}
// NextStringToUint16 is first with key of type string and value of type uint16.
func (c *Cursor) NextStringToUint16() (string, uint16) {
rawKey, rawValue := c.Next()
key := string(rawKey)
value := bytesTouint16(rawValue)
return key, value
}
// PrevStringToUint16 is first with key of type string and value of type uint16.
func (c *Cursor) PrevStringToUint16() (string, uint16) {
rawKey, rawValue := c.Prev()
key := string(rawKey)
value := bytesTouint16(rawValue)
return key, value
}
// SeekStringToUint16 is first with key of type string and value of type uint16.
func (c *Cursor) SeekStringToUint16(key string) (string, uint16) {
rawKey, rawValue := c.Seek([]byte(key))
key = string(rawKey)
value := bytesTouint16(rawValue)
return key, value
}
// ForEachStringToUint32 is a for each with key of type string and value of type uint32.
func (b *Bucket) ForEachStringToUint32(fn func(key string, value uint32) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := string(rawKey)
value := bytesTouint32(rawValue)
return fn(key, value)
},
)
}
// GetStringToUint32 is a get with key of type string and value of type uint32.
func (b *Bucket) GetStringToUint32(key string) uint32 {
return bytesTouint32(b.Get([]byte(key)))
}
// GetRequiredStringToUint32 is a get with key of type string and value of type uint32 that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredStringToUint32(key string) (uint32, error) {
value := b.Get([]byte(key))
if value == nil {
return 0, NewKeyNotFoundError(key)
}
return bytesTouint32(value), nil
}
// PutStringToUint32 is a put with key of type string and value of type uint32.
func (b *Bucket) PutStringToUint32(key string, value uint32) error {
return b.Put([]byte(key), uint32Tobytes(value))
}
// FirstStringToUint32 is first with key of type string and value of type uint32.
func (c *Cursor) FirstStringToUint32() (string, uint32) {
rawKey, rawValue := c.First()
key := string(rawKey)
value := bytesTouint32(rawValue)
return key, value
}
// LastStringToUint32 is first with key of type string and value of type uint32.
func (c *Cursor) LastStringToUint32() (string, uint32) {
rawKey, rawValue := c.Last()
key := string(rawKey)
value := bytesTouint32(rawValue)
return key, value
}
// NextStringToUint32 is first with key of type string and value of type uint32.
func (c *Cursor) NextStringToUint32() (string, uint32) {
rawKey, rawValue := c.Next()
key := string(rawKey)
value := bytesTouint32(rawValue)
return key, value
}
// PrevStringToUint32 is first with key of type string and value of type uint32.
func (c *Cursor) PrevStringToUint32() (string, uint32) {
rawKey, rawValue := c.Prev()
key := string(rawKey)
value := bytesTouint32(rawValue)
return key, value
}
// SeekStringToUint32 is first with key of type string and value of type uint32.
func (c *Cursor) SeekStringToUint32(key string) (string, uint32) {
rawKey, rawValue := c.Seek([]byte(key))
key = string(rawKey)
value := bytesTouint32(rawValue)
return key, value
}
// ForEachStringToUint64 is a for each with key of type string and value of type uint64.
func (b *Bucket) ForEachStringToUint64(fn func(key string, value uint64) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := string(rawKey)
value := bytesTouint64(rawValue)
return fn(key, value)
},
)
}
// GetStringToUint64 is a get with key of type string and value of type uint64.
func (b *Bucket) GetStringToUint64(key string) uint64 {
return bytesTouint64(b.Get([]byte(key)))
}
// GetRequiredStringToUint64 is a get with key of type string and value of type uint64 that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredStringToUint64(key string) (uint64, error) {
value := b.Get([]byte(key))
if value == nil {
return 0, NewKeyNotFoundError(key)
}
return bytesTouint64(value), nil
}
// PutStringToUint64 is a put with key of type string and value of type uint64.
func (b *Bucket) PutStringToUint64(key string, value uint64) error {
return b.Put([]byte(key), uint64Tobytes(value))
}
// FirstStringToUint64 is first with key of type string and value of type uint64.
func (c *Cursor) FirstStringToUint64() (string, uint64) {
rawKey, rawValue := c.First()
key := string(rawKey)
value := bytesTouint64(rawValue)
return key, value
}
// LastStringToUint64 is first with key of type string and value of type uint64.
func (c *Cursor) LastStringToUint64() (string, uint64) {
rawKey, rawValue := c.Last()
key := string(rawKey)
value := bytesTouint64(rawValue)
return key, value
}
// NextStringToUint64 is first with key of type string and value of type uint64.
func (c *Cursor) NextStringToUint64() (string, uint64) {
rawKey, rawValue := c.Next()
key := string(rawKey)
value := bytesTouint64(rawValue)
return key, value
}
// PrevStringToUint64 is first with key of type string and value of type uint64.
func (c *Cursor) PrevStringToUint64() (string, uint64) {
rawKey, rawValue := c.Prev()
key := string(rawKey)
value := bytesTouint64(rawValue)
return key, value
}
// SeekStringToUint64 is first with key of type string and value of type uint64.
func (c *Cursor) SeekStringToUint64(key string) (string, uint64) {
rawKey, rawValue := c.Seek([]byte(key))
key = string(rawKey)
value := bytesTouint64(rawValue)
return key, value
}
// ForEachStringToUint16Uint16 is a for each with key of type string and value of type pair(uint16,uint16).
func (b *Bucket) ForEachStringToUint16Uint16(fn func(key string, value1 uint16, value2 uint16) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := string(rawKey)
value1, value2 := bytesTouint16uint16(rawValue)
return fn(key, value1, value2)
},
)
}
// GetStringToUint16Uint16 is a get with key of type string and value of type pair(uint16,uint16).
func (b *Bucket) GetStringToUint16Uint16(key string) (uint16, uint16) {
return bytesTouint16uint16(b.Get([]byte(key)))
}
// GetRequiredStringToUint16Uint16 is a get with key of type string and value of type pair(uint16,uint16) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredStringToUint16Uint16(key string) (uint16, uint16, error) {
value := b.Get([]byte(key))
if value == nil {
return 0, 0, NewKeyNotFoundError(key)
}
value1, value2 := bytesTouint16uint16(value)
return value1, value2, nil
}
// PutStringToUint16Uint16 is a put with key of type string and value of type pair(uint16,uint16).
func (b *Bucket) PutStringToUint16Uint16(key string, value1 uint16, value2 uint16) error {
return b.Put([]byte(key), uint16uint16Tobytes(value1, value2))
}
// FirstStringToUint16Uint16 is first with key of type string and value of type pair(uint16,uint16).
func (c *Cursor) FirstStringToUint16Uint16() (string, uint16, uint16) {
rawKey, rawValue := c.First()
key := string(rawKey)
value1, value2 := bytesTouint16uint16(rawValue)
return key, value1, value2
}
// LastStringToUint16Uint16 is first with key of type string and value of type pair(uint16,uint16).
func (c *Cursor) LastStringToUint16Uint16() (string, uint16, uint16) {
rawKey, rawValue := c.Last()
key := string(rawKey)
value1, value2 := bytesTouint16uint16(rawValue)
return key, value1, value2
}
// NextStringToUint16Uint16 is first with key of type string and value of type pair(uint16,uint16).
func (c *Cursor) NextStringToUint16Uint16() (string, uint16, uint16) {
rawKey, rawValue := c.Next()
key := string(rawKey)
value1, value2 := bytesTouint16uint16(rawValue)
return key, value1, value2
}
// PrevStringToUint16Uint16 is first with key of type string and value of type pair(uint16,uint16).
func (c *Cursor) PrevStringToUint16Uint16() (string, uint16, uint16) {
rawKey, rawValue := c.Prev()
key := string(rawKey)
value1, value2 := bytesTouint16uint16(rawValue)
return key, value1, value2
}
// SeekStringToUint16Uint16 is first with key of type string and value of type pair(uint16,uint16).
func (c *Cursor) SeekStringToUint16Uint16(key string) (string, uint16, uint16) {
rawKey, rawValue := c.Seek([]byte(key))
key = string(rawKey)
value1, value2 := bytesTouint16uint16(rawValue)
return key, value1, value2
}
// ForEachStringToUint32Uint32 is a for each with key of type string and value of type pair(uint32,uint32).
func (b *Bucket) ForEachStringToUint32Uint32(fn func(key string, value1 uint32, value2 uint32) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := string(rawKey)
value1, value2 := bytesTouint32uint32(rawValue)
return fn(key, value1, value2)
},
)
}
// GetStringToUint32Uint32 is a get with key of type string and value of type pair(uint32,uint32).
func (b *Bucket) GetStringToUint32Uint32(key string) (uint32, uint32) {
return bytesTouint32uint32(b.Get([]byte(key)))
}
// GetRequiredStringToUint32Uint32 is a get with key of type string and value of type pair(uint32,uint32) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredStringToUint32Uint32(key string) (uint32, uint32, error) {
value := b.Get([]byte(key))
if value == nil {
return 0, 0, NewKeyNotFoundError(key)
}
value1, value2 := bytesTouint32uint32(value)
return value1, value2, nil
}
// PutStringToUint32Uint32 is a put with key of type string and value of type pair(uint32,uint32).
func (b *Bucket) PutStringToUint32Uint32(key string, value1 uint32, value2 uint32) error {
return b.Put([]byte(key), uint32uint32Tobytes(value1, value2))
}
// FirstStringToUint32Uint32 is first with key of type string and value of type pair(uint32,uint32).
func (c *Cursor) FirstStringToUint32Uint32() (string, uint32, uint32) {
rawKey, rawValue := c.First()
key := string(rawKey)
value1, value2 := bytesTouint32uint32(rawValue)
return key, value1, value2
}
// LastStringToUint32Uint32 is first with key of type string and value of type pair(uint32,uint32).
func (c *Cursor) LastStringToUint32Uint32() (string, uint32, uint32) {
rawKey, rawValue := c.Last()
key := string(rawKey)
value1, value2 := bytesTouint32uint32(rawValue)
return key, value1, value2
}
// NextStringToUint32Uint32 is first with key of type string and value of type pair(uint32,uint32).
func (c *Cursor) NextStringToUint32Uint32() (string, uint32, uint32) {
rawKey, rawValue := c.Next()
key := string(rawKey)
value1, value2 := bytesTouint32uint32(rawValue)
return key, value1, value2
}
// PrevStringToUint32Uint32 is first with key of type string and value of type pair(uint32,uint32).
func (c *Cursor) PrevStringToUint32Uint32() (string, uint32, uint32) {
rawKey, rawValue := c.Prev()
key := string(rawKey)
value1, value2 := bytesTouint32uint32(rawValue)
return key, value1, value2
}
// SeekStringToUint32Uint32 is first with key of type string and value of type pair(uint32,uint32).
func (c *Cursor) SeekStringToUint32Uint32(key string) (string, uint32, uint32) {
rawKey, rawValue := c.Seek([]byte(key))
key = string(rawKey)
value1, value2 := bytesTouint32uint32(rawValue)
return key, value1, value2
}
// ForEachStringToUint64Uint64 is a for each with key of type string and value of type pair(uint64,uint64).
func (b *Bucket) ForEachStringToUint64Uint64(fn func(key string, value1 uint64, value2 uint64) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := string(rawKey)
value1, value2 := bytesTouint64uint64(rawValue)
return fn(key, value1, value2)
},
)
}
// GetStringToUint64Uint64 is a get with key of type string and value of type pair(uint64,uint64).
func (b *Bucket) GetStringToUint64Uint64(key string) (uint64, uint64) {
return bytesTouint64uint64(b.Get([]byte(key)))
}
// GetRequiredStringToUint64Uint64 is a get with key of type string and value of type pair(uint64,uint64) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredStringToUint64Uint64(key string) (uint64, uint64, error) {
value := b.Get([]byte(key))
if value == nil {
return 0, 0, NewKeyNotFoundError(key)
}
value1, value2 := bytesTouint64uint64(value)
return value1, value2, nil
}
// PutStringToUint64Uint64 is a put with key of type string and value of type pair(uint64,uint64).
func (b *Bucket) PutStringToUint64Uint64(key string, value1 uint64, value2 uint64) error {
return b.Put([]byte(key), uint64uint64Tobytes(value1, value2))
}
// FirstStringToUint64Uint64 is first with key of type string and value of type pair(uint64,uint64).
func (c *Cursor) FirstStringToUint64Uint64() (string, uint64, uint64) {
rawKey, rawValue := c.First()
key := string(rawKey)
value1, value2 := bytesTouint64uint64(rawValue)
return key, value1, value2
}
// LastStringToUint64Uint64 is first with key of type string and value of type pair(uint64,uint64).
func (c *Cursor) LastStringToUint64Uint64() (string, uint64, uint64) {
rawKey, rawValue := c.Last()
key := string(rawKey)
value1, value2 := bytesTouint64uint64(rawValue)
return key, value1, value2
}
// NextStringToUint64Uint64 is first with key of type string and value of type pair(uint64,uint64).
func (c *Cursor) NextStringToUint64Uint64() (string, uint64, uint64) {
rawKey, rawValue := c.Next()
key := string(rawKey)
value1, value2 := bytesTouint64uint64(rawValue)
return key, value1, value2
}
// PrevStringToUint64Uint64 is first with key of type string and value of type pair(uint64,uint64).
func (c *Cursor) PrevStringToUint64Uint64() (string, uint64, uint64) {
rawKey, rawValue := c.Prev()
key := string(rawKey)
value1, value2 := bytesTouint64uint64(rawValue)
return key, value1, value2
}
// SeekStringToUint64Uint64 is first with key of type string and value of type pair(uint64,uint64).
func (c *Cursor) SeekStringToUint64Uint64(key string) (string, uint64, uint64) {
rawKey, rawValue := c.Seek([]byte(key))
key = string(rawKey)
value1, value2 := bytesTouint64uint64(rawValue)
return key, value1, value2
}
// ForEachStringToUint16Bytes is a for each with key of type string and value of type pair(uint16,[]byte).
func (b *Bucket) ForEachStringToUint16Bytes(fn func(key string, value1 uint16, value2 []byte) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := string(rawKey)
value1, value2 := bytesTouint16bytes(rawValue)
return fn(key, value1, value2)
},
)
}
// GetStringToUint16Bytes is a get with key of type string and value of type pair(uint16,[]byte).
func (b *Bucket) GetStringToUint16Bytes(key string) (uint16, []byte) {
return bytesTouint16bytes(b.Get([]byte(key)))
}
// GetRequiredStringToUint16Bytes is a get with key of type string and value of type pair(uint16,[]byte) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredStringToUint16Bytes(key string) (uint16, []byte, error) {
value := b.Get([]byte(key))
if value == nil {
return 0, nil, NewKeyNotFoundError(key)
}
value1, value2 := bytesTouint16bytes(value)
return value1, value2, nil
}
// PutStringToUint16Bytes is a put with key of type string and value of type pair(uint16,[]byte).
func (b *Bucket) PutStringToUint16Bytes(key string, value1 uint16, value2 []byte) error {
return b.Put([]byte(key), uint16bytesTobytes(value1, value2))
}
// FirstStringToUint16Bytes is first with key of type string and value of type pair(uint16,[]byte).
func (c *Cursor) FirstStringToUint16Bytes() (string, uint16, []byte) {
rawKey, rawValue := c.First()
key := string(rawKey)
value1, value2 := bytesTouint16bytes(rawValue)
return key, value1, value2
}
// LastStringToUint16Bytes is first with key of type string and value of type pair(uint16,[]byte).
func (c *Cursor) LastStringToUint16Bytes() (string, uint16, []byte) {
rawKey, rawValue := c.Last()
key := string(rawKey)
value1, value2 := bytesTouint16bytes(rawValue)
return key, value1, value2
}
// NextStringToUint16Bytes is first with key of type string and value of type pair(uint16,[]byte).
func (c *Cursor) NextStringToUint16Bytes() (string, uint16, []byte) {
rawKey, rawValue := c.Next()
key := string(rawKey)
value1, value2 := bytesTouint16bytes(rawValue)
return key, value1, value2
}
// PrevStringToUint16Bytes is first with key of type string and value of type pair(uint16,[]byte).
func (c *Cursor) PrevStringToUint16Bytes() (string, uint16, []byte) {
rawKey, rawValue := c.Prev()
key := string(rawKey)
value1, value2 := bytesTouint16bytes(rawValue)
return key, value1, value2
}
// SeekStringToUint16Bytes is first with key of type string and value of type pair(uint16,[]byte).
func (c *Cursor) SeekStringToUint16Bytes(key string) (string, uint16, []byte) {
rawKey, rawValue := c.Seek([]byte(key))
key = string(rawKey)
value1, value2 := bytesTouint16bytes(rawValue)
return key, value1, value2
}
// ForEachStringToUint32Bytes is a for each with key of type string and value of type pair(uint32,[]byte).
func (b *Bucket) ForEachStringToUint32Bytes(fn func(key string, value1 uint32, value2 []byte) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := string(rawKey)
value1, value2 := bytesTouint32bytes(rawValue)
return fn(key, value1, value2)
},
)
}
// GetStringToUint32Bytes is a get with key of type string and value of type pair(uint32,[]byte).
func (b *Bucket) GetStringToUint32Bytes(key string) (uint32, []byte) {
return bytesTouint32bytes(b.Get([]byte(key)))
}
// GetRequiredStringToUint32Bytes is a get with key of type string and value of type pair(uint32,[]byte) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredStringToUint32Bytes(key string) (uint32, []byte, error) {
value := b.Get([]byte(key))
if value == nil {
return 0, nil, NewKeyNotFoundError(key)
}
value1, value2 := bytesTouint32bytes(value)
return value1, value2, nil
}
// PutStringToUint32Bytes is a put with key of type string and value of type pair(uint32,[]byte).
func (b *Bucket) PutStringToUint32Bytes(key string, value1 uint32, value2 []byte) error {
return b.Put([]byte(key), uint32bytesTobytes(value1, value2))
}
// FirstStringToUint32Bytes is first with key of type string and value of type pair(uint32,[]byte).
func (c *Cursor) FirstStringToUint32Bytes() (string, uint32, []byte) {
rawKey, rawValue := c.First()
key := string(rawKey)
value1, value2 := bytesTouint32bytes(rawValue)
return key, value1, value2
}
// LastStringToUint32Bytes is first with key of type string and value of type pair(uint32,[]byte).
func (c *Cursor) LastStringToUint32Bytes() (string, uint32, []byte) {
rawKey, rawValue := c.Last()
key := string(rawKey)
value1, value2 := bytesTouint32bytes(rawValue)
return key, value1, value2
}
// NextStringToUint32Bytes is first with key of type string and value of type pair(uint32,[]byte).
func (c *Cursor) NextStringToUint32Bytes() (string, uint32, []byte) {
rawKey, rawValue := c.Next()
key := string(rawKey)
value1, value2 := bytesTouint32bytes(rawValue)
return key, value1, value2
}
// PrevStringToUint32Bytes is first with key of type string and value of type pair(uint32,[]byte).
func (c *Cursor) PrevStringToUint32Bytes() (string, uint32, []byte) {
rawKey, rawValue := c.Prev()
key := string(rawKey)
value1, value2 := bytesTouint32bytes(rawValue)
return key, value1, value2
}
// SeekStringToUint32Bytes is first with key of type string and value of type pair(uint32,[]byte).
func (c *Cursor) SeekStringToUint32Bytes(key string) (string, uint32, []byte) {
rawKey, rawValue := c.Seek([]byte(key))
key = string(rawKey)
value1, value2 := bytesTouint32bytes(rawValue)
return key, value1, value2
}
// ForEachStringToUint64Bytes is a for each with key of type string and value of type pair(uint64,[]byte).
func (b *Bucket) ForEachStringToUint64Bytes(fn func(key string, value1 uint64, value2 []byte) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := string(rawKey)
value1, value2 := bytesTouint64bytes(rawValue)
return fn(key, value1, value2)
},
)
}
// GetStringToUint64Bytes is a get with key of type string and value of type pair(uint64,[]byte).
func (b *Bucket) GetStringToUint64Bytes(key string) (uint64, []byte) {
return bytesTouint64bytes(b.Get([]byte(key)))
}
// GetRequiredStringToUint64Bytes is a get with key of type string and value of type pair(uint64,[]byte) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredStringToUint64Bytes(key string) (uint64, []byte, error) {
value := b.Get([]byte(key))
if value == nil {
return 0, nil, NewKeyNotFoundError(key)
}
value1, value2 := bytesTouint64bytes(value)
return value1, value2, nil
}
// PutStringToUint64Bytes is a put with key of type string and value of type pair(uint64,[]byte).
func (b *Bucket) PutStringToUint64Bytes(key string, value1 uint64, value2 []byte) error {
return b.Put([]byte(key), uint64bytesTobytes(value1, value2))
}
// FirstStringToUint64Bytes is first with key of type string and value of type pair(uint64,[]byte).
func (c *Cursor) FirstStringToUint64Bytes() (string, uint64, []byte) {
rawKey, rawValue := c.First()
key := string(rawKey)
value1, value2 := bytesTouint64bytes(rawValue)
return key, value1, value2
}
// LastStringToUint64Bytes is first with key of type string and value of type pair(uint64,[]byte).
func (c *Cursor) LastStringToUint64Bytes() (string, uint64, []byte) {
rawKey, rawValue := c.Last()
key := string(rawKey)
value1, value2 := bytesTouint64bytes(rawValue)
return key, value1, value2
}
// NextStringToUint64Bytes is first with key of type string and value of type pair(uint64,[]byte).
func (c *Cursor) NextStringToUint64Bytes() (string, uint64, []byte) {
rawKey, rawValue := c.Next()
key := string(rawKey)
value1, value2 := bytesTouint64bytes(rawValue)
return key, value1, value2
}
// PrevStringToUint64Bytes is first with key of type string and value of type pair(uint64,[]byte).
func (c *Cursor) PrevStringToUint64Bytes() (string, uint64, []byte) {
rawKey, rawValue := c.Prev()
key := string(rawKey)
value1, value2 := bytesTouint64bytes(rawValue)
return key, value1, value2
}
// SeekStringToUint64Bytes is first with key of type string and value of type pair(uint64,[]byte).
func (c *Cursor) SeekStringToUint64Bytes(key string) (string, uint64, []byte) {
rawKey, rawValue := c.Seek([]byte(key))
key = string(rawKey)
value1, value2 := bytesTouint64bytes(rawValue)
return key, value1, value2
}
// ForEachStringToBytesUint16 is a for each with key of type string and value of type pair([]byte,uint16).
func (b *Bucket) ForEachStringToBytesUint16(fn func(key string, value1 []byte, value2 uint16) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := string(rawKey)
value1, value2 := bytesTobytesuint16(rawValue)
return fn(key, value1, value2)
},
)
}
// GetStringToBytesUint16 is a get with key of type string and value of type pair([]byte,uint16).
func (b *Bucket) GetStringToBytesUint16(key string) ([]byte, uint16) {
return bytesTobytesuint16(b.Get([]byte(key)))
}
// GetRequiredStringToBytesUint16 is a get with key of type string and value of type pair([]byte,uint16) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredStringToBytesUint16(key string) ([]byte, uint16, error) {
value := b.Get([]byte(key))
if value == nil {
return nil, 0, NewKeyNotFoundError(key)
}
value1, value2 := bytesTobytesuint16(value)
return value1, value2, nil
}
// PutStringToBytesUint16 is a put with key of type string and value of type pair([]byte,uint16).
func (b *Bucket) PutStringToBytesUint16(key string, value1 []byte, value2 uint16) error {
return b.Put([]byte(key), bytesuint16Tobytes(value1, value2))
}
// FirstStringToBytesUint16 is first with key of type string and value of type pair([]byte,uint16).
func (c *Cursor) FirstStringToBytesUint16() (string, []byte, uint16) {
rawKey, rawValue := c.First()
key := string(rawKey)
value1, value2 := bytesTobytesuint16(rawValue)
return key, value1, value2
}
// LastStringToBytesUint16 is first with key of type string and value of type pair([]byte,uint16).
func (c *Cursor) LastStringToBytesUint16() (string, []byte, uint16) {
rawKey, rawValue := c.Last()
key := string(rawKey)
value1, value2 := bytesTobytesuint16(rawValue)
return key, value1, value2
}
// NextStringToBytesUint16 is first with key of type string and value of type pair([]byte,uint16).
func (c *Cursor) NextStringToBytesUint16() (string, []byte, uint16) {
rawKey, rawValue := c.Next()
key := string(rawKey)
value1, value2 := bytesTobytesuint16(rawValue)
return key, value1, value2
}
// PrevStringToBytesUint16 is first with key of type string and value of type pair([]byte,uint16).
func (c *Cursor) PrevStringToBytesUint16() (string, []byte, uint16) {
rawKey, rawValue := c.Prev()
key := string(rawKey)
value1, value2 := bytesTobytesuint16(rawValue)
return key, value1, value2
}
// SeekStringToBytesUint16 is first with key of type string and value of type pair([]byte,uint16).
func (c *Cursor) SeekStringToBytesUint16(key string) (string, []byte, uint16) {
rawKey, rawValue := c.Seek([]byte(key))
key = string(rawKey)
value1, value2 := bytesTobytesuint16(rawValue)
return key, value1, value2
}
// ForEachStringToBytesUint32 is a for each with key of type string and value of type pair([]byte,uint32).
func (b *Bucket) ForEachStringToBytesUint32(fn func(key string, value1 []byte, value2 uint32) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := string(rawKey)
value1, value2 := bytesTobytesuint32(rawValue)
return fn(key, value1, value2)
},
)
}
// GetStringToBytesUint32 is a get with key of type string and value of type pair([]byte,uint32).
func (b *Bucket) GetStringToBytesUint32(key string) ([]byte, uint32) {
return bytesTobytesuint32(b.Get([]byte(key)))
}
// GetRequiredStringToBytesUint32 is a get with key of type string and value of type pair([]byte,uint32) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredStringToBytesUint32(key string) ([]byte, uint32, error) {
value := b.Get([]byte(key))
if value == nil {
return nil, 0, NewKeyNotFoundError(key)
}
value1, value2 := bytesTobytesuint32(value)
return value1, value2, nil
}
// PutStringToBytesUint32 is a put with key of type string and value of type pair([]byte,uint32).
func (b *Bucket) PutStringToBytesUint32(key string, value1 []byte, value2 uint32) error {
return b.Put([]byte(key), bytesuint32Tobytes(value1, value2))
}
// FirstStringToBytesUint32 is first with key of type string and value of type pair([]byte,uint32).
func (c *Cursor) FirstStringToBytesUint32() (string, []byte, uint32) {
rawKey, rawValue := c.First()
key := string(rawKey)
value1, value2 := bytesTobytesuint32(rawValue)
return key, value1, value2
}
// LastStringToBytesUint32 is first with key of type string and value of type pair([]byte,uint32).
func (c *Cursor) LastStringToBytesUint32() (string, []byte, uint32) {
rawKey, rawValue := c.Last()
key := string(rawKey)
value1, value2 := bytesTobytesuint32(rawValue)
return key, value1, value2
}
// NextStringToBytesUint32 is first with key of type string and value of type pair([]byte,uint32).
func (c *Cursor) NextStringToBytesUint32() (string, []byte, uint32) {
rawKey, rawValue := c.Next()
key := string(rawKey)
value1, value2 := bytesTobytesuint32(rawValue)
return key, value1, value2
}
// PrevStringToBytesUint32 is first with key of type string and value of type pair([]byte,uint32).
func (c *Cursor) PrevStringToBytesUint32() (string, []byte, uint32) {
rawKey, rawValue := c.Prev()
key := string(rawKey)
value1, value2 := bytesTobytesuint32(rawValue)
return key, value1, value2
}
// SeekStringToBytesUint32 is first with key of type string and value of type pair([]byte,uint32).
func (c *Cursor) SeekStringToBytesUint32(key string) (string, []byte, uint32) {
rawKey, rawValue := c.Seek([]byte(key))
key = string(rawKey)
value1, value2 := bytesTobytesuint32(rawValue)
return key, value1, value2
}
// ForEachStringToBytesUint64 is a for each with key of type string and value of type pair([]byte,uint64).
func (b *Bucket) ForEachStringToBytesUint64(fn func(key string, value1 []byte, value2 uint64) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := string(rawKey)
value1, value2 := bytesTobytesuint64(rawValue)
return fn(key, value1, value2)
},
)
}
// GetStringToBytesUint64 is a get with key of type string and value of type pair([]byte,uint64).
func (b *Bucket) GetStringToBytesUint64(key string) ([]byte, uint64) {
return bytesTobytesuint64(b.Get([]byte(key)))
}
// GetRequiredStringToBytesUint64 is a get with key of type string and value of type pair([]byte,uint64) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredStringToBytesUint64(key string) ([]byte, uint64, error) {
value := b.Get([]byte(key))
if value == nil {
return nil, 0, NewKeyNotFoundError(key)
}
value1, value2 := bytesTobytesuint64(value)
return value1, value2, nil
}
// PutStringToBytesUint64 is a put with key of type string and value of type pair([]byte,uint64).
func (b *Bucket) PutStringToBytesUint64(key string, value1 []byte, value2 uint64) error {
return b.Put([]byte(key), bytesuint64Tobytes(value1, value2))
}
// FirstStringToBytesUint64 is first with key of type string and value of type pair([]byte,uint64).
func (c *Cursor) FirstStringToBytesUint64() (string, []byte, uint64) {
rawKey, rawValue := c.First()
key := string(rawKey)
value1, value2 := bytesTobytesuint64(rawValue)
return key, value1, value2
}
// LastStringToBytesUint64 is first with key of type string and value of type pair([]byte,uint64).
func (c *Cursor) LastStringToBytesUint64() (string, []byte, uint64) {
rawKey, rawValue := c.Last()
key := string(rawKey)
value1, value2 := bytesTobytesuint64(rawValue)
return key, value1, value2
}
// NextStringToBytesUint64 is first with key of type string and value of type pair([]byte,uint64).
func (c *Cursor) NextStringToBytesUint64() (string, []byte, uint64) {
rawKey, rawValue := c.Next()
key := string(rawKey)
value1, value2 := bytesTobytesuint64(rawValue)
return key, value1, value2
}
// PrevStringToBytesUint64 is first with key of type string and value of type pair([]byte,uint64).
func (c *Cursor) PrevStringToBytesUint64() (string, []byte, uint64) {
rawKey, rawValue := c.Prev()
key := string(rawKey)
value1, value2 := bytesTobytesuint64(rawValue)
return key, value1, value2
}
// SeekStringToBytesUint64 is first with key of type string and value of type pair([]byte,uint64).
func (c *Cursor) SeekStringToBytesUint64(key string) (string, []byte, uint64) {
rawKey, rawValue := c.Seek([]byte(key))
key = string(rawKey)
value1, value2 := bytesTobytesuint64(rawValue)
return key, value1, value2
}
// DeleteString is a delete with key of type string.
func (b *Bucket) DeleteString(key string) error {
return b.Delete([]byte(key))
}
// ForEachUint16ToBytes is a for each with key of type uint16 and value of type []byte.
func (b *Bucket) ForEachUint16ToBytes(fn func(key uint16, value []byte) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := bytesTouint16(rawKey)
value := (rawValue)
return fn(key, value)
},
)
}
// GetUint16ToBytes is a get with key of type uint16 and value of type []byte.
func (b *Bucket) GetUint16ToBytes(key uint16) []byte {
return (b.Get(uint16Tobytes(key)))
}
// GetRequiredUint16ToBytes is a get with key of type uint16 and value of type []byte that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredUint16ToBytes(key uint16) ([]byte, error) {
value := b.Get(uint16Tobytes(key))
if value == nil {
return nil, NewKeyNotFoundError(key)
}
return (value), nil
}
// PutUint16ToBytes is a put with key of type uint16 and value of type []byte.
func (b *Bucket) PutUint16ToBytes(key uint16, value []byte) error {
return b.Put(uint16Tobytes(key), (value))
}
// FirstUint16ToBytes is first with key of type uint16 and value of type []byte.
func (c *Cursor) FirstUint16ToBytes() (uint16, []byte) {
rawKey, rawValue := c.First()
key := bytesTouint16(rawKey)
value := (rawValue)
return key, value
}
// LastUint16ToBytes is first with key of type uint16 and value of type []byte.
func (c *Cursor) LastUint16ToBytes() (uint16, []byte) {
rawKey, rawValue := c.Last()
key := bytesTouint16(rawKey)
value := (rawValue)
return key, value
}
// NextUint16ToBytes is first with key of type uint16 and value of type []byte.
func (c *Cursor) NextUint16ToBytes() (uint16, []byte) {
rawKey, rawValue := c.Next()
key := bytesTouint16(rawKey)
value := (rawValue)
return key, value
}
// PrevUint16ToBytes is first with key of type uint16 and value of type []byte.
func (c *Cursor) PrevUint16ToBytes() (uint16, []byte) {
rawKey, rawValue := c.Prev()
key := bytesTouint16(rawKey)
value := (rawValue)
return key, value
}
// SeekUint16ToBytes is first with key of type uint16 and value of type []byte.
func (c *Cursor) SeekUint16ToBytes(key uint16) (uint16, []byte) {
rawKey, rawValue := c.Seek(uint16Tobytes(key))
key = bytesTouint16(rawKey)
value := (rawValue)
return key, value
}
// ForEachUint16ToString is a for each with key of type uint16 and value of type string.
func (b *Bucket) ForEachUint16ToString(fn func(key uint16, value string) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := bytesTouint16(rawKey)
value := string(rawValue)
return fn(key, value)
},
)
}
// GetUint16ToString is a get with key of type uint16 and value of type string.
func (b *Bucket) GetUint16ToString(key uint16) string {
return string(b.Get(uint16Tobytes(key)))
}
// GetRequiredUint16ToString is a get with key of type uint16 and value of type string that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredUint16ToString(key uint16) (string, error) {
value := b.Get(uint16Tobytes(key))
if value == nil {
return "", NewKeyNotFoundError(key)
}
return string(value), nil
}
// PutUint16ToString is a put with key of type uint16 and value of type string.
func (b *Bucket) PutUint16ToString(key uint16, value string) error {
return b.Put(uint16Tobytes(key), []byte(value))
}
// FirstUint16ToString is first with key of type uint16 and value of type string.
func (c *Cursor) FirstUint16ToString() (uint16, string) {
rawKey, rawValue := c.First()
key := bytesTouint16(rawKey)
value := string(rawValue)
return key, value
}
// LastUint16ToString is first with key of type uint16 and value of type string.
func (c *Cursor) LastUint16ToString() (uint16, string) {
rawKey, rawValue := c.Last()
key := bytesTouint16(rawKey)
value := string(rawValue)
return key, value
}
// NextUint16ToString is first with key of type uint16 and value of type string.
func (c *Cursor) NextUint16ToString() (uint16, string) {
rawKey, rawValue := c.Next()
key := bytesTouint16(rawKey)
value := string(rawValue)
return key, value
}
// PrevUint16ToString is first with key of type uint16 and value of type string.
func (c *Cursor) PrevUint16ToString() (uint16, string) {
rawKey, rawValue := c.Prev()
key := bytesTouint16(rawKey)
value := string(rawValue)
return key, value
}
// SeekUint16ToString is first with key of type uint16 and value of type string.
func (c *Cursor) SeekUint16ToString(key uint16) (uint16, string) {
rawKey, rawValue := c.Seek(uint16Tobytes(key))
key = bytesTouint16(rawKey)
value := string(rawValue)
return key, value
}
// ForEachUint16ToUint16 is a for each with key of type uint16 and value of type uint16.
func (b *Bucket) ForEachUint16ToUint16(fn func(key uint16, value uint16) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := bytesTouint16(rawKey)
value := bytesTouint16(rawValue)
return fn(key, value)
},
)
}
// GetUint16ToUint16 is a get with key of type uint16 and value of type uint16.
func (b *Bucket) GetUint16ToUint16(key uint16) uint16 {
return bytesTouint16(b.Get(uint16Tobytes(key)))
}
// GetRequiredUint16ToUint16 is a get with key of type uint16 and value of type uint16 that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredUint16ToUint16(key uint16) (uint16, error) {
value := b.Get(uint16Tobytes(key))
if value == nil {
return 0, NewKeyNotFoundError(key)
}
return bytesTouint16(value), nil
}
// PutUint16ToUint16 is a put with key of type uint16 and value of type uint16.
func (b *Bucket) PutUint16ToUint16(key uint16, value uint16) error {
return b.Put(uint16Tobytes(key), uint16Tobytes(value))
}
// FirstUint16ToUint16 is first with key of type uint16 and value of type uint16.
func (c *Cursor) FirstUint16ToUint16() (uint16, uint16) {
rawKey, rawValue := c.First()
key := bytesTouint16(rawKey)
value := bytesTouint16(rawValue)
return key, value
}
// LastUint16ToUint16 is first with key of type uint16 and value of type uint16.
func (c *Cursor) LastUint16ToUint16() (uint16, uint16) {
rawKey, rawValue := c.Last()
key := bytesTouint16(rawKey)
value := bytesTouint16(rawValue)
return key, value
}
// NextUint16ToUint16 is first with key of type uint16 and value of type uint16.
func (c *Cursor) NextUint16ToUint16() (uint16, uint16) {
rawKey, rawValue := c.Next()
key := bytesTouint16(rawKey)
value := bytesTouint16(rawValue)
return key, value
}
// PrevUint16ToUint16 is first with key of type uint16 and value of type uint16.
func (c *Cursor) PrevUint16ToUint16() (uint16, uint16) {
rawKey, rawValue := c.Prev()
key := bytesTouint16(rawKey)
value := bytesTouint16(rawValue)
return key, value
}
// SeekUint16ToUint16 is first with key of type uint16 and value of type uint16.
func (c *Cursor) SeekUint16ToUint16(key uint16) (uint16, uint16) {
rawKey, rawValue := c.Seek(uint16Tobytes(key))
key = bytesTouint16(rawKey)
value := bytesTouint16(rawValue)
return key, value
}
// ForEachUint16ToUint32 is a for each with key of type uint16 and value of type uint32.
func (b *Bucket) ForEachUint16ToUint32(fn func(key uint16, value uint32) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := bytesTouint16(rawKey)
value := bytesTouint32(rawValue)
return fn(key, value)
},
)
}
// GetUint16ToUint32 is a get with key of type uint16 and value of type uint32.
func (b *Bucket) GetUint16ToUint32(key uint16) uint32 {
return bytesTouint32(b.Get(uint16Tobytes(key)))
}
// GetRequiredUint16ToUint32 is a get with key of type uint16 and value of type uint32 that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredUint16ToUint32(key uint16) (uint32, error) {
value := b.Get(uint16Tobytes(key))
if value == nil {
return 0, NewKeyNotFoundError(key)
}
return bytesTouint32(value), nil
}
// PutUint16ToUint32 is a put with key of type uint16 and value of type uint32.
func (b *Bucket) PutUint16ToUint32(key uint16, value uint32) error {
return b.Put(uint16Tobytes(key), uint32Tobytes(value))
}
// FirstUint16ToUint32 is first with key of type uint16 and value of type uint32.
func (c *Cursor) FirstUint16ToUint32() (uint16, uint32) {
rawKey, rawValue := c.First()
key := bytesTouint16(rawKey)
value := bytesTouint32(rawValue)
return key, value
}
// LastUint16ToUint32 is first with key of type uint16 and value of type uint32.
func (c *Cursor) LastUint16ToUint32() (uint16, uint32) {
rawKey, rawValue := c.Last()
key := bytesTouint16(rawKey)
value := bytesTouint32(rawValue)
return key, value
}
// NextUint16ToUint32 is first with key of type uint16 and value of type uint32.
func (c *Cursor) NextUint16ToUint32() (uint16, uint32) {
rawKey, rawValue := c.Next()
key := bytesTouint16(rawKey)
value := bytesTouint32(rawValue)
return key, value
}
// PrevUint16ToUint32 is first with key of type uint16 and value of type uint32.
func (c *Cursor) PrevUint16ToUint32() (uint16, uint32) {
rawKey, rawValue := c.Prev()
key := bytesTouint16(rawKey)
value := bytesTouint32(rawValue)
return key, value
}
// SeekUint16ToUint32 is first with key of type uint16 and value of type uint32.
func (c *Cursor) SeekUint16ToUint32(key uint16) (uint16, uint32) {
rawKey, rawValue := c.Seek(uint16Tobytes(key))
key = bytesTouint16(rawKey)
value := bytesTouint32(rawValue)
return key, value
}
// ForEachUint16ToUint64 is a for each with key of type uint16 and value of type uint64.
func (b *Bucket) ForEachUint16ToUint64(fn func(key uint16, value uint64) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := bytesTouint16(rawKey)
value := bytesTouint64(rawValue)
return fn(key, value)
},
)
}
// GetUint16ToUint64 is a get with key of type uint16 and value of type uint64.
func (b *Bucket) GetUint16ToUint64(key uint16) uint64 {
return bytesTouint64(b.Get(uint16Tobytes(key)))
}
// GetRequiredUint16ToUint64 is a get with key of type uint16 and value of type uint64 that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredUint16ToUint64(key uint16) (uint64, error) {
value := b.Get(uint16Tobytes(key))
if value == nil {
return 0, NewKeyNotFoundError(key)
}
return bytesTouint64(value), nil
}
// PutUint16ToUint64 is a put with key of type uint16 and value of type uint64.
func (b *Bucket) PutUint16ToUint64(key uint16, value uint64) error {
return b.Put(uint16Tobytes(key), uint64Tobytes(value))
}
// FirstUint16ToUint64 is first with key of type uint16 and value of type uint64.
func (c *Cursor) FirstUint16ToUint64() (uint16, uint64) {
rawKey, rawValue := c.First()
key := bytesTouint16(rawKey)
value := bytesTouint64(rawValue)
return key, value
}
// LastUint16ToUint64 is first with key of type uint16 and value of type uint64.
func (c *Cursor) LastUint16ToUint64() (uint16, uint64) {
rawKey, rawValue := c.Last()
key := bytesTouint16(rawKey)
value := bytesTouint64(rawValue)
return key, value
}
// NextUint16ToUint64 is first with key of type uint16 and value of type uint64.
func (c *Cursor) NextUint16ToUint64() (uint16, uint64) {
rawKey, rawValue := c.Next()
key := bytesTouint16(rawKey)
value := bytesTouint64(rawValue)
return key, value
}
// PrevUint16ToUint64 is first with key of type uint16 and value of type uint64.
func (c *Cursor) PrevUint16ToUint64() (uint16, uint64) {
rawKey, rawValue := c.Prev()
key := bytesTouint16(rawKey)
value := bytesTouint64(rawValue)
return key, value
}
// SeekUint16ToUint64 is first with key of type uint16 and value of type uint64.
func (c *Cursor) SeekUint16ToUint64(key uint16) (uint16, uint64) {
rawKey, rawValue := c.Seek(uint16Tobytes(key))
key = bytesTouint16(rawKey)
value := bytesTouint64(rawValue)
return key, value
}
// ForEachUint16ToUint16Uint16 is a for each with key of type uint16 and value of type pair(uint16,uint16).
func (b *Bucket) ForEachUint16ToUint16Uint16(fn func(key uint16, value1 uint16, value2 uint16) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint16uint16(rawValue)
return fn(key, value1, value2)
},
)
}
// GetUint16ToUint16Uint16 is a get with key of type uint16 and value of type pair(uint16,uint16).
func (b *Bucket) GetUint16ToUint16Uint16(key uint16) (uint16, uint16) {
return bytesTouint16uint16(b.Get(uint16Tobytes(key)))
}
// GetRequiredUint16ToUint16Uint16 is a get with key of type uint16 and value of type pair(uint16,uint16) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredUint16ToUint16Uint16(key uint16) (uint16, uint16, error) {
value := b.Get(uint16Tobytes(key))
if value == nil {
return 0, 0, NewKeyNotFoundError(key)
}
value1, value2 := bytesTouint16uint16(value)
return value1, value2, nil
}
// PutUint16ToUint16Uint16 is a put with key of type uint16 and value of type pair(uint16,uint16).
func (b *Bucket) PutUint16ToUint16Uint16(key uint16, value1 uint16, value2 uint16) error {
return b.Put(uint16Tobytes(key), uint16uint16Tobytes(value1, value2))
}
// FirstUint16ToUint16Uint16 is first with key of type uint16 and value of type pair(uint16,uint16).
func (c *Cursor) FirstUint16ToUint16Uint16() (uint16, uint16, uint16) {
rawKey, rawValue := c.First()
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint16uint16(rawValue)
return key, value1, value2
}
// LastUint16ToUint16Uint16 is first with key of type uint16 and value of type pair(uint16,uint16).
func (c *Cursor) LastUint16ToUint16Uint16() (uint16, uint16, uint16) {
rawKey, rawValue := c.Last()
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint16uint16(rawValue)
return key, value1, value2
}
// NextUint16ToUint16Uint16 is first with key of type uint16 and value of type pair(uint16,uint16).
func (c *Cursor) NextUint16ToUint16Uint16() (uint16, uint16, uint16) {
rawKey, rawValue := c.Next()
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint16uint16(rawValue)
return key, value1, value2
}
// PrevUint16ToUint16Uint16 is first with key of type uint16 and value of type pair(uint16,uint16).
func (c *Cursor) PrevUint16ToUint16Uint16() (uint16, uint16, uint16) {
rawKey, rawValue := c.Prev()
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint16uint16(rawValue)
return key, value1, value2
}
// SeekUint16ToUint16Uint16 is first with key of type uint16 and value of type pair(uint16,uint16).
func (c *Cursor) SeekUint16ToUint16Uint16(key uint16) (uint16, uint16, uint16) {
rawKey, rawValue := c.Seek(uint16Tobytes(key))
key = bytesTouint16(rawKey)
value1, value2 := bytesTouint16uint16(rawValue)
return key, value1, value2
}
// ForEachUint16ToUint32Uint32 is a for each with key of type uint16 and value of type pair(uint32,uint32).
func (b *Bucket) ForEachUint16ToUint32Uint32(fn func(key uint16, value1 uint32, value2 uint32) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint32uint32(rawValue)
return fn(key, value1, value2)
},
)
}
// GetUint16ToUint32Uint32 is a get with key of type uint16 and value of type pair(uint32,uint32).
func (b *Bucket) GetUint16ToUint32Uint32(key uint16) (uint32, uint32) {
return bytesTouint32uint32(b.Get(uint16Tobytes(key)))
}
// GetRequiredUint16ToUint32Uint32 is a get with key of type uint16 and value of type pair(uint32,uint32) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredUint16ToUint32Uint32(key uint16) (uint32, uint32, error) {
value := b.Get(uint16Tobytes(key))
if value == nil {
return 0, 0, NewKeyNotFoundError(key)
}
value1, value2 := bytesTouint32uint32(value)
return value1, value2, nil
}
// PutUint16ToUint32Uint32 is a put with key of type uint16 and value of type pair(uint32,uint32).
func (b *Bucket) PutUint16ToUint32Uint32(key uint16, value1 uint32, value2 uint32) error {
return b.Put(uint16Tobytes(key), uint32uint32Tobytes(value1, value2))
}
// FirstUint16ToUint32Uint32 is first with key of type uint16 and value of type pair(uint32,uint32).
func (c *Cursor) FirstUint16ToUint32Uint32() (uint16, uint32, uint32) {
rawKey, rawValue := c.First()
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint32uint32(rawValue)
return key, value1, value2
}
// LastUint16ToUint32Uint32 is first with key of type uint16 and value of type pair(uint32,uint32).
func (c *Cursor) LastUint16ToUint32Uint32() (uint16, uint32, uint32) {
rawKey, rawValue := c.Last()
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint32uint32(rawValue)
return key, value1, value2
}
// NextUint16ToUint32Uint32 is first with key of type uint16 and value of type pair(uint32,uint32).
func (c *Cursor) NextUint16ToUint32Uint32() (uint16, uint32, uint32) {
rawKey, rawValue := c.Next()
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint32uint32(rawValue)
return key, value1, value2
}
// PrevUint16ToUint32Uint32 is first with key of type uint16 and value of type pair(uint32,uint32).
func (c *Cursor) PrevUint16ToUint32Uint32() (uint16, uint32, uint32) {
rawKey, rawValue := c.Prev()
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint32uint32(rawValue)
return key, value1, value2
}
// SeekUint16ToUint32Uint32 is first with key of type uint16 and value of type pair(uint32,uint32).
func (c *Cursor) SeekUint16ToUint32Uint32(key uint16) (uint16, uint32, uint32) {
rawKey, rawValue := c.Seek(uint16Tobytes(key))
key = bytesTouint16(rawKey)
value1, value2 := bytesTouint32uint32(rawValue)
return key, value1, value2
}
// ForEachUint16ToUint64Uint64 is a for each with key of type uint16 and value of type pair(uint64,uint64).
func (b *Bucket) ForEachUint16ToUint64Uint64(fn func(key uint16, value1 uint64, value2 uint64) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint64uint64(rawValue)
return fn(key, value1, value2)
},
)
}
// GetUint16ToUint64Uint64 is a get with key of type uint16 and value of type pair(uint64,uint64).
func (b *Bucket) GetUint16ToUint64Uint64(key uint16) (uint64, uint64) {
return bytesTouint64uint64(b.Get(uint16Tobytes(key)))
}
// GetRequiredUint16ToUint64Uint64 is a get with key of type uint16 and value of type pair(uint64,uint64) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredUint16ToUint64Uint64(key uint16) (uint64, uint64, error) {
value := b.Get(uint16Tobytes(key))
if value == nil {
return 0, 0, NewKeyNotFoundError(key)
}
value1, value2 := bytesTouint64uint64(value)
return value1, value2, nil
}
// PutUint16ToUint64Uint64 is a put with key of type uint16 and value of type pair(uint64,uint64).
func (b *Bucket) PutUint16ToUint64Uint64(key uint16, value1 uint64, value2 uint64) error {
return b.Put(uint16Tobytes(key), uint64uint64Tobytes(value1, value2))
}
// FirstUint16ToUint64Uint64 is first with key of type uint16 and value of type pair(uint64,uint64).
func (c *Cursor) FirstUint16ToUint64Uint64() (uint16, uint64, uint64) {
rawKey, rawValue := c.First()
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint64uint64(rawValue)
return key, value1, value2
}
// LastUint16ToUint64Uint64 is first with key of type uint16 and value of type pair(uint64,uint64).
func (c *Cursor) LastUint16ToUint64Uint64() (uint16, uint64, uint64) {
rawKey, rawValue := c.Last()
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint64uint64(rawValue)
return key, value1, value2
}
// NextUint16ToUint64Uint64 is first with key of type uint16 and value of type pair(uint64,uint64).
func (c *Cursor) NextUint16ToUint64Uint64() (uint16, uint64, uint64) {
rawKey, rawValue := c.Next()
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint64uint64(rawValue)
return key, value1, value2
}
// PrevUint16ToUint64Uint64 is first with key of type uint16 and value of type pair(uint64,uint64).
func (c *Cursor) PrevUint16ToUint64Uint64() (uint16, uint64, uint64) {
rawKey, rawValue := c.Prev()
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint64uint64(rawValue)
return key, value1, value2
}
// SeekUint16ToUint64Uint64 is first with key of type uint16 and value of type pair(uint64,uint64).
func (c *Cursor) SeekUint16ToUint64Uint64(key uint16) (uint16, uint64, uint64) {
rawKey, rawValue := c.Seek(uint16Tobytes(key))
key = bytesTouint16(rawKey)
value1, value2 := bytesTouint64uint64(rawValue)
return key, value1, value2
}
// ForEachUint16ToUint16Bytes is a for each with key of type uint16 and value of type pair(uint16,[]byte).
func (b *Bucket) ForEachUint16ToUint16Bytes(fn func(key uint16, value1 uint16, value2 []byte) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint16bytes(rawValue)
return fn(key, value1, value2)
},
)
}
// GetUint16ToUint16Bytes is a get with key of type uint16 and value of type pair(uint16,[]byte).
func (b *Bucket) GetUint16ToUint16Bytes(key uint16) (uint16, []byte) {
return bytesTouint16bytes(b.Get(uint16Tobytes(key)))
}
// GetRequiredUint16ToUint16Bytes is a get with key of type uint16 and value of type pair(uint16,[]byte) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredUint16ToUint16Bytes(key uint16) (uint16, []byte, error) {
value := b.Get(uint16Tobytes(key))
if value == nil {
return 0, nil, NewKeyNotFoundError(key)
}
value1, value2 := bytesTouint16bytes(value)
return value1, value2, nil
}
// PutUint16ToUint16Bytes is a put with key of type uint16 and value of type pair(uint16,[]byte).
func (b *Bucket) PutUint16ToUint16Bytes(key uint16, value1 uint16, value2 []byte) error {
return b.Put(uint16Tobytes(key), uint16bytesTobytes(value1, value2))
}
// FirstUint16ToUint16Bytes is first with key of type uint16 and value of type pair(uint16,[]byte).
func (c *Cursor) FirstUint16ToUint16Bytes() (uint16, uint16, []byte) {
rawKey, rawValue := c.First()
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint16bytes(rawValue)
return key, value1, value2
}
// LastUint16ToUint16Bytes is first with key of type uint16 and value of type pair(uint16,[]byte).
func (c *Cursor) LastUint16ToUint16Bytes() (uint16, uint16, []byte) {
rawKey, rawValue := c.Last()
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint16bytes(rawValue)
return key, value1, value2
}
// NextUint16ToUint16Bytes is first with key of type uint16 and value of type pair(uint16,[]byte).
func (c *Cursor) NextUint16ToUint16Bytes() (uint16, uint16, []byte) {
rawKey, rawValue := c.Next()
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint16bytes(rawValue)
return key, value1, value2
}
// PrevUint16ToUint16Bytes is first with key of type uint16 and value of type pair(uint16,[]byte).
func (c *Cursor) PrevUint16ToUint16Bytes() (uint16, uint16, []byte) {
rawKey, rawValue := c.Prev()
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint16bytes(rawValue)
return key, value1, value2
}
// SeekUint16ToUint16Bytes is first with key of type uint16 and value of type pair(uint16,[]byte).
func (c *Cursor) SeekUint16ToUint16Bytes(key uint16) (uint16, uint16, []byte) {
rawKey, rawValue := c.Seek(uint16Tobytes(key))
key = bytesTouint16(rawKey)
value1, value2 := bytesTouint16bytes(rawValue)
return key, value1, value2
}
// ForEachUint16ToUint32Bytes is a for each with key of type uint16 and value of type pair(uint32,[]byte).
func (b *Bucket) ForEachUint16ToUint32Bytes(fn func(key uint16, value1 uint32, value2 []byte) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint32bytes(rawValue)
return fn(key, value1, value2)
},
)
}
// GetUint16ToUint32Bytes is a get with key of type uint16 and value of type pair(uint32,[]byte).
func (b *Bucket) GetUint16ToUint32Bytes(key uint16) (uint32, []byte) {
return bytesTouint32bytes(b.Get(uint16Tobytes(key)))
}
// GetRequiredUint16ToUint32Bytes is a get with key of type uint16 and value of type pair(uint32,[]byte) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredUint16ToUint32Bytes(key uint16) (uint32, []byte, error) {
value := b.Get(uint16Tobytes(key))
if value == nil {
return 0, nil, NewKeyNotFoundError(key)
}
value1, value2 := bytesTouint32bytes(value)
return value1, value2, nil
}
// PutUint16ToUint32Bytes is a put with key of type uint16 and value of type pair(uint32,[]byte).
func (b *Bucket) PutUint16ToUint32Bytes(key uint16, value1 uint32, value2 []byte) error {
return b.Put(uint16Tobytes(key), uint32bytesTobytes(value1, value2))
}
// FirstUint16ToUint32Bytes is first with key of type uint16 and value of type pair(uint32,[]byte).
func (c *Cursor) FirstUint16ToUint32Bytes() (uint16, uint32, []byte) {
rawKey, rawValue := c.First()
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint32bytes(rawValue)
return key, value1, value2
}
// LastUint16ToUint32Bytes is first with key of type uint16 and value of type pair(uint32,[]byte).
func (c *Cursor) LastUint16ToUint32Bytes() (uint16, uint32, []byte) {
rawKey, rawValue := c.Last()
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint32bytes(rawValue)
return key, value1, value2
}
// NextUint16ToUint32Bytes is first with key of type uint16 and value of type pair(uint32,[]byte).
func (c *Cursor) NextUint16ToUint32Bytes() (uint16, uint32, []byte) {
rawKey, rawValue := c.Next()
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint32bytes(rawValue)
return key, value1, value2
}
// PrevUint16ToUint32Bytes is first with key of type uint16 and value of type pair(uint32,[]byte).
func (c *Cursor) PrevUint16ToUint32Bytes() (uint16, uint32, []byte) {
rawKey, rawValue := c.Prev()
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint32bytes(rawValue)
return key, value1, value2
}
// SeekUint16ToUint32Bytes is first with key of type uint16 and value of type pair(uint32,[]byte).
func (c *Cursor) SeekUint16ToUint32Bytes(key uint16) (uint16, uint32, []byte) {
rawKey, rawValue := c.Seek(uint16Tobytes(key))
key = bytesTouint16(rawKey)
value1, value2 := bytesTouint32bytes(rawValue)
return key, value1, value2
}
// ForEachUint16ToUint64Bytes is a for each with key of type uint16 and value of type pair(uint64,[]byte).
func (b *Bucket) ForEachUint16ToUint64Bytes(fn func(key uint16, value1 uint64, value2 []byte) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint64bytes(rawValue)
return fn(key, value1, value2)
},
)
}
// GetUint16ToUint64Bytes is a get with key of type uint16 and value of type pair(uint64,[]byte).
func (b *Bucket) GetUint16ToUint64Bytes(key uint16) (uint64, []byte) {
return bytesTouint64bytes(b.Get(uint16Tobytes(key)))
}
// GetRequiredUint16ToUint64Bytes is a get with key of type uint16 and value of type pair(uint64,[]byte) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredUint16ToUint64Bytes(key uint16) (uint64, []byte, error) {
value := b.Get(uint16Tobytes(key))
if value == nil {
return 0, nil, NewKeyNotFoundError(key)
}
value1, value2 := bytesTouint64bytes(value)
return value1, value2, nil
}
// PutUint16ToUint64Bytes is a put with key of type uint16 and value of type pair(uint64,[]byte).
func (b *Bucket) PutUint16ToUint64Bytes(key uint16, value1 uint64, value2 []byte) error {
return b.Put(uint16Tobytes(key), uint64bytesTobytes(value1, value2))
}
// FirstUint16ToUint64Bytes is first with key of type uint16 and value of type pair(uint64,[]byte).
func (c *Cursor) FirstUint16ToUint64Bytes() (uint16, uint64, []byte) {
rawKey, rawValue := c.First()
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint64bytes(rawValue)
return key, value1, value2
}
// LastUint16ToUint64Bytes is first with key of type uint16 and value of type pair(uint64,[]byte).
func (c *Cursor) LastUint16ToUint64Bytes() (uint16, uint64, []byte) {
rawKey, rawValue := c.Last()
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint64bytes(rawValue)
return key, value1, value2
}
// NextUint16ToUint64Bytes is first with key of type uint16 and value of type pair(uint64,[]byte).
func (c *Cursor) NextUint16ToUint64Bytes() (uint16, uint64, []byte) {
rawKey, rawValue := c.Next()
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint64bytes(rawValue)
return key, value1, value2
}
// PrevUint16ToUint64Bytes is first with key of type uint16 and value of type pair(uint64,[]byte).
func (c *Cursor) PrevUint16ToUint64Bytes() (uint16, uint64, []byte) {
rawKey, rawValue := c.Prev()
key := bytesTouint16(rawKey)
value1, value2 := bytesTouint64bytes(rawValue)
return key, value1, value2
}
// SeekUint16ToUint64Bytes is first with key of type uint16 and value of type pair(uint64,[]byte).
func (c *Cursor) SeekUint16ToUint64Bytes(key uint16) (uint16, uint64, []byte) {
rawKey, rawValue := c.Seek(uint16Tobytes(key))
key = bytesTouint16(rawKey)
value1, value2 := bytesTouint64bytes(rawValue)
return key, value1, value2
}
// ForEachUint16ToBytesUint16 is a for each with key of type uint16 and value of type pair([]byte,uint16).
func (b *Bucket) ForEachUint16ToBytesUint16(fn func(key uint16, value1 []byte, value2 uint16) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := bytesTouint16(rawKey)
value1, value2 := bytesTobytesuint16(rawValue)
return fn(key, value1, value2)
},
)
}
// GetUint16ToBytesUint16 is a get with key of type uint16 and value of type pair([]byte,uint16).
func (b *Bucket) GetUint16ToBytesUint16(key uint16) ([]byte, uint16) {
return bytesTobytesuint16(b.Get(uint16Tobytes(key)))
}
// GetRequiredUint16ToBytesUint16 is a get with key of type uint16 and value of type pair([]byte,uint16) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredUint16ToBytesUint16(key uint16) ([]byte, uint16, error) {
value := b.Get(uint16Tobytes(key))
if value == nil {
return nil, 0, NewKeyNotFoundError(key)
}
value1, value2 := bytesTobytesuint16(value)
return value1, value2, nil
}
// PutUint16ToBytesUint16 is a put with key of type uint16 and value of type pair([]byte,uint16).
func (b *Bucket) PutUint16ToBytesUint16(key uint16, value1 []byte, value2 uint16) error {
return b.Put(uint16Tobytes(key), bytesuint16Tobytes(value1, value2))
}
// FirstUint16ToBytesUint16 is first with key of type uint16 and value of type pair([]byte,uint16).
func (c *Cursor) FirstUint16ToBytesUint16() (uint16, []byte, uint16) {
rawKey, rawValue := c.First()
key := bytesTouint16(rawKey)
value1, value2 := bytesTobytesuint16(rawValue)
return key, value1, value2
}
// LastUint16ToBytesUint16 is first with key of type uint16 and value of type pair([]byte,uint16).
func (c *Cursor) LastUint16ToBytesUint16() (uint16, []byte, uint16) {
rawKey, rawValue := c.Last()
key := bytesTouint16(rawKey)
value1, value2 := bytesTobytesuint16(rawValue)
return key, value1, value2
}
// NextUint16ToBytesUint16 is first with key of type uint16 and value of type pair([]byte,uint16).
func (c *Cursor) NextUint16ToBytesUint16() (uint16, []byte, uint16) {
rawKey, rawValue := c.Next()
key := bytesTouint16(rawKey)
value1, value2 := bytesTobytesuint16(rawValue)
return key, value1, value2
}
// PrevUint16ToBytesUint16 is first with key of type uint16 and value of type pair([]byte,uint16).
func (c *Cursor) PrevUint16ToBytesUint16() (uint16, []byte, uint16) {
rawKey, rawValue := c.Prev()
key := bytesTouint16(rawKey)
value1, value2 := bytesTobytesuint16(rawValue)
return key, value1, value2
}
// SeekUint16ToBytesUint16 is first with key of type uint16 and value of type pair([]byte,uint16).
func (c *Cursor) SeekUint16ToBytesUint16(key uint16) (uint16, []byte, uint16) {
rawKey, rawValue := c.Seek(uint16Tobytes(key))
key = bytesTouint16(rawKey)
value1, value2 := bytesTobytesuint16(rawValue)
return key, value1, value2
}
// ForEachUint16ToBytesUint32 is a for each with key of type uint16 and value of type pair([]byte,uint32).
func (b *Bucket) ForEachUint16ToBytesUint32(fn func(key uint16, value1 []byte, value2 uint32) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := bytesTouint16(rawKey)
value1, value2 := bytesTobytesuint32(rawValue)
return fn(key, value1, value2)
},
)
}
// GetUint16ToBytesUint32 is a get with key of type uint16 and value of type pair([]byte,uint32).
func (b *Bucket) GetUint16ToBytesUint32(key uint16) ([]byte, uint32) {
return bytesTobytesuint32(b.Get(uint16Tobytes(key)))
}
// GetRequiredUint16ToBytesUint32 is a get with key of type uint16 and value of type pair([]byte,uint32) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredUint16ToBytesUint32(key uint16) ([]byte, uint32, error) {
value := b.Get(uint16Tobytes(key))
if value == nil {
return nil, 0, NewKeyNotFoundError(key)
}
value1, value2 := bytesTobytesuint32(value)
return value1, value2, nil
}
// PutUint16ToBytesUint32 is a put with key of type uint16 and value of type pair([]byte,uint32).
func (b *Bucket) PutUint16ToBytesUint32(key uint16, value1 []byte, value2 uint32) error {
return b.Put(uint16Tobytes(key), bytesuint32Tobytes(value1, value2))
}
// FirstUint16ToBytesUint32 is first with key of type uint16 and value of type pair([]byte,uint32).
func (c *Cursor) FirstUint16ToBytesUint32() (uint16, []byte, uint32) {
rawKey, rawValue := c.First()
key := bytesTouint16(rawKey)
value1, value2 := bytesTobytesuint32(rawValue)
return key, value1, value2
}
// LastUint16ToBytesUint32 is first with key of type uint16 and value of type pair([]byte,uint32).
func (c *Cursor) LastUint16ToBytesUint32() (uint16, []byte, uint32) {
rawKey, rawValue := c.Last()
key := bytesTouint16(rawKey)
value1, value2 := bytesTobytesuint32(rawValue)
return key, value1, value2
}
// NextUint16ToBytesUint32 is first with key of type uint16 and value of type pair([]byte,uint32).
func (c *Cursor) NextUint16ToBytesUint32() (uint16, []byte, uint32) {
rawKey, rawValue := c.Next()
key := bytesTouint16(rawKey)
value1, value2 := bytesTobytesuint32(rawValue)
return key, value1, value2
}
// PrevUint16ToBytesUint32 is first with key of type uint16 and value of type pair([]byte,uint32).
func (c *Cursor) PrevUint16ToBytesUint32() (uint16, []byte, uint32) {
rawKey, rawValue := c.Prev()
key := bytesTouint16(rawKey)
value1, value2 := bytesTobytesuint32(rawValue)
return key, value1, value2
}
// SeekUint16ToBytesUint32 is first with key of type uint16 and value of type pair([]byte,uint32).
func (c *Cursor) SeekUint16ToBytesUint32(key uint16) (uint16, []byte, uint32) {
rawKey, rawValue := c.Seek(uint16Tobytes(key))
key = bytesTouint16(rawKey)
value1, value2 := bytesTobytesuint32(rawValue)
return key, value1, value2
}
// ForEachUint16ToBytesUint64 is a for each with key of type uint16 and value of type pair([]byte,uint64).
func (b *Bucket) ForEachUint16ToBytesUint64(fn func(key uint16, value1 []byte, value2 uint64) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := bytesTouint16(rawKey)
value1, value2 := bytesTobytesuint64(rawValue)
return fn(key, value1, value2)
},
)
}
// GetUint16ToBytesUint64 is a get with key of type uint16 and value of type pair([]byte,uint64).
func (b *Bucket) GetUint16ToBytesUint64(key uint16) ([]byte, uint64) {
return bytesTobytesuint64(b.Get(uint16Tobytes(key)))
}
// GetRequiredUint16ToBytesUint64 is a get with key of type uint16 and value of type pair([]byte,uint64) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredUint16ToBytesUint64(key uint16) ([]byte, uint64, error) {
value := b.Get(uint16Tobytes(key))
if value == nil {
return nil, 0, NewKeyNotFoundError(key)
}
value1, value2 := bytesTobytesuint64(value)
return value1, value2, nil
}
// PutUint16ToBytesUint64 is a put with key of type uint16 and value of type pair([]byte,uint64).
func (b *Bucket) PutUint16ToBytesUint64(key uint16, value1 []byte, value2 uint64) error {
return b.Put(uint16Tobytes(key), bytesuint64Tobytes(value1, value2))
}
// FirstUint16ToBytesUint64 is first with key of type uint16 and value of type pair([]byte,uint64).
func (c *Cursor) FirstUint16ToBytesUint64() (uint16, []byte, uint64) {
rawKey, rawValue := c.First()
key := bytesTouint16(rawKey)
value1, value2 := bytesTobytesuint64(rawValue)
return key, value1, value2
}
// LastUint16ToBytesUint64 is first with key of type uint16 and value of type pair([]byte,uint64).
func (c *Cursor) LastUint16ToBytesUint64() (uint16, []byte, uint64) {
rawKey, rawValue := c.Last()
key := bytesTouint16(rawKey)
value1, value2 := bytesTobytesuint64(rawValue)
return key, value1, value2
}
// NextUint16ToBytesUint64 is first with key of type uint16 and value of type pair([]byte,uint64).
func (c *Cursor) NextUint16ToBytesUint64() (uint16, []byte, uint64) {
rawKey, rawValue := c.Next()
key := bytesTouint16(rawKey)
value1, value2 := bytesTobytesuint64(rawValue)
return key, value1, value2
}
// PrevUint16ToBytesUint64 is first with key of type uint16 and value of type pair([]byte,uint64).
func (c *Cursor) PrevUint16ToBytesUint64() (uint16, []byte, uint64) {
rawKey, rawValue := c.Prev()
key := bytesTouint16(rawKey)
value1, value2 := bytesTobytesuint64(rawValue)
return key, value1, value2
}
// SeekUint16ToBytesUint64 is first with key of type uint16 and value of type pair([]byte,uint64).
func (c *Cursor) SeekUint16ToBytesUint64(key uint16) (uint16, []byte, uint64) {
rawKey, rawValue := c.Seek(uint16Tobytes(key))
key = bytesTouint16(rawKey)
value1, value2 := bytesTobytesuint64(rawValue)
return key, value1, value2
}
// DeleteUint16 is a delete with key of type uint16.
func (b *Bucket) DeleteUint16(key uint16) error {
return b.Delete(uint16Tobytes(key))
}
// ForEachUint32ToBytes is a for each with key of type uint32 and value of type []byte.
func (b *Bucket) ForEachUint32ToBytes(fn func(key uint32, value []byte) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := bytesTouint32(rawKey)
value := (rawValue)
return fn(key, value)
},
)
}
// GetUint32ToBytes is a get with key of type uint32 and value of type []byte.
func (b *Bucket) GetUint32ToBytes(key uint32) []byte {
return (b.Get(uint32Tobytes(key)))
}
// GetRequiredUint32ToBytes is a get with key of type uint32 and value of type []byte that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredUint32ToBytes(key uint32) ([]byte, error) {
value := b.Get(uint32Tobytes(key))
if value == nil {
return nil, NewKeyNotFoundError(key)
}
return (value), nil
}
// PutUint32ToBytes is a put with key of type uint32 and value of type []byte.
func (b *Bucket) PutUint32ToBytes(key uint32, value []byte) error {
return b.Put(uint32Tobytes(key), (value))
}
// FirstUint32ToBytes is first with key of type uint32 and value of type []byte.
func (c *Cursor) FirstUint32ToBytes() (uint32, []byte) {
rawKey, rawValue := c.First()
key := bytesTouint32(rawKey)
value := (rawValue)
return key, value
}
// LastUint32ToBytes is first with key of type uint32 and value of type []byte.
func (c *Cursor) LastUint32ToBytes() (uint32, []byte) {
rawKey, rawValue := c.Last()
key := bytesTouint32(rawKey)
value := (rawValue)
return key, value
}
// NextUint32ToBytes is first with key of type uint32 and value of type []byte.
func (c *Cursor) NextUint32ToBytes() (uint32, []byte) {
rawKey, rawValue := c.Next()
key := bytesTouint32(rawKey)
value := (rawValue)
return key, value
}
// PrevUint32ToBytes is first with key of type uint32 and value of type []byte.
func (c *Cursor) PrevUint32ToBytes() (uint32, []byte) {
rawKey, rawValue := c.Prev()
key := bytesTouint32(rawKey)
value := (rawValue)
return key, value
}
// SeekUint32ToBytes is first with key of type uint32 and value of type []byte.
func (c *Cursor) SeekUint32ToBytes(key uint32) (uint32, []byte) {
rawKey, rawValue := c.Seek(uint32Tobytes(key))
key = bytesTouint32(rawKey)
value := (rawValue)
return key, value
}
// ForEachUint32ToString is a for each with key of type uint32 and value of type string.
func (b *Bucket) ForEachUint32ToString(fn func(key uint32, value string) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := bytesTouint32(rawKey)
value := string(rawValue)
return fn(key, value)
},
)
}
// GetUint32ToString is a get with key of type uint32 and value of type string.
func (b *Bucket) GetUint32ToString(key uint32) string {
return string(b.Get(uint32Tobytes(key)))
}
// GetRequiredUint32ToString is a get with key of type uint32 and value of type string that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredUint32ToString(key uint32) (string, error) {
value := b.Get(uint32Tobytes(key))
if value == nil {
return "", NewKeyNotFoundError(key)
}
return string(value), nil
}
// PutUint32ToString is a put with key of type uint32 and value of type string.
func (b *Bucket) PutUint32ToString(key uint32, value string) error {
return b.Put(uint32Tobytes(key), []byte(value))
}
// FirstUint32ToString is first with key of type uint32 and value of type string.
func (c *Cursor) FirstUint32ToString() (uint32, string) {
rawKey, rawValue := c.First()
key := bytesTouint32(rawKey)
value := string(rawValue)
return key, value
}
// LastUint32ToString is first with key of type uint32 and value of type string.
func (c *Cursor) LastUint32ToString() (uint32, string) {
rawKey, rawValue := c.Last()
key := bytesTouint32(rawKey)
value := string(rawValue)
return key, value
}
// NextUint32ToString is first with key of type uint32 and value of type string.
func (c *Cursor) NextUint32ToString() (uint32, string) {
rawKey, rawValue := c.Next()
key := bytesTouint32(rawKey)
value := string(rawValue)
return key, value
}
// PrevUint32ToString is first with key of type uint32 and value of type string.
func (c *Cursor) PrevUint32ToString() (uint32, string) {
rawKey, rawValue := c.Prev()
key := bytesTouint32(rawKey)
value := string(rawValue)
return key, value
}
// SeekUint32ToString is first with key of type uint32 and value of type string.
func (c *Cursor) SeekUint32ToString(key uint32) (uint32, string) {
rawKey, rawValue := c.Seek(uint32Tobytes(key))
key = bytesTouint32(rawKey)
value := string(rawValue)
return key, value
}
// ForEachUint32ToUint16 is a for each with key of type uint32 and value of type uint16.
func (b *Bucket) ForEachUint32ToUint16(fn func(key uint32, value uint16) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := bytesTouint32(rawKey)
value := bytesTouint16(rawValue)
return fn(key, value)
},
)
}
// GetUint32ToUint16 is a get with key of type uint32 and value of type uint16.
func (b *Bucket) GetUint32ToUint16(key uint32) uint16 {
return bytesTouint16(b.Get(uint32Tobytes(key)))
}
// GetRequiredUint32ToUint16 is a get with key of type uint32 and value of type uint16 that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredUint32ToUint16(key uint32) (uint16, error) {
value := b.Get(uint32Tobytes(key))
if value == nil {
return 0, NewKeyNotFoundError(key)
}
return bytesTouint16(value), nil
}
// PutUint32ToUint16 is a put with key of type uint32 and value of type uint16.
func (b *Bucket) PutUint32ToUint16(key uint32, value uint16) error {
return b.Put(uint32Tobytes(key), uint16Tobytes(value))
}
// FirstUint32ToUint16 is first with key of type uint32 and value of type uint16.
func (c *Cursor) FirstUint32ToUint16() (uint32, uint16) {
rawKey, rawValue := c.First()
key := bytesTouint32(rawKey)
value := bytesTouint16(rawValue)
return key, value
}
// LastUint32ToUint16 is first with key of type uint32 and value of type uint16.
func (c *Cursor) LastUint32ToUint16() (uint32, uint16) {
rawKey, rawValue := c.Last()
key := bytesTouint32(rawKey)
value := bytesTouint16(rawValue)
return key, value
}
// NextUint32ToUint16 is first with key of type uint32 and value of type uint16.
func (c *Cursor) NextUint32ToUint16() (uint32, uint16) {
rawKey, rawValue := c.Next()
key := bytesTouint32(rawKey)
value := bytesTouint16(rawValue)
return key, value
}
// PrevUint32ToUint16 is first with key of type uint32 and value of type uint16.
func (c *Cursor) PrevUint32ToUint16() (uint32, uint16) {
rawKey, rawValue := c.Prev()
key := bytesTouint32(rawKey)
value := bytesTouint16(rawValue)
return key, value
}
// SeekUint32ToUint16 is first with key of type uint32 and value of type uint16.
func (c *Cursor) SeekUint32ToUint16(key uint32) (uint32, uint16) {
rawKey, rawValue := c.Seek(uint32Tobytes(key))
key = bytesTouint32(rawKey)
value := bytesTouint16(rawValue)
return key, value
}
// ForEachUint32ToUint32 is a for each with key of type uint32 and value of type uint32.
func (b *Bucket) ForEachUint32ToUint32(fn func(key uint32, value uint32) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := bytesTouint32(rawKey)
value := bytesTouint32(rawValue)
return fn(key, value)
},
)
}
// GetUint32ToUint32 is a get with key of type uint32 and value of type uint32.
func (b *Bucket) GetUint32ToUint32(key uint32) uint32 {
return bytesTouint32(b.Get(uint32Tobytes(key)))
}
// GetRequiredUint32ToUint32 is a get with key of type uint32 and value of type uint32 that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredUint32ToUint32(key uint32) (uint32, error) {
value := b.Get(uint32Tobytes(key))
if value == nil {
return 0, NewKeyNotFoundError(key)
}
return bytesTouint32(value), nil
}
// PutUint32ToUint32 is a put with key of type uint32 and value of type uint32.
func (b *Bucket) PutUint32ToUint32(key uint32, value uint32) error {
return b.Put(uint32Tobytes(key), uint32Tobytes(value))
}
// FirstUint32ToUint32 is first with key of type uint32 and value of type uint32.
func (c *Cursor) FirstUint32ToUint32() (uint32, uint32) {
rawKey, rawValue := c.First()
key := bytesTouint32(rawKey)
value := bytesTouint32(rawValue)
return key, value
}
// LastUint32ToUint32 is first with key of type uint32 and value of type uint32.
func (c *Cursor) LastUint32ToUint32() (uint32, uint32) {
rawKey, rawValue := c.Last()
key := bytesTouint32(rawKey)
value := bytesTouint32(rawValue)
return key, value
}
// NextUint32ToUint32 is first with key of type uint32 and value of type uint32.
func (c *Cursor) NextUint32ToUint32() (uint32, uint32) {
rawKey, rawValue := c.Next()
key := bytesTouint32(rawKey)
value := bytesTouint32(rawValue)
return key, value
}
// PrevUint32ToUint32 is first with key of type uint32 and value of type uint32.
func (c *Cursor) PrevUint32ToUint32() (uint32, uint32) {
rawKey, rawValue := c.Prev()
key := bytesTouint32(rawKey)
value := bytesTouint32(rawValue)
return key, value
}
// SeekUint32ToUint32 is first with key of type uint32 and value of type uint32.
func (c *Cursor) SeekUint32ToUint32(key uint32) (uint32, uint32) {
rawKey, rawValue := c.Seek(uint32Tobytes(key))
key = bytesTouint32(rawKey)
value := bytesTouint32(rawValue)
return key, value
}
// ForEachUint32ToUint64 is a for each with key of type uint32 and value of type uint64.
func (b *Bucket) ForEachUint32ToUint64(fn func(key uint32, value uint64) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := bytesTouint32(rawKey)
value := bytesTouint64(rawValue)
return fn(key, value)
},
)
}
// GetUint32ToUint64 is a get with key of type uint32 and value of type uint64.
func (b *Bucket) GetUint32ToUint64(key uint32) uint64 {
return bytesTouint64(b.Get(uint32Tobytes(key)))
}
// GetRequiredUint32ToUint64 is a get with key of type uint32 and value of type uint64 that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredUint32ToUint64(key uint32) (uint64, error) {
value := b.Get(uint32Tobytes(key))
if value == nil {
return 0, NewKeyNotFoundError(key)
}
return bytesTouint64(value), nil
}
// PutUint32ToUint64 is a put with key of type uint32 and value of type uint64.
func (b *Bucket) PutUint32ToUint64(key uint32, value uint64) error {
return b.Put(uint32Tobytes(key), uint64Tobytes(value))
}
// FirstUint32ToUint64 is first with key of type uint32 and value of type uint64.
func (c *Cursor) FirstUint32ToUint64() (uint32, uint64) {
rawKey, rawValue := c.First()
key := bytesTouint32(rawKey)
value := bytesTouint64(rawValue)
return key, value
}
// LastUint32ToUint64 is first with key of type uint32 and value of type uint64.
func (c *Cursor) LastUint32ToUint64() (uint32, uint64) {
rawKey, rawValue := c.Last()
key := bytesTouint32(rawKey)
value := bytesTouint64(rawValue)
return key, value
}
// NextUint32ToUint64 is first with key of type uint32 and value of type uint64.
func (c *Cursor) NextUint32ToUint64() (uint32, uint64) {
rawKey, rawValue := c.Next()
key := bytesTouint32(rawKey)
value := bytesTouint64(rawValue)
return key, value
}
// PrevUint32ToUint64 is first with key of type uint32 and value of type uint64.
func (c *Cursor) PrevUint32ToUint64() (uint32, uint64) {
rawKey, rawValue := c.Prev()
key := bytesTouint32(rawKey)
value := bytesTouint64(rawValue)
return key, value
}
// SeekUint32ToUint64 is first with key of type uint32 and value of type uint64.
func (c *Cursor) SeekUint32ToUint64(key uint32) (uint32, uint64) {
rawKey, rawValue := c.Seek(uint32Tobytes(key))
key = bytesTouint32(rawKey)
value := bytesTouint64(rawValue)
return key, value
}
// ForEachUint32ToUint16Uint16 is a for each with key of type uint32 and value of type pair(uint16,uint16).
func (b *Bucket) ForEachUint32ToUint16Uint16(fn func(key uint32, value1 uint16, value2 uint16) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := bytesTouint32(rawKey)
value1, value2 := bytesTouint16uint16(rawValue)
return fn(key, value1, value2)
},
)
}
// GetUint32ToUint16Uint16 is a get with key of type uint32 and value of type pair(uint16,uint16).
func (b *Bucket) GetUint32ToUint16Uint16(key uint32) (uint16, uint16) {
return bytesTouint16uint16(b.Get(uint32Tobytes(key)))
}
// GetRequiredUint32ToUint16Uint16 is a get with key of type uint32 and value of type pair(uint16,uint16) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredUint32ToUint16Uint16(key uint32) (uint16, uint16, error) {
value := b.Get(uint32Tobytes(key))
if value == nil {
return 0, 0, NewKeyNotFoundError(key)
}
value1, value2 := bytesTouint16uint16(value)
return value1, value2, nil
}
// PutUint32ToUint16Uint16 is a put with key of type uint32 and value of type pair(uint16,uint16).
func (b *Bucket) PutUint32ToUint16Uint16(key uint32, value1 uint16, value2 uint16) error {
return b.Put(uint32Tobytes(key), uint16uint16Tobytes(value1, value2))
}
// FirstUint32ToUint16Uint16 is first with key of type uint32 and value of type pair(uint16,uint16).
func (c *Cursor) FirstUint32ToUint16Uint16() (uint32, uint16, uint16) {
rawKey, rawValue := c.First()
key := bytesTouint32(rawKey)
value1, value2 := bytesTouint16uint16(rawValue)
return key, value1, value2
}
// LastUint32ToUint16Uint16 is first with key of type uint32 and value of type pair(uint16,uint16).
func (c *Cursor) LastUint32ToUint16Uint16() (uint32, uint16, uint16) {
rawKey, rawValue := c.Last()
key := bytesTouint32(rawKey)
value1, value2 := bytesTouint16uint16(rawValue)
return key, value1, value2
}
// NextUint32ToUint16Uint16 is first with key of type uint32 and value of type pair(uint16,uint16).
func (c *Cursor) NextUint32ToUint16Uint16() (uint32, uint16, uint16) {
rawKey, rawValue := c.Next()
key := bytesTouint32(rawKey)
value1, value2 := bytesTouint16uint16(rawValue)
return key, value1, value2
}
// PrevUint32ToUint16Uint16 is first with key of type uint32 and value of type pair(uint16,uint16).
func (c *Cursor) PrevUint32ToUint16Uint16() (uint32, uint16, uint16) {
rawKey, rawValue := c.Prev()
key := bytesTouint32(rawKey)
value1, value2 := bytesTouint16uint16(rawValue)
return key, value1, value2
}
// SeekUint32ToUint16Uint16 is first with key of type uint32 and value of type pair(uint16,uint16).
func (c *Cursor) SeekUint32ToUint16Uint16(key uint32) (uint32, uint16, uint16) {
rawKey, rawValue := c.Seek(uint32Tobytes(key))
key = bytesTouint32(rawKey)
value1, value2 := bytesTouint16uint16(rawValue)
return key, value1, value2
}
// ForEachUint32ToUint32Uint32 is a for each with key of type uint32 and value of type pair(uint32,uint32).
func (b *Bucket) ForEachUint32ToUint32Uint32(fn func(key uint32, value1 uint32, value2 uint32) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := bytesTouint32(rawKey)
value1, value2 := bytesTouint32uint32(rawValue)
return fn(key, value1, value2)
},
)
}
// GetUint32ToUint32Uint32 is a get with key of type uint32 and value of type pair(uint32,uint32).
func (b *Bucket) GetUint32ToUint32Uint32(key uint32) (uint32, uint32) {
return bytesTouint32uint32(b.Get(uint32Tobytes(key)))
}
// GetRequiredUint32ToUint32Uint32 is a get with key of type uint32 and value of type pair(uint32,uint32) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredUint32ToUint32Uint32(key uint32) (uint32, uint32, error) {
value := b.Get(uint32Tobytes(key))
if value == nil {
return 0, 0, NewKeyNotFoundError(key)
}
value1, value2 := bytesTouint32uint32(value)
return value1, value2, nil
}
// PutUint32ToUint32Uint32 is a put with key of type uint32 and value of type pair(uint32,uint32).
func (b *Bucket) PutUint32ToUint32Uint32(key uint32, value1 uint32, value2 uint32) error {
return b.Put(uint32Tobytes(key), uint32uint32Tobytes(value1, value2))
}
// FirstUint32ToUint32Uint32 is first with key of type uint32 and value of type pair(uint32,uint32).
func (c *Cursor) FirstUint32ToUint32Uint32() (uint32, uint32, uint32) {
rawKey, rawValue := c.First()
key := bytesTouint32(rawKey)
value1, value2 := bytesTouint32uint32(rawValue)
return key, value1, value2
}
// LastUint32ToUint32Uint32 is first with key of type uint32 and value of type pair(uint32,uint32).
func (c *Cursor) LastUint32ToUint32Uint32() (uint32, uint32, uint32) {
rawKey, rawValue := c.Last()
key := bytesTouint32(rawKey)
value1, value2 := bytesTouint32uint32(rawValue)
return key, value1, value2
}
// NextUint32ToUint32Uint32 is first with key of type uint32 and value of type pair(uint32,uint32).
func (c *Cursor) NextUint32ToUint32Uint32() (uint32, uint32, uint32) {
rawKey, rawValue := c.Next()
key := bytesTouint32(rawKey)
value1, value2 := bytesTouint32uint32(rawValue)
return key, value1, value2
}
// PrevUint32ToUint32Uint32 is first with key of type uint32 and value of type pair(uint32,uint32).
func (c *Cursor) PrevUint32ToUint32Uint32() (uint32, uint32, uint32) {
rawKey, rawValue := c.Prev()
key := bytesTouint32(rawKey)
value1, value2 := bytesTouint32uint32(rawValue)
return key, value1, value2
}
// SeekUint32ToUint32Uint32 is first with key of type uint32 and value of type pair(uint32,uint32).
func (c *Cursor) SeekUint32ToUint32Uint32(key uint32) (uint32, uint32, uint32) {
rawKey, rawValue := c.Seek(uint32Tobytes(key))
key = bytesTouint32(rawKey)
value1, value2 := bytesTouint32uint32(rawValue)
return key, value1, value2
}
// ForEachUint32ToUint64Uint64 is a for each with key of type uint32 and value of type pair(uint64,uint64).
func (b *Bucket) ForEachUint32ToUint64Uint64(fn func(key uint32, value1 uint64, value2 uint64) error) error {
return b.ForEach(
func(rawKey []byte, rawValue []byte) error {
key := bytesTouint32(rawKey)
value1, value2 := bytesTouint64uint64(rawValue)
return fn(key, value1, value2)
},
)
}
// GetUint32ToUint64Uint64 is a get with key of type uint32 and value of type pair(uint64,uint64).
func (b *Bucket) GetUint32ToUint64Uint64(key uint32) (uint64, uint64) {
return bytesTouint64uint64(b.Get(uint32Tobytes(key)))
}
// GetRequiredUint32ToUint64Uint64 is a get with key of type uint32 and value of type pair(uint64,uint64) that returns a KeyNotFoundError if the key is not found.
func (b *Bucket) GetRequiredUint32ToUint64Uint64(key uint32) (uint64, uint64, error) {
value := b.Get(uint32Tobytes(key))
if value == nil {
return 0, 0, NewKeyNotFoundError(key)
}
value1, value2 := bytesTouint64uint64(value)
return value1, value2, nil
}
// PutUint32ToUint64Uint64 is a put with key of type uint32 and value of type pair(uint64,uint64).
func (b *Bucket) PutUint32ToUint64Uint64(key uint32, value1 uint64, value2 uint64) error {
return b.Put(uint32Tobytes(key), uint64uint64Tobytes(value1, value2))
}
// FirstUint32ToUint64Uint64 is first with key of type uint32 and value of type pair(uint64,uint64).
func (c *Cursor) FirstUint32ToUint64Uint64() (uint32, uint64, uint64) {
rawKey, rawValue := c.First()
key := bytesTouint32(rawKey)
value1, value2 := bytesTouint64uint64(rawValue)
return key, value1, value2
}
// LastUint32ToUint64Uint64 is first with key of type uint32 and value of type pair(uint64,uint64).
func (c *Cursor) LastUint32ToUint64Uint64() (uint32, uint64, uint64) {
rawKey, rawValue := c.Last()
key := bytesTouint32(rawKey)
value1, value2 := bytesTouint64uint64(rawValue)
return key, value1, value2
}
// NextUint32ToUint64Uint64 is first with key of type uint32 and value of type pair(uint64,uint64).