Documentation
¶
Index ¶
- type Broker
- type ChannelBroker
- func (b *ChannelBroker) Publish(ctx context.Context, topic string, data []byte) error
- func (b *ChannelBroker) ReadRequest(ctx context.Context) (json.RawMessage, Replier, error)
- func (b *ChannelBroker) SetDroppedMessageHandler(fn func(string, []byte)) *ChannelBroker
- func (b *ChannelBroker) Subscribe(ctx context.Context, topic string) (Subscription, error)
- func (b *ChannelBroker) WriteRequest(ctx context.Context, topic string, msg json.RawMessage) error
- type Client
- func (c *Client) BatchCall(ctx context.Context, b ...*codec.BatchElem) error
- func (c *Client) Close() error
- func (c *Client) Closed() <-chan struct{}
- func (c *Client) Do(ctx context.Context, result any, method string, params any) error
- func (c *Client) Mount(h codec.Middleware)
- func (c *Client) Notify(ctx context.Context, method string, params any) error
- func (c *Client) SetHandlerPeer(pi codec.PeerInfo)
- func (c *Client) SetHeader(key string, value string)
- type ClientSpoke
- type Codec
- type Replier
- type ReplierFunc
- type Server
- type ServerSpoke
- type Subscription
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker interface { ServerSpoke ClientSpoke }
type ChannelBroker ¶
type ChannelBroker struct {
// contains filtered or unexported fields
}
func NewChannelBroker ¶
func NewChannelBroker() *ChannelBroker
func (*ChannelBroker) ReadRequest ¶
func (b *ChannelBroker) ReadRequest(ctx context.Context) (json.RawMessage, Replier, error)
func (*ChannelBroker) SetDroppedMessageHandler ¶
func (b *ChannelBroker) SetDroppedMessageHandler(fn func(string, []byte)) *ChannelBroker
func (*ChannelBroker) Subscribe ¶
func (b *ChannelBroker) Subscribe(ctx context.Context, topic string) (Subscription, error)
func (*ChannelBroker) WriteRequest ¶
func (b *ChannelBroker) WriteRequest(ctx context.Context, topic string, msg json.RawMessage) error
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(spoke ClientSpoke) *Client
func (*Client) Mount ¶
func (c *Client) Mount(h codec.Middleware)
func (*Client) SetHandlerPeer ¶
type ClientSpoke ¶
type Codec ¶
type Codec struct {
// contains filtered or unexported fields
}
func (*Codec) Closed ¶
func (c *Codec) Closed() <-chan struct{}
Closed returns a channel which is closed when the connection is closed.
type ReplierFunc ¶
type Server ¶
func (*Server) ServeSpoke ¶
func (s *Server) ServeSpoke(ctx context.Context, stream ServerSpoke)
type ServerSpoke ¶
type Subscription ¶
type Subscription interface { // channel that will close when done or error Listen() <-chan json.RawMessage // should close the channel and also stop listening Close() error // this hold errors Err() error }
Click to show internal directories.
Click to hide internal directories.