codec

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2023 License: MIT Imports: 1 Imported by: 2

Documentation

Index

Constants

View Source
const (
	JSONCodec = "json"
	XMLCodec  = "xml"
)

Variables

View Source
var (
	ErrNoMarshal   = errors.New("no code")
	ErrNoUnmarshal = errors.New("no unmarshal")
)

Functions

This section is empty.

Types

type Codec

type Codec interface {
	Marshal(interface{}) ([]byte, error)
	Unmarshal([]byte, interface{}) error
	Name() string
}

type Codecs added in v0.2.6

type Codecs map[string]Codec

func (Codecs) Get added in v0.2.6

func (cs Codecs) Get(name string) Codec

func (Codecs) Set added in v0.2.6

func (cs Codecs) Set(name string, codec Codec)

type Option

type Option func(*Options)

func WithEscapeHTML added in v0.2.6

func WithEscapeHTML(on bool) Option

func WithIndent added in v0.2.6

func WithIndent(prefix, indent string) Option

type Options

type Options struct {
	EscapeHTML   bool
	IndentPrefix string
	IndentValue  string
}

Directories

Path Synopsis
wechat module

Jump to

Keyboard shortcuts

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