pb

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_moment_proto protoreflect.FileDescriptor
View Source
var MomentRpc_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "moment.MomentRpc",
	HandlerType: (*MomentRpcServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "getMoment",
			Handler:    _MomentRpc_GetMoment_Handler,
		},
		{
			MethodName: "queryMoment",
			Handler:    _MomentRpc_QueryMoment_Handler,
		},
		{
			MethodName: "insertMoment",
			Handler:    _MomentRpc_InsertMoment_Handler,
		},
		{
			MethodName: "updateMoment",
			Handler:    _MomentRpc_UpdateMoment_Handler,
		},
		{
			MethodName: "deleteMoment",
			Handler:    _MomentRpc_DeleteMoment_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "moment.proto",
}

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

Functions

func RegisterMomentRpcServer

func RegisterMomentRpcServer(s grpc.ServiceRegistrar, srv MomentRpcServer)

Types

type DeleteMomentReq

type DeleteMomentReq struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// 考虑到一般情况下用户只能删除自己的动态,增加userId字段
	// 如果userId为空,则删除时不会校验用户id
	UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteMomentReq) Descriptor deprecated

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

Deprecated: Use DeleteMomentReq.ProtoReflect.Descriptor instead.

func (*DeleteMomentReq) GetId

func (x *DeleteMomentReq) GetId() string

func (*DeleteMomentReq) GetUserId

func (x *DeleteMomentReq) GetUserId() string

func (*DeleteMomentReq) ProtoMessage

func (*DeleteMomentReq) ProtoMessage()

func (*DeleteMomentReq) ProtoReflect

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

func (*DeleteMomentReq) Reset

func (x *DeleteMomentReq) Reset()

func (*DeleteMomentReq) String

func (x *DeleteMomentReq) String() string

type DeleteMomentResp

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

func (*DeleteMomentResp) Descriptor deprecated

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

Deprecated: Use DeleteMomentResp.ProtoReflect.Descriptor instead.

func (*DeleteMomentResp) ProtoMessage

func (*DeleteMomentResp) ProtoMessage()

func (*DeleteMomentResp) ProtoReflect

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

func (*DeleteMomentResp) Reset

func (x *DeleteMomentResp) Reset()

func (*DeleteMomentResp) String

func (x *DeleteMomentResp) String() string

type GetMomentReq

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

func (*GetMomentReq) Descriptor deprecated

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

Deprecated: Use GetMomentReq.ProtoReflect.Descriptor instead.

func (*GetMomentReq) GetId

func (x *GetMomentReq) GetId() string

func (*GetMomentReq) ProtoMessage

func (*GetMomentReq) ProtoMessage()

func (*GetMomentReq) ProtoReflect

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

func (*GetMomentReq) Reset

func (x *GetMomentReq) Reset()

func (*GetMomentReq) String

func (x *GetMomentReq) String() string

type GetMomentResp

type GetMomentResp struct {
	Moment *Moment `protobuf:"bytes,1,opt,name=moment,proto3" json:"moment,omitempty"`
	// contains filtered or unexported fields
}

func (*GetMomentResp) Descriptor deprecated

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

Deprecated: Use GetMomentResp.ProtoReflect.Descriptor instead.

func (*GetMomentResp) GetMoment

func (x *GetMomentResp) GetMoment() *Moment

func (*GetMomentResp) ProtoMessage

func (*GetMomentResp) ProtoMessage()

func (*GetMomentResp) ProtoReflect

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

func (*GetMomentResp) Reset

func (x *GetMomentResp) Reset()

func (*GetMomentResp) String

func (x *GetMomentResp) String() string

type InsertMomentReq

type InsertMomentReq struct {
	Title     string   `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
	CatId     string   `protobuf:"bytes,2,opt,name=catId,proto3" json:"catId,omitempty"`
	Text      string   `protobuf:"bytes,3,opt,name=text,proto3" json:"text,omitempty"`
	ImageUrls []string `protobuf:"bytes,4,rep,name=imageUrls,proto3" json:"imageUrls,omitempty"`
	UserId    string   `protobuf:"bytes,5,opt,name=userId,proto3" json:"userId,omitempty"`
	// contains filtered or unexported fields
}

func (*InsertMomentReq) Descriptor deprecated

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

Deprecated: Use InsertMomentReq.ProtoReflect.Descriptor instead.

func (*InsertMomentReq) GetCatId

func (x *InsertMomentReq) GetCatId() string

func (*InsertMomentReq) GetImageUrls

func (x *InsertMomentReq) GetImageUrls() []string

func (*InsertMomentReq) GetText

func (x *InsertMomentReq) GetText() string

func (*InsertMomentReq) GetTitle

func (x *InsertMomentReq) GetTitle() string

func (*InsertMomentReq) GetUserId

func (x *InsertMomentReq) GetUserId() string

func (*InsertMomentReq) ProtoMessage

func (*InsertMomentReq) ProtoMessage()

func (*InsertMomentReq) ProtoReflect

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

func (*InsertMomentReq) Reset

func (x *InsertMomentReq) Reset()

func (*InsertMomentReq) String

func (x *InsertMomentReq) String() string

type InsertMomentResp

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

func (*InsertMomentResp) Descriptor deprecated

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

Deprecated: Use InsertMomentResp.ProtoReflect.Descriptor instead.

func (*InsertMomentResp) GetId

func (x *InsertMomentResp) GetId() string

func (*InsertMomentResp) ProtoMessage

func (*InsertMomentResp) ProtoMessage()

func (*InsertMomentResp) ProtoReflect

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

func (*InsertMomentResp) Reset

func (x *InsertMomentResp) Reset()

func (*InsertMomentResp) String

func (x *InsertMomentResp) String() string

type Moment

type Moment struct {
	Id        string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Title     string   `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
	CatId     string   `protobuf:"bytes,3,opt,name=catId,proto3" json:"catId,omitempty"`
	Text      string   `protobuf:"bytes,4,opt,name=text,proto3" json:"text,omitempty"`
	ImageUrls []string `protobuf:"bytes,5,rep,name=imageUrls,proto3" json:"imageUrls,omitempty"`
	UserId    string   `protobuf:"bytes,6,opt,name=userId,proto3" json:"userId,omitempty"`
	CreateAt  int64    `protobuf:"varint,7,opt,name=createAt,proto3" json:"createAt,omitempty"`
	Likes     int32    `protobuf:"varint,8,opt,name=likes,proto3" json:"likes,omitempty"`
	// contains filtered or unexported fields
}

func (*Moment) Descriptor deprecated

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

Deprecated: Use Moment.ProtoReflect.Descriptor instead.

func (*Moment) GetCatId

func (x *Moment) GetCatId() string

func (*Moment) GetCreateAt added in v1.0.1

func (x *Moment) GetCreateAt() int64

func (*Moment) GetId

func (x *Moment) GetId() string

func (*Moment) GetImageUrls

func (x *Moment) GetImageUrls() []string

func (*Moment) GetLikes added in v1.0.1

func (x *Moment) GetLikes() int32

func (*Moment) GetText

func (x *Moment) GetText() string

func (*Moment) GetTitle

func (x *Moment) GetTitle() string

func (*Moment) GetUserId

func (x *Moment) GetUserId() string

func (*Moment) ProtoMessage

func (*Moment) ProtoMessage()

func (*Moment) ProtoReflect

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

func (*Moment) Reset

func (x *Moment) Reset()

func (*Moment) String

func (x *Moment) String() string

type MomentRpcClient

type MomentRpcClient interface {
	GetMoment(ctx context.Context, in *GetMomentReq, opts ...grpc.CallOption) (*GetMomentResp, error)
	QueryMoment(ctx context.Context, in *QueryMomentReq, opts ...grpc.CallOption) (*QueryMomentResp, error)
	InsertMoment(ctx context.Context, in *InsertMomentReq, opts ...grpc.CallOption) (*InsertMomentResp, error)
	UpdateMoment(ctx context.Context, in *UpdateMomentReq, opts ...grpc.CallOption) (*UpdateMomentResp, error)
	DeleteMoment(ctx context.Context, in *DeleteMomentReq, opts ...grpc.CallOption) (*DeleteMomentResp, error)
}

MomentRpcClient is the client API for MomentRpc 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 NewMomentRpcClient

func NewMomentRpcClient(cc grpc.ClientConnInterface) MomentRpcClient

type MomentRpcServer

type MomentRpcServer interface {
	GetMoment(context.Context, *GetMomentReq) (*GetMomentResp, error)
	QueryMoment(context.Context, *QueryMomentReq) (*QueryMomentResp, error)
	InsertMoment(context.Context, *InsertMomentReq) (*InsertMomentResp, error)
	UpdateMoment(context.Context, *UpdateMomentReq) (*UpdateMomentResp, error)
	DeleteMoment(context.Context, *DeleteMomentReq) (*DeleteMomentResp, error)
	// contains filtered or unexported methods
}

MomentRpcServer is the server API for MomentRpc service. All implementations must embed UnimplementedMomentRpcServer for forward compatibility

type QueryMomentReq

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

func (*QueryMomentReq) Descriptor deprecated

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

Deprecated: Use QueryMomentReq.ProtoReflect.Descriptor instead.

func (*QueryMomentReq) GetPage

func (x *QueryMomentReq) GetPage() int32

func (*QueryMomentReq) GetSize

func (x *QueryMomentReq) GetSize() int32

func (*QueryMomentReq) ProtoMessage

func (*QueryMomentReq) ProtoMessage()

func (*QueryMomentReq) ProtoReflect

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

func (*QueryMomentReq) Reset

func (x *QueryMomentReq) Reset()

func (*QueryMomentReq) String

func (x *QueryMomentReq) String() string

type QueryMomentResp

type QueryMomentResp struct {
	Moments []*Moment `protobuf:"bytes,1,rep,name=moments,proto3" json:"moments,omitempty"`
	// contains filtered or unexported fields
}

func (*QueryMomentResp) Descriptor deprecated

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

Deprecated: Use QueryMomentResp.ProtoReflect.Descriptor instead.

func (*QueryMomentResp) GetMoments

func (x *QueryMomentResp) GetMoments() []*Moment

func (*QueryMomentResp) ProtoMessage

func (*QueryMomentResp) ProtoMessage()

func (*QueryMomentResp) ProtoReflect

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

func (*QueryMomentResp) Reset

func (x *QueryMomentResp) Reset()

func (*QueryMomentResp) String

func (x *QueryMomentResp) String() string

type UnimplementedMomentRpcServer

type UnimplementedMomentRpcServer struct {
}

UnimplementedMomentRpcServer must be embedded to have forward compatible implementations.

func (UnimplementedMomentRpcServer) DeleteMoment

func (UnimplementedMomentRpcServer) GetMoment

func (UnimplementedMomentRpcServer) InsertMoment

func (UnimplementedMomentRpcServer) QueryMoment

func (UnimplementedMomentRpcServer) UpdateMoment

type UnsafeMomentRpcServer

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

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

type UpdateMomentReq

type UpdateMomentReq struct {
	Id        string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Title     string   `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
	CatId     string   `protobuf:"bytes,3,opt,name=catId,proto3" json:"catId,omitempty"`
	Text      string   `protobuf:"bytes,4,opt,name=text,proto3" json:"text,omitempty"`
	ImageUrls []string `protobuf:"bytes,5,rep,name=imageUrls,proto3" json:"imageUrls,omitempty"`
	// 考虑到一般情况下用户只能更新自己的动态,增加userId字段
	// 如果userId为空,则更新时不会校验用户id
	UserId string `protobuf:"bytes,6,opt,name=userId,proto3" json:"userId,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateMomentReq) Descriptor deprecated

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

Deprecated: Use UpdateMomentReq.ProtoReflect.Descriptor instead.

func (*UpdateMomentReq) GetCatId

func (x *UpdateMomentReq) GetCatId() string

func (*UpdateMomentReq) GetId

func (x *UpdateMomentReq) GetId() string

func (*UpdateMomentReq) GetImageUrls

func (x *UpdateMomentReq) GetImageUrls() []string

func (*UpdateMomentReq) GetText

func (x *UpdateMomentReq) GetText() string

func (*UpdateMomentReq) GetTitle

func (x *UpdateMomentReq) GetTitle() string

func (*UpdateMomentReq) GetUserId

func (x *UpdateMomentReq) GetUserId() string

func (*UpdateMomentReq) ProtoMessage

func (*UpdateMomentReq) ProtoMessage()

func (*UpdateMomentReq) ProtoReflect

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

func (*UpdateMomentReq) Reset

func (x *UpdateMomentReq) Reset()

func (*UpdateMomentReq) String

func (x *UpdateMomentReq) String() string

type UpdateMomentResp

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

func (*UpdateMomentResp) Descriptor deprecated

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

Deprecated: Use UpdateMomentResp.ProtoReflect.Descriptor instead.

func (*UpdateMomentResp) ProtoMessage

func (*UpdateMomentResp) ProtoMessage()

func (*UpdateMomentResp) ProtoReflect

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

func (*UpdateMomentResp) Reset

func (x *UpdateMomentResp) Reset()

func (*UpdateMomentResp) String

func (x *UpdateMomentResp) String() string

Jump to

Keyboard shortcuts

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