types

package
v0.0.0-...-118864b Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2020 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTypes          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
)

Functions

This section is empty.

Types

type Header struct {
	Fields []HeaderField `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields"`
}

func NewHeader

func NewHeader() Header

NewHeader returns a new header

func (*Header) Descriptor

func (*Header) Descriptor() ([]byte, []int)

func (Header) Get

func (h Header) Get(key string) ([]byte, bool)

Get gets the first value associated with the given key.

func (Header) Keys

func (h Header) Keys() []string

Keys returns all keys in the header

func (*Header) Marshal

func (m *Header) Marshal() (dAtA []byte, err error)

func (*Header) MarshalTo

func (m *Header) MarshalTo(dAtA []byte) (int, error)

func (*Header) MarshalToSizedBuffer

func (m *Header) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Header) ProtoMessage

func (*Header) ProtoMessage()

func (*Header) Reset

func (m *Header) Reset()

func (*Header) Set

func (h *Header) Set(key string, value []byte)

Set sets the header fields associated with key to the single element value.

func (*Header) Size

func (m *Header) Size() (n int)

func (*Header) String

func (m *Header) String() string

func (*Header) Unmarshal

func (m *Header) Unmarshal(dAtA []byte) error

func (*Header) XXX_DiscardUnknown

func (m *Header) XXX_DiscardUnknown()

func (*Header) XXX_Marshal

func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Header) XXX_Merge

func (m *Header) XXX_Merge(src proto.Message)

func (*Header) XXX_Size

func (m *Header) XXX_Size() int

func (*Header) XXX_Unmarshal

func (m *Header) XXX_Unmarshal(b []byte) error

type HeaderField

type HeaderField struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}

func (*HeaderField) Descriptor

func (*HeaderField) Descriptor() ([]byte, []int)

func (*HeaderField) Marshal

func (m *HeaderField) Marshal() (dAtA []byte, err error)

func (*HeaderField) MarshalTo

func (m *HeaderField) MarshalTo(dAtA []byte) (int, error)

func (*HeaderField) MarshalToSizedBuffer

func (m *HeaderField) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*HeaderField) ProtoMessage

func (*HeaderField) ProtoMessage()

func (*HeaderField) Reset

func (m *HeaderField) Reset()

func (*HeaderField) Size

func (m *HeaderField) Size() (n int)

func (*HeaderField) String

func (m *HeaderField) String() string

func (*HeaderField) Unmarshal

func (m *HeaderField) Unmarshal(dAtA []byte) error

func (*HeaderField) XXX_DiscardUnknown

func (m *HeaderField) XXX_DiscardUnknown()

func (*HeaderField) XXX_Marshal

func (m *HeaderField) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HeaderField) XXX_Merge

func (m *HeaderField) XXX_Merge(src proto.Message)

func (*HeaderField) XXX_Size

func (m *HeaderField) XXX_Size() int

func (*HeaderField) XXX_Unmarshal

func (m *HeaderField) XXX_Unmarshal(b []byte) error

type HeaderI

type HeaderI interface {
	Get(key string) ([]byte, bool)
	Set(key string, value []byte)
	Keys() []string
}

HeaderI defines the standard header for a packet data.

type PacketData

type PacketData struct {
	Header  Header  `protobuf:"bytes,1,opt,name=header,proto3" json:"header"`
	Payload Payload `protobuf:"bytes,2,opt,name=payload,proto3,casttype=Payload" json:"payload,omitempty"`
}

func NewSimplePacketData

func NewSimplePacketData(h Header, payload []byte) PacketData

NewSimplePacketData returns a new packet data

func (*PacketData) Descriptor

func (*PacketData) Descriptor() ([]byte, []int)

func (PacketData) GetHeader

func (pd PacketData) GetHeader() HeaderI

GetHeader returns a header

func (PacketData) GetPayload

func (pd PacketData) GetPayload() Payload

GetPayload returns a payload

func (*PacketData) Marshal

func (m *PacketData) Marshal() (dAtA []byte, err error)

func (*PacketData) MarshalTo

func (m *PacketData) MarshalTo(dAtA []byte) (int, error)

func (*PacketData) MarshalToSizedBuffer

func (m *PacketData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PacketData) ProtoMessage

func (*PacketData) ProtoMessage()

func (*PacketData) Reset

func (m *PacketData) Reset()

func (*PacketData) Size

func (m *PacketData) Size() (n int)

func (*PacketData) String

func (m *PacketData) String() string

func (*PacketData) Unmarshal

func (m *PacketData) Unmarshal(dAtA []byte) error

func (*PacketData) XXX_DiscardUnknown

func (m *PacketData) XXX_DiscardUnknown()

func (*PacketData) XXX_Marshal

func (m *PacketData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PacketData) XXX_Merge

func (m *PacketData) XXX_Merge(src proto.Message)

func (*PacketData) XXX_Size

func (m *PacketData) XXX_Size() int

func (*PacketData) XXX_Unmarshal

func (m *PacketData) XXX_Unmarshal(b []byte) error

type PacketDataI

type PacketDataI interface {
	GetHeader() HeaderI
	GetPayload() Payload
}

PacketDataI defines the standard packet data.

type Payload

type Payload = json.RawMessage

Payload is a raw encoded JSON value.

Jump to

Keyboard shortcuts

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