Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type End ¶
type End interface {
// End is a default stream with streamID 1
// Close on default stream will close all from the End
Stream
// End is a stream multiplexer
Multiplexer
// End is a net.Listener
// Accept is a wrapper for AcceptStream
// Addr is a wrapper for LocalAddr
net.Listener
Close() error
}
type Message ¶
type Message interface {
// to tell peer received or errored
Done() error
Error(err error) error
// those meta info shouldn't be changed
ID() uint64
StreamID() uint64
ClientID() uint64
Timeout() time.Duration
Topic() string // empty if not set
// consistency protocol
Cnss() options.Cnss
// application data
Data() []byte
// custom data
Custom() []byte
// those Set operations must be accomplish before Publish
SetTimeout(timeout time.Duration)
SetCustom(data []byte)
SetTopic(topic string)
SetClientID(clientID uint64)
SetStreamID(streamID uint64)
}
type Messager ¶
type Messager interface {
NewMessage(data []byte, opts ...*options.NewMessageOptions) Message
Publish(ctx context.Context, msg Message, opts ...*options.PublishOptions) error
PublishAsync(ctx context.Context, msg Message, ch chan *Publish, opts ...*options.PublishOptions) (*Publish, error)
Receive(ctx context.Context) (Message, error)
}
type Multiplexer ¶
type Multiplexer interface {
OpenStream(opts ...*options.OpenStreamOptions) (Stream, error)
AcceptStream() (Stream, error)
ListStreams() []Stream
}
Stream multiplexer
type RPCer ¶
type RPCer interface {
NewRequest(data []byte, opts ...*options.NewRequestOptions) Request
Call(ctx context.Context, method string, req Request, opts ...*options.CallOptions) (Response, error)
CallAsync(ctx context.Context, method string, req Request, ch chan *Call, opts ...*options.CallOptions) (*Call, error)
Register(ctx context.Context, method string, rpc RPC) error
// Hijack rpc from remote
Hijack(rpc HijackRPC, opts ...*options.HijackOptions) error
}
type RawRPCMessager ¶
type Request ¶
type Request interface {
// those meta info shouldn't be changed
ID() uint64
StreamID() uint64
ClientID() uint64
Method() string
Timeout() time.Duration
// application data
Data() []byte
// custom data
Custom() []byte
SetTimeout(timeout time.Duration)
SetCustom([]byte)
SetClientID(clientID uint64)
SetStreamID(streamID uint64)
}
RPC releated
type Response ¶
type Response interface {
// those meta info shouldn't be changed
ID() uint64
StreamID() uint64
ClientID() uint64
Method() string
// application data
Data() []byte
Error() error
// custom data
Custom() []byte
SetData([]byte)
SetError(error)
SetCustom([]byte)
SetClientID(clientID uint64)
SetStreamID(streamID uint64)
}
Directories
¶
| Path | Synopsis |
|---|---|
|
mock
Package mock_multiplexer is a generated GoMock package.
|
Package mock_multiplexer is a generated GoMock package. |
|
batch/client
command
|
|
|
bench/client
command
|
|
|
example/client
command
|
|
|
example/server
command
|
|
|
examples
|
|
|
chatroom/client
command
|
|
|
chatroom/server
command
|
|
|
messager/client
command
|
|
|
messager/server
command
|
|
|
mq/broker
command
|
|
|
mq/consumer
command
|
|
|
mq/producer
command
|
|
|
relay
command
|
|
|
traversal/internet
command
|
|
|
traversal/intranet
command
|
|
|
usage/brpc/client
command
|
|
|
usage/brpc/server
command
|
|
|
usage/message/client
command
|
|
|
usage/message/server
command
|
|
|
usage/multiplexer/client
command
|
|
|
usage/multiplexer/server
command
|
|
|
usage/rpc/client
command
|
|
|
usage/rpc/server
command
|
|
|
bench
command
|
|
|
example/client
command
|
|
|
example/server
command
|
|
|
pkg
|
|
|
harness
Package harness provides reusable test helpers for geminio tests.
|
Package harness provides reusable test helpers for geminio tests. |
|
tools
|
|
|
packets_drop
command
|
Click to show internal directories.
Click to hide internal directories.

