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, streamCopier zfs.StreamCopier) (*pdu.ReceiveRes, error)
- func (c *Client) ReqSend(ctx context.Context, req *pdu.SendReq) (*pdu.SendRes, zfs.StreamCopier, error)
- 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, streamCopier zfs.StreamCopier) (*pdu.ReceiveRes, error)
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, zfs.StreamCopier, 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 zfs.StreamCopier) (*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
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
microbenchmark to manually test rpc/dataconn perforamnce With stdin / stdout on client and server, simulating zfs send|recv piping ./microbenchmark -appmode server | pv -r > /dev/null ./microbenchmark -appmode client -direction recv < /dev/zero Without the overhead of pipes (just protocol perforamnce, mostly useful with perf bc no bw measurement) ./microbenchmark -appmode client -direction recv -devnoopWriter -devnoopReader ./microbenchmark -appmode server -devnoopReader -devnoopWriter
|
microbenchmark to manually test rpc/dataconn perforamnce With stdin / stdout on client and server, simulating zfs send|recv piping ./microbenchmark -appmode server | pv -r > /dev/null ./microbenchmark -appmode client -direction recv < /dev/zero Without the overhead of pipes (just protocol perforamnce, mostly useful with perf bc no bw measurement) ./microbenchmark -appmode client -direction recv -devnoopWriter -devnoopReader ./microbenchmark -appmode server -devnoopReader -devnoopWriter |
|
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
command
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.