Documentation ¶
Overview ¶
Package bitseq provides a structure and utilities for representing long bitmask as sequence of run-length encoded blocks. It operates directly on the encoded representation, it does not decode/encode.
Index ¶
- Variables
- type Handle
- func (h *Handle) Bits() uint64
- func (h *Handle) CheckConsistency() error
- 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) FromByteArray(ba []byte) error
- 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) ToByteArray() ([]byte, error)
- 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 = errors.New("no bit available") // ErrBitAllocated is returned when the specific bit requested is already set ErrBitAllocated = errors.New("requested bit is already allocated") )
Functions ¶
This section is empty.
Types ¶
type Handle ¶
Handle contains the sequence representing the bitmask and its identifier
func (*Handle) CheckConsistency ¶
CheckConsistency checks if the bit sequence is in an inconsistent state and attempts to fix it. It looks for a corruption signature that may happen in docker 1.9.0 and 1.9.1.
func (*Handle) FromByteArray ¶
FromByteArray reads his handle's data from a byte array
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 Handle into 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) ToByteArray ¶
ToByteArray converts this handle's data into a byte array
func (*Handle) UnmarshalJSON ¶
UnmarshalJSON decodes json message into Handle
func (*Handle) Unselected ¶
Unselected returns the number of bits which are not selected