protocol

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: BSD-3-Clause Imports: 13 Imported by: 0

README

protocol

消息协议内容

包含消息协议相关的API

Documentation

Index

Constants

View Source
const (
	InstanceAuto = 0    // 自动分配实例
	InstanceAll  = 0xFF // 选取所有实例

	SessionAll = 0xFFFFFFFF // 广播给所有session
	ServiceAll = 0xFF       // 所有服务
)
View Source
const (
	ErrBadRequest            = 101 // 错误的请求
	ErrInvalidArgument       = 102 // 参数错误
	ErrOperationNotSupported = 103 // 不支持当前操作
	ErrOperationTooOften     = 104 // 操作过于频繁
	ErrRequestTimeout        = 105 // 请求超时
	ErrDataCodecFailure      = 106 // 数据编码错误
	ErrProtocolIncompatible  = 107 // 协议不兼容
	ErrRpcTimeout            = 108 // RPC超时
	ErrDuplicateRegistration = 201 // 服务重复注册
	ErrRegistrationDenied    = 202 // 服务注册被拒绝
	ErrServerInternalError   = 203 // 服务器内部错误
	ErrServerMaintenance     = 204 // 服务器维护中
	ErrServiceNotAvailable   = 205 // 服务不可用
	ErrServiceBusy           = 206 // 服务正忙
	ErrDBException           = 207 // 数据库异常
	ErrSessionNotFound       = 208 // 未找到会话
)

错误码,定义与errno.proto一致

Variables

View Source
var (
	ErrInvalidLengthInternalMsg        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowInternalMsg          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupInternalMsg = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthInternalStruct        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowInternalStruct          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupInternalStruct = fmt.Errorf("proto: unexpected end of group")
)
View Source
var InternalMsgType_name = map[int32]string{
	0:   "MSG_INTERNAL_RESERVED",
	104: "MSG_INTERNAL_REGISTER",
	105: "MSG_INTERNAL_REGISTER_STATUS",
	106: "MSG_INTERNAL_INTRODUCE",
	107: "MSG_INTERNAL_INTRODUCE_STATUS",
	123: "MSG_INTERNAL_SUBSCRIBE",
	124: "MSG_INTERNAL_SUBSCRIBE_STATUS",
	101: "MSG_INTERNAL_KEEP_ALIVE",
	102: "MSG_INTERNAL_KEEP_ALIVE_STATUS",
	103: "MSG_INTERNAL_INSTANCE_STATE_NOTIFY",
	201: "MSG_INTERNAL_ROUTE_FORWARD",
	202: "MSG_INTERNAL_ROUTE_MULTICAST",
}
View Source
var InternalMsgType_value = map[string]int32{
	"MSG_INTERNAL_RESERVED":              0,
	"MSG_INTERNAL_REGISTER":              104,
	"MSG_INTERNAL_REGISTER_STATUS":       105,
	"MSG_INTERNAL_INTRODUCE":             106,
	"MSG_INTERNAL_INTRODUCE_STATUS":      107,
	"MSG_INTERNAL_SUBSCRIBE":             123,
	"MSG_INTERNAL_SUBSCRIBE_STATUS":      124,
	"MSG_INTERNAL_KEEP_ALIVE":            101,
	"MSG_INTERNAL_KEEP_ALIVE_STATUS":     102,
	"MSG_INTERNAL_INSTANCE_STATE_NOTIFY": 103,
	"MSG_INTERNAL_ROUTE_FORWARD":         201,
	"MSG_INTERNAL_ROUTE_MULTICAST":       202,
}
View Source
var NodeState_name = map[int32]string{
	0: "StateDown",
	1: "StateUp",
}
View Source
var NodeState_value = map[string]int32{
	"StateDown": 0,
	"StateUp":   1,
}

Functions

func CreateMessageBy

func CreateMessageBy(msgId uint32) proto.Message

根据消息ID创建message

func GetMessageIDOf

func GetMessageIDOf(msg proto.Message) uint32

根据message获取消息ID

func RegisterV1

func RegisterV1()

func RegisterV2

func RegisterV2(exName string)

Types

type Environ

type Environ struct {
	AppEnv            string           `protobuf:"bytes,1,opt,name=app_env,json=appEnv,proto3" json:"app_env,omitempty"`
	AppGameId         string           `protobuf:"bytes,2,opt,name=app_game_id,json=appGameId,proto3" json:"app_game_id,omitempty"`
	AppChannelId      string           `protobuf:"bytes,3,opt,name=app_channel_id,json=appChannelId,proto3" json:"app_channel_id,omitempty"`
	AppServerId       string           `protobuf:"bytes,4,opt,name=app_server_id,json=appServerId,proto3" json:"app_server_id,omitempty"`
	AppServerName     string           `protobuf:"bytes,5,opt,name=app_server_name,json=appServerName,proto3" json:"app_server_name,omitempty"`
	AppAccessKey      string           `protobuf:"bytes,6,opt,name=app_access_key,json=appAccessKey,proto3" json:"app_access_key,omitempty"`
	AppLogLevel       string           `protobuf:"bytes,7,opt,name=app_log_level,json=appLogLevel,proto3" json:"app_log_level,omitempty"`
	AppPprofAddr      string           `protobuf:"bytes,19,opt,name=app_pprof_addr,json=appPprofAddr,proto3" json:"app_pprof_addr,omitempty"`
	AppWorkingDir     string           `protobuf:"bytes,20,opt,name=app_working_dir,json=appWorkingDir,proto3" json:"app_working_dir,omitempty"`
	ServiceType       string           `protobuf:"bytes,10,opt,name=service_type,json=serviceType,proto3" json:"service_type,omitempty"`
	ServiceIndex      int32            `protobuf:"varint,11,opt,name=service_index,json=serviceIndex,proto3" json:"service_index,omitempty"`
	ServiceDependency string           `protobuf:"bytes,12,opt,name=service_dependency,json=serviceDependency,proto3" json:"service_dependency,omitempty"`
	EtcdAddr          string           `protobuf:"bytes,13,opt,name=etcd_addr,json=etcdAddr,proto3" json:"etcd_addr,omitempty"`
	EtcdKeyspace      string           `protobuf:"bytes,14,opt,name=etcd_keyspace,json=etcdKeyspace,proto3" json:"etcd_keyspace,omitempty"`
	EtcdLeaseTtl      int32            `protobuf:"varint,15,opt,name=etcd_lease_ttl,json=etcdLeaseTtl,proto3" json:"etcd_lease_ttl,omitempty"`
	NetInterfaces     []*InterfaceAddr `protobuf:"bytes,22,rep,name=net_interfaces,json=netInterfaces,proto3" json:"net_interfaces,omitempty"`
}

通用环境变量

func (*Environ) Descriptor

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

func (*Environ) GetAppAccessKey

func (m *Environ) GetAppAccessKey() string

func (*Environ) GetAppChannelId

func (m *Environ) GetAppChannelId() string

func (*Environ) GetAppEnv

func (m *Environ) GetAppEnv() string

func (*Environ) GetAppGameId

func (m *Environ) GetAppGameId() string

func (*Environ) GetAppLogLevel

func (m *Environ) GetAppLogLevel() string

func (*Environ) GetAppPprofAddr

func (m *Environ) GetAppPprofAddr() string

func (*Environ) GetAppServerId

func (m *Environ) GetAppServerId() string

func (*Environ) GetAppServerName

func (m *Environ) GetAppServerName() string

func (*Environ) GetAppWorkingDir

func (m *Environ) GetAppWorkingDir() string

func (*Environ) GetEtcdAddr

func (m *Environ) GetEtcdAddr() string

func (*Environ) GetEtcdKeyspace

func (m *Environ) GetEtcdKeyspace() string

func (*Environ) GetEtcdLeaseTtl

func (m *Environ) GetEtcdLeaseTtl() int32

func (*Environ) GetNetInterfaces

func (m *Environ) GetNetInterfaces() []*InterfaceAddr

func (*Environ) GetServiceDependency

func (m *Environ) GetServiceDependency() string

func (*Environ) GetServiceIndex

func (m *Environ) GetServiceIndex() int32

func (*Environ) GetServiceType

func (m *Environ) GetServiceType() string

func (*Environ) Marshal

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

func (*Environ) MarshalTo

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

func (*Environ) MarshalToSizedBuffer

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

func (*Environ) ProtoMessage

func (*Environ) ProtoMessage()

func (*Environ) Reset

func (m *Environ) Reset()

func (*Environ) Size

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

func (*Environ) String

func (m *Environ) String() string

func (*Environ) Unmarshal

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

func (*Environ) XXX_DiscardUnknown

func (m *Environ) XXX_DiscardUnknown()

func (*Environ) XXX_Marshal

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

func (*Environ) XXX_Merge

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

func (*Environ) XXX_Size

func (m *Environ) XXX_Size() int

func (*Environ) XXX_Unmarshal

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

type ForwardMsg added in v1.0.5

type ForwardMsg struct {
	Node    uint32 `protobuf:"varint,1,opt,name=node,proto3" json:"node,omitempty"`
	MsgId   uint32 `protobuf:"varint,3,opt,name=msg_id,json=msgId,proto3" json:"msg_id,omitempty"`
	MsgData []byte `protobuf:"bytes,4,opt,name=msg_data,json=msgData,proto3" json:"msg_data,omitempty"`
}

转发消息

func (*ForwardMsg) Descriptor added in v1.0.5

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

func (*ForwardMsg) GetMsgData added in v1.0.5

func (m *ForwardMsg) GetMsgData() []byte

func (*ForwardMsg) GetMsgId added in v1.0.5

func (m *ForwardMsg) GetMsgId() uint32

func (*ForwardMsg) GetNode added in v1.0.5

func (m *ForwardMsg) GetNode() uint32

func (*ForwardMsg) Marshal added in v1.0.5

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

func (*ForwardMsg) MarshalTo added in v1.0.5

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

func (*ForwardMsg) MarshalToSizedBuffer added in v1.0.5

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

func (*ForwardMsg) ProtoMessage added in v1.0.5

func (*ForwardMsg) ProtoMessage()

func (*ForwardMsg) Reset added in v1.0.5

func (m *ForwardMsg) Reset()

func (*ForwardMsg) Size added in v1.0.5

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

func (*ForwardMsg) String added in v1.0.5

func (m *ForwardMsg) String() string

func (*ForwardMsg) Unmarshal added in v1.0.5

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

func (*ForwardMsg) XXX_DiscardUnknown added in v1.0.5

func (m *ForwardMsg) XXX_DiscardUnknown()

func (*ForwardMsg) XXX_Marshal added in v1.0.5

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

func (*ForwardMsg) XXX_Merge added in v1.0.5

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

func (*ForwardMsg) XXX_Size added in v1.0.5

func (m *ForwardMsg) XXX_Size() int

func (*ForwardMsg) XXX_Unmarshal added in v1.0.5

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

type InstanceStateNtf added in v1.0.2

type InstanceStateNtf struct {
	State NodeState `protobuf:"varint,1,opt,name=state,proto3,enum=protocol.NodeState" json:"state,omitempty"`
	Peers []uint32  `protobuf:"varint,2,rep,packed,name=peers,proto3" json:"peers,omitempty"`
}

节点状态变化通知

func (*InstanceStateNtf) Descriptor added in v1.0.2

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

func (*InstanceStateNtf) GetPeers added in v1.0.2

func (m *InstanceStateNtf) GetPeers() []uint32

func (*InstanceStateNtf) GetState added in v1.0.2

func (m *InstanceStateNtf) GetState() NodeState

func (*InstanceStateNtf) Marshal added in v1.0.2

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

func (*InstanceStateNtf) MarshalTo added in v1.0.2

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

func (*InstanceStateNtf) MarshalToSizedBuffer added in v1.0.2

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

func (*InstanceStateNtf) ProtoMessage added in v1.0.2

func (*InstanceStateNtf) ProtoMessage()

func (*InstanceStateNtf) Reset added in v1.0.2

func (m *InstanceStateNtf) Reset()

func (*InstanceStateNtf) Size added in v1.0.2

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

func (*InstanceStateNtf) String added in v1.0.2

func (m *InstanceStateNtf) String() string

func (*InstanceStateNtf) Unmarshal added in v1.0.2

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

func (*InstanceStateNtf) XXX_DiscardUnknown added in v1.0.2

func (m *InstanceStateNtf) XXX_DiscardUnknown()

func (*InstanceStateNtf) XXX_Marshal added in v1.0.2

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

func (*InstanceStateNtf) XXX_Merge added in v1.0.2

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

func (*InstanceStateNtf) XXX_Size added in v1.0.2

func (m *InstanceStateNtf) XXX_Size() int

func (*InstanceStateNtf) XXX_Unmarshal added in v1.0.2

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

type InterfaceAddr

type InterfaceAddr struct {
	BindAddr      string `protobuf:"bytes,1,opt,name=bind_addr,json=bindAddr,proto3" json:"bind_addr,omitempty"`
	AdvertiseAddr string `protobuf:"bytes,2,opt,name=advertise_addr,json=advertiseAddr,proto3" json:"advertise_addr,omitempty"`
	Port          int32  `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"`
}

地址接口,对外地址@bind地址:端口,如example.com@0.0.0.0:9527

func (*InterfaceAddr) Descriptor

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

func (*InterfaceAddr) GetAdvertiseAddr

func (m *InterfaceAddr) GetAdvertiseAddr() string

func (*InterfaceAddr) GetBindAddr

func (m *InterfaceAddr) GetBindAddr() string

func (*InterfaceAddr) GetPort

func (m *InterfaceAddr) GetPort() int32

func (*InterfaceAddr) Marshal

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

func (*InterfaceAddr) MarshalTo

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

func (*InterfaceAddr) MarshalToSizedBuffer

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

func (*InterfaceAddr) ProtoMessage

func (*InterfaceAddr) ProtoMessage()

func (*InterfaceAddr) Reset

func (m *InterfaceAddr) Reset()

func (*InterfaceAddr) Size

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

func (*InterfaceAddr) String

func (m *InterfaceAddr) String() string

func (*InterfaceAddr) Unmarshal

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

func (*InterfaceAddr) XXX_DiscardUnknown

func (m *InterfaceAddr) XXX_DiscardUnknown()

func (*InterfaceAddr) XXX_Marshal

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

func (*InterfaceAddr) XXX_Merge

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

func (*InterfaceAddr) XXX_Size

func (m *InterfaceAddr) XXX_Size() int

func (*InterfaceAddr) XXX_Unmarshal

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

type InternalMsgType added in v1.0.2

type InternalMsgType int32

内部消息协议

const (
	// 内部通信协议 [100 - 1000)
	MSG_INTERNAL_RESERVED              InternalMsgType = 0
	MSG_INTERNAL_REGISTER              InternalMsgType = 104
	MSG_INTERNAL_REGISTER_STATUS       InternalMsgType = 105
	MSG_INTERNAL_INTRODUCE             InternalMsgType = 106
	MSG_INTERNAL_INTRODUCE_STATUS      InternalMsgType = 107
	MSG_INTERNAL_SUBSCRIBE             InternalMsgType = 123
	MSG_INTERNAL_SUBSCRIBE_STATUS      InternalMsgType = 124
	MSG_INTERNAL_KEEP_ALIVE            InternalMsgType = 101
	MSG_INTERNAL_KEEP_ALIVE_STATUS     InternalMsgType = 102
	MSG_INTERNAL_INSTANCE_STATE_NOTIFY InternalMsgType = 103
	MSG_INTERNAL_ROUTE_FORWARD         InternalMsgType = 201
	MSG_INTERNAL_ROUTE_MULTICAST       InternalMsgType = 202
)

func (InternalMsgType) EnumDescriptor added in v1.0.2

func (InternalMsgType) EnumDescriptor() ([]byte, []int)

func (InternalMsgType) String added in v1.0.2

func (x InternalMsgType) String() string

type KeepAliveAck added in v1.0.2

type KeepAliveAck struct {
	Time int64 `protobuf:"varint,1,opt,name=time,proto3" json:"time,omitempty"`
}

func (*KeepAliveAck) Descriptor added in v1.0.2

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

func (*KeepAliveAck) GetTime added in v1.0.2

func (m *KeepAliveAck) GetTime() int64

func (*KeepAliveAck) Marshal added in v1.0.2

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

func (*KeepAliveAck) MarshalTo added in v1.0.2

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

func (*KeepAliveAck) MarshalToSizedBuffer added in v1.0.2

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

func (*KeepAliveAck) ProtoMessage added in v1.0.2

func (*KeepAliveAck) ProtoMessage()

func (*KeepAliveAck) Reset added in v1.0.2

func (m *KeepAliveAck) Reset()

func (*KeepAliveAck) Size added in v1.0.2

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

func (*KeepAliveAck) String added in v1.0.2

func (m *KeepAliveAck) String() string

func (*KeepAliveAck) Unmarshal added in v1.0.2

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

func (*KeepAliveAck) XXX_DiscardUnknown added in v1.0.2

func (m *KeepAliveAck) XXX_DiscardUnknown()

func (*KeepAliveAck) XXX_Marshal added in v1.0.2

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

func (*KeepAliveAck) XXX_Merge added in v1.0.2

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

func (*KeepAliveAck) XXX_Size added in v1.0.2

func (m *KeepAliveAck) XXX_Size() int

func (*KeepAliveAck) XXX_Unmarshal added in v1.0.2

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

type KeepAliveReq added in v1.0.2

type KeepAliveReq struct {
	Time int64 `protobuf:"varint,1,opt,name=time,proto3" json:"time,omitempty"`
	Load int64 `protobuf:"varint,2,opt,name=load,proto3" json:"load,omitempty"`
}

心跳

func (*KeepAliveReq) Descriptor added in v1.0.2

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

func (*KeepAliveReq) GetLoad added in v1.0.2

func (m *KeepAliveReq) GetLoad() int64

func (*KeepAliveReq) GetTime added in v1.0.2

func (m *KeepAliveReq) GetTime() int64

func (*KeepAliveReq) Marshal added in v1.0.2

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

func (*KeepAliveReq) MarshalTo added in v1.0.2

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

func (*KeepAliveReq) MarshalToSizedBuffer added in v1.0.2

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

func (*KeepAliveReq) ProtoMessage added in v1.0.2

func (*KeepAliveReq) ProtoMessage()

func (*KeepAliveReq) Reset added in v1.0.2

func (m *KeepAliveReq) Reset()

func (*KeepAliveReq) Size added in v1.0.2

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

func (*KeepAliveReq) String added in v1.0.2

func (m *KeepAliveReq) String() string

func (*KeepAliveReq) Unmarshal added in v1.0.2

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

func (*KeepAliveReq) XXX_DiscardUnknown added in v1.0.2

func (m *KeepAliveReq) XXX_DiscardUnknown()

func (*KeepAliveReq) XXX_Marshal added in v1.0.2

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

func (*KeepAliveReq) XXX_Merge added in v1.0.2

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

func (*KeepAliveReq) XXX_Size added in v1.0.2

func (m *KeepAliveReq) XXX_Size() int

func (*KeepAliveReq) XXX_Unmarshal added in v1.0.2

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

type MulticastMsg added in v1.0.5

type MulticastMsg struct {
	Nodes   []uint32 `protobuf:"varint,1,rep,packed,name=nodes,proto3" json:"nodes,omitempty"`
	MsgId   uint32   `protobuf:"varint,2,opt,name=msg_id,json=msgId,proto3" json:"msg_id,omitempty"`
	MsgData []byte   `protobuf:"bytes,3,opt,name=msg_data,json=msgData,proto3" json:"msg_data,omitempty"`
}

组播消息

func (*MulticastMsg) Descriptor added in v1.0.5

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

func (*MulticastMsg) GetMsgData added in v1.0.5

func (m *MulticastMsg) GetMsgData() []byte

func (*MulticastMsg) GetMsgId added in v1.0.5

func (m *MulticastMsg) GetMsgId() uint32

func (*MulticastMsg) GetNodes added in v1.0.5

func (m *MulticastMsg) GetNodes() []uint32

func (*MulticastMsg) Marshal added in v1.0.5

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

func (*MulticastMsg) MarshalTo added in v1.0.5

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

func (*MulticastMsg) MarshalToSizedBuffer added in v1.0.5

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

func (*MulticastMsg) ProtoMessage added in v1.0.5

func (*MulticastMsg) ProtoMessage()

func (*MulticastMsg) Reset added in v1.0.5

func (m *MulticastMsg) Reset()

func (*MulticastMsg) Size added in v1.0.5

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

func (*MulticastMsg) String added in v1.0.5

func (m *MulticastMsg) String() string

func (*MulticastMsg) Unmarshal added in v1.0.5

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

func (*MulticastMsg) XXX_DiscardUnknown added in v1.0.5

func (m *MulticastMsg) XXX_DiscardUnknown()

func (*MulticastMsg) XXX_Marshal added in v1.0.5

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

func (*MulticastMsg) XXX_Merge added in v1.0.5

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

func (*MulticastMsg) XXX_Size added in v1.0.5

func (m *MulticastMsg) XXX_Size() int

func (*MulticastMsg) XXX_Unmarshal added in v1.0.5

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

type NodeInfo added in v1.0.2

type NodeInfo struct {
	Node      uint32 `protobuf:"varint,1,opt,name=node,proto3" json:"node,omitempty"`
	Interface string `protobuf:"bytes,2,opt,name=interface,proto3" json:"interface,omitempty"`
}

节点信息

func (*NodeInfo) Descriptor added in v1.0.2

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

func (*NodeInfo) GetInterface added in v1.0.2

func (m *NodeInfo) GetInterface() string

func (*NodeInfo) GetNode added in v1.0.2

func (m *NodeInfo) GetNode() uint32

func (*NodeInfo) Marshal added in v1.0.2

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

func (*NodeInfo) MarshalTo added in v1.0.2

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

func (*NodeInfo) MarshalToSizedBuffer added in v1.0.2

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

func (*NodeInfo) ProtoMessage added in v1.0.2

func (*NodeInfo) ProtoMessage()

func (*NodeInfo) Reset added in v1.0.2

func (m *NodeInfo) Reset()

func (*NodeInfo) Size added in v1.0.2

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

func (*NodeInfo) String added in v1.0.2

func (m *NodeInfo) String() string

func (*NodeInfo) Unmarshal added in v1.0.2

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

func (*NodeInfo) XXX_DiscardUnknown added in v1.0.2

func (m *NodeInfo) XXX_DiscardUnknown()

func (*NodeInfo) XXX_Marshal added in v1.0.2

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

func (*NodeInfo) XXX_Merge added in v1.0.2

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

func (*NodeInfo) XXX_Size added in v1.0.2

func (m *NodeInfo) XXX_Size() int

func (*NodeInfo) XXX_Unmarshal added in v1.0.2

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

type NodeState added in v1.0.2

type NodeState int32

节点状态

const (
	StateDown NodeState = 0
	StateUp   NodeState = 1
)

func (NodeState) EnumDescriptor added in v1.0.2

func (NodeState) EnumDescriptor() ([]byte, []int)

func (NodeState) String added in v1.0.2

func (x NodeState) String() string

type RegisterAck added in v1.0.2

type RegisterAck struct {
	Node uint32 `protobuf:"varint,2,opt,name=node,proto3" json:"node,omitempty"`
}

func (*RegisterAck) Descriptor added in v1.0.2

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

func (*RegisterAck) GetNode added in v1.0.2

func (m *RegisterAck) GetNode() uint32

func (*RegisterAck) Marshal added in v1.0.2

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

func (*RegisterAck) MarshalTo added in v1.0.2

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

func (*RegisterAck) MarshalToSizedBuffer added in v1.0.2

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

func (*RegisterAck) ProtoMessage added in v1.0.2

func (*RegisterAck) ProtoMessage()

func (*RegisterAck) Reset added in v1.0.2

func (m *RegisterAck) Reset()

func (*RegisterAck) Size added in v1.0.2

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

func (*RegisterAck) String added in v1.0.2

func (m *RegisterAck) String() string

func (*RegisterAck) Unmarshal added in v1.0.2

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

func (*RegisterAck) XXX_DiscardUnknown added in v1.0.2

func (m *RegisterAck) XXX_DiscardUnknown()

func (*RegisterAck) XXX_Marshal added in v1.0.2

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

func (*RegisterAck) XXX_Merge added in v1.0.2

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

func (*RegisterAck) XXX_Size added in v1.0.2

func (m *RegisterAck) XXX_Size() int

func (*RegisterAck) XXX_Unmarshal added in v1.0.2

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

type RegisterReq added in v1.0.2

type RegisterReq struct {
	AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
	Node        uint32 `protobuf:"varint,2,opt,name=node,proto3" json:"node,omitempty"`
}

注册节点

func (*RegisterReq) Descriptor added in v1.0.2

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

func (*RegisterReq) GetAccessToken added in v1.0.2

func (m *RegisterReq) GetAccessToken() string

func (*RegisterReq) GetNode added in v1.0.2

func (m *RegisterReq) GetNode() uint32

func (*RegisterReq) Marshal added in v1.0.2

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

func (*RegisterReq) MarshalTo added in v1.0.2

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

func (*RegisterReq) MarshalToSizedBuffer added in v1.0.2

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

func (*RegisterReq) ProtoMessage added in v1.0.2

func (*RegisterReq) ProtoMessage()

func (*RegisterReq) Reset added in v1.0.2

func (m *RegisterReq) Reset()

func (*RegisterReq) Size added in v1.0.2

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

func (*RegisterReq) String added in v1.0.2

func (m *RegisterReq) String() string

func (*RegisterReq) Unmarshal added in v1.0.2

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

func (*RegisterReq) XXX_DiscardUnknown added in v1.0.2

func (m *RegisterReq) XXX_DiscardUnknown()

func (*RegisterReq) XXX_Marshal added in v1.0.2

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

func (*RegisterReq) XXX_Merge added in v1.0.2

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

func (*RegisterReq) XXX_Size added in v1.0.2

func (m *RegisterReq) XXX_Size() int

func (*RegisterReq) XXX_Unmarshal added in v1.0.2

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

type SubscribeAck added in v1.0.2

type SubscribeAck struct {
}

func (*SubscribeAck) Descriptor added in v1.0.2

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

func (*SubscribeAck) Marshal added in v1.0.2

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

func (*SubscribeAck) MarshalTo added in v1.0.2

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

func (*SubscribeAck) MarshalToSizedBuffer added in v1.0.2

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

func (*SubscribeAck) ProtoMessage added in v1.0.2

func (*SubscribeAck) ProtoMessage()

func (*SubscribeAck) Reset added in v1.0.2

func (m *SubscribeAck) Reset()

func (*SubscribeAck) Size added in v1.0.2

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

func (*SubscribeAck) String added in v1.0.2

func (m *SubscribeAck) String() string

func (*SubscribeAck) Unmarshal added in v1.0.2

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

func (*SubscribeAck) XXX_DiscardUnknown added in v1.0.2

func (m *SubscribeAck) XXX_DiscardUnknown()

func (*SubscribeAck) XXX_Marshal added in v1.0.2

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

func (*SubscribeAck) XXX_Merge added in v1.0.2

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

func (*SubscribeAck) XXX_Size added in v1.0.2

func (m *SubscribeAck) XXX_Size() int

func (*SubscribeAck) XXX_Unmarshal added in v1.0.2

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

type SubscribeReq added in v1.0.2

type SubscribeReq struct {
	MsgStart int32 `protobuf:"varint,1,opt,name=msg_start,json=msgStart,proto3" json:"msg_start,omitempty"`
	MsgEnd   int32 `protobuf:"varint,2,opt,name=msg_end,json=msgEnd,proto3" json:"msg_end,omitempty"`
}

订阅消息处理

func (*SubscribeReq) Descriptor added in v1.0.2

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

func (*SubscribeReq) GetMsgEnd added in v1.0.2

func (m *SubscribeReq) GetMsgEnd() int32

func (*SubscribeReq) GetMsgStart added in v1.0.2

func (m *SubscribeReq) GetMsgStart() int32

func (*SubscribeReq) Marshal added in v1.0.2

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

func (*SubscribeReq) MarshalTo added in v1.0.2

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

func (*SubscribeReq) MarshalToSizedBuffer added in v1.0.2

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

func (*SubscribeReq) ProtoMessage added in v1.0.2

func (*SubscribeReq) ProtoMessage()

func (*SubscribeReq) Reset added in v1.0.2

func (m *SubscribeReq) Reset()

func (*SubscribeReq) Size added in v1.0.2

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

func (*SubscribeReq) String added in v1.0.2

func (m *SubscribeReq) String() string

func (*SubscribeReq) Unmarshal added in v1.0.2

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

func (*SubscribeReq) XXX_DiscardUnknown added in v1.0.2

func (m *SubscribeReq) XXX_DiscardUnknown()

func (*SubscribeReq) XXX_Marshal added in v1.0.2

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

func (*SubscribeReq) XXX_Merge added in v1.0.2

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

func (*SubscribeReq) XXX_Size added in v1.0.2

func (m *SubscribeReq) XXX_Size() int

func (*SubscribeReq) XXX_Unmarshal added in v1.0.2

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

Jump to

Keyboard shortcuts

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