b2

package
v0.0.0-...-2776ad3 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2019 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRoleNotFound = errors.New("role not found")
)

Functions

func Backend

func Backend() *backend

Backend returns a configured B2 backend

func Factory

Factory returns a configured instance of the B2 backend

Types

type Config

type Config struct {
	AccountId  string `json:"account_id"`
	KeyId      string `json:"key_id"`
	Key        string `json:"key"`
	KeyName    string `json:"key_name"`
	Configured bool   `json:"is_configured"`
}

func DefaultConfig

func DefaultConfig() *Config

func (*Config) Update

func (c *Config) Update(d *framework.FieldData) (bool, error)

type Role

type Role struct {

	// Capabilities is a list of strings which reflects
	// the capabilities this key will have in B2
	Capabilities []string `json:"capabilities"`

	KeyNamePrefix string `json:"key_name_prefix"`

	// BucketName is an optional restriction to limit this key to
	// a particular bucket
	BucketName string `json:"bucket_id"`

	// NamePrefix is an optional restriction to limit which object
	// name prefixes this key can operate on
	NamePrefix string `json:"name_prefix"`

	// DefaultTTL is the TTL which will be applied to keys if no
	// TTL is requested
	DefaultTTL time.Duration `json:"default_ttl"`

	// MaxTTL is the maximum any TTL can be for this role
	MaxTTL time.Duration `json:"max_ttl"`
}

A role stored in the storage backend

Jump to

Keyboard shortcuts

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