compressxdr

package
v0.0.0-...-100dc4f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2024 License: Apache-2.0, Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultCompressor = &ZstdCompressor{}

Functions

This section is empty.

Types

type Compressor

type Compressor interface {
	NewWriter(w io.Writer) (io.WriteCloser, error)
	NewReader(r io.Reader) (io.ReadCloser, error)
	Name() string
}

Compressor represents a compression algorithm.

type MockXDRDecoder

type MockXDRDecoder struct {
	mock.Mock
}

func (*MockXDRDecoder) ReadFrom

func (m *MockXDRDecoder) ReadFrom(r io.Reader) (int64, error)

func (*MockXDRDecoder) Unzip

func (m *MockXDRDecoder) Unzip(r io.Reader) ([]byte, error)

type XDRDecoder

type XDRDecoder struct {
	Compressor Compressor
	XdrPayload interface{}
}

XDRDecoder combines decompression with XDR decoding

func NewXDRDecoder

func NewXDRDecoder(compressor Compressor, xdrPayload interface{}) XDRDecoder

func (XDRDecoder) ReadFrom

func (d XDRDecoder) ReadFrom(r io.Reader) (int64, error)

ReadFrom reads XDR compressed encoded data

type XDREncoder

type XDREncoder struct {
	Compressor Compressor
	XdrPayload interface{}
}

XDREncoder combines compression with XDR encoding

func NewXDREncoder

func NewXDREncoder(compressor Compressor, xdrPayload interface{}) XDREncoder

func (XDREncoder) WriteTo

func (e XDREncoder) WriteTo(w io.Writer) (int64, error)

WriteTo writes the XDR compressed encoded data

type ZstdCompressor

type ZstdCompressor struct{}

ZstdCompressor is an implementation of the Compressor interface for Zstd compression.

func (ZstdCompressor) Name

func (z ZstdCompressor) Name() string

GetName returns the name of the compression algorithm.

func (ZstdCompressor) NewReader

func (z ZstdCompressor) NewReader(r io.Reader) (io.ReadCloser, error)

NewReader creates a new Zstd reader.

func (ZstdCompressor) NewWriter

func (z ZstdCompressor) NewWriter(w io.Writer) (io.WriteCloser, error)

NewWriter creates a new Zstd writer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL