Versions in this module Expand all Collapse all v0 v0.0.1 Oct 25, 2018 Changes in this version + var BufferBucketKey = []byte("c") + var BufferKey = []byte("d") + var CellarBucketKey = []byte("e") + var CellarKey = []byte("f") + var CheckPointBucketKey = []byte("a") + var ChunkTableKey = []byte("b") + var ErrBucketNotExists = errors.New("boltdb: bucket not present") + var ErrIsFile = errors.New("provided folder is actually a path") + func WithNoFileLock(db *DB) error + func WithReadOnly(db *DB) error + type AES struct + func NewAES(key []byte) AES + func (a AES) Decrypt(src io.Reader) (io.Reader, error) + func (a AES) Encrypt(w io.Writer) (*cipher.StreamWriter, error) + type BoltMetaDB struct + func (b *BoltMetaDB) AddChunk(pos int64, dto *pb.ChunkDto) error + func (b *BoltMetaDB) CellarMeta() (dto *pb.MetaDto, err error) + func (b *BoltMetaDB) GetBuffer() (buf *pb.BufferDto, err error) + func (b *BoltMetaDB) GetCheckpoint(name string) (pos int64, err error) + func (b *BoltMetaDB) Init() error + func (b *BoltMetaDB) ListChunks() (dto []*pb.ChunkDto, err error) + func (b *BoltMetaDB) PutBuffer(dto *pb.BufferDto) (err error) + func (b *BoltMetaDB) PutCheckpoint(name string, pos int64) error + func (b *BoltMetaDB) SetCellarMeta(dto *pb.MetaDto) (err error) + type Buffer struct + type ChainCompressor struct + CompressionLevel int + func (c ChainCompressor) Compress(w io.Writer) (CompressionWriter, error) + type ChainDecompressor struct + func (c ChainDecompressor) Decompress(r io.Reader) (io.Reader, error) + type Cipher interface + Decrypt func(src io.Reader) (io.Reader, error) + Encrypt func(w io.Writer) (*cipher.StreamWriter, error) + type CompressionWriter interface + Close func() error + type Compressor interface + Compress func(io.Writer) (CompressionWriter, error) + type DB struct + func New(folder string, options ...Option) (*DB, error) + func (db *DB) Append(data []byte) (pos int64, err error) + func (db *DB) Buffer() int64 + func (db *DB) Checkpoint() (pos int64, err error) + func (db *DB) Close() (err error) + func (db *DB) Flush() (err error) + func (db *DB) Folder() string + func (db *DB) GetUserCheckpoint(name string) (pos int64, err error) + func (db *DB) PutUserCheckpoint(name string, pos int64) (err error) + func (db *DB) Reader() *Reader + func (db *DB) VolatilePos() int64 + type Decompressor interface + Decompress func(io.Reader) (io.Reader, error) + type FileLock interface + Lock func() error + TryLock func() (bool, error) + Unlock func() error + type MetaDB interface + AddChunk func(int64, *pb.ChunkDto) error + CellarMeta func() (*pb.MetaDto, error) + Close func() error + GetBuffer func() (*pb.BufferDto, error) + GetCheckpoint func(name string) (int64, error) + Init func() error + ListChunks func() ([]*pb.ChunkDto, error) + PutBuffer func(*pb.BufferDto) error + PutCheckpoint func(name string, pos int64) error + SetCellarMeta func(*pb.MetaDto) error + type MockLock struct + func (m MockLock) Lock() error + func (m MockLock) TryLock() (bool, error) + func (m MockLock) Unlock() error + type Option func(db *DB) error + func WithCipher(cipher Cipher) Option + func WithLogger(logger *zap.Logger) Option + func WithMetaDB(mdb MetaDB) Option + type ReadFlag int + const RF_LoadBuffer + const RF_None + const RF_PrintChunks + type ReadOp func(pos *ReaderInfo, data []byte) error + type Reader struct + EndPos int64 + Flags ReadFlag + Folder string + LimitChunks int + StartPos int64 + func NewReader(folder string, cipher Cipher, decompressor Decompressor, meta MetaDB, ...) *Reader + func (r *Reader) Scan(op ReadOp) error + func (reader *Reader) ScanAsync(ctx context.Context, buffer int) (chan Rec, chan error) + type ReaderInfo struct + ChunkPos int64 + NextPos int64 + StartPos int64 + type Rec struct + ChunkPos int64 + Data []byte + NextPos int64 + StartPos int64 + type Writer struct + func NewWriter(folder string, maxBufferSize int64, cipher Cipher, compressor Compressor, ...) (*Writer, error) + func (w *Writer) Append(data []byte) (pos int64, err error) + func (w *Writer) Checkpoint() (int64, error) + func (w *Writer) Close() error + func (w *Writer) Flush() error + func (w *Writer) GetUserCheckpoint(name string) (int64, error) + func (w *Writer) PutUserCheckpoint(name string, pos int64) error + func (w *Writer) VolatilePos() int64