package backend
import "github.com/coreos/etcd/storage/backend"
Package backend defines a standard interface for etcd's backend storage.
Index ¶
- Variables
- func NewDefaultTmpBackend() (*backend, string)
- func NewTmpBackend(batchInterval time.Duration, batchLimit int) (*backend, string)
- type Backend
- func New(path string, d time.Duration, limit int) Backend
- func NewDefaultBackend(path string) Backend
- type BatchTx
- type Snapshot
Variables ¶
var ( // InitialMmapSize is the initial size of the mmapped region. Setting this larger than // the potential max db size can prevent writer from blocking reader. // This only works for linux. InitialMmapSize = int64(10 * 1024 * 1024 * 1024) )
Functions ¶
func NewDefaultTmpBackend ¶
func NewDefaultTmpBackend() (*backend, string)
func NewTmpBackend ¶
NewTmpBackend creates a backend implementation for testing.
Types ¶
type Backend ¶
type Backend interface {
BatchTx() BatchTx
Snapshot() Snapshot
Hash() (uint32, error)
// Size returns the current size of the backend.
Size() int64
Defrag() error
ForceCommit()
Close() error
}
func New ¶
func NewDefaultBackend ¶
type BatchTx ¶
type BatchTx interface {
Lock()
Unlock()
UnsafeCreateBucket(name []byte)
UnsafePut(bucketName []byte, key []byte, value []byte)
UnsafeSeqPut(bucketName []byte, key []byte, value []byte)
UnsafeRange(bucketName []byte, key, endKey []byte, limit int64) (keys [][]byte, vals [][]byte)
UnsafeDelete(bucketName []byte, key []byte)
Commit()
CommitAndStop()
}
type Snapshot ¶
type Snapshot interface {
// Size gets the size of the snapshot.
Size() int64
// WriteTo writes the snapshot into the given writer.
WriteTo(w io.Writer) (n int64, err error)
// Close closes the snapshot.
Close() error
}
Source Files ¶
backend.go batch_tx.go boltoption_unix.go doc.go
- Version
- v2.3.8+incompatible (latest)
- Published
- Feb 16, 2017
- Platform
- linux/amd64
- Imports
- 13 packages
- Last checked
- 1 week ago –
Tools for package owners.