encoding

package
v0.0.0-...-0352b5b Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONCodec

type JSONCodec struct{}

JSONCodec is easyjson codec used for code generated by protogen. It is binary-level compatible with the standard protojson format, thus uses the same name.

func (JSONCodec) Marshal

func (JSONCodec) Marshal(v any) ([]byte, error)

Marshal implements the encoding.Codec interface.

func (JSONCodec) Name

func (JSONCodec) Name() string

Name implements the encoding.Codec interface.

func (JSONCodec) Unmarshal

func (JSONCodec) Unmarshal(data []byte, v any) error

Unmarshal implements the encoding.Codec interface.

type ProtoCodec

type ProtoCodec struct{}

ProtoCodec is easyproto codec used for code generated by protogen. It is binary-level compatible with the standard proto codec, thus uses the same name.

func (ProtoCodec) Marshal

func (ProtoCodec) Marshal(v any) ([]byte, error)

Marshal implements the encoding.Codec interface.

func (ProtoCodec) Name

func (ProtoCodec) Name() string

Name implements the encoding.Codec interface.

func (ProtoCodec) Unmarshal

func (ProtoCodec) Unmarshal(data []byte, v any) error

Unmarshal implements the encoding.Codec interface.

type ProtoMarshaler

type ProtoMarshaler interface {
	MarshalProtobuf([]byte) []byte
}

ProtoMarshaler is an interface accepted by ProtoCodec.Marshal.

type ProtoUnmarshaler

type ProtoUnmarshaler interface {
	UnmarshalProtobuf([]byte) error
}

ProtoUnmarshaler is an interface accepted by ProtoCodec.Unmarshal.

Jump to

Keyboard shortcuts

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