backend

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2017 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterBackend

func RegisterBackend(name string, backend Factory)

RegisterBackend registers a backend.

Types

type Factory

type Factory func() (Interface, error)

Factory is a function that returns a backend.Interface.

type Interface

type Interface interface {
	// LoadAccount loads the account from the backend store.
	LoadAccount(domain string) (*types.Account, error)
	// Name returns the display name of the backend.
	Name() string
	// SaveAccount saves the account to the backend store.
	SaveAccount(*types.Account) error
}

Interface represents a backend.

func GetBackend

func GetBackend(name string) (Interface, error)

GetBackend creates an instance of the named backend, or nil if the name is not known. The error return is only used if the named provider was known but failed to initialize.

func InitBackend

func InitBackend(name string) (Interface, error)

InitBackend creates an instance of the named backend.

Directories

Path Synopsis
fs
s3

Jump to

Keyboard shortcuts

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