Documentation ¶
Index ¶
- Constants
- Variables
- func BlockExist(s Store, sum []byte) bool
- func BlockIndexExist(s Store, sum []byte) bool
- func BlocksCount(rowsCount uint32) uint32
- func CombineRowBytesIntoBlock(blk [][]byte) []byte
- func CommitExist(s Store, sum []byte) bool
- func DeleteAllCommit(s Store) error
- func DeleteBlock(s Store, sum []byte) error
- func DeleteBlockIndex(s Store, sum []byte) error
- func DeleteCommit(s Store, sum []byte) error
- func DeleteTable(s Store, sum []byte) error
- func DeleteTableIndex(s Store, sum []byte) error
- func GetAllBlockKeys(s Store) ([][]byte, error)
- func GetAllCommitKeys(s Store) ([][]byte, error)
- func GetAllTableKeys(s Store) ([][]byte, error)
- func GetBlock(s Store, sum []byte) ([][]string, error)
- func GetBlockBytes(s Store, sum []byte) ([]byte, error)
- func GetTableIndex(s Store, sum []byte) ([][]string, error)
- func NopCloser(r io.ReadSeeker) io.ReadSeekCloser
- func ReadBlockFrom(r io.Reader) (int64, [][]string, error)
- func SaveBlock(s Store, content []byte) (sum []byte, err error)
- func SaveBlockIndex(s Store, sum, content []byte) (err error)
- func SaveCommit(s Store, content []byte) (sum []byte, err error)
- func SaveTable(s Store, content []byte) (sum []byte, err error)
- func SaveTableIndex(s Store, sum, content []byte) (err error)
- func StringSliceIsLess(pk []uint32, a, b []string) bool
- func TableExist(s Store, sum []byte) bool
- func TableIndexExist(s Store, sum []byte) bool
- func ValidateBlockBytes(b []byte) (err error)
- func ValidateStrListBytes(b []byte) (int, error)
- func WriteBlockTo(enc *StrListEncoder, w io.Writer, blk [][]string) (int64, error)
- type BlockIndex
- func GetBlockIndex(s Store, sum []byte) (*BlockIndex, error)
- func IndexBlock(enc *StrListEncoder, hash hash.Hash, blk [][]string, pk []uint32) (*BlockIndex, error)
- func IndexBlockFromBytes(dec *StrListDecoder, hash hash.Hash, e *StrListEditor, blk []byte, pk []uint32) (*BlockIndex, error)
- func ReadBlockIndex(r io.Reader) (int64, *BlockIndex, error)
- type Commit
- type Diff
- type Store
- type StrList
- type StrListDecoder
- type StrListEditor
- type StrListEncoder
- type Table
- type UintListDecoder
- type UintListEncoder
Constants ¶
View Source
const BlockSize = 255
Variables ¶
View Source
var ErrKeyNotFound = fmt.Errorf("key not found")
Functions ¶
func BlockExist ¶ added in v0.3.0
func BlockIndexExist ¶ added in v0.3.0
func BlocksCount ¶ added in v0.3.0
func CombineRowBytesIntoBlock ¶ added in v0.3.0
func CommitExist ¶ added in v0.3.0
func DeleteAllCommit ¶ added in v0.3.0
func DeleteBlock ¶ added in v0.3.0
func DeleteBlockIndex ¶ added in v0.3.0
func DeleteCommit ¶ added in v0.3.0
func DeleteTable ¶ added in v0.3.0
func DeleteTableIndex ¶ added in v0.3.0
func GetAllBlockKeys ¶ added in v0.3.0
func GetAllCommitKeys ¶ added in v0.3.0
func GetAllTableKeys ¶ added in v0.3.0
func NopCloser ¶ added in v0.3.0
func NopCloser(r io.ReadSeeker) io.ReadSeekCloser
func SaveBlockIndex ¶ added in v0.3.0
func SaveTableIndex ¶ added in v0.3.0
func StringSliceIsLess ¶ added in v0.3.0
func TableExist ¶ added in v0.3.0
func TableIndexExist ¶ added in v0.3.0
func ValidateBlockBytes ¶ added in v0.3.11
func ValidateStrListBytes ¶ added in v0.3.11
func WriteBlockTo ¶ added in v0.3.0
Types ¶
type BlockIndex ¶ added in v0.3.0
type BlockIndex struct { Rows [][]byte // contains filtered or unexported fields }
func GetBlockIndex ¶ added in v0.3.0
func GetBlockIndex(s Store, sum []byte) (*BlockIndex, error)
func IndexBlock ¶ added in v0.3.0
func IndexBlock(enc *StrListEncoder, hash hash.Hash, blk [][]string, pk []uint32) (*BlockIndex, error)
func IndexBlockFromBytes ¶ added in v0.3.0
func IndexBlockFromBytes(dec *StrListDecoder, hash hash.Hash, e *StrListEditor, blk []byte, pk []uint32) (*BlockIndex, error)
func ReadBlockIndex ¶ added in v0.3.0
func ReadBlockIndex(r io.Reader) (int64, *BlockIndex, error)
func (*BlockIndex) Len ¶ added in v0.3.0
func (idx *BlockIndex) Len() int
func (*BlockIndex) Less ¶ added in v0.3.0
func (idx *BlockIndex) Less(i, j int) bool
func (*BlockIndex) ReadFrom ¶ added in v0.3.0
func (idx *BlockIndex) ReadFrom(r io.Reader) (int64, error)
func (*BlockIndex) Swap ¶ added in v0.3.0
func (idx *BlockIndex) Swap(i, j int)
type Commit ¶
type StrList ¶ added in v0.3.0
type StrList []byte
func (StrList) LessThan ¶ added in v0.3.0
LessThan returns true if a is less than b based on given column indices
func (StrList) ReadColumns ¶ added in v0.3.0
type StrListDecoder ¶ added in v0.2.0
type StrListDecoder struct {
// contains filtered or unexported fields
}
StrListDecoder decodes string slice.
func NewStrListDecoder ¶ added in v0.2.0
func NewStrListDecoder(reuseRecords bool) *StrListDecoder
func (*StrListDecoder) Decode ¶ added in v0.2.0
func (d *StrListDecoder) Decode(b []byte) []string
type StrListEditor ¶ added in v0.3.0
type StrListEditor struct {
// contains filtered or unexported fields
}
StrListEditor can either remove certain columns from StrList or remove everything except certain columns. It is built to minimize allocations so given StrList will always be edit in place.
func NewStrListEditor ¶ added in v0.3.0
func NewStrListEditor(columns []uint32) *StrListEditor
func (*StrListEditor) PickFrom ¶ added in v0.3.0
func (r *StrListEditor) PickFrom(dst, src []byte) []byte
func (*StrListEditor) RemoveFrom ¶ added in v0.3.0
func (r *StrListEditor) RemoveFrom(b []byte) []byte
type StrListEncoder ¶ added in v0.2.0
type StrListEncoder struct {
// contains filtered or unexported fields
}
StrListEncoder encodes string slice. Max bytes size for each string is 65536 bytes
func NewStrListEncoder ¶ added in v0.2.0
func NewStrListEncoder(reuseRecords bool) *StrListEncoder
func (*StrListEncoder) Encode ¶ added in v0.2.0
func (e *StrListEncoder) Encode(sl []string) []byte
type Table ¶ added in v0.2.0
func (*Table) PrimaryKey ¶ added in v0.3.0
type UintListDecoder ¶ added in v0.2.0
type UintListDecoder struct {
// contains filtered or unexported fields
}
UintListDecoder decodes string slice.
func NewUintListDecoder ¶ added in v0.2.0
func NewUintListDecoder(reuseRecords bool) *UintListDecoder
func (*UintListDecoder) Decode ¶ added in v0.2.0
func (d *UintListDecoder) Decode(b []byte) []uint32
type UintListEncoder ¶ added in v0.2.0
type UintListEncoder struct {
// contains filtered or unexported fields
}
UintListEncoder encodes string slice. Max bytes size for each string is 65536 bytes
func NewUintListEncoder ¶ added in v0.2.0
func NewUintListEncoder() *UintListEncoder
func (*UintListEncoder) Encode ¶ added in v0.2.0
func (e *UintListEncoder) Encode(sl []uint32) []byte
Source Files ¶
Click to show internal directories.
Click to hide internal directories.