backend

package
v0.0.0-...-664f50f Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Insert(key string, value []byte, lease int64) (types.Record, error)
	Get(key string, revision int64) (types.Record, int64, error)
	Delete(key string, revision int64) (types.Record, error)
	Update(key string, val []byte, revision int64, lease int64) (types.Record, types.Record, error)
	ListAllCurrent() (int64, []types.Record, error)
	ListForPrefix(prefix string) (int64, []types.Record, error)
	ListEvents(startRevision int64) ([]types.Record, error)
	Compact(rev int64) (int64, error)
	GetCompactedRev(force bool) (int64, error)
	CurrentRevision() (int64, error)

	// leader election stuff
	NewLeaderElection(electionName string, myName string) types.LeaderElect

	// lease stuff
	ListAllCurrentWithLease(leaseId int64) (int64, []types.Record, error)
	CreateLease(lease *types.Lease) error
	DeleteLease(id int64) error
	UpdateLease(lease *types.Lease) error
	GetLease(id int64) (*types.Lease, error)
	GetLeases() ([]*types.Lease, error)
}

func NewBackend

func NewBackend(c *config.Config) (Backend, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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