Documentation ¶
Index ¶
- func Init(addr []string, minOpen, maxOpen int, maxLifeTime, timeout int) error
- func RegisterHubCenterServer(s *grpc.Server, srv HubCenterServer)
- func SendWsRawByte(ctx context.Context, requestId string, uniqId int, data []byte) error
- type AppRequest
- func (*AppRequest) Descriptor() ([]byte, []int)
- func (m *AppRequest) GetData() []byte
- func (m *AppRequest) GetRequestId() string
- func (m *AppRequest) GetToId() int64
- func (*AppRequest) ProtoMessage()
- func (m *AppRequest) Reset()
- func (m *AppRequest) String() string
- func (m *AppRequest) XXX_DiscardUnknown()
- func (m *AppRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *AppRequest) XXX_Merge(src proto.Message)
- func (m *AppRequest) XXX_Size() int
- func (m *AppRequest) XXX_Unmarshal(b []byte) error
- type HubCenterClient
- type HubCenterServer
- type HubReply
- func (*HubReply) Descriptor() ([]byte, []int)
- func (m *HubReply) GetErrCode() int32
- func (m *HubReply) GetMessage() string
- func (m *HubReply) GetRequestId() string
- func (*HubReply) ProtoMessage()
- func (m *HubReply) Reset()
- func (m *HubReply) String() string
- func (m *HubReply) XXX_DiscardUnknown()
- func (m *HubReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HubReply) XXX_Merge(src proto.Message)
- func (m *HubReply) XXX_Size() int
- func (m *HubReply) XXX_Unmarshal(b []byte) error
- type UnimplementedHubCenterServer
- type WsRequest
- func (*WsRequest) Descriptor() ([]byte, []int)
- func (m *WsRequest) GetData() []byte
- func (m *WsRequest) GetFromId() int64
- func (m *WsRequest) GetRequestId() string
- func (*WsRequest) ProtoMessage()
- func (m *WsRequest) Reset()
- func (m *WsRequest) String() string
- func (m *WsRequest) XXX_DiscardUnknown()
- func (m *WsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *WsRequest) XXX_Merge(src proto.Message)
- func (m *WsRequest) XXX_Size() int
- func (m *WsRequest) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterHubCenterServer ¶
func RegisterHubCenterServer(s *grpc.Server, srv HubCenterServer)
Types ¶
type AppRequest ¶
type AppRequest struct { RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` ToId int64 `protobuf:"varint,2,opt,name=to_id,json=toId,proto3" json:"to_id,omitempty"` Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
app request
func (*AppRequest) Descriptor ¶
func (*AppRequest) Descriptor() ([]byte, []int)
func (*AppRequest) GetData ¶
func (m *AppRequest) GetData() []byte
func (*AppRequest) GetRequestId ¶
func (m *AppRequest) GetRequestId() string
func (*AppRequest) GetToId ¶
func (m *AppRequest) GetToId() int64
func (*AppRequest) ProtoMessage ¶
func (*AppRequest) ProtoMessage()
func (*AppRequest) Reset ¶
func (m *AppRequest) Reset()
func (*AppRequest) String ¶
func (m *AppRequest) String() string
func (*AppRequest) XXX_DiscardUnknown ¶
func (m *AppRequest) XXX_DiscardUnknown()
func (*AppRequest) XXX_Marshal ¶
func (m *AppRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*AppRequest) XXX_Merge ¶
func (m *AppRequest) XXX_Merge(src proto.Message)
func (*AppRequest) XXX_Size ¶
func (m *AppRequest) XXX_Size() int
func (*AppRequest) XXX_Unmarshal ¶
func (m *AppRequest) XXX_Unmarshal(b []byte) error
type HubCenterClient ¶
type HubCenterClient interface { SendWsRawByte(ctx context.Context, in *WsRequest, opts ...grpc.CallOption) (*HubReply, error) SendAppData(ctx context.Context, in *AppRequest, opts ...grpc.CallOption) (*HubReply, error) }
HubCenterClient is the client API for HubCenter service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewHubCenterClient ¶
func NewHubCenterClient(cc *grpc.ClientConn) HubCenterClient
type HubCenterServer ¶
type HubCenterServer interface { SendWsRawByte(context.Context, *WsRequest) (*HubReply, error) SendAppData(context.Context, *AppRequest) (*HubReply, error) }
HubCenterServer is the server API for HubCenter service.
type HubReply ¶
type HubReply struct { RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` ErrCode int32 `protobuf:"varint,2,opt,name=err_code,json=errCode,proto3" json:"err_code,omitempty"` Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
ws response
func (*HubReply) Descriptor ¶
func (*HubReply) GetErrCode ¶
func (*HubReply) GetMessage ¶
func (*HubReply) GetRequestId ¶
func (*HubReply) ProtoMessage ¶
func (*HubReply) ProtoMessage()
func (*HubReply) XXX_DiscardUnknown ¶
func (m *HubReply) XXX_DiscardUnknown()
func (*HubReply) XXX_Marshal ¶
func (*HubReply) XXX_Unmarshal ¶
type UnimplementedHubCenterServer ¶
type UnimplementedHubCenterServer struct { }
UnimplementedHubCenterServer can be embedded to have forward compatible implementations.
func (*UnimplementedHubCenterServer) SendAppData ¶
func (*UnimplementedHubCenterServer) SendAppData(ctx context.Context, req *AppRequest) (*HubReply, error)
func (*UnimplementedHubCenterServer) SendWsRawByte ¶
type WsRequest ¶
type WsRequest struct { RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` FromId int64 `protobuf:"varint,2,opt,name=from_id,json=fromId,proto3" json:"from_id,omitempty"` Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
ws request
func (*WsRequest) Descriptor ¶
func (*WsRequest) GetRequestId ¶
func (*WsRequest) ProtoMessage ¶
func (*WsRequest) ProtoMessage()
func (*WsRequest) XXX_DiscardUnknown ¶
func (m *WsRequest) XXX_DiscardUnknown()
func (*WsRequest) XXX_Marshal ¶
func (*WsRequest) XXX_Unmarshal ¶
Click to show internal directories.
Click to hide internal directories.