codec

package
v0.0.0-...-11bda66 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = make(Map)
View Source
var DefaultField = Default.
	RegisterMap("field", 50, make(Map))
View Source
var DefaultStruct = Default.
	RegisterMap("struct", 100, make(Map))

Functions

This section is empty.

Types

type Field

type Field struct {
	Type    string
	Convert func(interface{}) (interface{}, error)
}

func (Field) Decode

func (f Field) Decode(key string, o big.Struct) error

func (Field) Encode

func (f Field) Encode(key string, o big.Struct) error

func (Field) GoString

func (f Field) GoString() string

type Func

type Func func(typ string, m Map) error

type Map

type Map map[string]struct {
	Codec    big.Codec
	Priority int
	Children Map
}

func (Map) Codec

func (m Map) Codec(typ string) big.Codec

func (Map) Decode

func (m Map) Decode(key string, o big.Struct) error

func (Map) Encode

func (m Map) Encode(key string, o big.Struct) error

func (Map) GoString

func (m Map) GoString() string

func (Map) Keys

func (m Map) Keys() []string

func (Map) Register

func (m Map) Register(name string, c big.Codec) Map

func (Map) RegisterMap

func (m Map) RegisterMap(name string, priority int, cm Map) Map

func (Map) String

func (m Map) String() string

func (Map) Walk

func (m Map) Walk(fn Func) error

func (Map) WriteTab

func (m Map) WriteTab(w io.Writer) (n int64, err error)

func (Map) WriteTo

func (m Map) WriteTo(w io.Writer) (int64, error)

type Struct

type Struct struct {
	Type      string
	Marshal   func(interface{}) ([]byte, error)
	Unmarshal func([]byte, interface{}) error
}

func (Struct) Decode

func (s Struct) Decode(key string, o big.Struct) error

func (Struct) Encode

func (s Struct) Encode(key string, o big.Struct) error

func (Struct) GoString

func (s Struct) GoString() string

type Template

type Template struct {
	Data  interface{}
	Funcs map[string]interface{}
}

func (Template) Decode

func (t Template) Decode(key string, o big.Struct) error

func (Template) Encode

func (t Template) Encode(key string, o big.Struct) error

func (Template) GoString

func (Template) GoString() string

Jump to

Keyboard shortcuts

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