codec

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CodecType

type CodecType int

codec define

const (
	Codec_Protobuf CodecType = iota
	Codec_Json
)

type JsonCodec

type JsonCodec interface {
	GetName() string
}

type JsonMarshaler

type JsonMarshaler struct {
}

func (*JsonMarshaler) Marshal

func (m *JsonMarshaler) Marshal(v interface{}) ([]byte, error)

func (*JsonMarshaler) String

func (m *JsonMarshaler) String() string

func (*JsonMarshaler) Unmarshal

func (m *JsonMarshaler) Unmarshal(data []byte, rtype reflect.Type) (interface{}, error)

type Marshaler

type Marshaler interface {
	Marshal(interface{}) ([]byte, error)
	Unmarshal([]byte, reflect.Type) (interface{}, error)
	String() string
}

Marshaler is a simple encoding interface used for the broker/transport where headers are not supported by the underlying implementation.

type ProtoBufMarshaler

type ProtoBufMarshaler struct {
}

func (*ProtoBufMarshaler) Marshal

func (m *ProtoBufMarshaler) Marshal(v interface{}) ([]byte, error)

func (*ProtoBufMarshaler) String

func (m *ProtoBufMarshaler) String() string

func (*ProtoBufMarshaler) Unmarshal

func (m *ProtoBufMarshaler) Unmarshal(data []byte, rtype reflect.Type) (interface{}, error)

Jump to

Keyboard shortcuts

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