mobile

package module
v0.0.0-...-3b07de9 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const Subsystem = "MOBL"

Variables

This section is empty.

Functions

func ConnectServer

func ConnectServer(nameSpace string, mailboxServer string, isDevServer bool,
	pairingPhrase string, localStatic string, remoteStatic string) error

ConnectServer creates a connection from the client to the mailbox server.

func Disconnect

func Disconnect(nameSpace string) error

Disconnect closes the RPC connection.

func GetExpiry

func GetExpiry(nameSpace string) (string, error)

GetExpiry returns the expiration time of the connection macaroon.

func HasPermissions

func HasPermissions(nameSpace, permission string) (bool, error)

HasPermissions returns whether or not the connection macaroon has a specified permission.

func InitLNC

func InitLNC(nameSpace, debugLevel string) error

InitLNC sets up everything required for LNC to run including signal interceptor, logs, and an instance of the mobile client.

func InvokeRPC

func InvokeRPC(nameSpace string, rpcName string, requestJSON string,
	c NativeCallback) error

InvokeRPC makes a synchronous RPC call.

func IsConnected

func IsConnected(nameSpace string) (bool, error)

IsConnected returns whether or not there is an active connection.

func IsReadOnly

func IsReadOnly(nameSpace string) (bool, error)

IsReadOnly returns whether or not the connection macaroon is read-only.

func NewGrpcLogLogger

func NewGrpcLogLogger(root *build.RotatingLogWriter,
	intercept signal.Interceptor, subsystem string) *mailbox.GrpcLogLogger

NewGrpcLogLogger creates a new grpclog compatible logger and attaches it as a sub logger to the passed root logger.

func RegisterAuthDataCallback

func RegisterAuthDataCallback(nameSpace string, c NativeCallback) error

RegisterAuthDataCallback sets up the native callbacks upon receiving auth data.

func RegisterLocalPrivCreateCallback

func RegisterLocalPrivCreateCallback(nameSpace string,
	c NativeCallback) error

RegisterLocalPrivCreateCallback sets up the native callbacks upon creation of local private key.

func RegisterRemoteKeyReceiveCallback

func RegisterRemoteKeyReceiveCallback(nameSpace string,
	c NativeCallback) error

RegisterRemoteKeyReceiveCallback sets up the native callbacks upon receiving the remote key from the server.

func SetupLoggers

func SetupLoggers(root *build.RotatingLogWriter, intercept signal.Interceptor)

SetupLoggers initializes all package-global logger variables.

func Status

func Status(nameSpace string) (string, error)

Status returns the status of the LNC RPC connection.

Types

type NativeCallback

type NativeCallback interface {
	SendResult(json string)
}

Jump to

Keyboard shortcuts

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