codec

package
v1.13.2 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "proto"

Name is the name by which the proxy codec is registered in the encoding codec registry We have to say that we are the "proto" codec otherwise marshaling will fail.

Variables

This section is empty.

Functions

func Register

func Register()

Register manually registers the codec.

Types

type Frame

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

Frame holds the proxy transported data.

func (*Frame) ProtoMessage

func (f *Frame) ProtoMessage()

ProtoMessage tags a frame as valid proto message.

func (Frame) Raw

func (f Frame) Raw() []byte

Raw returns the raw message. This is primarily useful for debugging.

type Proxy

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

Proxy satisfies the encoding.Codec interface.

func (*Proxy) Marshal

func (p *Proxy) Marshal(v any) ([]byte, error)

Marshal implements the encoding.Codec interface method.

func (*Proxy) Name

func (*Proxy) Name() string

Name implements the encoding.Codec interface method.

func (*Proxy) Unmarshal

func (p *Proxy) Unmarshal(data []byte, v any) error

Unmarshal implements the encoding.Codec interface method.

Jump to

Keyboard shortcuts

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