b2

package
v0.12.1 Latest Latest
Warning

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

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

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

Open opens a connection to the B2 service.

func ParseConfig

func ParseConfig(s string) (interface{}, 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.

Types

type Config

type Config struct {
	AccountID string
	Key       string
	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.

Jump to

Keyboard shortcuts

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