swift

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: BSD-2-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() location.Factory

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.

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.

func ParseConfig

func ParseConfig(s string) (*Config, error)

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

func (*Config) ApplyEnvironment

func (cfg *Config) ApplyEnvironment(prefix string)

ApplyEnvironment saves values from the environment to the config.

Jump to

Keyboard shortcuts

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