v1

package
v0.0.0-...-a2c21a8 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_api_message_v1_message_proto protoreflect.FileDescriptor
View Source
var File_api_message_v1_notice_proto protoreflect.FileDescriptor
View Source
var MessageService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "news.v1.MessageService",
	HandlerType: (*MessageServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "List",
			Handler:    _MessageService_List_Handler,
		},
		{
			MethodName: "Read",
			Handler:    _MessageService_Read_Handler,
		},
		{
			MethodName: "Send",
			Handler:    _MessageService_Send_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _MessageService_Delete_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/message/v1/message.proto",
}

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

View Source
var NoticeService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "news.v1.NoticeService",
	HandlerType: (*NoticeServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "List",
			Handler:    _NoticeService_List_Handler,
		},
		{
			MethodName: "Send",
			Handler:    _NoticeService_Send_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/message/v1/notice.proto",
}

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

Functions

func NewMessageServiceHandler

func NewMessageServiceHandler(srv MessageServiceHandler, opts ...http1.HandleOption) http.Handler

func NewNoticeServiceHandler

func NewNoticeServiceHandler(srv NoticeServiceHandler, opts ...http1.HandleOption) http.Handler

func RegisterMessageServiceServer

func RegisterMessageServiceServer(s grpc.ServiceRegistrar, srv MessageServiceServer)

func RegisterNoticeServiceServer

func RegisterNoticeServiceServer(s grpc.ServiceRegistrar, srv NoticeServiceServer)

Types

type Message

type Message struct {

	// 消息类型 0 普通通知
	Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	// 标题
	Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
	// 消息内容
	Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"`
	// 接受者用户id
	To string `protobuf:"bytes,4,opt,name=to,proto3" json:"to,omitempty"`
	// 是否已读 普通通知才有效
	Read bool `protobuf:"varint,5,opt,name=read,proto3" json:"read,omitempty"`
	// 发送时间
	Birthday *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=birthday,proto3" json:"birthday,omitempty"`
	// contains filtered or unexported fields
}

func (*Message) Descriptor deprecated

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

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetBirthday

func (x *Message) GetBirthday() *timestamppb.Timestamp

func (*Message) GetContent

func (x *Message) GetContent() string

func (*Message) GetRead

func (x *Message) GetRead() bool

func (*Message) GetTitle

func (x *Message) GetTitle() string

func (*Message) GetTo

func (x *Message) GetTo() string

func (*Message) GetType

func (x *Message) GetType() string

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect

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

func (*Message) Reset

func (x *Message) Reset()

func (*Message) String

func (x *Message) String() string

type MessageCreateOption

type MessageCreateOption struct {

	// 消息类型 0 普通通知
	Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	// 标题
	Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"`
	// 消息内容
	Content string `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty"`
	// 接受者用户id
	To string `protobuf:"bytes,6,opt,name=to,proto3" json:"to,omitempty"`
	// contains filtered or unexported fields
}

创建消息

func (*MessageCreateOption) Descriptor deprecated

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

Deprecated: Use MessageCreateOption.ProtoReflect.Descriptor instead.

func (*MessageCreateOption) GetContent

func (x *MessageCreateOption) GetContent() string

func (*MessageCreateOption) GetTitle

func (x *MessageCreateOption) GetTitle() string

func (*MessageCreateOption) GetTo

func (x *MessageCreateOption) GetTo() string

func (*MessageCreateOption) GetType

func (x *MessageCreateOption) GetType() string

func (*MessageCreateOption) ProtoMessage

func (*MessageCreateOption) ProtoMessage()

func (*MessageCreateOption) ProtoReflect

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

func (*MessageCreateOption) Reset

func (x *MessageCreateOption) Reset()

func (*MessageCreateOption) String

func (x *MessageCreateOption) String() string

type MessageDeleteOption

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

func (*MessageDeleteOption) Descriptor deprecated

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

Deprecated: Use MessageDeleteOption.ProtoReflect.Descriptor instead.

func (*MessageDeleteOption) GetId

func (x *MessageDeleteOption) GetId() int64

func (*MessageDeleteOption) ProtoMessage

func (*MessageDeleteOption) ProtoMessage()

func (*MessageDeleteOption) ProtoReflect

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

func (*MessageDeleteOption) Reset

func (x *MessageDeleteOption) Reset()

func (*MessageDeleteOption) String

func (x *MessageDeleteOption) String() string

type MessageIds

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

func (*MessageIds) Descriptor deprecated

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

Deprecated: Use MessageIds.ProtoReflect.Descriptor instead.

func (*MessageIds) GetId

func (x *MessageIds) GetId() int64

func (*MessageIds) ProtoMessage

func (*MessageIds) ProtoMessage()

func (*MessageIds) ProtoReflect

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

func (*MessageIds) Reset

func (x *MessageIds) Reset()

func (*MessageIds) String

func (x *MessageIds) String() string

type MessageList

type MessageList struct {

	//列表
	List []*Message `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"`
	//总数
	Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"`
	//页码
	Page uint32 `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"`
	//分页大学
	PageSize uint32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	// contains filtered or unexported fields
}

func (*MessageList) Descriptor deprecated

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

Deprecated: Use MessageList.ProtoReflect.Descriptor instead.

func (*MessageList) GetList

func (x *MessageList) GetList() []*Message

func (*MessageList) GetPage

func (x *MessageList) GetPage() uint32

func (*MessageList) GetPageSize

func (x *MessageList) GetPageSize() uint32

func (*MessageList) GetTotal

func (x *MessageList) GetTotal() int64

func (*MessageList) ProtoMessage

func (*MessageList) ProtoMessage()

func (*MessageList) ProtoReflect

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

func (*MessageList) Reset

func (x *MessageList) Reset()

func (*MessageList) String

func (x *MessageList) String() string

type MessageListOption

type MessageListOption struct {

	// 类型 消息类型 0 普通通知
	Type uint32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"`
	// 0全部  1已读 2未读
	Read uint32 `protobuf:"varint,2,opt,name=read,proto3" json:"read,omitempty"`
	// 总数
	Total int64 `protobuf:"varint,8,opt,name=total,proto3" json:"total,omitempty"`
	// 未读总数
	UnreadTotal int64 `protobuf:"varint,9,opt,name=unread_total,json=unreadTotal,proto3" json:"unread_total,omitempty"`
	// 页码
	Page uint32 `protobuf:"varint,10,opt,name=page,proto3" json:"page,omitempty"`
	// 分页大小
	PageSize uint32 `protobuf:"varint,11,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	// contains filtered or unexported fields
}

func (*MessageListOption) Descriptor deprecated

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

Deprecated: Use MessageListOption.ProtoReflect.Descriptor instead.

func (*MessageListOption) GetPage

func (x *MessageListOption) GetPage() uint32

func (*MessageListOption) GetPageSize

func (x *MessageListOption) GetPageSize() uint32

func (*MessageListOption) GetRead

func (x *MessageListOption) GetRead() uint32

func (*MessageListOption) GetTotal

func (x *MessageListOption) GetTotal() int64

func (*MessageListOption) GetType

func (x *MessageListOption) GetType() uint32

func (*MessageListOption) GetUnreadTotal

func (x *MessageListOption) GetUnreadTotal() int64

func (*MessageListOption) ProtoMessage

func (*MessageListOption) ProtoMessage()

func (*MessageListOption) ProtoReflect

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

func (*MessageListOption) Reset

func (x *MessageListOption) Reset()

func (*MessageListOption) String

func (x *MessageListOption) String() string

type MessageServiceClient

type MessageServiceClient interface {
	// 消息列表
	List(ctx context.Context, in *MessageListOption, opts ...grpc.CallOption) (*MessageList, error)
	//标记已都
	Read(ctx context.Context, in *MessageIds, opts ...grpc.CallOption) (*Message, error)
	// 发送一个消息
	Send(ctx context.Context, in *MessageCreateOption, opts ...grpc.CallOption) (*Message, error)
	// 删除消息
	Delete(ctx context.Context, in *MessageDeleteOption, opts ...grpc.CallOption) (*Message, error)
}

MessageServiceClient is the client API for MessageService 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.

type MessageServiceServer

type MessageServiceServer interface {
	// 消息列表
	List(context.Context, *MessageListOption) (*MessageList, error)
	//标记已都
	Read(context.Context, *MessageIds) (*Message, error)
	// 发送一个消息
	Send(context.Context, *MessageCreateOption) (*Message, error)
	// 删除消息
	Delete(context.Context, *MessageDeleteOption) (*Message, error)
	// contains filtered or unexported methods
}

MessageServiceServer is the server API for MessageService service. All implementations must embed UnimplementedMessageServiceServer for forward compatibility

type Notice

type Notice struct {

	// 通知类型 1 email 2 短信
	Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	// 标题
	Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
	// 通知内容
	Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"`
	// 接受者用户id
	To string `protobuf:"bytes,4,opt,name=to,proto3" json:"to,omitempty"`
	// 状态 0未发送 9发送成功 10 发送失败
	Status uint32 `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"`
	// 失败原因
	ErrorMsg string `protobuf:"bytes,6,opt,name=error_msg,json=errorMsg,proto3" json:"error_msg,omitempty"`
	// 发送时间
	Birthday *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=birthday,proto3" json:"birthday,omitempty"`
	// contains filtered or unexported fields
}

func (*Notice) Descriptor deprecated

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

Deprecated: Use Notice.ProtoReflect.Descriptor instead.

func (*Notice) GetBirthday

func (x *Notice) GetBirthday() *timestamppb.Timestamp

func (*Notice) GetContent

func (x *Notice) GetContent() string

func (*Notice) GetErrorMsg

func (x *Notice) GetErrorMsg() string

func (*Notice) GetStatus

func (x *Notice) GetStatus() uint32

func (*Notice) GetTitle

func (x *Notice) GetTitle() string

func (*Notice) GetTo

func (x *Notice) GetTo() string

func (*Notice) GetType

func (x *Notice) GetType() string

func (*Notice) ProtoMessage

func (*Notice) ProtoMessage()

func (*Notice) ProtoReflect

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

func (*Notice) Reset

func (x *Notice) Reset()

func (*Notice) String

func (x *Notice) String() string

type NoticeCreateOption

type NoticeCreateOption struct {

	// 通知类型 0 普通通知
	Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	// 标题
	Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"`
	// 通知内容
	Content string `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty"`
	// 接受者用户id
	To string `protobuf:"bytes,6,opt,name=to,proto3" json:"to,omitempty"`
	// contains filtered or unexported fields
}

创建通知

func (*NoticeCreateOption) Descriptor deprecated

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

Deprecated: Use NoticeCreateOption.ProtoReflect.Descriptor instead.

func (*NoticeCreateOption) GetContent

func (x *NoticeCreateOption) GetContent() string

func (*NoticeCreateOption) GetTitle

func (x *NoticeCreateOption) GetTitle() string

func (*NoticeCreateOption) GetTo

func (x *NoticeCreateOption) GetTo() string

func (*NoticeCreateOption) GetType

func (x *NoticeCreateOption) GetType() string

func (*NoticeCreateOption) ProtoMessage

func (*NoticeCreateOption) ProtoMessage()

func (*NoticeCreateOption) ProtoReflect

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

func (*NoticeCreateOption) Reset

func (x *NoticeCreateOption) Reset()

func (*NoticeCreateOption) String

func (x *NoticeCreateOption) String() string

type NoticeList

type NoticeList struct {

	//列表
	List []*Notice `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"`
	//总数
	Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"`
	//页码
	Page uint32 `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"`
	//分页
	PageSize uint32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	// contains filtered or unexported fields
}

func (*NoticeList) Descriptor deprecated

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

Deprecated: Use NoticeList.ProtoReflect.Descriptor instead.

func (*NoticeList) GetList

func (x *NoticeList) GetList() []*Notice

func (*NoticeList) GetPage

func (x *NoticeList) GetPage() uint32

func (*NoticeList) GetPageSize

func (x *NoticeList) GetPageSize() uint32

func (*NoticeList) GetTotal

func (x *NoticeList) GetTotal() int64

func (*NoticeList) ProtoMessage

func (*NoticeList) ProtoMessage()

func (*NoticeList) ProtoReflect

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

func (*NoticeList) Reset

func (x *NoticeList) Reset()

func (*NoticeList) String

func (x *NoticeList) String() string

type NoticeListOption

type NoticeListOption struct {

	// 类型 通知类型 1 email 2 短信
	Type uint32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"`
	// 总数
	Total int64 `protobuf:"varint,8,opt,name=total,proto3" json:"total,omitempty"`
	// 页码
	Page uint32 `protobuf:"varint,10,opt,name=page,proto3" json:"page,omitempty"`
	// 分页大小
	PageSize uint32 `protobuf:"varint,11,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	// contains filtered or unexported fields
}

func (*NoticeListOption) Descriptor deprecated

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

Deprecated: Use NoticeListOption.ProtoReflect.Descriptor instead.

func (*NoticeListOption) GetPage

func (x *NoticeListOption) GetPage() uint32

func (*NoticeListOption) GetPageSize

func (x *NoticeListOption) GetPageSize() uint32

func (*NoticeListOption) GetTotal

func (x *NoticeListOption) GetTotal() int64

func (*NoticeListOption) GetType

func (x *NoticeListOption) GetType() uint32

func (*NoticeListOption) ProtoMessage

func (*NoticeListOption) ProtoMessage()

func (*NoticeListOption) ProtoReflect

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

func (*NoticeListOption) Reset

func (x *NoticeListOption) Reset()

func (*NoticeListOption) String

func (x *NoticeListOption) String() string

type NoticeServiceClient

type NoticeServiceClient interface {
	// 查看发送队列
	List(ctx context.Context, in *NoticeListOption, opts ...grpc.CallOption) (*NoticeList, error)
	// 发送一个通知
	Send(ctx context.Context, in *NoticeCreateOption, opts ...grpc.CallOption) (*Notice, error)
}

NoticeServiceClient is the client API for NoticeService 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.

type NoticeServiceHandler

type NoticeServiceHandler interface {
	List(context.Context, *NoticeListOption) (*NoticeList, error)

	Send(context.Context, *NoticeCreateOption) (*Notice, error)
}

type NoticeServiceServer

type NoticeServiceServer interface {
	// 查看发送队列
	List(context.Context, *NoticeListOption) (*NoticeList, error)
	// 发送一个通知
	Send(context.Context, *NoticeCreateOption) (*Notice, error)
	// contains filtered or unexported methods
}

NoticeServiceServer is the server API for NoticeService service. All implementations must embed UnimplementedNoticeServiceServer for forward compatibility

type UnimplementedMessageServiceServer

type UnimplementedMessageServiceServer struct {
}

UnimplementedMessageServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedMessageServiceServer) Delete

func (UnimplementedMessageServiceServer) List

func (UnimplementedMessageServiceServer) Read

func (UnimplementedMessageServiceServer) Send

type UnimplementedNoticeServiceServer

type UnimplementedNoticeServiceServer struct {
}

UnimplementedNoticeServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedNoticeServiceServer) List

func (UnimplementedNoticeServiceServer) Send

type UnsafeMessageServiceServer

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

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

type UnsafeNoticeServiceServer

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

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

Jump to

Keyboard shortcuts

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