Documentation
¶
Index ¶
Constants ¶
View Source
const ( ConfigTypeFile = "file" ConfigTypeS3 = "s3" ConfigTypeMock = "mock" )
Variables ¶
This section is empty.
Functions ¶
func NewMockBackend ¶ added in v0.3.0
func NewMockBackend() *mockBackend
Types ¶
type Client ¶ added in v0.3.0
type Config ¶ added in v0.3.0
type Config struct {
Type string `toml:"type"`
Backup backupConfig `toml:"backup"`
Settings map[string]interface{} `toml:"settings"`
}
func NewDefaultConfig ¶ added in v0.3.0
func NewDefaultConfig() Config
type DiskBackend ¶
type DiskBackend struct {
// contains filtered or unexported fields
}
func NewDiskBackend ¶
func NewDiskBackend(config Config) (*DiskBackend, error)
func (*DiskBackend) Backup ¶ added in v0.3.0
func (db *DiskBackend) Backup() error
func (*DiskBackend) Load ¶
func (db *DiskBackend) Load() ([]byte, error)
func (*DiskBackend) SafeLocation ¶ added in v0.4.0
func (db *DiskBackend) SafeLocation() string
func (*DiskBackend) Save ¶
func (db *DiskBackend) Save(data []byte) error
type S3Backend ¶ added in v0.5.0
S3Backend provides AWS S3 backed safe storage
This implementation relies on AWS Credentials in `~/.aws/credentials` for authentication. If AWS_PROFILE is not set, "default" will be used.
The following environment variables are required:
AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_REGION
func NewS3Backend ¶ added in v0.5.0
NewS3Backend returns a new S3 Backend implementation.
The following config settings are supported:
region: AWS Region to use profile: AWS Profile in ~/.aws/credentials to use bucket: AWS S3 Bucket name for storing the safe. Defaults to `defaultS3Bucket` key: AWS S3 Key name for storing the safe. Defaults to `defaultS3Key`
func (*S3Backend) SafeLocation ¶ added in v0.5.0
SafeLocation return the path to the current safe
Click to show internal directories.
Click to hide internal directories.