Versions in this module Expand all Collapse all v1 v1.3.2 Dec 25, 2023 Changes in this version + const ExtensionName + const MaxLZ77WindowSize + var DefaultHelper = Helper + var DefaultParameters = Parameters + var ErrUnexpectedCompressionBit = ws.ProtocolError("control frame or non-first fragment of data contains compression bit set") + var ExtensionNameBytes = []byte(ExtensionName) + func CompressFrame(f ws.Frame) (ws.Frame, error) + func CompressFrameBuffer(buf Buffer, f ws.Frame) (ws.Frame, error) + func DecompressFrame(f ws.Frame) (ws.Frame, error) + func DecompressFrameBuffer(buf Buffer, f ws.Frame) (ws.Frame, error) + func IsCompressed(h ws.Header) (bool, error) + func SetBit(h ws.Header) (_ ws.Header, err error) + func UnsetBit(h ws.Header) (_ ws.Header, wasSet bool, err error) + type Buffer interface + Bytes func() []byte + type Compressor interface + Flush func() error + type Decompressor interface + type Extension struct + Parameters Parameters + func (n *Extension) Accepted() (_ Parameters, accepted bool) + func (n *Extension) Negotiate(opt httphead.Option) (accept httphead.Option, err error) + func (n *Extension) Reset() + type Helper struct + Compressor func(w io.Writer) Compressor + Decompressor func(r io.Reader) Decompressor + func (h *Helper) Compress(p []byte) ([]byte, error) + func (h *Helper) CompressFrame(in ws.Frame) (f ws.Frame, err error) + func (h *Helper) CompressFrameBuffer(buf Buffer, f ws.Frame) (ws.Frame, error) + func (h *Helper) CompressTo(w io.Writer, p []byte) (err error) + func (h *Helper) Decompress(p []byte) ([]byte, error) + func (h *Helper) DecompressFrame(in ws.Frame) (f ws.Frame, err error) + func (h *Helper) DecompressFrameBuffer(buf Buffer, f ws.Frame) (ws.Frame, error) + func (h *Helper) DecompressTo(w io.Writer, p []byte) (err error) + type MessageState struct + func (s *MessageState) IsCompressed() bool + func (s *MessageState) SetBits(h ws.Header) (ws.Header, error) + func (s *MessageState) SetCompressed(v bool) + func (s *MessageState) UnsetBits(h ws.Header) (ws.Header, error) + type Parameters struct + ClientMaxWindowBits WindowBits + ClientNoContextTakeover bool + ServerMaxWindowBits WindowBits + ServerNoContextTakeover bool + func (p *Parameters) Parse(opt httphead.Option) (err error) + func (p Parameters) Option() httphead.Option + type ReadResetter interface + Reset func(io.Reader) + type Reader struct + func NewReader(r io.Reader, ctor func(io.Reader) Decompressor) *Reader + func (r *Reader) Close() error + func (r *Reader) Err() error + func (r *Reader) Read(p []byte) (n int, err error) + func (r *Reader) Reset(src io.Reader) + type WindowBits byte + func (b WindowBits) Bytes() int + func (b WindowBits) Defined() bool + type WriteResetter interface + Reset func(io.Writer) + type Writer struct + func NewWriter(w io.Writer, ctor func(io.Writer) Compressor) *Writer + func (w *Writer) Close() error + func (w *Writer) Err() error + func (w *Writer) Flush() error + func (w *Writer) Reset(dest io.Writer) + func (w *Writer) Write(p []byte) (n int, err error)