Documentation ¶
Overview ¶
Package bertybridge is the main gomobile entrypoint, used to generate iOS and Android frameworks.
Index ¶
- Constants
- Variables
- type Bridge
- func (b *Bridge) Close() (err error)
- func (b *Bridge) GRPCListenerAddr() string
- func (b *Bridge) GRPCWebListenerAddr() string
- func (b *Bridge) GRPCWebSocketListenerAddr() string
- func (b *Bridge) GetGRPCAddrFor(protos string) string
- func (b *Bridge) InvokeBridgeMethod(method string, b64message string) (string, error)
- func (b *Bridge) InvokeBridgeMethodWithPromiseBlock(promise PromiseBlock, method string, b64message string)
- func (b *Bridge) NewGRPCClient() (client *Client, cleanup func(), err error)
- type Client
- type Config
- type LifeCycleBackgroundTask
- type LifeCycleDriver
- type LifeCycleHandler
- type LocalNotification
- type MessengerBridge
- type MessengerConfig
- func (pc *MessengerConfig) AddSwarmListener(laddr string)
- func (pc *MessengerConfig) DisableLocalDiscovery()
- func (pc *MessengerConfig) EnableTracing()
- func (pc *MessengerConfig) LifeCycleDriver(lc LifeCycleDriver)
- func (pc *MessengerConfig) LoggerDriver(dLogger NativeLoggerDriver)
- func (pc *MessengerConfig) NotificationDriver(driver NotificationDriver)
- func (pc *MessengerConfig) RootDirectory(dir string)
- func (pc *MessengerConfig) SetLogFilters(filters string)
- func (pc *MessengerConfig) SetTracingPrefix(prefix string)
- type NativeLoggerDriver
- type NotificationDriver
- type PromiseBlock
- type Service
- func (s *Service) ClientInvokeUnary(ctx context.Context, req *pb.ClientInvokeUnary_Request) (*pb.ClientInvokeUnary_Reply, error)
- func (s *Service) ClientStreamClose(ctx context.Context, req *pb.ClientStreamClose_Request) (*pb.ClientStreamClose_Reply, error)
- func (s *Service) ClientStreamRecv(ctx context.Context, req *pb.ClientStreamRecv_Request) (*pb.ClientStreamRecv_Reply, error)
- func (s *Service) ClientStreamSend(ctx context.Context, req *pb.ClientStreamSend_Request) (*pb.ClientStreamSend_Reply, error)
- func (s *Service) Close() error
- func (s *Service) CreateClientStream(ctx context.Context, req *pb.ClientCreateStream_Request) (*pb.ClientCreateStream_Reply, error)
Constants ¶
const ( AppStateUnknow int = iota AppStateActive AppStateInactive AppStateBackground )
const ClientBufferSize = 256 * 1024
Variables ¶
var (
APIConfig = config.BertyMobile.APIConfig
)
Functions ¶
This section is empty.
Types ¶
type Bridge ¶
type Bridge struct {
// contains filtered or unexported fields
}
func (*Bridge) GRPCListenerAddr ¶
func (*Bridge) GRPCWebListenerAddr ¶
func (*Bridge) GRPCWebSocketListenerAddr ¶
func (*Bridge) GetGRPCAddrFor ¶
GetGRPCAddrFor the given protocols, if not found return an empty string
func (*Bridge) InvokeBridgeMethod ¶ added in v2.121.0
func (*Bridge) InvokeBridgeMethodWithPromiseBlock ¶ added in v2.121.0
func (b *Bridge) InvokeBridgeMethodWithPromiseBlock(promise PromiseBlock, method string, b64message string)
func (*Bridge) NewGRPCClient ¶
NewGRPCClient return client service on success
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
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
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 (*Config) AddGRPCListener ¶
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
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 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 NotificationDriver ¶ added in v2.134.1
type NotificationDriver interface {
Post(notif *LocalNotification) error
}
type PromiseBlock ¶ added in v2.121.0
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) CreateClientStream ¶ added in v2.121.0
func (s *Service) CreateClientStream(ctx context.Context, req *pb.ClientCreateStream_Request) (*pb.ClientCreateStream_Reply, error)
CreateStream create a stream