hub

package
v0.0.0-...-399f02e Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(addr []string, minOpen, maxOpen int, maxLifeTime, timeout int) error

func RegisterHubCenterServer

func RegisterHubCenterServer(s *grpc.Server, srv HubCenterServer)

func SendWsRawByte

func SendWsRawByte(ctx context.Context, requestId string, uniqId int, data []byte) error

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) Descriptor() ([]byte, []int)

func (*HubReply) GetErrCode

func (m *HubReply) GetErrCode() int32

func (*HubReply) GetMessage

func (m *HubReply) GetMessage() string

func (*HubReply) GetRequestId

func (m *HubReply) GetRequestId() string

func (*HubReply) ProtoMessage

func (*HubReply) ProtoMessage()

func (*HubReply) Reset

func (m *HubReply) Reset()

func (*HubReply) String

func (m *HubReply) String() string

func (*HubReply) XXX_DiscardUnknown

func (m *HubReply) XXX_DiscardUnknown()

func (*HubReply) XXX_Marshal

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

func (*HubReply) XXX_Merge

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

func (*HubReply) XXX_Size

func (m *HubReply) XXX_Size() int

func (*HubReply) XXX_Unmarshal

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

type UnimplementedHubCenterServer

type UnimplementedHubCenterServer struct {
}

UnimplementedHubCenterServer can be embedded to have forward compatible implementations.

func (*UnimplementedHubCenterServer) SendAppData

func (*UnimplementedHubCenterServer) SendWsRawByte

func (*UnimplementedHubCenterServer) SendWsRawByte(ctx context.Context, req *WsRequest) (*HubReply, error)

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) Descriptor() ([]byte, []int)

func (*WsRequest) GetData

func (m *WsRequest) GetData() []byte

func (*WsRequest) GetFromId

func (m *WsRequest) GetFromId() int64

func (*WsRequest) GetRequestId

func (m *WsRequest) GetRequestId() string

func (*WsRequest) ProtoMessage

func (*WsRequest) ProtoMessage()

func (*WsRequest) Reset

func (m *WsRequest) Reset()

func (*WsRequest) String

func (m *WsRequest) String() string

func (*WsRequest) XXX_DiscardUnknown

func (m *WsRequest) XXX_DiscardUnknown()

func (*WsRequest) XXX_Marshal

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

func (*WsRequest) XXX_Merge

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

func (*WsRequest) XXX_Size

func (m *WsRequest) XXX_Size() int

func (*WsRequest) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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