proto

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2025 License: Apache-2.0 Imports: 4 Imported by: 20

Documentation

Overview

Package proto implements a marshaler interface for protocol buffers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Proto

type Proto struct{}

Proto is a proto marshaler that can encode and decode protocol buffers.

func (*Proto) ContentTypes

func (p *Proto) ContentTypes() []string

ContentTypes returns the list of content types this marshaller is able to handle.

func (*Proto) Exts

func (p *Proto) Exts() []string

Exts is a list of file extensions this marshaler supports.

func (*Proto) Marshal added in v0.2.0

func (p *Proto) Marshal(value interface{}) ([]byte, error)

Marshal encodes "value" into Proto.

func (*Proto) Marshals added in v0.2.0

func (p *Proto) Marshals(v any) bool

Marshals returns if this is able to encode the given type.

func (*Proto) Name added in v0.2.0

func (p *Proto) Name() string

Name returns the codec name.

func (*Proto) NewDecoder

func (p *Proto) NewDecoder(reader io.Reader) codecs.Decoder

NewDecoder returns a Decoder which reads proto stream from "reader".

func (*Proto) NewEncoder

func (p *Proto) NewEncoder(writer io.Writer) codecs.Encoder

NewEncoder returns an Encoder which writes proto stream into "writer".

func (*Proto) Unmarshal added in v0.2.0

func (p *Proto) Unmarshal(data []byte, value interface{}) error

Unmarshal decodes proto "data" into "value".

func (*Proto) Unmarshals added in v0.2.0

func (p *Proto) Unmarshals(v any) bool

Unmarshals returns if this is able to decode the given type.

Jump to

Keyboard shortcuts

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