codecs

package
v0.0.0-...-27647ab Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bzip2Codec

type Bzip2Codec struct{}

func (Bzip2Codec) Decode

func (c Bzip2Codec) Decode(t []byte) []byte

func (Bzip2Codec) Encode

func (c Bzip2Codec) Encode(f []byte) []byte

type Codec

type Codec[F, T any] interface {
	Encoder[F, T]
	Decoder[F, T]
}

type CompositeCodec

type CompositeCodec[F0, F1, T any] struct {
	// contains filtered or unexported fields
}

func Compose

func Compose[F0, F1, T any](c0 Codec[F0, F1], c1 Codec[F1, T]) CompositeCodec[F0, F1, T]

func (CompositeCodec[F0, F1, T]) Decode

func (d CompositeCodec[F0, F1, T]) Decode(t T) F0

func (CompositeCodec[F0, F1, T]) Encode

func (e CompositeCodec[F0, F1, T]) Encode(f F0) T

type CompositeDecoder

type CompositeDecoder[F0, F1, T any] struct {
	// contains filtered or unexported fields
}

func (CompositeDecoder[F0, F1, T]) Decode

func (d CompositeDecoder[F0, F1, T]) Decode(t T) F0

type CompositeEncoder

type CompositeEncoder[F0, F1, T any] struct {
	// contains filtered or unexported fields
}

func (CompositeEncoder[F0, F1, T]) Encode

func (e CompositeEncoder[F0, F1, T]) Encode(f F0) T

type Decoder

type Decoder[F, T any] interface {
	Decode(T) F
}

type Encoder

type Encoder[F, T any] interface {
	Encode(F) T
}

type FuncCodec

type FuncCodec[F, T any] struct {
	// contains filtered or unexported fields
}

func Of

func Of[F, T any](e func(F) T, d func(T) F) FuncCodec[F, T]

func (FuncCodec[F, T]) Decode

func (c FuncCodec[F, T]) Decode(t T) F

func (FuncCodec[F, T]) Encode

func (c FuncCodec[F, T]) Encode(f F) T

type GzipCodec

type GzipCodec struct{}

func (GzipCodec) Decode

func (c GzipCodec) Decode(t []byte) []byte

func (GzipCodec) Encode

func (c GzipCodec) Encode(f []byte) []byte

type InvertCodec

type InvertCodec[F, T any] struct {
	// contains filtered or unexported fields
}

func Invert

func Invert[F, T any](c Codec[F, T]) InvertCodec[T, F]

func (InvertCodec[F, T]) Decode

func (c InvertCodec[F, T]) Decode(t T) F

func (InvertCodec[F, T]) Encode

func (c InvertCodec[F, T]) Encode(f F) T

Jump to

Keyboard shortcuts

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