Documentation ¶
Index ¶
- Constants
- Variables
- func BytesToSeq(b []byte) (seq uint64)
- func ExtractID(data interface{}) (string, bool)
- func GetEncodedSeqByID(queue string, id []byte, b *bolt.Bucket) ([]byte, error)
- func IntToUint(i int) uint64
- func SeqToBytes(seq uint64) []byte
- func SetSeqToIDRef(seq, id []byte, b *bolt.Bucket) error
- func UintToInt(u uint64) int
Constants ¶
View Source
const ( MaxUint = ^uint64(0) ZeroPoint = MaxUint / 1000000000 )
Constanst to correctly converts uint64 sequences to int
Variables ¶
View Source
var ( ElementsBucket = []byte("_elements") IDToSeqBucket = []byte("_id2seq") SeqToIDBucket = []byte("_seq2id") StatBytes = []byte("_stat") )
common sub buckets names
View Source
var ( ErrNotFound = errors.New("not found") ErrSeqToIDBucket = errors.New("seqToIDBucket is not exists") ErrExists = errors.New("element exists") ErrNoIDInTheElement = errors.New("no id in element") )
common errors
Functions ¶
func BytesToSeq ¶
BytesToSeq converts []byte implementation of sequence to uint64
func ExtractID ¶
ExtractID returns _id property of the passed interface{} if it is a map[string]interface{}
func GetEncodedSeqByID ¶
GetEncodedSeqByID returns []byte representation of the item sequence key by item _id property
func SeqToBytes ¶
SeqToBytes converts uint64 implementation of sequence to []byte
func SetSeqToIDRef ¶
SetSeqToIDRef creates index records when key is a sequence and value is a item _id
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.