Help us shape the future of Go! Take the 2026 Go Developer Survey

s3

package
v2.17.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Overview

Package s3 provides reusable S3 configuration and connectivity helpers. It deals in infrastructure configuration only; mapping from API DTOs belongs to the backup destination domain.

Index

Constants

View Source
const (
	RepositoryReasonMissingBucket     = "missing_bucket"
	RepositoryReasonMissingRepository = "missing_repository"
)

Variables

This section is empty.

Functions

func CheckRepository added in v2.11.0

func CheckRepository(ctx context.Context, configuration Configuration, root, snapshotID string) (backuptypes.RepositoryObservation, error)

CheckRepository reads only the config and, when supplied, one snapshot object.

func ConnectionFieldsEqual

func ConnectionFieldsEqual(a, b Configuration) bool

ConnectionFieldsEqual reports whether two configurations address the same service the same way. A change in any of these fields means a stored secret may no longer be combined with the configuration.

func ListRepositoryRoots added in v2.12.0

func ListRepositoryRoots(ctx context.Context, configuration Configuration, root string) ([]string, error)

ListRepositoryRoots returns the first-level prefixes below root, one per Arcane instance.

func TestConnection

func TestConnection(ctx context.Context, configuration Configuration) (err error)

TestConnection verifies upload, download, and delete access for a destination.

func ValidateEndpoint

func ValidateEndpoint(endpoint string) error

ValidateEndpoint checks a custom endpoint: only HTTP or HTTPS with a host, no userinfo, query, or fragment. Private and self-hosted hosts are allowed.

Types

type Configuration

type Configuration struct {
	ID              string
	Name            string
	Endpoint        string
	Bucket          string
	Region          string
	AccessKeyID     string
	SecretAccessKey string
	Prefix          string
	UseSSL          bool
	ForcePathStyle  bool
}

Configuration contains the credentials and addressing options for an S3 destination.

func (Configuration) EndpointURL

func (c Configuration) EndpointURL() string

EndpointURL returns the normalized endpoint URL, applying UseSSL to custom endpoints.

func (Configuration) Normalized

func (c Configuration) Normalized() Configuration

Normalized returns a copy with surrounding whitespace and prefix separators removed.

func (Configuration) RusticEnvironment

func (c Configuration) RusticEnvironment(rootParts ...string) []string

RusticEnvironment builds the environment used by Rustic's OpenDAL S3 backend.

func (Configuration) Validate

func (c Configuration) Validate(requireSecret bool) error

Validate verifies the fields required to connect to the configured destination.

Jump to

Keyboard shortcuts

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