bertybridge

package
v2.37.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: Apache-2.0, MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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) NewGRPCClient

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

NewGRPCClient return client service on success

type Client

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

func (*Client) UnaryRequest

func (c *Client) UnaryRequest(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

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 Demo

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

func NewDemoBridge

func NewDemoBridge(config *DemoConfig) (*Demo, error)

func (*Demo) Close

func (d *Demo) Close() (err error)

type DemoConfig

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

func NewDemoConfig

func NewDemoConfig() *DemoConfig

func (*DemoConfig) AddSwarmListener

func (dc *DemoConfig) AddSwarmListener(laddr string)

func (*DemoConfig) LogLevel

func (dc *DemoConfig) LogLevel(level string)

func (*DemoConfig) LoggerDriver

func (dc *DemoConfig) LoggerDriver(dLogger NativeLoggerDriver)

func (*DemoConfig) OrbitDBDirectory

func (dc *DemoConfig) OrbitDBDirectory(dir string)

type NativeLoggerDriver

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

type Protocol

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

func NewProtocolBridge

func NewProtocolBridge(config *ProtocolConfig) (*Protocol, error)

func (*Protocol) Close

func (p *Protocol) Close() (err error)

type ProtocolConfig

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

func NewProtocolConfig

func NewProtocolConfig() *ProtocolConfig

func (*ProtocolConfig) AddSwarmListener added in v2.35.0

func (pc *ProtocolConfig) AddSwarmListener(laddr string)

func (*ProtocolConfig) LogLevel

func (pc *ProtocolConfig) LogLevel(level string)

func (*ProtocolConfig) LoggerDriver

func (pc *ProtocolConfig) LoggerDriver(dLogger NativeLoggerDriver)

func (*ProtocolConfig) OrbitDBDirectory added in v2.35.0

func (pc *ProtocolConfig) OrbitDBDirectory(dir string)

Jump to

Keyboard shortcuts

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