handlers

package
v0.0.0-...-e5c7075 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package handlers implements an api for the bitbox-wallet-app to talk to. It also takes care of running the noise encryption.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Identifier      []byte
	QueueIfNoClient bool
}

Event represents a Event the middleware passes to the handlers to be send to a client.

type Handlers

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

Handlers provides a web api

func NewHandlers

func NewHandlers(middlewareInstance Middleware, dataDir string) *Handlers

NewHandlers returns a handler instance.

type Middleware

type Middleware interface {
	// Start triggers the main middleware event loop that emits events to be caught by the handlers.
	Start() <-chan Event

	/* --- RPCs --- */
	BackupHSMSecret() rpcmessages.ErrorResponse
	BackupSysconfig() rpcmessages.ErrorResponse
	EnableClearnetIBD(rpcmessages.ToggleSettingArgs) rpcmessages.ErrorResponse
	EnableRootLogin(rpcmessages.ToggleSettingArgs) rpcmessages.ErrorResponse
	EnableSSHPasswordLogin(rpcmessages.ToggleSettingArgs) rpcmessages.ErrorResponse
	EnableTor(rpcmessages.ToggleSettingArgs) rpcmessages.ErrorResponse
	EnableTorElectrs(rpcmessages.ToggleSettingArgs) rpcmessages.ErrorResponse
	EnableTorMiddleware(rpcmessages.ToggleSettingArgs) rpcmessages.ErrorResponse
	EnableTorSSH(rpcmessages.ToggleSettingArgs) rpcmessages.ErrorResponse
	FinalizeSetupWizard() rpcmessages.ErrorResponse
	GetBaseInfo() rpcmessages.GetBaseInfoResponse
	GetBaseUpdateProgress() rpcmessages.GetBaseUpdateProgressResponse
	GetServiceInfo() rpcmessages.GetServiceInfoResponse
	GetServiceStatus() rpcmessages.GetServiceStatusResponse
	IsBaseUpdateAvailable() rpcmessages.IsBaseUpdateAvailableResponse
	RebootBase() rpcmessages.ErrorResponse
	ReindexBitcoin() rpcmessages.ErrorResponse
	RestoreHSMSecret() rpcmessages.ErrorResponse
	RestoreSysconfig() rpcmessages.ErrorResponse
	ResyncBitcoin() rpcmessages.ErrorResponse
	SetHostname(rpcmessages.SetHostnameArgs) rpcmessages.ErrorResponse
	SetLoginPassword(rpcmessages.SetLoginPasswordArgs) rpcmessages.ErrorResponse
	SetupStatus() rpcmessages.SetupStatusResponse
	ShutdownBase() rpcmessages.ErrorResponse
	SystemEnv() rpcmessages.GetEnvResponse
	UpdateBase(rpcmessages.UpdateBaseArgs) rpcmessages.ErrorResponse
	UserAuthenticate(rpcmessages.UserAuthenticateArgs) rpcmessages.UserAuthenticateResponse
	UserChangePassword(rpcmessages.UserChangePasswordArgs) rpcmessages.ErrorResponse

	GetMiddlewareVersion() string
	ValidateToken(token string) error
	VerifyAppMiddlewarePairing(channelHash []byte) (bool, error)
}

Middleware provides an interface to the middleware package.

Jump to

Keyboard shortcuts

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