encoding

package
v0.0.0-...-2e52d37 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

type Encoder interface {
	// Encode encodes a value as bytes.
	//
	// This function returns an error if the value type is not supported by this encoder.
	Encode(interface{}) ([]byte, error)

	// Decode decodes bytes into a value.
	//
	// This functions returns an error if the bytes do not fit the provided value type.
	Decode([]byte, interface{}) error

	// MustEncode encodes a value as bytes.
	//
	// This functions panic if encoding fails.
	MustEncode(interface{}) []byte

	// MustDecode decodes bytes into a value.
	//
	// This functions panic if decoding fails.
	MustDecode([]byte, interface{})
}

Encoder encodes and decodes values to and from bytes.

var DefaultEncoder Encoder = json.NewEncoder()

DefaultEncoder is the default encoder used by Flow.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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