encoding

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalJSON

func MarshalJSON(v interface{}) ([]byte, error)

func UnmarshalJSON

func UnmarshalJSON(data []byte, v interface{}) error

Types

type Codec

type Codec interface {
	// Marshal returns the wire format of v.
	Marshal(v interface{}) ([]byte, error)
	// Unmarshal parses the wire format into v.
	Unmarshal(data []byte, v interface{}) error
}

Codec defines the interface Transport uses to encode and decode messages. Note that implementations of this interface must be thread safe; a Codec's methods can be called from concurrent goroutines.

type EncoderFunc

type EncoderFunc func(v interface{}) error

EncoderFunc adapts an encoder function into Encoder

func NewEncoderFunc

func NewEncoderFunc(writer io.Writer) EncoderFunc

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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