b2

package
v0.16.4 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: BSD-2-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

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

Create opens a connection to the B2 service. If the bucket does not exist yet, it is created.

func NewFactory added in v0.16.0

func NewFactory() location.Factory

func Open

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

Open opens a connection to the B2 service.

Types

type Config

type Config struct {
	AccountID string
	Key       options.SecretString
	Bucket    string
	Prefix    string

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

Config contains all configuration necessary to connect to an b2 compatible server.

func NewConfig

func NewConfig() Config

NewConfig returns a new config with default options applied.

func ParseConfig

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

ParseConfig parses the string s and extracts the b2 config. The supported configuration format is b2:bucketname/prefix. If no prefix is given the prefix "restic" will be used.

func (*Config) ApplyEnvironment added in v0.16.0

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