Documentation ¶
Overview ¶
Package bitseq provides a structure and utilities for representing a long bitmask which is persisted in a datastore. It is backed by bitmap.Bitmap which operates directly on the encoded representation, without uncompressing.
Index ¶
- Variables
- type Handle
- func (h *Handle) Bits() uint64
- func (h *Handle) CopyTo(o datastore.KVObject) error
- func (h *Handle) DataScope() string
- func (h *Handle) Destroy() error
- func (h *Handle) Exists() bool
- func (h *Handle) Index() uint64
- func (h *Handle) IsSet(ordinal uint64) bool
- func (h *Handle) Key() []string
- func (h *Handle) KeyPrefix() []string
- func (h *Handle) MarshalJSON() ([]byte, error)
- func (h *Handle) New() datastore.KVObject
- func (h *Handle) Set(ordinal uint64) error
- func (h *Handle) SetAny(serial bool) (uint64, error)
- func (h *Handle) SetAnyInRange(start, end uint64, serial bool) (uint64, error)
- func (h *Handle) SetIndex(index uint64)
- func (h *Handle) SetValue(value []byte) error
- func (h *Handle) Skip() bool
- func (h *Handle) String() string
- func (h *Handle) UnmarshalJSON(data []byte) error
- func (h *Handle) Unselected() uint64
- func (h *Handle) Unset(ordinal uint64) error
- func (h *Handle) Value() []byte
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoBitAvailable is returned when no more bits are available to set ErrNoBitAvailable = bitmap.ErrNoBitAvailable // ErrBitAllocated is returned when the specific bit requested is already set ErrBitAllocated = bitmap.ErrBitAllocated )
Functions ¶
This section is empty.
Types ¶
type Handle ¶
type Handle struct {
// contains filtered or unexported fields
}
Handle contains the sequence representing the bitmask and its identifier
func (*Handle) IsSet ¶
IsSet atomically checks if the ordinal bit is set. In case ordinal is outside of the bit sequence limits, false is returned.
func (*Handle) KeyPrefix ¶
KeyPrefix returns the immediate parent key that can be used for tree walk
func (*Handle) MarshalJSON ¶
MarshalJSON encodes h into a JSON message.
func (*Handle) SetAny ¶
SetAny atomically sets the first unset bit in the sequence and returns the corresponding ordinal
func (*Handle) SetAnyInRange ¶
SetAnyInRange atomically sets the first unset bit in the specified range in the sequence and returns the corresponding ordinal
func (*Handle) SetIndex ¶
SetIndex method allows the datastore to store the latest DB Index into this object
func (*Handle) UnmarshalJSON ¶
UnmarshalJSON decodes a JSON message into h.
func (*Handle) Unselected ¶
Unselected returns the number of bits which are not selected