rpcx: github.com/smallnest/rpcx/codec Index | Files

package codec

import "github.com/smallnest/rpcx/codec"

Index

Package Files

codec.go

type ByteCodec Uses

type ByteCodec struct{}

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

func (ByteCodec) Decode Uses

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

Decode returns raw slice of bytes.

func (ByteCodec) Encode Uses

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

Encode returns raw slice of bytes.

type Codec Uses

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

Codec defines the interface that decode/encode payload.

type JSONCodec Uses

type JSONCodec struct{}

JSONCodec uses json marshaler and unmarshaler.

func (JSONCodec) Decode Uses

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

Decode decodes an object from slice of bytes.

func (JSONCodec) Encode Uses

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

Encode encodes an object into slice of bytes.

type MsgpackCodec Uses

type MsgpackCodec struct{}

MsgpackCodec uses messagepack marshaler and unmarshaler.

func (MsgpackCodec) Decode Uses

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

Decode decodes an object from slice of bytes.

func (MsgpackCodec) Encode Uses

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

Encode encodes an object into slice of bytes.

type PBCodec Uses

type PBCodec struct{}

PBCodec uses protobuf marshaler and unmarshaler.

func (PBCodec) Decode Uses

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

Decode decodes an object from slice of bytes.

func (PBCodec) Encode Uses

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

Encode encodes an object into slice of bytes.

type ThriftCodec Uses

type ThriftCodec struct{}

func (ThriftCodec) Decode Uses

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

func (ThriftCodec) Encode Uses

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

Package codec imports 9 packages (graph) and is imported by 19 packages. Updated 2019-02-13. Refresh now. Tools for package owners.