Documentation
¶
Index ¶
- type ControlRegister
- type Delegate
- type Dialer
- type EdgeOffline
- type EdgeOnline
- type GetEdgeID
- type Logger
- type Messager
- type Multiplexer
- type RPCMessager
- type RPCer
- type Service
- type ServiceOption
- func OptionServiceBufferSize(read, write int) ServiceOption
- func OptionServiceDelegate(delegate Delegate) ServiceOption
- func OptionServiceID(serviceID uint64) ServiceOption
- func OptionServiceLog(logger Logger) ServiceOption
- func OptionServiceName(service string) ServiceOption
- func OptionServiceReceiveTopics(topics []string) ServiceOption
- func OptionServiceTimer(tmr Timer) ServiceOption
- type Timer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ControlRegister ¶
type Delegate ¶
type Delegate delegate.ClientDelegate
type Messager ¶
type Messager interface {
NewMessage(data []byte) geminio.Message
Publish(ctx context.Context, edgeID uint64, msg geminio.Message) error
PublishAsync(ctx context.Context, edgeID uint64, msg geminio.Message, ch chan *geminio.Publish) (*geminio.Publish, error)
Receive(ctx context.Context) (geminio.Message, error)
}
Messager is edge oriented
type Multiplexer ¶
type Multiplexer interface {
// Open a stream to specific edgeID
OpenStream(ctx context.Context, edgeID uint64) (geminio.Stream, error)
AcceptStream() (geminio.Stream, error)
ListStreams() []geminio.Stream
}
Stream multiplexer
type RPCMessager ¶
type RPCer ¶
type RPCer interface {
NewRequest(data []byte) geminio.Request
Call(ctx context.Context, edgeID uint64, method string, req geminio.Request) (geminio.Response, error)
CallAsync(ctx context.Context, edgeID uint64, method string, req geminio.Request, ch chan *geminio.Call) (*geminio.Call, error)
Register(ctx context.Context, method string, rpc geminio.RPC) error
}
RPCer is edge and it's method oriented
type Service ¶
type Service interface {
// Service can direct Message or RPC
RPCMessager
// Service can manage streams from or to a Edge
Multiplexer
// Service is a net.Listener, actually it's wrapper of Multiplexer
// The Accept is a wrapper for AcceptStream
// The Addr is a wrapper for LocalAddr
net.Listener
// Service can register some control functions that be called by frontier when edge updated
ControlRegister
Close() error
}
Service
func NewClusterService ¶ added in v1.1.0
func NewClusterService(frontlasAddr string, opts ...ServiceOption) (Service, error)
call this function when you deploy a frontier cluster
func NewService ¶
func NewService(dialer Dialer, opts ...ServiceOption) (Service, error)
the service field specific the role for this Service, and then Edge can OpenStream to this service
type ServiceOption ¶
type ServiceOption func(*serviceOption)
func OptionServiceBufferSize ¶ added in v1.1.0
func OptionServiceBufferSize(read, write int) ServiceOption
func OptionServiceDelegate ¶
func OptionServiceDelegate(delegate Delegate) ServiceOption
delegations for the service own connection, streams and more
func OptionServiceID ¶ added in v1.1.0
func OptionServiceID(serviceID uint64) ServiceOption
func OptionServiceLog ¶
func OptionServiceLog(logger Logger) ServiceOption
func OptionServiceName ¶
func OptionServiceName(service string) ServiceOption
func OptionServiceReceiveTopics ¶
func OptionServiceReceiveTopics(topics []string) ServiceOption
func OptionServiceTimer ¶
func OptionServiceTimer(tmr Timer) ServiceOption
Pre set timer for the sdk
Click to show internal directories.
Click to hide internal directories.