proto

package
v2.9.1 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2020 License: Apache-2.0 Imports: 6 Imported by: 5

Documentation

Overview

Package proto provides a proto codec

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCodec

func NewCodec(c io.ReadWriteCloser) codec.Codec

Types

type Codec

type Codec struct {
	Conn io.ReadWriteCloser
}

func (*Codec) Close

func (c *Codec) Close() error

func (*Codec) ReadBody

func (c *Codec) ReadBody(b interface{}) error

func (*Codec) ReadHeader

func (c *Codec) ReadHeader(m *codec.Message, t codec.MessageType) error

func (*Codec) String

func (c *Codec) String() string

func (*Codec) Write

func (c *Codec) Write(m *codec.Message, b interface{}) error

type Marshaler

type Marshaler struct{}

func (Marshaler) Marshal

func (Marshaler) Marshal(v interface{}) ([]byte, error)

func (Marshaler) String

func (Marshaler) String() string

func (Marshaler) Unmarshal

func (Marshaler) Unmarshal(data []byte, v interface{}) error

type Message added in v2.5.0

type Message struct {
	Data []byte
}

func NewMessage added in v2.5.0

func NewMessage(data []byte) *Message

func (*Message) Marshal added in v2.5.0

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

func (*Message) MarshalJSON added in v2.5.0

func (m *Message) MarshalJSON() ([]byte, error)

func (*Message) ProtoMessage added in v2.5.0

func (m *Message) ProtoMessage()

func (*Message) Reset added in v2.5.0

func (m *Message) Reset()

func (*Message) String added in v2.5.0

func (m *Message) String() string

func (*Message) Unmarshal added in v2.5.0

func (m *Message) Unmarshal(data []byte) error

func (*Message) UnmarshalJSON added in v2.5.0

func (m *Message) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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