handlers

package
v4.14.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base interface {
	MiddlewareInfo() (rpcmessages.SampleInfoResponse, error)
	VerificationProgress() (rpcmessages.VerificationProgressResponse, error)
	ConnectElectrum() error
	Status() bitboxbasestatus.Status
	ChannelHash() (string, bool)
	Deregister() error
	ReindexBitcoin() error
	ResyncBitcoin() error
	SetHostname(string) error
	UserAuthenticate(string, string) error
	UserChangePassword(string, string, string) error
	BackupSysconfig() error
	BackupHSMSecret() error
	RestoreSysconfig() error
	RestoreHSMSecret() error
	EnableTor(rpcmessages.ToggleSettingArgs) error
	EnableTorMiddleware(rpcmessages.ToggleSettingArgs) error
	EnableTorElectrs(rpcmessages.ToggleSettingArgs) error
	EnableTorSSH(rpcmessages.ToggleSettingArgs) error
	EnableClearnetIBD(rpcmessages.ToggleSettingArgs) error
	EnableRootLogin(rpcmessages.ToggleSettingArgs) error
	SetRootPassword(string) error
	ShutdownBase() error
	RebootBase() error
	BaseInfo() (rpcmessages.GetBaseInfoResponse, error)
	ServiceInfo() (rpcmessages.GetServiceInfoResponse, error)
}

Base models the api of the base middleware

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(base Base)

Init installs a bitboxbase 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 bitboxbase. After this, no requests should be made.

Jump to

Keyboard shortcuts

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