Documentation ¶
Index ¶
- type Client
- func (c *Client[RequestType, ResponseType]) Close()
- func (c *Client[RequestType, ResponseType]) Connect()
- func (c *Client[RequestType, ResponseType]) Connected() bool
- func (c *Client[RequestType, ResponseType]) DoWithClient(op func(client ClientStream[RequestType, ResponseType]) error) bool
- func (c *Client[RequestType, ResponseType]) OnMsgRecv(f func(ResponseType))
- func (c *Client[RequestType, ResponseType]) OnReconnect(f func())
- func (c *Client[RequestType, ResponseType]) Reconnect()
- func (c *Client[RequestType, ResponseType]) ReconnectNotVerify()
- func (c *Client[RequestType, ResponseType]) Send(request RequestType)
- type ClientStream
- type ClientStreamFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client[RequestType, ResponseType any] struct { ClientStreamFactory[RequestType, ResponseType] // contains filtered or unexported fields }
func NewClient ¶
func NewClient[RequestType, ResponseType any](factory ClientStreamFactory[RequestType, ResponseType]) *Client[RequestType, ResponseType]
func (*Client[RequestType, ResponseType]) Close ¶
func (c *Client[RequestType, ResponseType]) Close()
func (*Client[RequestType, ResponseType]) Connect ¶
func (c *Client[RequestType, ResponseType]) Connect()
func (*Client[RequestType, ResponseType]) DoWithClient ¶
func (c *Client[RequestType, ResponseType]) DoWithClient(op func(client ClientStream[RequestType, ResponseType]) error) bool
DoWithClient do something with c.stream
func (*Client[RequestType, ResponseType]) OnMsgRecv ¶
func (c *Client[RequestType, ResponseType]) OnMsgRecv(f func(ResponseType))
func (*Client[RequestType, ResponseType]) OnReconnect ¶
func (c *Client[RequestType, ResponseType]) OnReconnect(f func())
func (*Client[RequestType, ResponseType]) Reconnect ¶
func (c *Client[RequestType, ResponseType]) Reconnect()
func (*Client[RequestType, ResponseType]) ReconnectNotVerify ¶
func (c *Client[RequestType, ResponseType]) ReconnectNotVerify()
type ClientStream ¶
type ClientStreamFactory ¶
type ClientStreamFactory[RequestType, ResponseType any] interface { NewClientStream(ctx context.Context) (ClientStream[RequestType, ResponseType], error) }
Click to show internal directories.
Click to hide internal directories.