Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BackendCall ¶
BackendCall bridges GET/POST calls (serverless, directly calling the backend handlers).
func Serve ¶
func Serve(dataDir string, environment GoEnvironmentInterface, theGoAPI GoAPIInterface)
Serve serves the BitBox Wallet API for use in a mobile client. It is called when the application is started or wakes up from sleep.
Types ¶
type GoAPIInterface ¶
GoAPIInterface is used to pas api (GET/POST) responses and websocket push notifications to Android.
type GoDeviceInfoInterface ¶
type GoDeviceInfoInterface interface { VendorID() int ProductID() int UsagePage() int Interface() int Serial() string Product() string Identifier() string Open() (GoReadWriteCloserInterface, error) }
GoDeviceInfoInterface adapts usb.DeviceInfo's Open method to return the adapted ReadWriteCloser.
type GoEnvironmentInterface ¶
type GoEnvironmentInterface interface { NotifyUser(string) DeviceInfo() GoDeviceInfoInterface }
GoEnvironmentInterface adapts backend.Environment to return only one DeviceInfo instead of a slice of them, as a slice of interfaces does not seem to be supported by gomobile yet.
type GoReadWriteCloserInterface ¶
GoReadWriteCloserInterface adapts io.ReadWriteCloser's Read method to return the byte read byte slice instead of the .Read([]byte) pattern. This is as gomobile bind seems to make a copy of passed slices instead of writing directly to it, so the byte slice never makes it back to Go-land.