message

package
v0.4.13 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Message_SendMessage_FullMethodName    = "/api.message.Message/SendMessage"
	Message_MarkAllRead_FullMethodName    = "/api.message.Message/MarkAllRead"
	Message_GetUnreadNum_FullMethodName   = "/api.message.Message/GetUnreadNum"
	Message_GetMessage_FullMethodName     = "/api.message.Message/GetMessage"
	Message_GetMessageList_FullMethodName = "/api.message.Message/GetMessageList"
)
View Source
const OperationMessageGetMessage = "/api.message.Message/GetMessage"
View Source
const OperationMessageGetMessageList = "/api.message.Message/GetMessageList"
View Source
const OperationMessageGetUnreadNum = "/api.message.Message/GetUnreadNum"
View Source
const OperationMessageMarkAllRead = "/api.message.Message/MarkAllRead"
View Source
const OperationMessageSendMessage = "/api.message.Message/SendMessage"

Variables

View Source
var (
	MessageType_name = map[int32]string{
		0: "TYPE_UNKNOWN",
		1: "TYPE_DEVICE_ONLINE",
		2: "TYPE_DEVICE_OFFLINE",
	}
	MessageType_value = map[string]int32{
		"TYPE_UNKNOWN":        0,
		"TYPE_DEVICE_ONLINE":  1,
		"TYPE_DEVICE_OFFLINE": 2,
	}
)

Enum value maps for MessageType.

View Source
var File_message_message_proto protoreflect.FileDescriptor
View Source
var Message_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.message.Message",
	HandlerType: (*MessageServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SendMessage",
			Handler:    _Message_SendMessage_Handler,
		},
		{
			MethodName: "MarkAllRead",
			Handler:    _Message_MarkAllRead_Handler,
		},
		{
			MethodName: "GetUnreadNum",
			Handler:    _Message_GetUnreadNum_Handler,
		},
		{
			MethodName: "GetMessage",
			Handler:    _Message_GetMessage_Handler,
		},
		{
			MethodName: "GetMessageList",
			Handler:    _Message_GetMessageList_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "message/message.proto",
}

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

Functions

func RegisterMessageHTTPServer

func RegisterMessageHTTPServer(s *http.Server, srv MessageHTTPServer)

func RegisterMessageServer

func RegisterMessageServer(s grpc.ServiceRegistrar, srv MessageServer)

Types

type Empty

type Empty struct {
	// contains filtered or unexported fields
}

func (*Empty) Descriptor deprecated

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

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

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

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

type GetMessageListReq

type GetMessageListReq struct {
	UserId     string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	TypeFilter string `protobuf:"bytes,2,opt,name=type_filter,json=typeFilter,proto3" json:"type_filter,omitempty"`
	StartTime  int64  `protobuf:"varint,3,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
	EndTime    int64  `protobuf:"varint,4,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"`
	Page       int32  `protobuf:"varint,5,opt,name=page,proto3" json:"page,omitempty"`
	Size       int32  `protobuf:"varint,6,opt,name=size,proto3" json:"size,omitempty"`
	UnreadOnly bool   `protobuf:"varint,7,opt,name=unread_only,json=unreadOnly,proto3" json:"unread_only,omitempty"`
	// contains filtered or unexported fields
}

func (*GetMessageListReq) Descriptor deprecated

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

Deprecated: Use GetMessageListReq.ProtoReflect.Descriptor instead.

func (*GetMessageListReq) GetEndTime

func (x *GetMessageListReq) GetEndTime() int64

func (*GetMessageListReq) GetPage

func (x *GetMessageListReq) GetPage() int32

func (*GetMessageListReq) GetSize

func (x *GetMessageListReq) GetSize() int32

func (*GetMessageListReq) GetStartTime

func (x *GetMessageListReq) GetStartTime() int64

func (*GetMessageListReq) GetTypeFilter

func (x *GetMessageListReq) GetTypeFilter() string

func (*GetMessageListReq) GetUnreadOnly

func (x *GetMessageListReq) GetUnreadOnly() bool

func (*GetMessageListReq) GetUserId

func (x *GetMessageListReq) GetUserId() string

func (*GetMessageListReq) ProtoMessage

func (*GetMessageListReq) ProtoMessage()

func (*GetMessageListReq) ProtoReflect

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

func (*GetMessageListReq) Reset

func (x *GetMessageListReq) Reset()

func (*GetMessageListReq) String

func (x *GetMessageListReq) String() string

type GetMessageListResp

type GetMessageListResp struct {
	Records []*MessageRecord `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"`
	Total   int64            `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"`
	// contains filtered or unexported fields
}

func (*GetMessageListResp) Descriptor deprecated

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

Deprecated: Use GetMessageListResp.ProtoReflect.Descriptor instead.

func (*GetMessageListResp) GetRecords

func (x *GetMessageListResp) GetRecords() []*MessageRecord

func (*GetMessageListResp) GetTotal

func (x *GetMessageListResp) GetTotal() int64

func (*GetMessageListResp) ProtoMessage

func (*GetMessageListResp) ProtoMessage()

func (*GetMessageListResp) ProtoReflect

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

func (*GetMessageListResp) Reset

func (x *GetMessageListResp) Reset()

func (*GetMessageListResp) String

func (x *GetMessageListResp) String() string

type GetMessageReq

type GetMessageReq struct {
	Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*GetMessageReq) Descriptor deprecated

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

Deprecated: Use GetMessageReq.ProtoReflect.Descriptor instead.

func (*GetMessageReq) GetId

func (x *GetMessageReq) GetId() uint64

func (*GetMessageReq) ProtoMessage

func (*GetMessageReq) ProtoMessage()

func (*GetMessageReq) ProtoReflect

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

func (*GetMessageReq) Reset

func (x *GetMessageReq) Reset()

func (*GetMessageReq) String

func (x *GetMessageReq) String() string

type GetUnreadNumReq

type GetUnreadNumReq struct {
	UserId     string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	TypeFilter string `protobuf:"bytes,2,opt,name=type_filter,json=typeFilter,proto3" json:"type_filter,omitempty"`
	// contains filtered or unexported fields
}

func (*GetUnreadNumReq) Descriptor deprecated

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

Deprecated: Use GetUnreadNumReq.ProtoReflect.Descriptor instead.

func (*GetUnreadNumReq) GetTypeFilter

func (x *GetUnreadNumReq) GetTypeFilter() string

func (*GetUnreadNumReq) GetUserId

func (x *GetUnreadNumReq) GetUserId() string

func (*GetUnreadNumReq) ProtoMessage

func (*GetUnreadNumReq) ProtoMessage()

func (*GetUnreadNumReq) ProtoReflect

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

func (*GetUnreadNumReq) Reset

func (x *GetUnreadNumReq) Reset()

func (*GetUnreadNumReq) String

func (x *GetUnreadNumReq) String() string

type GetUnreadNumResp

type GetUnreadNumResp struct {
	Nums map[int32]int64 `` /* 151-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*GetUnreadNumResp) Descriptor deprecated

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

Deprecated: Use GetUnreadNumResp.ProtoReflect.Descriptor instead.

func (*GetUnreadNumResp) GetNums

func (x *GetUnreadNumResp) GetNums() map[int32]int64

func (*GetUnreadNumResp) ProtoMessage

func (*GetUnreadNumResp) ProtoMessage()

func (*GetUnreadNumResp) ProtoReflect

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

func (*GetUnreadNumResp) Reset

func (x *GetUnreadNumResp) Reset()

func (*GetUnreadNumResp) String

func (x *GetUnreadNumResp) String() string

type MarkAllReadReq

type MarkAllReadReq struct {
	UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// contains filtered or unexported fields
}

func (*MarkAllReadReq) Descriptor deprecated

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

Deprecated: Use MarkAllReadReq.ProtoReflect.Descriptor instead.

func (*MarkAllReadReq) GetUserId

func (x *MarkAllReadReq) GetUserId() string

func (*MarkAllReadReq) ProtoMessage

func (*MarkAllReadReq) ProtoMessage()

func (*MarkAllReadReq) ProtoReflect

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

func (*MarkAllReadReq) Reset

func (x *MarkAllReadReq) Reset()

func (*MarkAllReadReq) String

func (x *MarkAllReadReq) String() string

type MessageClient

type MessageClient interface {
	SendMessage(ctx context.Context, in *SendMessageReq, opts ...grpc.CallOption) (*Empty, error)
	MarkAllRead(ctx context.Context, in *MarkAllReadReq, opts ...grpc.CallOption) (*Empty, error)
	GetUnreadNum(ctx context.Context, in *GetUnreadNumReq, opts ...grpc.CallOption) (*GetUnreadNumResp, error)
	GetMessage(ctx context.Context, in *GetMessageReq, opts ...grpc.CallOption) (*MessageRecord, error)
	GetMessageList(ctx context.Context, in *GetMessageListReq, opts ...grpc.CallOption) (*GetMessageListResp, error)
}

MessageClient is the client API for Message 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 NewMessageClient

func NewMessageClient(cc grpc.ClientConnInterface) MessageClient

type MessageHTTPClient

type MessageHTTPClient interface {
	GetMessage(ctx context.Context, req *GetMessageReq, opts ...http.CallOption) (rsp *MessageRecord, err error)
	GetMessageList(ctx context.Context, req *GetMessageListReq, opts ...http.CallOption) (rsp *GetMessageListResp, err error)
	GetUnreadNum(ctx context.Context, req *GetUnreadNumReq, opts ...http.CallOption) (rsp *GetUnreadNumResp, err error)
	MarkAllRead(ctx context.Context, req *MarkAllReadReq, opts ...http.CallOption) (rsp *Empty, err error)
	SendMessage(ctx context.Context, req *SendMessageReq, opts ...http.CallOption) (rsp *Empty, err error)
}

func NewMessageHTTPClient

func NewMessageHTTPClient(client *http.Client) MessageHTTPClient

type MessageHTTPClientImpl

type MessageHTTPClientImpl struct {
	// contains filtered or unexported fields
}

func (*MessageHTTPClientImpl) GetMessage

func (*MessageHTTPClientImpl) GetMessageList

func (*MessageHTTPClientImpl) GetUnreadNum

func (*MessageHTTPClientImpl) MarkAllRead

func (c *MessageHTTPClientImpl) MarkAllRead(ctx context.Context, in *MarkAllReadReq, opts ...http.CallOption) (*Empty, error)

func (*MessageHTTPClientImpl) SendMessage

func (c *MessageHTTPClientImpl) SendMessage(ctx context.Context, in *SendMessageReq, opts ...http.CallOption) (*Empty, error)

type MessageHTTPServer

type MessageHTTPServer interface {
	GetMessage(context.Context, *GetMessageReq) (*MessageRecord, error)
	GetMessageList(context.Context, *GetMessageListReq) (*GetMessageListResp, error)
	GetUnreadNum(context.Context, *GetUnreadNumReq) (*GetUnreadNumResp, error)
	MarkAllRead(context.Context, *MarkAllReadReq) (*Empty, error)
	SendMessage(context.Context, *SendMessageReq) (*Empty, error)
}

type MessagePayload

type MessagePayload struct {
	Timestamp   int64       `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	MessageType MessageType `protobuf:"varint,3,opt,name=message_type,json=messageType,proto3,enum=api.message.MessageType" json:"message_type,omitempty"`
	Title       string      `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"`
	Content     string      `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"`
	// contains filtered or unexported fields
}

func (*MessagePayload) Descriptor deprecated

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

Deprecated: Use MessagePayload.ProtoReflect.Descriptor instead.

func (*MessagePayload) GetContent

func (x *MessagePayload) GetContent() string

func (*MessagePayload) GetMessageType

func (x *MessagePayload) GetMessageType() MessageType

func (*MessagePayload) GetTimestamp

func (x *MessagePayload) GetTimestamp() int64

func (*MessagePayload) GetTitle

func (x *MessagePayload) GetTitle() string

func (*MessagePayload) ProtoMessage

func (*MessagePayload) ProtoMessage()

func (*MessagePayload) ProtoReflect

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

func (*MessagePayload) Reset

func (x *MessagePayload) Reset()

func (*MessagePayload) String

func (x *MessagePayload) String() string

type MessageRecord

type MessageRecord struct {
	Id         uint64          `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	CreateTime int64           `protobuf:"varint,2,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
	UpdateTime int64           `protobuf:"varint,3,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
	Unread     bool            `protobuf:"varint,4,opt,name=unread,proto3" json:"unread,omitempty"`
	UserId     string          `protobuf:"bytes,5,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	Payload    *MessagePayload `protobuf:"bytes,6,opt,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

func (*MessageRecord) Descriptor deprecated

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

Deprecated: Use MessageRecord.ProtoReflect.Descriptor instead.

func (*MessageRecord) GetCreateTime

func (x *MessageRecord) GetCreateTime() int64

func (*MessageRecord) GetId

func (x *MessageRecord) GetId() uint64

func (*MessageRecord) GetPayload

func (x *MessageRecord) GetPayload() *MessagePayload

func (*MessageRecord) GetUnread

func (x *MessageRecord) GetUnread() bool

func (*MessageRecord) GetUpdateTime

func (x *MessageRecord) GetUpdateTime() int64

func (*MessageRecord) GetUserId

func (x *MessageRecord) GetUserId() string

func (*MessageRecord) ProtoMessage

func (*MessageRecord) ProtoMessage()

func (*MessageRecord) ProtoReflect

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

func (*MessageRecord) Reset

func (x *MessageRecord) Reset()

func (*MessageRecord) String

func (x *MessageRecord) String() string

type MessageServer

type MessageServer interface {
	SendMessage(context.Context, *SendMessageReq) (*Empty, error)
	MarkAllRead(context.Context, *MarkAllReadReq) (*Empty, error)
	GetUnreadNum(context.Context, *GetUnreadNumReq) (*GetUnreadNumResp, error)
	GetMessage(context.Context, *GetMessageReq) (*MessageRecord, error)
	GetMessageList(context.Context, *GetMessageListReq) (*GetMessageListResp, error)
	// contains filtered or unexported methods
}

MessageServer is the server API for Message service. All implementations must embed UnimplementedMessageServer for forward compatibility.

type MessageType

type MessageType int32
const (
	MessageType_TYPE_UNKNOWN        MessageType = 0
	MessageType_TYPE_DEVICE_ONLINE  MessageType = 1
	MessageType_TYPE_DEVICE_OFFLINE MessageType = 2
)

func (MessageType) Descriptor

func (MessageType) Enum

func (x MessageType) Enum() *MessageType

func (MessageType) EnumDescriptor deprecated

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

Deprecated: Use MessageType.Descriptor instead.

func (MessageType) Number

func (x MessageType) Number() protoreflect.EnumNumber

func (MessageType) String

func (x MessageType) String() string

func (MessageType) Type

type SendMessageReq

type SendMessageReq struct {
	UserId  []string        `protobuf:"bytes,1,rep,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	Payload *MessagePayload `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

func (*SendMessageReq) Descriptor deprecated

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

Deprecated: Use SendMessageReq.ProtoReflect.Descriptor instead.

func (*SendMessageReq) GetPayload

func (x *SendMessageReq) GetPayload() *MessagePayload

func (*SendMessageReq) GetUserId

func (x *SendMessageReq) GetUserId() []string

func (*SendMessageReq) ProtoMessage

func (*SendMessageReq) ProtoMessage()

func (*SendMessageReq) ProtoReflect

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

func (*SendMessageReq) Reset

func (x *SendMessageReq) Reset()

func (*SendMessageReq) String

func (x *SendMessageReq) String() string

type UnimplementedMessageServer

type UnimplementedMessageServer struct{}

UnimplementedMessageServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedMessageServer) GetMessage

func (UnimplementedMessageServer) GetMessageList

func (UnimplementedMessageServer) GetUnreadNum

func (UnimplementedMessageServer) MarkAllRead

func (UnimplementedMessageServer) SendMessage

type UnsafeMessageServer

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

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

Jump to

Keyboard shortcuts

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