Documentation ¶
Index ¶
- type Block
- func (b *Block) Add(recordID, value string)
- func (b *Block) BadRecords() []string
- func (b *Block) Dataset() *Dataset
- func (b *Block) Delete(key string) error
- func (b *Block) Filter(recordIDs map[string]string)
- func (b *Block) Get(key string) (*Record, error)
- func (b *Block) HumanSize() string
- func (b *Block) Len() int
- func (b *Block) MarshalJSON() ([]byte, error)
- func (b *Block) Path() string
- func (b *Block) Record(i int) *Record
- func (b *Block) RecordCount() int
- func (b *Block) Records() []*Record
- func (b *Block) UnmarshalJSON(data []byte) error
- type Dataset
- func (d *Dataset) BadBlocks() []string
- func (d *Dataset) BadBlocksCount() int
- func (d *Dataset) BadRecords() []string
- func (d *Dataset) BadRecordsCount() int
- func (d *Dataset) Block(i int) *Block
- func (d *Dataset) BlockCount() int
- func (d *Dataset) Blocks() []*Block
- func (d *Dataset) HumanSize() string
- func (d *Dataset) Indexes() []string
- func (d *Dataset) LastModifiedDate() string
- func (d *Dataset) Name() string
- func (d *Dataset) Path() string
- func (d *Dataset) RecordCount() int
- func (d *Dataset) Size() int64
- type EmptyBlock
- type Record
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct {
// contains filtered or unexported fields
}
Block represents a block file
func (*Block) BadRecords ¶
BadRecords returns all bad records found in a block
func (*Block) MarshalJSON ¶
MarshalJSON implements json.MarshalJSON
func (*Block) RecordCount ¶
RecordCount returns the number of records in a block
func (*Block) Records ¶
Records returns decrypted slice of all Records in a Block sorted in asc order of id
func (*Block) UnmarshalJSON ¶
UnmarshalJSON implements json.UnmarshalJSON
type Dataset ¶
type Dataset struct {
// contains filtered or unexported fields
}
Dataset represent a collection of blocks
func LoadDataset ¶
LoadDataset loads the dataset at path
func LoadDatasets ¶
LoadDatasets loads all datasets in given gitdb path
func (*Dataset) BadBlocksCount ¶
BadBlocksCount returns the number of bad blocks in a DataSet
func (*Dataset) BadRecords ¶
BadRecords returns all the bad records in a dataset
func (*Dataset) BadRecordsCount ¶
BadRecordsCount returns the number of bad records in a DataSet
func (*Dataset) BlockCount ¶
BlockCount returns the number of blocks in a DataSet
func (*Dataset) LastModifiedDate ¶
LastModifiedDate returns the last modification time of a DataSet
func (*Dataset) RecordCount ¶
RecordCount returns the number of records in a DataSet
type EmptyBlock ¶
type EmptyBlock struct {
Block
}
EmptyBlock is used for hydration
func NewEmptyBlock ¶
func NewEmptyBlock(key string) *EmptyBlock
NewEmptyBlock should be used to store records from multiple blocks
func (*EmptyBlock) Hydrate ¶
func (b *EmptyBlock) Hydrate(blockFilePath string) error
Hydrate should be called on EmptyBlock
func (*EmptyBlock) HydrateByPositions ¶
func (b *EmptyBlock) HydrateByPositions(blockFilePath string, positions ...[]int) error
HydrateByPositions should be called on EmptyBlock pos must be []int{offset, position}