dispatchserver

package
v0.0.0-...-b3af538 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthDispatch        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowDispatch          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupDispatch = fmt.Errorf("proto: unexpected end of group")
)

Functions

func RegisterDispatchServer

func RegisterDispatchServer(s *grpc.Server, srv DispatchServer)

Types

type BatchDispatchReq

type BatchDispatchReq struct {
	// 消息长度列表
	MsgsLen []int64 `protobuf:"varint,1,rep,packed,name=msgsLen,proto3" json:"msgsLen,omitempty"`
	// 多个消息组合的列表
	Msgs []byte `protobuf:"bytes,2,opt,name=msgs,proto3" json:"msgs,omitempty"`
}

批量分发消息

func (*BatchDispatchReq) Cleanup

func (m *BatchDispatchReq) Cleanup()

Cleanup Clean up the fields of the message. 清理消息的字段,该方法在消息被释放时被调用,不对切片中的字段进行处理。

func (*BatchDispatchReq) DeepCleanup

func (m *BatchDispatchReq) DeepCleanup()

DeepCleanup Clean up the fields of the message. 清理消息的字段,该方法在消息被释放时被调用,递归处理切片中的字段。

func (*BatchDispatchReq) Descriptor

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

func (*BatchDispatchReq) GetMsgs

func (m *BatchDispatchReq) GetMsgs() []byte

func (*BatchDispatchReq) GetMsgsLen

func (m *BatchDispatchReq) GetMsgsLen() []int64

func (*BatchDispatchReq) Marshal

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

func (*BatchDispatchReq) MarshalTo

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

func (*BatchDispatchReq) MarshalToSizedBuffer

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

func (*BatchDispatchReq) ProtoMessage

func (*BatchDispatchReq) ProtoMessage()

func (*BatchDispatchReq) Reset

func (m *BatchDispatchReq) Reset()

func (*BatchDispatchReq) Size

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

func (*BatchDispatchReq) String

func (m *BatchDispatchReq) String() string

func (*BatchDispatchReq) Unmarshal

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

func (*BatchDispatchReq) UnmarshalWithFieldNum

func (m *BatchDispatchReq) UnmarshalWithFieldNum(dAtA []byte, targetFileNum int) error

Deserialize a specified number of fields, return early as soon as the specified fields are deserialized. 反序列化指定数量的字段,达到指定的次数就返回. 参数 targetFileNum <=0 直接返回,不进行反序列化

func (*BatchDispatchReq) XXX_DiscardUnknown

func (m *BatchDispatchReq) XXX_DiscardUnknown()

func (*BatchDispatchReq) XXX_Marshal

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

func (*BatchDispatchReq) XXX_Merge

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

func (*BatchDispatchReq) XXX_Size

func (m *BatchDispatchReq) XXX_Size() int

func (*BatchDispatchReq) XXX_Unmarshal

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

type BatchDispatchResp

type BatchDispatchResp struct {
	UserIds []int64           `protobuf:"varint,1,rep,packed,name=userIds,proto3" json:"userIds,omitempty"`
	Codes   []v1.ResponseCode `protobuf:"varint,2,rep,packed,name=codes,proto3,enum=ResponseCode" json:"codes,omitempty"`
}

批量分发消息响应

func (*BatchDispatchResp) Cleanup

func (m *BatchDispatchResp) Cleanup()

Cleanup Clean up the fields of the message. 清理消息的字段,该方法在消息被释放时被调用,不对切片中的字段进行处理。

func (*BatchDispatchResp) DeepCleanup

func (m *BatchDispatchResp) DeepCleanup()

DeepCleanup Clean up the fields of the message. 清理消息的字段,该方法在消息被释放时被调用,递归处理切片中的字段。

func (*BatchDispatchResp) Descriptor

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

func (*BatchDispatchResp) GetCodes

func (m *BatchDispatchResp) GetCodes() []v1.ResponseCode

func (*BatchDispatchResp) GetUserIds

func (m *BatchDispatchResp) GetUserIds() []int64

func (*BatchDispatchResp) Marshal

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

func (*BatchDispatchResp) MarshalTo

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

func (*BatchDispatchResp) MarshalToSizedBuffer

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

func (*BatchDispatchResp) ProtoMessage

func (*BatchDispatchResp) ProtoMessage()

func (*BatchDispatchResp) Reset

func (m *BatchDispatchResp) Reset()

func (*BatchDispatchResp) Size

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

func (*BatchDispatchResp) String

func (m *BatchDispatchResp) String() string

func (*BatchDispatchResp) Unmarshal

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

func (*BatchDispatchResp) UnmarshalWithFieldNum

func (m *BatchDispatchResp) UnmarshalWithFieldNum(dAtA []byte, targetFileNum int) error

Deserialize a specified number of fields, return early as soon as the specified fields are deserialized. 反序列化指定数量的字段,达到指定的次数就返回. 参数 targetFileNum <=0 直接返回,不进行反序列化

func (*BatchDispatchResp) XXX_DiscardUnknown

func (m *BatchDispatchResp) XXX_DiscardUnknown()

func (*BatchDispatchResp) XXX_Marshal

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

func (*BatchDispatchResp) XXX_Merge

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

func (*BatchDispatchResp) XXX_Size

func (m *BatchDispatchResp) XXX_Size() int

func (*BatchDispatchResp) XXX_Unmarshal

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

type DispatchClient

type DispatchClient interface {
	// 消息分发
	DispatchMessage(ctx context.Context, in *DispatchReq, opts ...grpc.CallOption) (*DispatchResp, error)
	// 批量分发消息,如果不需要有状态的服务可以调用这个接口
	DispatchBatchMessage(ctx context.Context, in *BatchDispatchReq, opts ...grpc.CallOption) (*BatchDispatchResp, error)
}

DispatchClient is the client API for Dispatch service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewDispatchClient

func NewDispatchClient(cc *grpc.ClientConn) DispatchClient

type DispatchReq

type DispatchReq struct {
	SenderDevice v1.DeviceType  `protobuf:"varint,1,opt,name=senderDevice,proto3,enum=DeviceType" json:"senderDevice,omitempty"`
	ChannelType  v1.ChannelType `protobuf:"varint,2,opt,name=channelType,proto3,enum=ChannelType" json:"channelType,omitempty"`
	SenderId     int64          `protobuf:"varint,3,opt,name=senderId,proto3" json:"senderId,omitempty"`
	ChannelId    int64          `protobuf:"varint,4,opt,name=channelId,proto3" json:"channelId,omitempty"`
	Message      []byte         `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"`
}

消息分发请求

func (*DispatchReq) Cleanup

func (m *DispatchReq) Cleanup()

Cleanup Clean up the fields of the message. 清理消息的字段,该方法在消息被释放时被调用,不对切片中的字段进行处理。

func (*DispatchReq) DeepCleanup

func (m *DispatchReq) DeepCleanup()

DeepCleanup Clean up the fields of the message. 清理消息的字段,该方法在消息被释放时被调用,递归处理切片中的字段。

func (*DispatchReq) Descriptor

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

func (*DispatchReq) GetChannelId

func (m *DispatchReq) GetChannelId() int64

func (*DispatchReq) GetChannelType

func (m *DispatchReq) GetChannelType() v1.ChannelType

func (*DispatchReq) GetMessage

func (m *DispatchReq) GetMessage() []byte

func (*DispatchReq) GetSenderDevice

func (m *DispatchReq) GetSenderDevice() v1.DeviceType

func (*DispatchReq) GetSenderId

func (m *DispatchReq) GetSenderId() int64

func (*DispatchReq) Marshal

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

func (*DispatchReq) MarshalTo

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

func (*DispatchReq) MarshalToSizedBuffer

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

func (*DispatchReq) ProtoMessage

func (*DispatchReq) ProtoMessage()

func (*DispatchReq) Reset

func (m *DispatchReq) Reset()

func (*DispatchReq) Size

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

func (*DispatchReq) String

func (m *DispatchReq) String() string

func (*DispatchReq) Unmarshal

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

func (*DispatchReq) UnmarshalWithFieldNum

func (m *DispatchReq) UnmarshalWithFieldNum(dAtA []byte, targetFileNum int) error

Deserialize a specified number of fields, return early as soon as the specified fields are deserialized. 反序列化指定数量的字段,达到指定的次数就返回. 参数 targetFileNum <=0 直接返回,不进行反序列化

func (*DispatchReq) XXX_DiscardUnknown

func (m *DispatchReq) XXX_DiscardUnknown()

func (*DispatchReq) XXX_Marshal

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

func (*DispatchReq) XXX_Merge

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

func (*DispatchReq) XXX_Size

func (m *DispatchReq) XXX_Size() int

func (*DispatchReq) XXX_Unmarshal

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

type DispatchResp

type DispatchResp struct {
	Code v1.ResponseCode `protobuf:"varint,1,opt,name=code,proto3,enum=ResponseCode" json:"code,omitempty"`
}

消息分发响应

func (*DispatchResp) Cleanup

func (m *DispatchResp) Cleanup()

Cleanup Clean up the fields of the message. 清理消息的字段,该方法在消息被释放时被调用,不对切片中的字段进行处理。

func (*DispatchResp) DeepCleanup

func (m *DispatchResp) DeepCleanup()

DeepCleanup Clean up the fields of the message. 清理消息的字段,该方法在消息被释放时被调用,递归处理切片中的字段。

func (*DispatchResp) Descriptor

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

func (*DispatchResp) GetCode

func (m *DispatchResp) GetCode() v1.ResponseCode

func (*DispatchResp) Marshal

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

func (*DispatchResp) MarshalTo

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

func (*DispatchResp) MarshalToSizedBuffer

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

func (*DispatchResp) ProtoMessage

func (*DispatchResp) ProtoMessage()

func (*DispatchResp) Reset

func (m *DispatchResp) Reset()

func (*DispatchResp) Size

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

func (*DispatchResp) String

func (m *DispatchResp) String() string

func (*DispatchResp) Unmarshal

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

func (*DispatchResp) UnmarshalWithFieldNum

func (m *DispatchResp) UnmarshalWithFieldNum(dAtA []byte, targetFileNum int) error

Deserialize a specified number of fields, return early as soon as the specified fields are deserialized. 反序列化指定数量的字段,达到指定的次数就返回. 参数 targetFileNum <=0 直接返回,不进行反序列化

func (*DispatchResp) XXX_DiscardUnknown

func (m *DispatchResp) XXX_DiscardUnknown()

func (*DispatchResp) XXX_Marshal

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

func (*DispatchResp) XXX_Merge

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

func (*DispatchResp) XXX_Size

func (m *DispatchResp) XXX_Size() int

func (*DispatchResp) XXX_Unmarshal

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

type DispatchServer

type DispatchServer interface {
	// 消息分发
	DispatchMessage(context.Context, *DispatchReq) (*DispatchResp, error)
	// 批量分发消息,如果不需要有状态的服务可以调用这个接口
	DispatchBatchMessage(context.Context, *BatchDispatchReq) (*BatchDispatchResp, error)
}

DispatchServer is the server API for Dispatch service.

type UnimplementedDispatchServer

type UnimplementedDispatchServer struct {
}

UnimplementedDispatchServer can be embedded to have forward compatible implementations.

func (*UnimplementedDispatchServer) DispatchBatchMessage

func (*UnimplementedDispatchServer) DispatchMessage

func (*UnimplementedDispatchServer) DispatchMessage(ctx context.Context, req *DispatchReq) (*DispatchResp, error)

Jump to

Keyboard shortcuts

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