bdb

package
v0.0.0-...-e36a8a6 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BucketState   = []byte("state")
	BucketMeta    = []byte("meta")
	BucketRefs    = []byte("refs")
	BucketMembers = []byte("members")
)
View Source
var (
	ErrReferenceNotFound = errors.New("reference not found")
	ErrMemberIDNotFound  = errors.New("member id not found")
	ErrLocalIDIsZero     = errors.New("local_id cannot be 0")
)

Functions

func CopyFile

func CopyFile(src, dst string) error

func WithLogger

func WithLogger(logger logging.Logger) func(*restorer)

Types

type LdbWALStorage

type LdbWALStorage = *ldbWALStorage

func OpenWAL

func OpenWAL(path string, opts *WALOptions) (LdbWALStorage, error)

type Option

type Option func(*restorer)

type Options

type Options struct {
	Listener refs.Listener

	Logger logging.Logger

	*WALOptions

	NewLocalID func() (refs.PeerID, error)
}

func NewOptions

func NewOptions() *Options

type RestoreConfig

type RestoreConfig struct {
	DataDir       string
	OutputDataDir string

	LocalID refs.PeerID
	Members []refs.Member
}

func (RestoreConfig) Validate

func (c RestoreConfig) Validate() error

type Restorer

type Restorer interface {
	Restore(cfg RestoreConfig) error
	Status(dbPath string) (*Status, error)
}

func NewRestorer

func NewRestorer(opts ...Option) Restorer

type Status

type Status = ragit.InitialState

type Storage

type Storage = *storage

func Open

func Open(path string,
	opts *Options,
	storageOpts ...StorageOptions,
) (Storage, error)

type StorageOptions

type StorageOptions func(*storage)

func WithSubscriberCap

func WithSubscriberCap(cap int) StorageOptions

func WithWaitApplyCap

func WithWaitApplyCap(cap int) StorageOptions

type SubManager

type SubManager interface {
	// contains filtered or unexported methods
}

type SubMgrOption

type SubMgrOption func(*subMgr)

func WithSubMgrCap

func WithSubMgrCap(cap int) SubMgrOption

func WithSubMgrLogger

func WithSubMgrLogger(logger logging.Logger) SubMgrOption

type WALOptions

type WALOptions struct {
	KeepLogCount int
	DBOptions    *opt.Options
	Logger       logging.Logger
}

func NewWALOptions

func NewWALOptions() *WALOptions

type WALStorage

type WALStorage interface {
	Describe(w io.Writer)
	SetSnapshotIndex(index uint64)
	SaveWAL(ents []pb.Entry) error
	Close()

	Entries(lo, hi, maxSize uint64) ([]pb.Entry, error)
	Term(i uint64) (uint64, error)
	LastIndex() (uint64, error)
	FirstIndex() (uint64, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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