blob_store

package
v0.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Blob_Header_Size     uint64 = 30
	Blob_Footer_Size     uint64 = 32
	Blob_Key_Header_Size uint64 = 32

	KErrorMessage_Header = "Error while decoding blob log header"
	KErrorMessage_Record = "Error while decoding blob log record"
	KErrorMessage_Footer = "Error while decoding blob log footer"
)

Variables

This section is empty.

Functions

func ByteToUint32

func ByteToUint32(data []byte) uint32

func ByteToUint64

func ByteToUint64(data []byte) uint64

func CheckKey

func CheckKey(path string, keysMap map[string]uint8) error

func GetFiles

func GetFiles(directory string) ([]string, error)

func GetUint32

func GetUint32(slice *[]byte, value *uint32) bool

func GetUint64

func GetUint64(slice *[]byte, value *uint64) bool

func ReadAll

func ReadAll(filePth string) ([]byte, error)

Types

type BlobLogFooter

type BlobLogFooter struct {
	// contains filtered or unexported fields
}

func (*BlobLogFooter) DecodeForm

func (footer *BlobLogFooter) DecodeForm(slice []byte) error

type BlobLogHeader

type BlobLogHeader struct {
	// contains filtered or unexported fields
}

Format of blob log file header (30 bytes):

+--------------+---------+---------+-------+-------------+-------------------+
| magic number | version |  cf id  | flags | compression | expiration range  |
+--------------+---------+---------+-------+-------------+-------------------+
|   Fixed32    | Fixed32 | Fixed32 | char  |    char     | Fixed64   Fixed64 |
+--------------+---------+---------+-------+-------------+-------------------+

func (*BlobLogHeader) DecodeForm

func (header *BlobLogHeader) DecodeForm(src []byte) error

type BlobLogRecord

type BlobLogRecord struct {
	// contains filtered or unexported fields
}

func (*BlobLogRecord) DecodeHeaderFrom

func (record *BlobLogRecord) DecodeHeaderFrom(src []byte) error

func (*BlobLogRecord) GetKey added in v0.7.2

func (record *BlobLogRecord) GetKey() []byte

func (*BlobLogRecord) GetVaule added in v0.7.2

func (record *BlobLogRecord) GetVaule() []byte

type CompressionType

type CompressionType uint8
const (
	KNOCompression     CompressionType = iota
	KSnappyCompression CompressionType = 1
	KZlibCompression   CompressionType = 2
	KBZip2Compression  CompressionType = 3
	KLZ4Compression    CompressionType = 4
	KXpressCompression CompressionType = 5
)

func GetCompressionType

func GetCompressionType(compression uint8) CompressionType

type ExpirationRange

type ExpirationRange struct {
	// contains filtered or unexported fields
}

type ReadLevel

type ReadLevel int

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

func NewReader

func NewReader(path string) (*Reader, error)

func (*Reader) GetNextByte

func (r *Reader) GetNextByte() uint64

func (*Reader) ReadFooter

func (r *Reader) ReadFooter(footer *BlobLogFooter)

func (*Reader) ReadHeader

func (r *Reader) ReadHeader(header *BlobLogHeader) error

func (*Reader) ReadHeaderMock

func (r *Reader) ReadHeaderMock() error

func (*Reader) ReadRecord

func (r *Reader) ReadRecord(record *BlobLogRecord) error

func (*Reader) ReadRecords

func (r *Reader) ReadRecords() []BlobLogRecord

func (*Reader) ReadSlice

func (r *Reader) ReadSlice(size uint64) ([]byte, bool)

func (*Reader) ResetNextByte

func (r *Reader) ResetNextByte()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL