You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1753 lines
45 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: api/v1/favorite.proto
package v1
import (
context "context"
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
_ "google.golang.org/genproto/googleapis/api/annotations"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
emptypb "google.golang.org/protobuf/types/known/emptypb"
_ "google.golang.org/protobuf/types/known/timestamppb"
io "io"
math "math"
math_bits "math/bits"
time "time"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
var _ = time.Kitchen
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// 文档收藏
type Favorite struct {
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
DocumentId int64 `protobuf:"varint,3,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"`
Title string `protobuf:"bytes,6,opt,name=title,proto3" json:"title,omitempty"`
Ext string `protobuf:"bytes,7,opt,name=ext,proto3" json:"ext,omitempty"`
Score int32 `protobuf:"varint,8,opt,name=score,proto3" json:"score,omitempty"`
Size_ int64 `protobuf:"varint,9,opt,name=size,proto3" json:"size,omitempty"`
Pages int32 `protobuf:"varint,10,opt,name=pages,proto3" json:"pages,omitempty"`
CreatedAt *time.Time `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at,omitempty"`
UpdatedAt *time.Time `protobuf:"bytes,5,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at,omitempty"`
}
func (m *Favorite) Reset() { *m = Favorite{} }
func (m *Favorite) String() string { return proto.CompactTextString(m) }
func (*Favorite) ProtoMessage() {}
func (*Favorite) Descriptor() ([]byte, []int) {
return fileDescriptor_a5e19a182b4c8c61, []int{0}
}
func (m *Favorite) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Favorite) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Favorite.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Favorite) XXX_Merge(src proto.Message) {
xxx_messageInfo_Favorite.Merge(m, src)
}
func (m *Favorite) XXX_Size() int {
return m.Size()
}
func (m *Favorite) XXX_DiscardUnknown() {
xxx_messageInfo_Favorite.DiscardUnknown(m)
}
var xxx_messageInfo_Favorite proto.InternalMessageInfo
func (m *Favorite) GetId() int64 {
if m != nil {
return m.Id
}
return 0
}
func (m *Favorite) GetUserId() int64 {
if m != nil {
return m.UserId
}
return 0
}
func (m *Favorite) GetDocumentId() int64 {
if m != nil {
return m.DocumentId
}
return 0
}
func (m *Favorite) GetTitle() string {
if m != nil {
return m.Title
}
return ""
}
func (m *Favorite) GetExt() string {
if m != nil {
return m.Ext
}
return ""
}
func (m *Favorite) GetScore() int32 {
if m != nil {
return m.Score
}
return 0
}
func (m *Favorite) GetSize_() int64 {
if m != nil {
return m.Size_
}
return 0
}
func (m *Favorite) GetPages() int32 {
if m != nil {
return m.Pages
}
return 0
}
func (m *Favorite) GetCreatedAt() *time.Time {
if m != nil {
return m.CreatedAt
}
return nil
}
func (m *Favorite) GetUpdatedAt() *time.Time {
if m != nil {
return m.UpdatedAt
}
return nil
}
// 取消收藏
type DeleteFavoriteRequest struct {
Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"`
}
func (m *DeleteFavoriteRequest) Reset() { *m = DeleteFavoriteRequest{} }
func (m *DeleteFavoriteRequest) String() string { return proto.CompactTextString(m) }
func (*DeleteFavoriteRequest) ProtoMessage() {}
func (*DeleteFavoriteRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_a5e19a182b4c8c61, []int{1}
}
func (m *DeleteFavoriteRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *DeleteFavoriteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_DeleteFavoriteRequest.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *DeleteFavoriteRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_DeleteFavoriteRequest.Merge(m, src)
}
func (m *DeleteFavoriteRequest) XXX_Size() int {
return m.Size()
}
func (m *DeleteFavoriteRequest) XXX_DiscardUnknown() {
xxx_messageInfo_DeleteFavoriteRequest.DiscardUnknown(m)
}
var xxx_messageInfo_DeleteFavoriteRequest proto.InternalMessageInfo
func (m *DeleteFavoriteRequest) GetId() []int64 {
if m != nil {
return m.Id
}
return nil
}
// 查询用户的收藏
type ListFavoriteRequest struct {
Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
Size_ int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
UserId int64 `protobuf:"varint,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
}
func (m *ListFavoriteRequest) Reset() { *m = ListFavoriteRequest{} }
func (m *ListFavoriteRequest) String() string { return proto.CompactTextString(m) }
func (*ListFavoriteRequest) ProtoMessage() {}
func (*ListFavoriteRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_a5e19a182b4c8c61, []int{2}
}
func (m *ListFavoriteRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *ListFavoriteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ListFavoriteRequest.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *ListFavoriteRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_ListFavoriteRequest.Merge(m, src)
}
func (m *ListFavoriteRequest) XXX_Size() int {
return m.Size()
}
func (m *ListFavoriteRequest) XXX_DiscardUnknown() {
xxx_messageInfo_ListFavoriteRequest.DiscardUnknown(m)
}
var xxx_messageInfo_ListFavoriteRequest proto.InternalMessageInfo
func (m *ListFavoriteRequest) GetPage() int64 {
if m != nil {
return m.Page
}
return 0
}
func (m *ListFavoriteRequest) GetSize_() int64 {
if m != nil {
return m.Size_
}
return 0
}
func (m *ListFavoriteRequest) GetUserId() int64 {
if m != nil {
return m.UserId
}
return 0
}
// 查询用户的收藏
type ListFavoriteReply struct {
Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
Favorite []*Favorite `protobuf:"bytes,2,rep,name=favorite,proto3" json:"favorite,omitempty"`
}
func (m *ListFavoriteReply) Reset() { *m = ListFavoriteReply{} }
func (m *ListFavoriteReply) String() string { return proto.CompactTextString(m) }
func (*ListFavoriteReply) ProtoMessage() {}
func (*ListFavoriteReply) Descriptor() ([]byte, []int) {
return fileDescriptor_a5e19a182b4c8c61, []int{3}
}
func (m *ListFavoriteReply) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *ListFavoriteReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ListFavoriteReply.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *ListFavoriteReply) XXX_Merge(src proto.Message) {
xxx_messageInfo_ListFavoriteReply.Merge(m, src)
}
func (m *ListFavoriteReply) XXX_Size() int {
return m.Size()
}
func (m *ListFavoriteReply) XXX_DiscardUnknown() {
xxx_messageInfo_ListFavoriteReply.DiscardUnknown(m)
}
var xxx_messageInfo_ListFavoriteReply proto.InternalMessageInfo
func (m *ListFavoriteReply) GetTotal() int64 {
if m != nil {
return m.Total
}
return 0
}
func (m *ListFavoriteReply) GetFavorite() []*Favorite {
if m != nil {
return m.Favorite
}
return nil
}
// 根据文章id查询用户是否有收藏某篇文档
type GetFavoriteRequest struct {
DocumentId int64 `protobuf:"varint,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"`
}
func (m *GetFavoriteRequest) Reset() { *m = GetFavoriteRequest{} }
func (m *GetFavoriteRequest) String() string { return proto.CompactTextString(m) }
func (*GetFavoriteRequest) ProtoMessage() {}
func (*GetFavoriteRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_a5e19a182b4c8c61, []int{4}
}
func (m *GetFavoriteRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *GetFavoriteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_GetFavoriteRequest.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *GetFavoriteRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetFavoriteRequest.Merge(m, src)
}
func (m *GetFavoriteRequest) XXX_Size() int {
return m.Size()
}
func (m *GetFavoriteRequest) XXX_DiscardUnknown() {
xxx_messageInfo_GetFavoriteRequest.DiscardUnknown(m)
}
var xxx_messageInfo_GetFavoriteRequest proto.InternalMessageInfo
func (m *GetFavoriteRequest) GetDocumentId() int64 {
if m != nil {
return m.DocumentId
}
return 0
}
func init() {
proto.RegisterType((*Favorite)(nil), "api.v1.Favorite")
proto.RegisterType((*DeleteFavoriteRequest)(nil), "api.v1.DeleteFavoriteRequest")
proto.RegisterType((*ListFavoriteRequest)(nil), "api.v1.ListFavoriteRequest")
proto.RegisterType((*ListFavoriteReply)(nil), "api.v1.ListFavoriteReply")
proto.RegisterType((*GetFavoriteRequest)(nil), "api.v1.GetFavoriteRequest")
}
func init() { proto.RegisterFile("api/v1/favorite.proto", fileDescriptor_a5e19a182b4c8c61) }
var fileDescriptor_a5e19a182b4c8c61 = []byte{
// 576 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x4d, 0x8f, 0xd2, 0x40,
0x18, 0x66, 0x5a, 0x60, 0xe1, 0xc5, 0x10, 0x76, 0x5c, 0xdc, 0x5a, 0xdc, 0x42, 0x7a, 0x91, 0x6c,
0x4c, 0x1b, 0x30, 0x7b, 0xd1, 0x83, 0x61, 0xfd, 0x0a, 0x89, 0x87, 0x95, 0xf8, 0x91, 0x78, 0xd9,
0xcc, 0xd2, 0x59, 0x32, 0x49, 0x61, 0x6a, 0x3b, 0x10, 0xf1, 0xa6, 0xbf, 0x60, 0x13, 0xff, 0x8f,
0x67, 0x8f, 0x9b, 0x78, 0xf1, 0xa6, 0x01, 0x7f, 0x88, 0xe9, 0x74, 0x4a, 0xd8, 0x96, 0x83, 0xb7,
0xf7, 0xf3, 0x79, 0xe7, 0x7d, 0x9e, 0xb7, 0x85, 0x26, 0x09, 0x98, 0xbb, 0xe8, 0xb9, 0x97, 0x64,
0xc1, 0x43, 0x26, 0xa8, 0x13, 0x84, 0x5c, 0x70, 0x5c, 0x26, 0x01, 0x73, 0x16, 0x3d, 0xb3, 0x3d,
0xe1, 0x7c, 0xe2, 0x53, 0x57, 0x46, 0x2f, 0xe6, 0x97, 0xae, 0x60, 0x53, 0x1a, 0x09, 0x32, 0x0d,
0x92, 0x42, 0xf3, 0x60, 0xc2, 0x27, 0x5c, 0x9a, 0x6e, 0x6c, 0xa9, 0xe8, 0x3d, 0xd5, 0x16, 0x83,
0x93, 0xd9, 0x8c, 0x0b, 0x22, 0x18, 0x9f, 0x45, 0x2a, 0xdb, 0xca, 0x82, 0xd2, 0x69, 0x20, 0x96,
0x49, 0xd2, 0xfe, 0xae, 0x41, 0xe5, 0x85, 0x7a, 0x0c, 0xae, 0x83, 0xc6, 0x3c, 0x03, 0x75, 0x50,
0x57, 0x1f, 0x69, 0xcc, 0xc3, 0x87, 0xb0, 0x37, 0x8f, 0x68, 0x78, 0xce, 0x3c, 0x43, 0x93, 0xc1,
0x72, 0xec, 0x0e, 0x3d, 0xdc, 0x86, 0x9a, 0xc7, 0xc7, 0xf3, 0x29, 0x9d, 0x89, 0x38, 0xa9, 0xcb,
0x24, 0xa4, 0xa1, 0xa1, 0x87, 0x0f, 0xa0, 0x24, 0x98, 0xf0, 0xa9, 0x51, 0xee, 0xa0, 0x6e, 0x75,
0x94, 0x38, 0xb8, 0x01, 0x3a, 0xfd, 0x24, 0x8c, 0x3d, 0x19, 0x8b, 0xcd, 0xb8, 0x2e, 0x1a, 0xf3,
0x90, 0x1a, 0x95, 0x0e, 0xea, 0x96, 0x46, 0x89, 0x83, 0x31, 0x14, 0x23, 0xf6, 0x99, 0x1a, 0x55,
0x89, 0x2b, 0xed, 0xb8, 0x32, 0x20, 0x13, 0x1a, 0x19, 0x90, 0x54, 0x4a, 0x07, 0x3f, 0x01, 0x18,
0x87, 0x94, 0x08, 0xea, 0x9d, 0x13, 0x61, 0x14, 0x3b, 0xa8, 0x5b, 0xeb, 0x9b, 0x4e, 0xb2, 0xb0,
0x93, 0x2e, 0xec, 0xbc, 0x49, 0x59, 0x3c, 0x2d, 0x5e, 0xfd, 0x6e, 0xa3, 0x51, 0x55, 0xf5, 0x0c,
0x44, 0x0c, 0x30, 0x0f, 0xbc, 0x14, 0xa0, 0xf4, 0xbf, 0x00, 0xaa, 0x67, 0x20, 0xec, 0xfb, 0xd0,
0x7c, 0x46, 0x7d, 0x2a, 0x68, 0xca, 0xe2, 0x88, 0x7e, 0x9c, 0xd3, 0x48, 0x6c, 0xc8, 0xd4, 0x13,
0x32, 0xed, 0x77, 0x70, 0xfb, 0x15, 0x8b, 0x44, 0xb6, 0x0c, 0x43, 0x31, 0x5e, 0x45, 0xb1, 0x2e,
0xed, 0xcd, 0xfe, 0xda, 0xd6, 0xfe, 0x5b, 0x5a, 0xe8, 0xdb, 0x5a, 0xd8, 0xef, 0x61, 0xff, 0x26,
0x6e, 0xe0, 0x2f, 0x25, 0xff, 0x5c, 0x10, 0x5f, 0xc1, 0x26, 0x0e, 0x7e, 0x00, 0x95, 0xf4, 0xf0,
0x0c, 0xad, 0xa3, 0x77, 0x6b, 0xfd, 0x86, 0x93, 0x5c, 0x9e, 0xb3, 0x69, 0xdf, 0x54, 0xd8, 0x27,
0x80, 0x5f, 0xd2, 0xdc, 0x7b, 0x33, 0xd2, 0xa3, 0xac, 0xf4, 0xfd, 0x2f, 0x3a, 0xd4, 0xd2, 0xa6,
0xc1, 0xd9, 0x10, 0xbf, 0x86, 0xfa, 0x53, 0x49, 0xf7, 0xe6, 0xcc, 0x72, 0x43, 0xcd, 0x5c, 0xc4,
0x6e, 0x7d, 0xfd, 0xf9, 0xf7, 0x9b, 0xd6, 0xb4, 0x1b, 0x6e, 0xe6, 0x8b, 0x79, 0x84, 0x8e, 0x31,
0x81, 0xfa, 0x4d, 0xce, 0xf1, 0x51, 0x0a, 0xb0, 0x53, 0x0b, 0xf3, 0x4e, 0x4e, 0xd1, 0xe7, 0xf1,
0x37, 0x60, 0x1b, 0x72, 0x0a, 0x3e, 0xce, 0x4d, 0xc1, 0x6f, 0xa1, 0xb6, 0xb5, 0x3c, 0x36, 0x53,
0xfc, 0x3c, 0x23, 0x3b, 0x1e, 0xaf, 0x60, 0x71, 0x1e, 0x96, 0xc2, 0xad, 0x6d, 0xb1, 0x70, 0x2b,
0xed, 0xdd, 0x71, 0x1a, 0xe6, 0xdd, 0xdd, 0xc9, 0xc0, 0x5f, 0xda, 0x47, 0x72, 0xc2, 0x21, 0x6e,
0x66, 0x27, 0xb8, 0x3e, 0x8b, 0xc4, 0xe9, 0xc9, 0x8f, 0x95, 0x85, 0xae, 0x57, 0x16, 0xfa, 0xb3,
0xb2, 0xd0, 0xd5, 0xda, 0x2a, 0x5c, 0xaf, 0xad, 0xc2, 0xaf, 0xb5, 0x55, 0x00, 0xf5, 0xa7, 0x39,
0x43, 0x1f, 0xf6, 0xa7, 0x3c, 0xa4, 0x1e, 0x1f, 0x2b, 0x84, 0xc7, 0x8b, 0xde, 0x45, 0x59, 0xd2,
0xf3, 0xf0, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8d, 0x8c, 0x60, 0x34, 0xa6, 0x04, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// FavoriteAPIClient is the client API for FavoriteAPI service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type FavoriteAPIClient interface {
// 添加收藏
CreateFavorite(ctx context.Context, in *Favorite, opts ...grpc.CallOption) (*Favorite, error)
// 取消收藏
DeleteFavorite(ctx context.Context, in *DeleteFavoriteRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// 根据文章id查询用户是否有收藏某篇文档
GetFavorite(ctx context.Context, in *GetFavoriteRequest, opts ...grpc.CallOption) (*Favorite, error)
// 查询用户的收藏
ListFavorite(ctx context.Context, in *ListFavoriteRequest, opts ...grpc.CallOption) (*ListFavoriteReply, error)
}
type favoriteAPIClient struct {
cc *grpc.ClientConn
}
func NewFavoriteAPIClient(cc *grpc.ClientConn) FavoriteAPIClient {
return &favoriteAPIClient{cc}
}
func (c *favoriteAPIClient) CreateFavorite(ctx context.Context, in *Favorite, opts ...grpc.CallOption) (*Favorite, error) {
out := new(Favorite)
err := c.cc.Invoke(ctx, "/api.v1.FavoriteAPI/CreateFavorite", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *favoriteAPIClient) DeleteFavorite(ctx context.Context, in *DeleteFavoriteRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/api.v1.FavoriteAPI/DeleteFavorite", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *favoriteAPIClient) GetFavorite(ctx context.Context, in *GetFavoriteRequest, opts ...grpc.CallOption) (*Favorite, error) {
out := new(Favorite)
err := c.cc.Invoke(ctx, "/api.v1.FavoriteAPI/GetFavorite", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *favoriteAPIClient) ListFavorite(ctx context.Context, in *ListFavoriteRequest, opts ...grpc.CallOption) (*ListFavoriteReply, error) {
out := new(ListFavoriteReply)
err := c.cc.Invoke(ctx, "/api.v1.FavoriteAPI/ListFavorite", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// FavoriteAPIServer is the server API for FavoriteAPI service.
type FavoriteAPIServer interface {
// 添加收藏
CreateFavorite(context.Context, *Favorite) (*Favorite, error)
// 取消收藏
DeleteFavorite(context.Context, *DeleteFavoriteRequest) (*emptypb.Empty, error)
// 根据文章id查询用户是否有收藏某篇文档
GetFavorite(context.Context, *GetFavoriteRequest) (*Favorite, error)
// 查询用户的收藏
ListFavorite(context.Context, *ListFavoriteRequest) (*ListFavoriteReply, error)
}
// UnimplementedFavoriteAPIServer can be embedded to have forward compatible implementations.
type UnimplementedFavoriteAPIServer struct {
}
func (*UnimplementedFavoriteAPIServer) CreateFavorite(ctx context.Context, req *Favorite) (*Favorite, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateFavorite not implemented")
}
func (*UnimplementedFavoriteAPIServer) DeleteFavorite(ctx context.Context, req *DeleteFavoriteRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteFavorite not implemented")
}
func (*UnimplementedFavoriteAPIServer) GetFavorite(ctx context.Context, req *GetFavoriteRequest) (*Favorite, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetFavorite not implemented")
}
func (*UnimplementedFavoriteAPIServer) ListFavorite(ctx context.Context, req *ListFavoriteRequest) (*ListFavoriteReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListFavorite not implemented")
}
func RegisterFavoriteAPIServer(s *grpc.Server, srv FavoriteAPIServer) {
s.RegisterService(&_FavoriteAPI_serviceDesc, srv)
}
func _FavoriteAPI_CreateFavorite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Favorite)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(FavoriteAPIServer).CreateFavorite(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.v1.FavoriteAPI/CreateFavorite",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(FavoriteAPIServer).CreateFavorite(ctx, req.(*Favorite))
}
return interceptor(ctx, in, info, handler)
}
func _FavoriteAPI_DeleteFavorite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteFavoriteRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(FavoriteAPIServer).DeleteFavorite(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.v1.FavoriteAPI/DeleteFavorite",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(FavoriteAPIServer).DeleteFavorite(ctx, req.(*DeleteFavoriteRequest))
}
return interceptor(ctx, in, info, handler)
}
func _FavoriteAPI_GetFavorite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetFavoriteRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(FavoriteAPIServer).GetFavorite(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.v1.FavoriteAPI/GetFavorite",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(FavoriteAPIServer).GetFavorite(ctx, req.(*GetFavoriteRequest))
}
return interceptor(ctx, in, info, handler)
}
func _FavoriteAPI_ListFavorite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListFavoriteRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(FavoriteAPIServer).ListFavorite(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.v1.FavoriteAPI/ListFavorite",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(FavoriteAPIServer).ListFavorite(ctx, req.(*ListFavoriteRequest))
}
return interceptor(ctx, in, info, handler)
}
var _FavoriteAPI_serviceDesc = grpc.ServiceDesc{
ServiceName: "api.v1.FavoriteAPI",
HandlerType: (*FavoriteAPIServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CreateFavorite",
Handler: _FavoriteAPI_CreateFavorite_Handler,
},
{
MethodName: "DeleteFavorite",
Handler: _FavoriteAPI_DeleteFavorite_Handler,
},
{
MethodName: "GetFavorite",
Handler: _FavoriteAPI_GetFavorite_Handler,
},
{
MethodName: "ListFavorite",
Handler: _FavoriteAPI_ListFavorite_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api/v1/favorite.proto",
}
func (m *Favorite) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Favorite) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Favorite) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.Pages != 0 {
i = encodeVarintFavorite(dAtA, i, uint64(m.Pages))
i--
dAtA[i] = 0x50
}
if m.Size_ != 0 {
i = encodeVarintFavorite(dAtA, i, uint64(m.Size_))
i--
dAtA[i] = 0x48
}
if m.Score != 0 {
i = encodeVarintFavorite(dAtA, i, uint64(m.Score))
i--
dAtA[i] = 0x40
}
if len(m.Ext) > 0 {
i -= len(m.Ext)
copy(dAtA[i:], m.Ext)
i = encodeVarintFavorite(dAtA, i, uint64(len(m.Ext)))
i--
dAtA[i] = 0x3a
}
if len(m.Title) > 0 {
i -= len(m.Title)
copy(dAtA[i:], m.Title)
i = encodeVarintFavorite(dAtA, i, uint64(len(m.Title)))
i--
dAtA[i] = 0x32
}
if m.UpdatedAt != nil {
n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.UpdatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.UpdatedAt):])
if err1 != nil {
return 0, err1
}
i -= n1
i = encodeVarintFavorite(dAtA, i, uint64(n1))
i--
dAtA[i] = 0x2a
}
if m.CreatedAt != nil {
n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.CreatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt):])
if err2 != nil {
return 0, err2
}
i -= n2
i = encodeVarintFavorite(dAtA, i, uint64(n2))
i--
dAtA[i] = 0x22
}
if m.DocumentId != 0 {
i = encodeVarintFavorite(dAtA, i, uint64(m.DocumentId))
i--
dAtA[i] = 0x18
}
if m.UserId != 0 {
i = encodeVarintFavorite(dAtA, i, uint64(m.UserId))
i--
dAtA[i] = 0x10
}
if m.Id != 0 {
i = encodeVarintFavorite(dAtA, i, uint64(m.Id))
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
func (m *DeleteFavoriteRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *DeleteFavoriteRequest) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *DeleteFavoriteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Id) > 0 {
dAtA4 := make([]byte, len(m.Id)*10)
var j3 int
for _, num1 := range m.Id {
num := uint64(num1)
for num >= 1<<7 {
dAtA4[j3] = uint8(uint64(num)&0x7f | 0x80)
num >>= 7
j3++
}
dAtA4[j3] = uint8(num)
j3++
}
i -= j3
copy(dAtA[i:], dAtA4[:j3])
i = encodeVarintFavorite(dAtA, i, uint64(j3))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *ListFavoriteRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *ListFavoriteRequest) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ListFavoriteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.UserId != 0 {
i = encodeVarintFavorite(dAtA, i, uint64(m.UserId))
i--
dAtA[i] = 0x18
}
if m.Size_ != 0 {
i = encodeVarintFavorite(dAtA, i, uint64(m.Size_))
i--
dAtA[i] = 0x10
}
if m.Page != 0 {
i = encodeVarintFavorite(dAtA, i, uint64(m.Page))
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
func (m *ListFavoriteReply) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *ListFavoriteReply) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ListFavoriteReply) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Favorite) > 0 {
for iNdEx := len(m.Favorite) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.Favorite[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintFavorite(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x12
}
}
if m.Total != 0 {
i = encodeVarintFavorite(dAtA, i, uint64(m.Total))
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
func (m *GetFavoriteRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *GetFavoriteRequest) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *GetFavoriteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.DocumentId != 0 {
i = encodeVarintFavorite(dAtA, i, uint64(m.DocumentId))
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
func encodeVarintFavorite(dAtA []byte, offset int, v uint64) int {
offset -= sovFavorite(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *Favorite) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Id != 0 {
n += 1 + sovFavorite(uint64(m.Id))
}
if m.UserId != 0 {
n += 1 + sovFavorite(uint64(m.UserId))
}
if m.DocumentId != 0 {
n += 1 + sovFavorite(uint64(m.DocumentId))
}
if m.CreatedAt != nil {
l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt)
n += 1 + l + sovFavorite(uint64(l))
}
if m.UpdatedAt != nil {
l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.UpdatedAt)
n += 1 + l + sovFavorite(uint64(l))
}
l = len(m.Title)
if l > 0 {
n += 1 + l + sovFavorite(uint64(l))
}
l = len(m.Ext)
if l > 0 {
n += 1 + l + sovFavorite(uint64(l))
}
if m.Score != 0 {
n += 1 + sovFavorite(uint64(m.Score))
}
if m.Size_ != 0 {
n += 1 + sovFavorite(uint64(m.Size_))
}
if m.Pages != 0 {
n += 1 + sovFavorite(uint64(m.Pages))
}
return n
}
func (m *DeleteFavoriteRequest) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if len(m.Id) > 0 {
l = 0
for _, e := range m.Id {
l += sovFavorite(uint64(e))
}
n += 1 + sovFavorite(uint64(l)) + l
}
return n
}
func (m *ListFavoriteRequest) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Page != 0 {
n += 1 + sovFavorite(uint64(m.Page))
}
if m.Size_ != 0 {
n += 1 + sovFavorite(uint64(m.Size_))
}
if m.UserId != 0 {
n += 1 + sovFavorite(uint64(m.UserId))
}
return n
}
func (m *ListFavoriteReply) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Total != 0 {
n += 1 + sovFavorite(uint64(m.Total))
}
if len(m.Favorite) > 0 {
for _, e := range m.Favorite {
l = e.Size()
n += 1 + l + sovFavorite(uint64(l))
}
}
return n
}
func (m *GetFavoriteRequest) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.DocumentId != 0 {
n += 1 + sovFavorite(uint64(m.DocumentId))
}
return n
}
func sovFavorite(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozFavorite(x uint64) (n int) {
return sovFavorite(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *Favorite) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFavorite
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: Favorite: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Favorite: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
}
m.Id = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFavorite
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Id |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field UserId", wireType)
}
m.UserId = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFavorite
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.UserId |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field DocumentId", wireType)
}
m.DocumentId = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFavorite
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.DocumentId |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFavorite
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthFavorite
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthFavorite
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.CreatedAt == nil {
m.CreatedAt = new(time.Time)
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.CreatedAt, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 5:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field UpdatedAt", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFavorite
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthFavorite
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthFavorite
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.UpdatedAt == nil {
m.UpdatedAt = new(time.Time)
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.UpdatedAt, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 6:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFavorite
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthFavorite
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthFavorite
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Title = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 7:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Ext", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFavorite
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthFavorite
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthFavorite
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Ext = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 8:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Score", wireType)
}
m.Score = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFavorite
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Score |= int32(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 9:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType)
}
m.Size_ = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFavorite
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Size_ |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 10:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Pages", wireType)
}
m.Pages = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFavorite
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Pages |= int32(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipFavorite(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthFavorite
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *DeleteFavoriteRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFavorite
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: DeleteFavoriteRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: DeleteFavoriteRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType == 0 {
var v int64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFavorite
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.Id = append(m.Id, v)
} else if wireType == 2 {
var packedLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFavorite
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
packedLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if packedLen < 0 {
return ErrInvalidLengthFavorite
}
postIndex := iNdEx + packedLen
if postIndex < 0 {
return ErrInvalidLengthFavorite
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
var elementCount int
var count int
for _, integer := range dAtA[iNdEx:postIndex] {
if integer < 128 {
count++
}
}
elementCount = count
if elementCount != 0 && len(m.Id) == 0 {
m.Id = make([]int64, 0, elementCount)
}
for iNdEx < postIndex {
var v int64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFavorite
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.Id = append(m.Id, v)
}
} else {
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
}
default:
iNdEx = preIndex
skippy, err := skipFavorite(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthFavorite
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *ListFavoriteRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFavorite
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: ListFavoriteRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: ListFavoriteRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Page", wireType)
}
m.Page = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFavorite
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Page |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType)
}
m.Size_ = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFavorite
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Size_ |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field UserId", wireType)
}
m.UserId = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFavorite
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.UserId |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipFavorite(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthFavorite
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *ListFavoriteReply) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFavorite
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: ListFavoriteReply: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: ListFavoriteReply: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType)
}
m.Total = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFavorite
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Total |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Favorite", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFavorite
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthFavorite
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthFavorite
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Favorite = append(m.Favorite, &Favorite{})
if err := m.Favorite[len(m.Favorite)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipFavorite(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthFavorite
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *GetFavoriteRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFavorite
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: GetFavoriteRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: GetFavoriteRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field DocumentId", wireType)
}
m.DocumentId = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowFavorite
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.DocumentId |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipFavorite(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthFavorite
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipFavorite(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowFavorite
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowFavorite
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowFavorite
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthFavorite
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupFavorite
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthFavorite
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthFavorite = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowFavorite = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupFavorite = fmt.Errorf("proto: unexpected end of group")
)