Documentation ¶
Index ¶
Constants ¶
View Source
const ( // FileVersion is the version of the backup file we produce. FileVersion = "1" // DefaultMinRestoreTTL is the minimum TTL to restore to the etcd cluster // https://github.com/coreos/etcd/blob/6dcd020d7da9730caf261a46378dce363c296519/lease/lessor.go#L34 DefaultMinRestoreTTL = 5 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func OfflineRestore ¶
func OfflineRestore(ctx context.Context, conf RestoreConfig, dir string) error
OfflineRestore restores the etcdv3 database to an offline etcd nodes snapshot DB.
Types ¶
type BackupConfig ¶
type BackupConfig struct { EtcdConfig etcdconf.Config Prefix []string Writer io.Writer Log log.FieldLogger }
BackupConfig are the settings to use for running a backup of the etcd database
func (*BackupConfig) CheckAndSetDefaults ¶
func (b *BackupConfig) CheckAndSetDefaults() error
type KeyValue ¶
type KeyValue struct { // key is the key in bytes. An empty key is not allowed. Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // create_revision is the revision of last creation on this key. CreateRevision int64 `protobuf:"varint,2,opt,name=create_revision,json=createRevision,proto3" json:"create_revision,omitempty"` // mod_revision is the revision of last modification on this key. ModRevision int64 `protobuf:"varint,3,opt,name=mod_revision,json=modRevision,proto3" json:"mod_revision,omitempty"` // version is the version of the key. A deletion resets // the version to zero and any modification of the key // increases its version. Version int64 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"` // value is the value held by the key, in bytes. Value []byte `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"` // lease is the ID of the lease that attached to key. // When the attached lease expires, the key will be deleted. // If lease is 0, then no lease is attached to the key. Lease int64 `protobuf:"varint,6,opt,name=lease,proto3" json:"lease,omitempty"` // TTL (not from etcd datastructure) // This is the TTL of the key, which we look up during the backup, because etcd3 stores these separatly from the key TTL int64 `json:"ttl,omitempty"` }
KeyValue is a clone of the internal KeyValue from etcd which isn't exported
type RestoreConfig ¶
type RestoreConfig struct { EtcdConfig etcdconf.Config Prefix []string MigratePrefix []string File string MinRestoreTTL time.Duration Log log.FieldLogger SkipV3 bool }
BackupConfig are the settings to use for running a backup of the etcd database
func (*RestoreConfig) CheckAndSetDefaults ¶
func (b *RestoreConfig) CheckAndSetDefaults() error
Click to show internal directories.
Click to hide internal directories.