Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func DecodeKernel ¶
func DecodeKernel() string
DecodeKernel returns the name of the implementation being used for decode operations
func EncodeKernel ¶
func EncodeKernel() string
EncodeKernel returns the name of the implementation being used for encode operations
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
func NewDecoder ¶
func NewDecoder(r io.Reader, opts ...DecoderOption) *Decoder
type DecoderOption ¶
type DecoderOption func(d *Decoder)
func WithBufferSize ¶
func WithBufferSize(size int) DecoderOption
WithBufferSize allows the caller to customise the size of the internal buffer used by the decoder
func WithDataFunc ¶
func WithDataFunc(dataFunc func() []byte) DecoderOption
WithDataFunc allows a function to be called when responses need a []byte, for example from a sync.Pool to reduce GC pressure
func WithStatusLineAlreadyRead ¶
func WithStatusLineAlreadyRead() DecoderOption
WithStatusLineAlreadyRead the decoder assumes the stream is positioned at the start of a multiline response body and the caller has already consumed the first line of the response
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
func NewEncoder ¶
NewEncoder returns a new Encoder. Writes to the returned writer are yEnc encoded and written to w.
It is the caller's responsibility to call Close on the Encoder when done.
func (*Encoder) Close ¶
Close flushes any pending output from the encoder and writes the trailing header. It is an error to call Write after calling Close.
func (*Encoder) Reset ¶
Reset discards the Encoder e's state and makes it equivalent to the result of its original state from NewEncoder, but writing to w instead. This permits reusing a Encoder rather than allocating a new one.
type EncoderOption ¶
type EncoderOption func(*Encoder)
func WithLineLength ¶
func WithLineLength(lineLength int) EncoderOption
WithLineLength configures the encoded line length
type End ¶
type End int
End is the State for incremental decoding, whether the end of the yEnc data was reached
type Meta ¶
type Meta struct {
FileName string
FileSize int64 // Total size of the file
PartNumber int64
TotalParts int64
Offset int64 // Offset of the part within the file relative to the start, like io.Seeker or io.WriterAt
PartSize int64 // Size of the unencoded data
}
Meta is the result of parsing the yEnc headers (ybegin, ypart, yend)
type Response ¶
type Response struct {
Metadata ResponseMeta
Data []byte
// contains filtered or unexported fields
}