codec

package
v0.0.0-...-bf1012a Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2020 License: MIT 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 interface {
	// Marshal returns the encoded form of v.
	// If in is provided with enough capacity, Marshal copies
	// into in, avoiding allocation.
	Marshal(v interface{}, in []byte) (out []byte, err error)

	// Unmarshal decodes data into v.
	Unmarshal(data []byte, v interface{}) error

	// Format returns the data interchange format.
	Format() Format
}

Codec marshals and unmarshals types.

type Format

type Format byte
const (
	Binary Format = iota
	JSON
	MessagePack
)

type Marshaler

type Marshaler interface {
	// If in is provided with enough capacity, Marshal copies
	// into in, avoiding allocation.
	Marshal(in []byte) (out []byte, err error)
}

Marshaler is the interface implemented by types that can marshal themselves.

type Unmarshaler

type Unmarshaler interface {
	Unmarshal(data []byte) error
}

Marshaler is the interface implemented by types that can unmarshal themselves.

Directories

Path Synopsis
Package key implements the standard encoding and decoding of Bow keys.
Package key implements the standard encoding and decoding of Bow keys.
Package msgp implements encoding and decoding of MessagePack, relying on serialization code generated by msgp, the code generation library for MessagePack at github.com/tinylib/msgp.
Package msgp implements encoding and decoding of MessagePack, relying on serialization code generated by msgp, the code generation library for MessagePack at github.com/tinylib/msgp.

Jump to

Keyboard shortcuts

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