b2

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 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) (backend.Backend, error)

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

func NewFactory

func NewFactory() location.Factory

func Open

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

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