bitcask

package module
v0.0.0-...-c225408 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: MPL-2.0 Imports: 19 Imported by: 0

README

go-bitcask

Bytes go in, bytes come out. You can't explain that.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound         = errors.New("bitcask: not found")
	ErrChecksumMismatch = errors.New("bitcask: checksum mismatch")
)

Functions

This section is empty.

Types

type DB

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

func Open

func Open(baseDir string) (*DB, error)

Open creates a new database at the given path and returns a handle to it along with any errors.

func (*DB) Close

func (d *DB) Close() error

func (*DB) Delete

func (d *DB) Delete(key string) error

func (*DB) Get

func (d *DB) Get(key string) ([]byte, error)

func (*DB) List

func (d *DB) List() []string

func (*DB) Path

func (d *DB) Path() string

func (*DB) Put

func (d *DB) Put(key string, val []byte) error

func (*DB) Size

func (d *DB) Size() (int64, error)

type Entry

type Entry struct {
	Crc       uint64     `protobuf:"varint,1,opt,name=crc,proto3" json:"crc,omitempty"`
	EntryData *EntryData `protobuf:"bytes,2,opt,name=entry_data,json=entryData,proto3" json:"entry_data,omitempty"`
	// contains filtered or unexported fields
}

func (*Entry) Descriptor deprecated

func (*Entry) Descriptor() ([]byte, []int)

Deprecated: Use Entry.ProtoReflect.Descriptor instead.

func (*Entry) GetCrc

func (x *Entry) GetCrc() uint64

func (*Entry) GetEntryData

func (x *Entry) GetEntryData() *EntryData

func (*Entry) ProtoMessage

func (*Entry) ProtoMessage()

func (*Entry) ProtoReflect

func (x *Entry) ProtoReflect() protoreflect.Message

func (*Entry) Reset

func (x *Entry) Reset()

func (*Entry) String

func (x *Entry) String() string

type EntryData

type EntryData struct {
	Timestamp int64  `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Key       string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	Value     []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
	Tombstone bool   `protobuf:"varint,4,opt,name=tombstone,proto3" json:"tombstone,omitempty"`
	// contains filtered or unexported fields
}

func (*EntryData) Descriptor deprecated

func (*EntryData) Descriptor() ([]byte, []int)

Deprecated: Use EntryData.ProtoReflect.Descriptor instead.

func (*EntryData) GetKey

func (x *EntryData) GetKey() string

func (*EntryData) GetTimestamp

func (x *EntryData) GetTimestamp() int64

func (*EntryData) GetTombstone

func (x *EntryData) GetTombstone() bool

func (*EntryData) GetValue

func (x *EntryData) GetValue() []byte

func (*EntryData) ProtoMessage

func (*EntryData) ProtoMessage()

func (*EntryData) ProtoReflect

func (x *EntryData) ProtoReflect() protoreflect.Message

func (*EntryData) Reset

func (x *EntryData) Reset()

func (*EntryData) String

func (x *EntryData) String() string

type KeyDir

type KeyDir struct {
	Timestamp int64  `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	FileId    string `protobuf:"bytes,2,opt,name=file_id,json=fileId,proto3" json:"file_id,omitempty"`
	Offset    int64  `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"`
	// contains filtered or unexported fields
}

func (*KeyDir) Descriptor deprecated

func (*KeyDir) Descriptor() ([]byte, []int)

Deprecated: Use KeyDir.ProtoReflect.Descriptor instead.

func (*KeyDir) GetFileId

func (x *KeyDir) GetFileId() string

func (*KeyDir) GetOffset

func (x *KeyDir) GetOffset() int64

func (*KeyDir) GetTimestamp

func (x *KeyDir) GetTimestamp() int64

func (*KeyDir) ProtoMessage

func (*KeyDir) ProtoMessage()

func (*KeyDir) ProtoReflect

func (x *KeyDir) ProtoReflect() protoreflect.Message

func (*KeyDir) Reset

func (x *KeyDir) Reset()

func (*KeyDir) String

func (x *KeyDir) String() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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