protox

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(m Message) ([]byte, error)

func MarshalToString added in v0.1.1

func MarshalToString(v Message) (string, error)

func Unmarshal

func Unmarshal(b []byte, m Message) error

func UnmarshalFromReader added in v0.1.1

func UnmarshalFromReader(r io.Reader, m Message) error

func UnmarshalFromString added in v0.1.1

func UnmarshalFromString(str string, m Message) error

func WrapError

func WrapError(err error) error

Types

type Codec added in v0.1.1

type Codec interface {
	// Marshal returns the wire format of v.
	Marshal(v Message) ([]byte, error)
	// MarshalToString returns the wire format of v.
	MarshalToString(v Message) (string, error)
	// Unmarshal parses the wire format into v.
	Unmarshal(data []byte, v interface{}) error
	// UnmarshalFromString parses the wire format into v.
	UnmarshalFromString(str string, v interface{}) error
	// UnmarshalFromReader parses the wire format into v.
	UnmarshalFromReader(reader io.Reader, v interface{}) error
	// Name returns the name of the Codec implementation. The returned string
	// will be used as part of content type in transmission.  The result must be
	// static; the result cannot change between calls.
	Name() string
}

Codec defines the interface Transport uses to marshal and unmarshals messages. Note that implementations of this interface must be thread safe; a Codec's methods can be called from concurrent goroutines.

type Message

type Message = protoreflect.ProtoMessage

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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