s3

package
v2.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: BSD-3-Clause Imports: 13 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

This section is empty.

Variables

This section is empty.

Functions

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 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