backends

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigTypeFile = "file"
	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 Client interface {
	Load() ([]byte, error)
	Save([]byte) error
	Backup() error
}

func New added in v0.3.0

func New(config *Config) (Client, error)

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) Save

func (db *DiskBackend) Save(data []byte) error

Jump to

Keyboard shortcuts

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