codec

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotString = errors.New("value returned by FormatEncoder is not a string type")

Functions

This section is empty.

Types

type Decoder

type Decoder interface {
	Decode([]byte) map[string]interface{}
}

func NewDecoder

func NewDecoder(t string) Decoder

type Encoder

type Encoder interface {
	Encode(interface{}) ([]byte, error)
}

func NewEncoder

func NewEncoder(t string) Encoder

type FormatEncoder added in v1.7.9

type FormatEncoder struct {
	// contains filtered or unexported fields
}

func NewFormatEncoder added in v1.7.9

func NewFormatEncoder(format string) *FormatEncoder

func (*FormatEncoder) Encode added in v1.7.9

func (e *FormatEncoder) Encode(v interface{}) ([]byte, error)

type JsonDecoder

type JsonDecoder struct {
	// contains filtered or unexported fields
}

func (*JsonDecoder) Decode

func (jd *JsonDecoder) Decode(value []byte) map[string]interface{}

type JsonEncoder

type JsonEncoder struct{}

func (*JsonEncoder) Encode

func (e *JsonEncoder) Encode(v interface{}) ([]byte, error)

type PlainDecoder

type PlainDecoder struct {
}

func (*PlainDecoder) Decode

func (d *PlainDecoder) Decode(value []byte) map[string]interface{}

Jump to

Keyboard shortcuts

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