codec

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: MIT Imports: 0 Imported by: 2

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

type Codec

type Codec interface {
	Init(...Option)
	Marshal(interface{}) ([]byte, error)
	Unmarshal([]byte, interface{}) error
}

type Marshal

type Marshal func(interface{}) ([]byte, error)

type Option

type Option func(options *Options)

func DisableEscapeHTML

func DisableEscapeHTML() Option

func EnableEscapeHTML

func EnableEscapeHTML() Option

func SetIndent

func SetIndent(indent string) Option

func SetPrefix

func SetPrefix(prefix string) Option

type Options

type Options struct {
	EscapeHTML bool
	Indent     string
	Prefix     string
}

type Unmarshal

type Unmarshal func([]byte, interface{}) error

Directories

Path Synopsis
wechat module

Jump to

Keyboard shortcuts

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