codec

package
v1.8.32 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: Apache-2.0 Imports: 11 Imported by: 63

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteCodec added in v1.3.1

type ByteCodec struct{}

ByteCodec uses raw slice pf bytes and don't encode/decode.

func (ByteCodec) Decode added in v1.3.1

func (c ByteCodec) Decode(data []byte, i interface{}) error

Decode returns raw slice of bytes.

func (ByteCodec) Encode added in v1.3.1

func (c ByteCodec) Encode(i interface{}) ([]byte, error)

Encode returns raw slice of bytes.

type Codec added in v1.3.1

type Codec interface {
	Encode(i interface{}) ([]byte, error)
	Decode(data []byte, i interface{}) error
}

Codec defines the interface that decode/encode payload.

type JSONCodec added in v1.3.1

type JSONCodec struct{}

JSONCodec uses json marshaler and unmarshaler.

func (JSONCodec) Decode added in v1.3.1

func (c JSONCodec) Decode(data []byte, i interface{}) error

Decode decodes an object from slice of bytes.

func (JSONCodec) Encode added in v1.3.1

func (c JSONCodec) Encode(i interface{}) ([]byte, error)

Encode encodes an object into slice of bytes.

type MsgpackCodec added in v1.3.1

type MsgpackCodec struct{}

MsgpackCodec uses messagepack marshaler and unmarshaler.

func (MsgpackCodec) Decode added in v1.3.1

func (c MsgpackCodec) Decode(data []byte, i interface{}) error

Decode decodes an object from slice of bytes.

func (MsgpackCodec) Encode added in v1.3.1

func (c MsgpackCodec) Encode(i interface{}) ([]byte, error)

Encode encodes an object into slice of bytes.

type PBCodec added in v1.3.1

type PBCodec struct{}

PBCodec uses protobuf marshaler and unmarshaler.

func (PBCodec) Decode added in v1.3.1

func (c PBCodec) Decode(data []byte, i interface{}) error

Decode decodes an object from slice of bytes.

func (PBCodec) Encode added in v1.3.1

func (c PBCodec) Encode(i interface{}) ([]byte, error)

Encode encodes an object into slice of bytes.

type ThriftCodec added in v1.4.1

type ThriftCodec struct{}

func (ThriftCodec) Decode added in v1.4.1

func (c ThriftCodec) Decode(data []byte, i interface{}) error

func (ThriftCodec) Encode added in v1.4.1

func (c ThriftCodec) Encode(i interface{}) ([]byte, error)

Jump to

Keyboard shortcuts

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