handlers

package
v4.6.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2019 License: Apache-2.0 Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitBox02

type BitBox02 interface {
	Status() bitbox02.Status
	Random() ([]byte, error)
	ChannelHash() (string, bool)
	ChannelHashVerify(ok bool)
	DeviceInfo() (*bitbox02.DeviceInfo, error)
	SetDeviceName(deviceName string) error
	SetPassword() error
	CreateBackup() error
	InsertRemoveSDCard(action messages.InsertRemoveSDCardRequest_SDCardAction) error
}

BitBox02 models the API of the bitbox02 package.

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(device BitBox02)

Init installs a bitbox02 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