source

package
v0.1.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package source finds and downloads backups from S3-compatible storage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client reads backups from one source.

func New

func New(cfg Config) *Client

New returns a client. Problems with the configuration are reported by Latest, so they end up in the job's result.

func (*Client) Download

func (c *Client) Download(ctx context.Context, object job.Object, target string) error

Download writes the object to path. Interrupted transfers are retried from the start.

func (*Client) Latest

func (c *Client) Latest(ctx context.Context) (job.Object, error)

Latest returns the pinned backup, or the newest object that matches the source's pattern.

type Config

type Config struct {
	ID       string
	Endpoint string
	Region   string
	Bucket   string
	Prefix   string
	// Pattern is a glob matched against the file name, such as "*.dump.gz". Empty matches every file.
	Pattern string
	// ObjectKey tests this exact backup instead of the newest one.
	ObjectKey string
	AccessKey config.Secret
	SecretKey config.Secret
}

Config describes where a source keeps its backups.

Jump to

Keyboard shortcuts

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