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: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bitbox

type Bitbox interface {
	device.Interface
	Status() bitbox.Status
	BootloaderStatus() (*bitbox.BootloaderStatus, error)
	DeviceInfo() (*bitbox.DeviceInfo, error)
	SetPassword(string) error
	ChangePassword(string, string) error
	SetHiddenPassword(string, string) (bool, error)
	CreateWallet(string, string) error
	Login(string) (bool, string, error)
	Blink() error
	Random(string) (string, error)
	Reset(string) (bool, error)
	XPub(path string) (*hdkeychain.ExtendedKey, error)
	Sign(tx *maketx.TxProposal, hashes [][]byte, keyPaths []string) ([]btcec.Signature, error)
	UnlockBootloader() (bool, error)
	LockBootloader() error
	EraseBackup(string) error
	RestoreBackup(string, string) (bool, error)
	CreateBackup(string, string) error
	BackupList() ([]map[string]string, error)
	BootloaderUpgradeFirmware([]byte) error
	DisplayAddress(keyPath string, typ string) error
	ECDHPKhash(string) (interface{}, error)
	ECDHPK(string) (interface{}, error)
	ECDHchallenge() error
	StartPairing() (*relay.Channel, error)
	Paired() bool
	Lock() (bool, error)
	CheckBackup(string, string) (bool, error)
}

Bitbox models the API of a Bitbox.

type Handlers

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

Handlers provides a web API to the Bitbox.

func NewHandlers

func NewHandlers(
	handleFunc func(string, func(*http.Request) (interface{}, error)) *mux.Route,
	log *logrus.Entry,
) *Handlers

NewHandlers creates a new Handlers instance.

func (*Handlers) Init

func (handlers *Handlers) Init(bitbox Bitbox)

Init installs a dbbdevice as a base for the web api. This needs to be called before any requests are made.

func (*Handlers) Uninit

func (handlers *Handlers) Uninit()

Uninit removes the bitbox. After this, not requests should be made.

Jump to

Keyboard shortcuts

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