Documentation ¶
Overview ¶
Package snapshot implements utilities around etcd snapshot.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager interface { // Save fetches snapshot from remote etcd server and saves data to target path. // If the context "ctx" is canceled or timed out, snapshot save stream will error out // (e.g. context.Canceled, context.DeadlineExceeded). Save(ctx context.Context, dbPath string) error // Status returns the snapshot file information. Status(dbPath string) (Status, error) // Restore restores a new etcd data directory from given snapshot file. // It returns an error if specified data directory already exists, to // prevent unintended data directory overwrites. Restore(dbPath string, cfg RestoreConfig) error }
Manager defines snapshot methods.
type RestoreConfig ¶
type RestoreConfig struct { // Name is the human-readable name of this member. Name string // OutputDataDir is the target data directory to save restored data. // OutputDataDir should not conflict with existing etcd data directory. // If OutputDataDir already exists, it will return an error to prevent // unintended data directory overwrites. // Defaults to "[Name].etcd" if not given. OutputDataDir string // OutputWALDir is the target WAL data directory. // Defaults to "[OutputDataDir]/member/wal" if not given. OutputWALDir string // InitialCluster is the initial cluster configuration for restore bootstrap. InitialCluster types.URLsMap // InitialClusterToken is the initial cluster token for etcd cluster during restore bootstrap. InitialClusterToken string // PeerURLs is a list of member's peer URLs to advertise to the rest of the cluster. PeerURLs types.URLs // SkipHashCheck is "true" to ignore snapshot integrity hash value // (required if copied from data directory). SkipHashCheck bool }
RestoreConfig configures snapshot restore operation.
Click to show internal directories.
Click to hide internal directories.