bertybridge

package
v2.146.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: Apache-2.0, MIT Imports: 55 Imported by: 0

Documentation

Overview

Package bertybridge is the main gomobile entrypoint, used to generate iOS and Android frameworks.

Index

Constants

View Source
const (
	AppStateUnknow int = iota
	AppStateActive
	AppStateInactive
	AppStateBackground
)
View Source
const ClientBufferSize = 256 * 1024

Variables

View Source
var (
	APIConfig = config.BertyMobile.APIConfig
)

Functions

This section is empty.

Types

type Bridge

type Bridge struct {
	// contains filtered or unexported fields
}

func (*Bridge) Close

func (b *Bridge) Close() (err error)

Close Bridge

func (*Bridge) GRPCListenerAddr

func (b *Bridge) GRPCListenerAddr() string

func (*Bridge) GRPCWebListenerAddr

func (b *Bridge) GRPCWebListenerAddr() string

func (*Bridge) GRPCWebSocketListenerAddr

func (b *Bridge) GRPCWebSocketListenerAddr() string

func (*Bridge) GetGRPCAddrFor

func (b *Bridge) GetGRPCAddrFor(protos string) string

GetGRPCAddrFor the given protocols, if not found return an empty string

func (*Bridge) InvokeBridgeMethod added in v2.121.0

func (b *Bridge) InvokeBridgeMethod(method string, b64message string) (string, error)

func (*Bridge) InvokeBridgeMethodWithPromiseBlock added in v2.121.0

func (b *Bridge) InvokeBridgeMethodWithPromiseBlock(promise PromiseBlock, method string, b64message string)

func (*Bridge) NewGRPCClient

func (b *Bridge) NewGRPCClient() (client *Client, cleanup func(), err error)

NewGRPCClient return client service on success

type Client

type Client struct {
	// contains filtered or unexported fields
}

func (*Client) Close added in v2.120.1

func (c *Client) Close() error

func (*Client) UnaryRequest

func (c *Client) UnaryRequest(ctx context.Context, method string, req []byte) (res []byte, err error)

UnaryRequest request make an unary request to the given method. the request need to be already serialized

func (*Client) UnaryRequestFromBase64 added in v2.121.0

func (c *Client) UnaryRequestFromBase64(method string, b64req string) (b64res string, err error)

UnaryRequestFromBase64 request make an unary request to the given method. the request need to be already serialized and encoded in a base64 string

type Config

type Config struct {
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig() *Config

func (*Config) AddGRPCListener

func (c *Config) AddGRPCListener(addr string)

AddGRPCListener create a grpc listener with the given multiaddr if a normal addr is given, it will listen by default on grpcweb (ex: ":0" -> "/ip4/127.0.0.1/tcp/0/grpcweb")

type LifeCycleBackgroundTask added in v2.124.0

type LifeCycleBackgroundTask interface {
	Execute() (success bool)
	Cancel()
}

func NewBackgroundTask added in v2.124.0

func NewBackgroundTask(logger *zap.Logger, task func(context.Context) error) LifeCycleBackgroundTask

type LifeCycleDriver added in v2.124.0

type LifeCycleDriver interface {
	GetCurrentState() int
	RegisterHandler(handler LifeCycleHandler)
}

type LifeCycleHandler added in v2.124.0

type LifeCycleHandler interface {
	HandleState(appstate int)
	HandleTask() LifeCycleBackgroundTask
	WillTerminate()
}

type LocalNotification added in v2.134.1

type LocalNotification struct {
	Title    string
	Body     string
	Interval float64
}

type MessengerBridge added in v2.120.0

type MessengerBridge struct {
	*Bridge
	// contains filtered or unexported fields
}

func NewMessengerBridge added in v2.120.0

func NewMessengerBridge(config *MessengerConfig) (*MessengerBridge, error)

func (*MessengerBridge) Close added in v2.120.0

func (p *MessengerBridge) Close() error

func (*MessengerBridge) HandleState added in v2.129.0

func (p *MessengerBridge) HandleState(appstate int)

func (*MessengerBridge) HandleTask added in v2.129.0

func (p *MessengerBridge) HandleTask() LifeCycleBackgroundTask

func (*MessengerBridge) WillTerminate added in v2.129.0

func (p *MessengerBridge) WillTerminate()

type MessengerConfig added in v2.120.0

type MessengerConfig struct {
	*Config
	// contains filtered or unexported fields
}

func NewMessengerConfig added in v2.120.0

func NewMessengerConfig() *MessengerConfig

func (*MessengerConfig) AddSwarmListener added in v2.120.0

func (pc *MessengerConfig) AddSwarmListener(laddr string)

func (*MessengerConfig) DisableLocalDiscovery added in v2.120.0

func (pc *MessengerConfig) DisableLocalDiscovery()

func (*MessengerConfig) EnableTracing added in v2.120.0

func (pc *MessengerConfig) EnableTracing()

func (*MessengerConfig) LifeCycleDriver added in v2.124.0

func (pc *MessengerConfig) LifeCycleDriver(lc LifeCycleDriver)

func (*MessengerConfig) LoggerDriver added in v2.120.0

func (pc *MessengerConfig) LoggerDriver(dLogger NativeLoggerDriver)

func (*MessengerConfig) NotificationDriver added in v2.134.1

func (pc *MessengerConfig) NotificationDriver(driver NotificationDriver)

func (*MessengerConfig) RootDirectory added in v2.120.0

func (pc *MessengerConfig) RootDirectory(dir string)

func (*MessengerConfig) SetLogFilters added in v2.132.1

func (pc *MessengerConfig) SetLogFilters(filters string)

func (*MessengerConfig) SetTracingPrefix added in v2.120.0

func (pc *MessengerConfig) SetTracingPrefix(prefix string)

type NativeLoggerDriver

type NativeLoggerDriver interface {
	Log(level, namespace, message string) error
	LevelEnabler(level string) bool
}

type NotificationDriver added in v2.134.1

type NotificationDriver interface {
	Post(notif *LocalNotification) error
}

type PromiseBlock added in v2.121.0

type PromiseBlock interface {
	CallResolve(reply string)
	CallReject(error error)
}

type Service added in v2.121.0

type Service struct {
	// contains filtered or unexported fields
}

func NewServiceFromClientConn added in v2.121.0

func NewServiceFromClientConn(cc *grpc.ClientConn) *Service

func (*Service) ClientInvokeUnary added in v2.121.0

func (s *Service) ClientInvokeUnary(ctx context.Context, req *pb.ClientInvokeUnary_Request) (*pb.ClientInvokeUnary_Reply, error)

ClientInvokeUnary invoke a unary method

func (*Service) ClientStreamClose added in v2.121.0

func (s *Service) ClientStreamClose(ctx context.Context, req *pb.ClientStreamClose_Request) (*pb.ClientStreamClose_Reply, error)

Close the given stream

func (*Service) ClientStreamRecv added in v2.121.0

func (s *Service) ClientStreamRecv(ctx context.Context, req *pb.ClientStreamRecv_Request) (*pb.ClientStreamRecv_Reply, error)

Recv message over the given stream

func (*Service) ClientStreamSend added in v2.121.0

func (s *Service) ClientStreamSend(ctx context.Context, req *pb.ClientStreamSend_Request) (*pb.ClientStreamSend_Reply, error)

Send Message over the given stream

func (*Service) Close added in v2.121.0

func (s *Service) Close() error

func (*Service) CreateClientStream added in v2.121.0

CreateStream create a stream

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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