Documentation
¶
Overview ¶
Package backend defines a standard interface for etcd's backend MVCC storage.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDefaultTmpBackend ¶
func NewDefaultTmpBackend() (*backend, string)
Types ¶
type Backend ¶
type Backend interface { ReadTx() ReadTx BatchTx() BatchTx Snapshot() Snapshot Hash(ignores map[IgnoreKey]struct{}) (uint32, error) // Size returns the current size of the backend. Size() int64 Defrag() error ForceCommit() Close() error }
func New ¶
func New(bcfg BackendConfig) Backend
func NewDefaultBackend ¶
type BackendConfig ¶ added in v3.2.0
type BackendConfig struct { // Path is the file path to the backend file. Path string // BatchInterval is the maximum time before flushing the BatchTx. BatchInterval time.Duration // BatchLimit is the maximum puts before flushing the BatchTx. BatchLimit int // MmapSize is the number of bytes to mmap for the backend. MmapSize uint64 }
func DefaultBackendConfig ¶ added in v3.2.0
func DefaultBackendConfig() BackendConfig
type BatchTx ¶
type BatchTx interface { ReadTx UnsafeCreateBucket(name []byte) UnsafePut(bucketName []byte, key []byte, value []byte) UnsafeSeqPut(bucketName []byte, key []byte, value []byte) UnsafeDelete(bucketName []byte, key []byte) // Commit commits a previous tx and begins a new writable one. Commit() // CommitAndStop commits the previous tx and does not create a new one. CommitAndStop() }
Click to show internal directories.
Click to hide internal directories.