Documentation ¶
Index ¶
- Constants
- Variables
- func IsPublicFrameType(ft uint32) bool
- func WithLogger(ctx context.Context, log Logger) context.Context
- type Conn
- func (c *Conn) Close() error
- func (c *Conn) ReadStreamInto(w io.Writer, frameType uint32) zfs.StreamCopierError
- func (c *Conn) ReadStreamedMessage(ctx context.Context, maxSize uint32, frameType uint32) ([]byte, *ReadStreamError)
- func (c *Conn) SendStream(ctx context.Context, src zfs.StreamCopier, frameType uint32) error
- func (c *Conn) WriteStreamedMessage(ctx context.Context, buf io.Reader, frameType uint32) error
- type Logger
- type ReadStreamError
- type ReadStreamErrorKind
Constants ¶
View Source
const ( StreamErrTrailer uint32 = 1 << (16 + iota) End )
Frame types used by this package. 4 MSBs are reserved for frameconn, next 4 MSB for heartbeatconn, next 4 MSB for us.
View Source
const FramePayloadShift = 19
Variables ¶
View Source
var ErrReadFramesStopped = fmt.Errorf("stream: reading frames stopped")
Functions ¶
func IsPublicFrameType ¶
Check whether the given frame type is allowed to be used by consumers of this package. Intended for use in unit tests.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) ReadStreamInto ¶
WriteStreamTo reads a stream from Conn and writes it to w.
func (*Conn) ReadStreamedMessage ¶
func (*Conn) SendStream ¶
type ReadStreamError ¶
type ReadStreamError struct { Kind ReadStreamErrorKind Err error }
func (*ReadStreamError) Error ¶
func (e *ReadStreamError) Error() string
func (ReadStreamError) IsReadError ¶
func (e ReadStreamError) IsReadError() bool
func (ReadStreamError) IsWriteError ¶
func (e ReadStreamError) IsWriteError() bool
func (ReadStreamError) Temporary ¶
func (e ReadStreamError) Temporary() bool
func (ReadStreamError) Timeout ¶
func (e ReadStreamError) Timeout() bool
type ReadStreamErrorKind ¶
type ReadStreamErrorKind int
const ( ReadStreamErrorKindConn ReadStreamErrorKind = 1 + iota ReadStreamErrorKindWrite ReadStreamErrorKindSource ReadStreamErrorKindStreamErrTrailerEncoding ReadStreamErrorKindUnexpectedFrameType )
Click to show internal directories.
Click to hide internal directories.