grpc

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Type_name = map[int32]string{
		0: "PUSH",
		1: "ROOM",
		2: "BROADCAST",
	}
	Type_value = map[string]int32{
		"PUSH":      0,
		"ROOM":      1,
		"BROADCAST": 2,
	}
)

Enum value maps for Type.

View Source
var File_logic_proto protoreflect.FileDescriptor
View Source
var Logic_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "im.logic.Logic",
	HandlerType: (*LogicServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Connect",
			Handler:    _Logic_Connect_Handler,
		},
		{
			MethodName: "Disconnect",
			Handler:    _Logic_Disconnect_Handler,
		},
		{
			MethodName: "Heartbeat",
			Handler:    _Logic_Heartbeat_Handler,
		},
		{
			MethodName: "Receive",
			Handler:    _Logic_Receive_Handler,
		},
		{
			MethodName: "PushByMids",
			Handler:    _Logic_PushByMids_Handler,
		},
		{
			MethodName: "PushByKeys",
			Handler:    _Logic_PushByKeys_Handler,
		},
		{
			MethodName: "PushGroup",
			Handler:    _Logic_PushGroup_Handler,
		},
		{
			MethodName: "JoinGroupsByKeys",
			Handler:    _Logic_JoinGroupsByKeys_Handler,
		},
		{
			MethodName: "JoinGroupsByMids",
			Handler:    _Logic_JoinGroupsByMids_Handler,
		},
		{
			MethodName: "LeaveGroupsByKeys",
			Handler:    _Logic_LeaveGroupsByKeys_Handler,
		},
		{
			MethodName: "LeaveGroupsByMids",
			Handler:    _Logic_LeaveGroupsByMids_Handler,
		},
		{
			MethodName: "DelGroups",
			Handler:    _Logic_DelGroups_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "logic.proto",
}

Logic_ServiceDesc is the grpc.ServiceDesc for Logic service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterLogicServer

func RegisterLogicServer(s grpc.ServiceRegistrar, srv LogicServer)

Types

type BizMsg

type BizMsg struct {
	AppId  string `protobuf:"bytes,1,opt,name=appId,proto3" json:"appId,omitempty"`
	FromId string `protobuf:"bytes,2,opt,name=fromId,proto3" json:"fromId,omitempty"`
	Type   Type   `protobuf:"varint,4,opt,name=type,proto3,enum=im.logic.Type" json:"type,omitempty"`
	Op     int32  `protobuf:"varint,5,opt,name=op,proto3" json:"op,omitempty"`
	Key    string `protobuf:"bytes,6,opt,name=key,proto3" json:"key,omitempty"`
	Msg    []byte `protobuf:"bytes,7,opt,name=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

logic --> mq

func (*BizMsg) Descriptor deprecated

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

Deprecated: Use BizMsg.ProtoReflect.Descriptor instead.

func (*BizMsg) GetAppId

func (x *BizMsg) GetAppId() string

func (*BizMsg) GetFromId

func (x *BizMsg) GetFromId() string

func (*BizMsg) GetKey

func (x *BizMsg) GetKey() string

func (*BizMsg) GetMsg

func (x *BizMsg) GetMsg() []byte

func (*BizMsg) GetOp

func (x *BizMsg) GetOp() int32

func (*BizMsg) GetType

func (x *BizMsg) GetType() Type

func (*BizMsg) ProtoMessage

func (*BizMsg) ProtoMessage()

func (*BizMsg) ProtoReflect

func (x *BizMsg) ProtoReflect() protoreflect.Message

func (*BizMsg) Reset

func (x *BizMsg) Reset()

func (*BizMsg) String

func (x *BizMsg) String() string

type ConnectReply

type ConnectReply struct {
	Key       string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	AppId     string `protobuf:"bytes,2,opt,name=appId,proto3" json:"appId,omitempty"`
	Mid       string `protobuf:"bytes,3,opt,name=mid,proto3" json:"mid,omitempty"`
	Heartbeat int64  `protobuf:"varint,4,opt,name=heartbeat,proto3" json:"heartbeat,omitempty"`
	// contains filtered or unexported fields
}

func (*ConnectReply) Descriptor deprecated

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

Deprecated: Use ConnectReply.ProtoReflect.Descriptor instead.

func (*ConnectReply) GetAppId

func (x *ConnectReply) GetAppId() string

func (*ConnectReply) GetHeartbeat

func (x *ConnectReply) GetHeartbeat() int64

func (*ConnectReply) GetKey

func (x *ConnectReply) GetKey() string

func (*ConnectReply) GetMid

func (x *ConnectReply) GetMid() string

func (*ConnectReply) ProtoMessage

func (*ConnectReply) ProtoMessage()

func (*ConnectReply) ProtoReflect

func (x *ConnectReply) ProtoReflect() protoreflect.Message

func (*ConnectReply) Reset

func (x *ConnectReply) Reset()

func (*ConnectReply) String

func (x *ConnectReply) String() string

type ConnectReq

type ConnectReq struct {
	Server string      `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"` // 客户端连接的是哪个 comet
	Proto  *grpc.Proto `protobuf:"bytes,3,opt,name=proto,proto3" json:"proto,omitempty"`
	// contains filtered or unexported fields
}

func (*ConnectReq) Descriptor deprecated

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

Deprecated: Use ConnectReq.ProtoReflect.Descriptor instead.

func (*ConnectReq) GetProto

func (x *ConnectReq) GetProto() *grpc.Proto

func (*ConnectReq) GetServer

func (x *ConnectReq) GetServer() string

func (*ConnectReq) ProtoMessage

func (*ConnectReq) ProtoMessage()

func (*ConnectReq) ProtoReflect

func (x *ConnectReq) ProtoReflect() protoreflect.Message

func (*ConnectReq) Reset

func (x *ConnectReq) Reset()

func (*ConnectReq) String

func (x *ConnectReq) String() string

type DelGroupsReq

type DelGroupsReq struct {
	AppId string   `protobuf:"bytes,1,opt,name=appId,proto3" json:"appId,omitempty"`
	Gid   []string `protobuf:"bytes,2,rep,name=gid,proto3" json:"gid,omitempty"`
	// contains filtered or unexported fields
}

biz --> logic

func (*DelGroupsReq) Descriptor deprecated

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

Deprecated: Use DelGroupsReq.ProtoReflect.Descriptor instead.

func (*DelGroupsReq) GetAppId

func (x *DelGroupsReq) GetAppId() string

func (*DelGroupsReq) GetGid

func (x *DelGroupsReq) GetGid() []string

func (*DelGroupsReq) ProtoMessage

func (*DelGroupsReq) ProtoMessage()

func (*DelGroupsReq) ProtoReflect

func (x *DelGroupsReq) ProtoReflect() protoreflect.Message

func (*DelGroupsReq) Reset

func (x *DelGroupsReq) Reset()

func (*DelGroupsReq) String

func (x *DelGroupsReq) String() string

type DisconnectReq

type DisconnectReq struct {
	Key    string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Server string `protobuf:"bytes,2,opt,name=server,proto3" json:"server,omitempty"`
	// contains filtered or unexported fields
}

func (*DisconnectReq) Descriptor deprecated

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

Deprecated: Use DisconnectReq.ProtoReflect.Descriptor instead.

func (*DisconnectReq) GetKey

func (x *DisconnectReq) GetKey() string

func (*DisconnectReq) GetServer

func (x *DisconnectReq) GetServer() string

func (*DisconnectReq) ProtoMessage

func (*DisconnectReq) ProtoMessage()

func (*DisconnectReq) ProtoReflect

func (x *DisconnectReq) ProtoReflect() protoreflect.Message

func (*DisconnectReq) Reset

func (x *DisconnectReq) Reset()

func (*DisconnectReq) String

func (x *DisconnectReq) String() string

type GroupMsg

type GroupMsg struct {
	AppId string `protobuf:"bytes,1,opt,name=appId,proto3" json:"appId,omitempty"`
	Group string `protobuf:"bytes,2,opt,name=group,proto3" json:"group,omitempty"`
	Type  Type   `protobuf:"varint,3,opt,name=type,proto3,enum=im.logic.Type" json:"type,omitempty"`
	Op    int32  `protobuf:"varint,4,opt,name=op,proto3" json:"op,omitempty"`
	Msg   []byte `protobuf:"bytes,5,opt,name=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

biz --> logic

func (*GroupMsg) Descriptor deprecated

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

Deprecated: Use GroupMsg.ProtoReflect.Descriptor instead.

func (*GroupMsg) GetAppId

func (x *GroupMsg) GetAppId() string

func (*GroupMsg) GetGroup

func (x *GroupMsg) GetGroup() string

func (*GroupMsg) GetMsg

func (x *GroupMsg) GetMsg() []byte

func (*GroupMsg) GetOp

func (x *GroupMsg) GetOp() int32

func (*GroupMsg) GetType

func (x *GroupMsg) GetType() Type

func (*GroupMsg) ProtoMessage

func (*GroupMsg) ProtoMessage()

func (*GroupMsg) ProtoReflect

func (x *GroupMsg) ProtoReflect() protoreflect.Message

func (*GroupMsg) Reset

func (x *GroupMsg) Reset()

func (*GroupMsg) String

func (x *GroupMsg) String() string

type GroupsKey

type GroupsKey struct {
	AppId string   `protobuf:"bytes,1,opt,name=appId,proto3" json:"appId,omitempty"`
	Keys  []string `protobuf:"bytes,2,rep,name=keys,proto3" json:"keys,omitempty"`
	Gid   []string `protobuf:"bytes,3,rep,name=gid,proto3" json:"gid,omitempty"`
	// contains filtered or unexported fields
}

biz --> logic

func (*GroupsKey) Descriptor deprecated

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

Deprecated: Use GroupsKey.ProtoReflect.Descriptor instead.

func (*GroupsKey) GetAppId

func (x *GroupsKey) GetAppId() string

func (*GroupsKey) GetGid

func (x *GroupsKey) GetGid() []string

func (*GroupsKey) GetKeys

func (x *GroupsKey) GetKeys() []string

func (*GroupsKey) ProtoMessage

func (*GroupsKey) ProtoMessage()

func (*GroupsKey) ProtoReflect

func (x *GroupsKey) ProtoReflect() protoreflect.Message

func (*GroupsKey) Reset

func (x *GroupsKey) Reset()

func (*GroupsKey) String

func (x *GroupsKey) String() string

type GroupsMid

type GroupsMid struct {
	AppId string   `protobuf:"bytes,1,opt,name=appId,proto3" json:"appId,omitempty"`
	Mids  []string `protobuf:"bytes,2,rep,name=mids,proto3" json:"mids,omitempty"`
	Gid   []string `protobuf:"bytes,3,rep,name=gid,proto3" json:"gid,omitempty"`
	// contains filtered or unexported fields
}

biz --> logic

func (*GroupsMid) Descriptor deprecated

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

Deprecated: Use GroupsMid.ProtoReflect.Descriptor instead.

func (*GroupsMid) GetAppId

func (x *GroupsMid) GetAppId() string

func (*GroupsMid) GetGid

func (x *GroupsMid) GetGid() []string

func (*GroupsMid) GetMids

func (x *GroupsMid) GetMids() []string

func (*GroupsMid) ProtoMessage

func (*GroupsMid) ProtoMessage()

func (*GroupsMid) ProtoReflect

func (x *GroupsMid) ProtoReflect() protoreflect.Message

func (*GroupsMid) Reset

func (x *GroupsMid) Reset()

func (*GroupsMid) String

func (x *GroupsMid) String() string

type HeartbeatReq

type HeartbeatReq struct {
	Key    string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Server string `protobuf:"bytes,2,opt,name=server,proto3" json:"server,omitempty"`
	// contains filtered or unexported fields
}

func (*HeartbeatReq) Descriptor deprecated

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

Deprecated: Use HeartbeatReq.ProtoReflect.Descriptor instead.

func (*HeartbeatReq) GetKey

func (x *HeartbeatReq) GetKey() string

func (*HeartbeatReq) GetServer

func (x *HeartbeatReq) GetServer() string

func (*HeartbeatReq) ProtoMessage

func (*HeartbeatReq) ProtoMessage()

func (*HeartbeatReq) ProtoReflect

func (x *HeartbeatReq) ProtoReflect() protoreflect.Message

func (*HeartbeatReq) Reset

func (x *HeartbeatReq) Reset()

func (*HeartbeatReq) String

func (x *HeartbeatReq) String() string

type KeysMsg

type KeysMsg struct {
	AppId  string   `protobuf:"bytes,1,opt,name=appId,proto3" json:"appId,omitempty"`
	ToKeys []string `protobuf:"bytes,2,rep,name=toKeys,proto3" json:"toKeys,omitempty"`
	Type   Type     `protobuf:"varint,3,opt,name=type,proto3,enum=im.logic.Type" json:"type,omitempty"`
	Op     int32    `protobuf:"varint,4,opt,name=op,proto3" json:"op,omitempty"`
	Msg    []byte   `protobuf:"bytes,5,opt,name=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

biz --> logic

func (*KeysMsg) Descriptor deprecated

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

Deprecated: Use KeysMsg.ProtoReflect.Descriptor instead.

func (*KeysMsg) GetAppId

func (x *KeysMsg) GetAppId() string

func (*KeysMsg) GetMsg

func (x *KeysMsg) GetMsg() []byte

func (*KeysMsg) GetOp

func (x *KeysMsg) GetOp() int32

func (*KeysMsg) GetToKeys

func (x *KeysMsg) GetToKeys() []string

func (*KeysMsg) GetType

func (x *KeysMsg) GetType() Type

func (*KeysMsg) ProtoMessage

func (*KeysMsg) ProtoMessage()

func (*KeysMsg) ProtoReflect

func (x *KeysMsg) ProtoReflect() protoreflect.Message

func (*KeysMsg) Reset

func (x *KeysMsg) Reset()

func (*KeysMsg) String

func (x *KeysMsg) String() string

type LogicClient

type LogicClient interface {
	Connect(ctx context.Context, in *ConnectReq, opts ...grpc.CallOption) (*ConnectReply, error)
	Disconnect(ctx context.Context, in *DisconnectReq, opts ...grpc.CallOption) (*Reply, error)
	Heartbeat(ctx context.Context, in *HeartbeatReq, opts ...grpc.CallOption) (*Reply, error)
	Receive(ctx context.Context, in *ReceiveReq, opts ...grpc.CallOption) (*Reply, error)
	PushByMids(ctx context.Context, in *MidsMsg, opts ...grpc.CallOption) (*Reply, error)
	PushByKeys(ctx context.Context, in *KeysMsg, opts ...grpc.CallOption) (*Reply, error)
	PushGroup(ctx context.Context, in *GroupMsg, opts ...grpc.CallOption) (*Reply, error)
	JoinGroupsByKeys(ctx context.Context, in *GroupsKey, opts ...grpc.CallOption) (*Reply, error)
	JoinGroupsByMids(ctx context.Context, in *GroupsMid, opts ...grpc.CallOption) (*Reply, error)
	LeaveGroupsByKeys(ctx context.Context, in *GroupsKey, opts ...grpc.CallOption) (*Reply, error)
	LeaveGroupsByMids(ctx context.Context, in *GroupsMid, opts ...grpc.CallOption) (*Reply, error)
	DelGroups(ctx context.Context, in *DelGroupsReq, opts ...grpc.CallOption) (*Reply, error)
}

LogicClient is the client API for Logic service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewLogicClient

func NewLogicClient(cc grpc.ClientConnInterface) LogicClient

type LogicServer

type LogicServer interface {
	Connect(context.Context, *ConnectReq) (*ConnectReply, error)
	Disconnect(context.Context, *DisconnectReq) (*Reply, error)
	Heartbeat(context.Context, *HeartbeatReq) (*Reply, error)
	Receive(context.Context, *ReceiveReq) (*Reply, error)
	PushByMids(context.Context, *MidsMsg) (*Reply, error)
	PushByKeys(context.Context, *KeysMsg) (*Reply, error)
	PushGroup(context.Context, *GroupMsg) (*Reply, error)
	JoinGroupsByKeys(context.Context, *GroupsKey) (*Reply, error)
	JoinGroupsByMids(context.Context, *GroupsMid) (*Reply, error)
	LeaveGroupsByKeys(context.Context, *GroupsKey) (*Reply, error)
	LeaveGroupsByMids(context.Context, *GroupsMid) (*Reply, error)
	DelGroups(context.Context, *DelGroupsReq) (*Reply, error)
	// contains filtered or unexported methods
}

LogicServer is the server API for Logic service. All implementations must embed UnimplementedLogicServer for forward compatibility

type MidsMsg

type MidsMsg struct {
	AppId string   `protobuf:"bytes,1,opt,name=appId,proto3" json:"appId,omitempty"`
	ToIds []string `protobuf:"bytes,2,rep,name=toIds,proto3" json:"toIds,omitempty"`
	Type  Type     `protobuf:"varint,3,opt,name=type,proto3,enum=im.logic.Type" json:"type,omitempty"`
	Op    int32    `protobuf:"varint,4,opt,name=op,proto3" json:"op,omitempty"`
	Msg   []byte   `protobuf:"bytes,5,opt,name=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

biz --> logic

func (*MidsMsg) Descriptor deprecated

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

Deprecated: Use MidsMsg.ProtoReflect.Descriptor instead.

func (*MidsMsg) GetAppId

func (x *MidsMsg) GetAppId() string

func (*MidsMsg) GetMsg

func (x *MidsMsg) GetMsg() []byte

func (*MidsMsg) GetOp

func (x *MidsMsg) GetOp() int32

func (*MidsMsg) GetToIds

func (x *MidsMsg) GetToIds() []string

func (*MidsMsg) GetType

func (x *MidsMsg) GetType() Type

func (*MidsMsg) ProtoMessage

func (*MidsMsg) ProtoMessage()

func (*MidsMsg) ProtoReflect

func (x *MidsMsg) ProtoReflect() protoreflect.Message

func (*MidsMsg) Reset

func (x *MidsMsg) Reset()

func (*MidsMsg) String

func (x *MidsMsg) String() string

type ReceiveReq

type ReceiveReq struct {
	Key   string      `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Proto *grpc.Proto `protobuf:"bytes,3,opt,name=proto,proto3" json:"proto,omitempty"`
	// contains filtered or unexported fields
}

func (*ReceiveReq) Descriptor deprecated

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

Deprecated: Use ReceiveReq.ProtoReflect.Descriptor instead.

func (*ReceiveReq) GetKey

func (x *ReceiveReq) GetKey() string

func (*ReceiveReq) GetProto

func (x *ReceiveReq) GetProto() *grpc.Proto

func (*ReceiveReq) ProtoMessage

func (*ReceiveReq) ProtoMessage()

func (*ReceiveReq) ProtoReflect

func (x *ReceiveReq) ProtoReflect() protoreflect.Message

func (*ReceiveReq) Reset

func (x *ReceiveReq) Reset()

func (*ReceiveReq) String

func (x *ReceiveReq) String() string

type Reply

type Reply struct {
	IsOk bool   `protobuf:"varint,1,opt,name=isOk,proto3" json:"isOk,omitempty"`
	Msg  []byte `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

func (*Reply) Descriptor deprecated

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

Deprecated: Use Reply.ProtoReflect.Descriptor instead.

func (*Reply) GetIsOk

func (x *Reply) GetIsOk() bool

func (*Reply) GetMsg

func (x *Reply) GetMsg() []byte

func (*Reply) ProtoMessage

func (*Reply) ProtoMessage()

func (*Reply) ProtoReflect

func (x *Reply) ProtoReflect() protoreflect.Message

func (*Reply) Reset

func (x *Reply) Reset()

func (*Reply) String

func (x *Reply) String() string

type Type

type Type int32
const (
	Type_PUSH      Type = 0
	Type_ROOM      Type = 1
	Type_BROADCAST Type = 2
)

func (Type) Descriptor

func (Type) Descriptor() protoreflect.EnumDescriptor

func (Type) Enum

func (x Type) Enum() *Type

func (Type) EnumDescriptor deprecated

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

Deprecated: Use Type.Descriptor instead.

func (Type) Number

func (x Type) Number() protoreflect.EnumNumber

func (Type) String

func (x Type) String() string

func (Type) Type

func (Type) Type() protoreflect.EnumType

type UnimplementedLogicServer

type UnimplementedLogicServer struct {
}

UnimplementedLogicServer must be embedded to have forward compatible implementations.

func (UnimplementedLogicServer) Connect

func (UnimplementedLogicServer) DelGroups

func (UnimplementedLogicServer) Disconnect

func (UnimplementedLogicServer) Heartbeat

func (UnimplementedLogicServer) JoinGroupsByKeys

func (UnimplementedLogicServer) JoinGroupsByKeys(context.Context, *GroupsKey) (*Reply, error)

func (UnimplementedLogicServer) JoinGroupsByMids

func (UnimplementedLogicServer) JoinGroupsByMids(context.Context, *GroupsMid) (*Reply, error)

func (UnimplementedLogicServer) LeaveGroupsByKeys

func (UnimplementedLogicServer) LeaveGroupsByKeys(context.Context, *GroupsKey) (*Reply, error)

func (UnimplementedLogicServer) LeaveGroupsByMids

func (UnimplementedLogicServer) LeaveGroupsByMids(context.Context, *GroupsMid) (*Reply, error)

func (UnimplementedLogicServer) PushByKeys

func (UnimplementedLogicServer) PushByMids

func (UnimplementedLogicServer) PushGroup

func (UnimplementedLogicServer) Receive

type UnsafeLogicServer

type UnsafeLogicServer interface {
	// contains filtered or unexported methods
}

UnsafeLogicServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to LogicServer will result in compilation errors.

Jump to

Keyboard shortcuts

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