s3

package
v1.31.3-0...-b1489ee Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoConfigSecret = errNoConfigSecret()

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client holds state for a given configuration - a preconfigured minio client, and reference to the config it was created for.

func (*Client) DeleteSnapshot

func (c *Client) DeleteSnapshot(ctx context.Context, key string) error

DeleteSnapshot deletes the selected snapshot (and its metadata) from S3

func (*Client) Download

func (c *Client) Download(ctx context.Context, snapshotName, snapshotDir string) (string, error)

Download downloads the given snapshot from the configured S3 compatible backend. If the file is successfully downloaded, it returns the path the file was downloaded to.

func (*Client) ListSnapshots

func (c *Client) ListSnapshots(ctx context.Context) (map[string]snapshot.File, error)

listSnapshots provides a list of currently stored snapshots in S3 along with their relevant metadata.

func (*Client) SnapshotRetention

func (c *Client) SnapshotRetention(ctx context.Context, retention int, prefix string) ([]string, error)

SnapshotRetention prunes snapshots in the configured S3 compatible backend for this specific node. Returns a list of pruned snapshot names.

func (*Client) Upload

func (c *Client) Upload(ctx context.Context, snapshotPath string, extraMetadata *v1.ConfigMap, now time.Time) (*snapshot.File, error)

upload uploads the given snapshot to the configured S3 compatible backend.

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

Controller maintains state for S3 functionality, and can be used to get clients for interacting with an S3 service, given specific client configuration.

func Start

func Start(ctx context.Context, config *config.Control) (*Controller, error)

Start initializes the cache and sets the cluster id and token hash, returning a reference to the the initialized controller. Initialization is locked by a sync.Once to prevent races, and multiple calls to start will return the same controller or error.

func (*Controller) GetClient

func (c *Controller) GetClient(ctx context.Context, etcdS3 *config.EtcdS3) (*Client, error)

Jump to

Keyboard shortcuts

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