codec

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Codec

type Codec[T any] interface {
	Encode(v T) ([]byte, error)
	Decode(b []byte) (T, error)
	Name() string
}

type Funcs

type Funcs[T any] struct {
	Format     string
	EncodeFunc func(v T) ([]byte, error)
	DecodeFunc func(b []byte) (T, error)
}

func (Funcs[T]) Decode

func (c Funcs[T]) Decode(b []byte) (T, error)

func (Funcs[T]) Encode

func (c Funcs[T]) Encode(a T) ([]byte, error)

func (Funcs[T]) Name

func (c Funcs[T]) Name() string

Jump to

Keyboard shortcuts

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