message

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Type                 int32    `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"`
	Payload              *any.Any `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

消息

func (*Message) Descriptor

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

func (*Message) GetPayload

func (m *Message) GetPayload() *any.Any

func (*Message) GetType

func (m *Message) GetType() int32

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) Reset

func (m *Message) Reset()

func (*Message) String

func (m *Message) String() string

func (*Message) XXX_DiscardUnknown

func (m *Message) XXX_DiscardUnknown()

func (*Message) XXX_Marshal

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

func (*Message) XXX_Merge

func (dst *Message) XXX_Merge(src proto.Message)

func (*Message) XXX_Size

func (m *Message) XXX_Size() int

func (*Message) XXX_Unmarshal

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

type Registry

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

Registry 消息类型注册

func NewRegistry

func NewRegistry() *Registry

NewRegistry 新建实例

func (*Registry) Add

func (r *Registry) Add(msgType Type, payload interface{})

Add 新增

func (*Registry) New

func (r *Registry) New(msgType Type) (v interface{}, found bool)

New 根据类型创建实例

type Type

type Type int32

Type 消息类型

Jump to

Keyboard shortcuts

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