swift

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: BSD-2-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyEnvironment

func ApplyEnvironment(prefix string, cfg interface{}) error

ApplyEnvironment saves values from the environment to the config.

func Open

func Open(ctx context.Context, cfg Config, rt http.RoundTripper) (restic.Backend, error)

Open opens the swift backend at a container in region. The container is created if it does not exist yet.

func ParseConfig

func ParseConfig(s string) (interface{}, error)

ParseConfig parses the string s and extract swift's container name and prefix.

Types

type Config

type Config struct {
	UserName       string
	UserID         string
	Domain         string
	DomainID       string
	APIKey         string
	AuthURL        string
	Region         string
	Tenant         string
	TenantID       string
	TenantDomain   string
	TenantDomainID string
	TrustID        string

	StorageURL string
	AuthToken  options.SecretString

	// auth v3 only
	ApplicationCredentialID     string
	ApplicationCredentialName   string
	ApplicationCredentialSecret options.SecretString

	Container              string
	Prefix                 string
	DefaultContainerPolicy string

	Connections uint `option:"connections" help:"set a limit for the number of concurrent connections (default: 5)"`
}

Config contains basic configuration needed to specify swift location for a swift server

func NewConfig

func NewConfig() Config

NewConfig returns a new config with the default values filled in.

Jump to

Keyboard shortcuts

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