v1

package
v0.0.0-...-fa05059 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ranking_TopN_FullMethodName     = "/api.ranking.v1.Ranking/TopN"
	Ranking_ListTopN_FullMethodName = "/api.ranking.v1.Ranking/ListTopN"
)
View Source
const OperationRankingListTopN = "/api.ranking.v1.Ranking/ListTopN"

Variables

View Source
var File_api_ranking_v1_ranking_proto protoreflect.FileDescriptor
View Source
var Ranking_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.ranking.v1.Ranking",
	HandlerType: (*RankingServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "TopN",
			Handler:    _Ranking_TopN_Handler,
		},
		{
			MethodName: "ListTopN",
			Handler:    _Ranking_ListTopN_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/ranking/v1/ranking.proto",
}

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

Functions

func RegisterRankingHTTPServer

func RegisterRankingHTTPServer(s *http.Server, srv RankingHTTPServer)

func RegisterRankingServer

func RegisterRankingServer(s grpc.ServiceRegistrar, srv RankingServer)

Types

type GetOrListRanking

type GetOrListRanking struct {
	Id           int64  `protobuf:"varint,1,opt,name=id,proto3" json:"id,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"`
	PostId       int64  `protobuf:"varint,4,opt,name=postId,proto3" json:"postId,omitempty"`
	UserId       int64  `protobuf:"varint,5,opt,name=userId,proto3" json:"userId,omitempty"`
	PlateId      int64  `protobuf:"varint,6,opt,name=plateId,proto3" json:"plateId,omitempty"`
	LikeCount    int64  `protobuf:"varint,7,opt,name=likeCount,proto3" json:"likeCount,omitempty"`
	CollectCount int64  `protobuf:"varint,8,opt,name=collectCount,proto3" json:"collectCount,omitempty"`
	ViewCount    int64  `protobuf:"varint,9,opt,name=viewCount,proto3" json:"viewCount,omitempty"`
	// contains filtered or unexported fields
}

func (*GetOrListRanking) Descriptor deprecated

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

Deprecated: Use GetOrListRanking.ProtoReflect.Descriptor instead.

func (*GetOrListRanking) GetCollectCount

func (x *GetOrListRanking) GetCollectCount() int64

func (*GetOrListRanking) GetContent

func (x *GetOrListRanking) GetContent() string

func (*GetOrListRanking) GetId

func (x *GetOrListRanking) GetId() int64

func (*GetOrListRanking) GetLikeCount

func (x *GetOrListRanking) GetLikeCount() int64

func (*GetOrListRanking) GetPlateId

func (x *GetOrListRanking) GetPlateId() int64

func (*GetOrListRanking) GetPostId

func (x *GetOrListRanking) GetPostId() int64

func (*GetOrListRanking) GetTitle

func (x *GetOrListRanking) GetTitle() string

func (*GetOrListRanking) GetUserId

func (x *GetOrListRanking) GetUserId() int64

func (*GetOrListRanking) GetViewCount

func (x *GetOrListRanking) GetViewCount() int64

func (*GetOrListRanking) ProtoMessage

func (*GetOrListRanking) ProtoMessage()

func (*GetOrListRanking) ProtoReflect

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

func (*GetOrListRanking) Reset

func (x *GetOrListRanking) Reset()

func (*GetOrListRanking) String

func (x *GetOrListRanking) String() string

type ListTopNReply

type ListTopNReply struct {
	Code int32               `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Msg  string              `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
	Data []*GetOrListRanking `protobuf:"bytes,3,rep,name=data,proto3" json:"data,omitempty"` // 排名列表
	// contains filtered or unexported fields
}

func (*ListTopNReply) Descriptor deprecated

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

Deprecated: Use ListTopNReply.ProtoReflect.Descriptor instead.

func (*ListTopNReply) GetCode

func (x *ListTopNReply) GetCode() int32

func (*ListTopNReply) GetData

func (x *ListTopNReply) GetData() []*GetOrListRanking

func (*ListTopNReply) GetMsg

func (x *ListTopNReply) GetMsg() string

func (*ListTopNReply) ProtoMessage

func (*ListTopNReply) ProtoMessage()

func (*ListTopNReply) ProtoReflect

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

func (*ListTopNReply) Reset

func (x *ListTopNReply) Reset()

func (*ListTopNReply) String

func (x *ListTopNReply) String() string

type ListTopNRequest

type ListTopNRequest struct {
	Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
	Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
	// contains filtered or unexported fields
}

func (*ListTopNRequest) Descriptor deprecated

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

Deprecated: Use ListTopNRequest.ProtoReflect.Descriptor instead.

func (*ListTopNRequest) GetPage

func (x *ListTopNRequest) GetPage() int32

func (*ListTopNRequest) GetSize

func (x *ListTopNRequest) GetSize() int64

func (*ListTopNRequest) ProtoMessage

func (*ListTopNRequest) ProtoMessage()

func (*ListTopNRequest) ProtoReflect

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

func (*ListTopNRequest) Reset

func (x *ListTopNRequest) Reset()

func (*ListTopNRequest) String

func (x *ListTopNRequest) String() string

type RankingClient

type RankingClient interface {
	// 获取前 N 个排名
	TopN(ctx context.Context, in *TopNRequest, opts ...grpc.CallOption) (*TopNReply, error)
	// 获取分页的前 N 个排名列表
	ListTopN(ctx context.Context, in *ListTopNRequest, opts ...grpc.CallOption) (*ListTopNReply, error)
}

RankingClient is the client API for Ranking 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 NewRankingClient

func NewRankingClient(cc grpc.ClientConnInterface) RankingClient

type RankingHTTPClient

type RankingHTTPClient interface {
	ListTopN(ctx context.Context, req *ListTopNRequest, opts ...http.CallOption) (rsp *ListTopNReply, err error)
}

func NewRankingHTTPClient

func NewRankingHTTPClient(client *http.Client) RankingHTTPClient

type RankingHTTPClientImpl

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

func (*RankingHTTPClientImpl) ListTopN

type RankingHTTPServer

type RankingHTTPServer interface {
	// ListTopN 获取分页的前 N 个排名列表
	ListTopN(context.Context, *ListTopNRequest) (*ListTopNReply, error)
}

type RankingServer

type RankingServer interface {
	// 获取前 N 个排名
	TopN(context.Context, *TopNRequest) (*TopNReply, error)
	// 获取分页的前 N 个排名列表
	ListTopN(context.Context, *ListTopNRequest) (*ListTopNReply, error)
	// contains filtered or unexported methods
}

RankingServer is the server API for Ranking service. All implementations must embed UnimplementedRankingServer for forward compatibility

type TopNReply

type TopNReply struct {
	Code int32  `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Msg  string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

func (*TopNReply) Descriptor deprecated

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

Deprecated: Use TopNReply.ProtoReflect.Descriptor instead.

func (*TopNReply) GetCode

func (x *TopNReply) GetCode() int32

func (*TopNReply) GetMsg

func (x *TopNReply) GetMsg() string

func (*TopNReply) ProtoMessage

func (*TopNReply) ProtoMessage()

func (*TopNReply) ProtoReflect

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

func (*TopNReply) Reset

func (x *TopNReply) Reset()

func (*TopNReply) String

func (x *TopNReply) String() string

type TopNRequest

type TopNRequest struct {
	Count int32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` // 要获取的排名数量
	// contains filtered or unexported fields
}

func (*TopNRequest) Descriptor deprecated

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

Deprecated: Use TopNRequest.ProtoReflect.Descriptor instead.

func (*TopNRequest) GetCount

func (x *TopNRequest) GetCount() int32

func (*TopNRequest) ProtoMessage

func (*TopNRequest) ProtoMessage()

func (*TopNRequest) ProtoReflect

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

func (*TopNRequest) Reset

func (x *TopNRequest) Reset()

func (*TopNRequest) String

func (x *TopNRequest) String() string

type UnimplementedRankingServer

type UnimplementedRankingServer struct {
}

UnimplementedRankingServer must be embedded to have forward compatible implementations.

func (UnimplementedRankingServer) ListTopN

func (UnimplementedRankingServer) TopN

type UnsafeRankingServer

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

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

Jump to

Keyboard shortcuts

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