codec

package
v0.2.1-beta.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(buf []byte, value Decodable) error

Decode value from a byte buffer.

func DecodeFrom

func DecodeFrom(r io.Reader, value Decodable) (int, error)

DecodeFrom decodes a value using data from a reader stream.

func Encode

func Encode(value Encodable) ([]byte, error)

Encode value to a byte buffer.

func EncodeTo

func EncodeTo(w io.Writer, value Encodable) (int, error)

EncodeTo encodes value to a writer stream.

Types

type Decodable

type Decodable interface{}

Decodable is an interface that must be implemented bya struct to be decoded.

type Encodable

type Encodable interface{}

Encodable is an interface that must be implemented by a struct to be encoded.

Jump to

Keyboard shortcuts

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