Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) ReqPing(ctx context.Context, req *pdu.PingReq) (*pdu.PingRes, error)
- func (c *Client) ReqRecv(ctx context.Context, req *pdu.ReceiveReq, stream io.ReadCloser) (*pdu.ReceiveRes, error)
- func (c *Client) ReqSend(ctx context.Context, req *pdu.SendReq) (*pdu.SendRes, io.ReadCloser, error)
- type ContextInterceptor
- type ContextInterceptorData
- type Handler
- type Logger
- type ProtocolError
- type RemoteHandlerError
- type Server
- type WireInterceptor
Constants ¶
View Source
const ( EndpointPing string = "/v1/ping" EndpointSend string = "/v1/send" EndpointRecv string = "/v1/recv" )
View Source
const ( ReqHeader uint32 = 1 + iota ReqStructured ResHeader ResStructured ZFSStream )
View Source
const ( HeartbeatInterval = 5 * time.Second HeartbeatPeerTimeout = 10 * time.Second RequestHeaderMaxSize = 1 << 15 RequestStructuredMaxSize = 1 << 22 ResponseHeaderMaxSize = 1 << 15 ResponseStructuredMaxSize = 1 << 23 )
Note that changing theses constants may break interop with other clients Aggressive with timing, conservative (future compatible) with buffer sizes
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ReqRecv ¶
func (c *Client) ReqRecv(ctx context.Context, req *pdu.ReceiveReq, stream io.ReadCloser) (*pdu.ReceiveRes, error)
type ContextInterceptor ¶ added in v0.7.4
type ContextInterceptor = func(ctx context.Context, data ContextInterceptorData, handler func(ctx context.Context))
type ContextInterceptorData ¶ added in v0.7.4
type Handler ¶
type Handler interface { // Send handles a SendRequest. // The returned io.ReadCloser is allowed to be nil, for example if the requested Send is a dry-run. Send(ctx context.Context, r *pdu.SendReq) (*pdu.SendRes, io.ReadCloser, error) // Receive handles a ReceiveRequest. // It is guaranteed that Server calls Receive with a stream that holds the IdleConnTimeout // configured in ServerConfig.Shared.IdleConnTimeout. Receive(ctx context.Context, r *pdu.ReceiveReq, receive io.ReadCloser) (*pdu.ReceiveRes, error) // PingDataconn handles a PingReq PingDataconn(ctx context.Context, r *pdu.PingReq) (*pdu.PingRes, error) }
Handler implements the functionality that is exposed by Server to the Client.
type ProtocolError ¶
type ProtocolError struct {
// contains filtered or unexported fields
}
func (*ProtocolError) Error ¶
func (e *ProtocolError) Error() string
type RemoteHandlerError ¶
type RemoteHandlerError struct {
// contains filtered or unexported fields
}
func (*RemoteHandlerError) Error ¶
func (e *RemoteHandlerError) Error() string
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(wi WireInterceptor, ci ContextInterceptor, logger Logger, handler Handler) *Server
wi and ci may be nil
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
integration_test_variablereceiverate
This integration test exercises the behavior of heartbeatconn where the server is slow at handling the data received over the connection.
|
This integration test exercises the behavior of heartbeatconn where the server is slow at handling the data received over the connection. |
microbenchmark to manually test rpc/dataconn performance
|
microbenchmark to manually test rpc/dataconn performance |
package timeoutconn wraps a Wire to provide idle timeouts based on Set{Read,Write}Deadline.
|
package timeoutconn wraps a Wire to provide idle timeouts based on Set{Read,Write}Deadline. |
internal/wireevaluator
a tool to test whether a given transport implements the timeoutconn.Wire interface
|
a tool to test whether a given transport implements the timeoutconn.Wire interface |
Click to show internal directories.
Click to hide internal directories.