coder

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coder

type Coder interface {
	Encode(data interface{}) ([]byte, error)
	Decode(data []byte, v interface{}) error
}

func New

func New(kind string) Coder

type GobCoder

type GobCoder struct {
}

func (*GobCoder) Decode

func (g *GobCoder) Decode(data []byte, to interface{}) error

func (*GobCoder) Encode

func (g *GobCoder) Encode(data interface{}) ([]byte, error)

type JsonCoder

type JsonCoder struct {
}

func (*JsonCoder) Decode

func (j *JsonCoder) Decode(data []byte, to interface{}) error

func (*JsonCoder) Encode

func (j *JsonCoder) Encode(data interface{}) ([]byte, error)

Jump to

Keyboard shortcuts

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