handlers

package
v4.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2018 License: Apache-2.0 Imports: 26 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Config() *config.Config
	DefaultConfig() config.AppConfig
	Coin(string) *btc.Coin
	WalletStatus() string
	Testing() bool
	Accounts() []*btc.Account
	UserLanguage() language.Tag
	OnWalletInit(f func(*btc.Account))
	OnWalletUninit(f func(*btc.Account))
	OnDeviceInit(f func(device.Interface))
	OnDeviceUninit(f func(deviceID string))
	DevicesRegistered() []string
	Start() <-chan interface{}
	Keystores() keystore.Keystores
	RegisterKeystore(keystore.Keystore)
	DeregisterKeystore()
	Register(device device.Interface) error
	Deregister(deviceID string)
	Rates() map[string]map[string]float64
	DownloadCert(string) (string, error)
	CheckElectrumServer(string, string) error
}

Backend models the API of the backend.

type ConnectionData

type ConnectionData struct {
	// contains filtered or unexported fields
}

ConnectionData contains the port and authorization token for communication with the backend.

func NewConnectionData

func NewConnectionData(port int, token string) *ConnectionData

NewConnectionData creates a connection data struct which holds the port and token for the API. If the port is -1 or the token is empty, we assume dev-mode.

type Handlers

type Handlers struct {
	Router *mux.Router
	// contains filtered or unexported fields
}

Handlers provides a web api to the backend.

func NewHandlers

func NewHandlers(
	backend Backend,
	connData *ConnectionData,
) *Handlers

NewHandlers creates a new Handlers instance.

Jump to

Keyboard shortcuts

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