snapshot

package
v3.0.0-...-eac99ac Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Overview

Package snapshot implements utilities around etcd snapshot.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Save

func Save(ctx context.Context, lg *zap.Logger, cfg clientv3.Config, dbPath string) error

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). Make sure to specify only one endpoint in client configuration. Snapshot API must be requested to a selected node, and saved snapshot is the point-in-time state of the selected node. Deprecated: Use SaveWithVersion instead.

func SaveWithVersion

func SaveWithVersion(ctx context.Context, lg *zap.Logger, cfg clientv3.Config, dbPath string) (version string, err error)

SaveWithVersion fetches snapshot from remote etcd server, saves data to target path and returns server version. If the context "ctx" is canceled or timed out, snapshot save stream will error out (e.g. context.Canceled, context.DeadlineExceeded). Make sure to specify only one endpoint in client configuration. Snapshot API must be requested to a selected node, and saved snapshot is the point-in-time state of the selected node. Etcd <v3.6 will return "" as version.

Types

This section is empty.

Jump to

Keyboard shortcuts

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