v1

package
v0.0.0-...-7d1b39b Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommentService_GetCommentList_FullMethodName = "/comment.service.v1.CommentService/GetCommentList"
	CommentService_CommentAction_FullMethodName  = "/comment.service.v1.CommentService/CommentAction"
)
View Source
const OperationCommentServiceCommentAction = "/comment.service.v1.CommentService/CommentAction"
View Source
const OperationCommentServiceGetCommentList = "/comment.service.v1.CommentService/GetCommentList"

Variables

View Source
var CommentService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "comment.service.v1.CommentService",
	HandlerType: (*CommentServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetCommentList",
			Handler:    _CommentService_GetCommentList_Handler,
		},
		{
			MethodName: "CommentAction",
			Handler:    _CommentService_CommentAction_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "comment/service/v1/comment.proto",
}

CommentService_ServiceDesc is the grpc.ServiceDesc for CommentService 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 File_comment_service_v1_comment_proto protoreflect.FileDescriptor

Functions

func RegisterCommentServiceHTTPServer

func RegisterCommentServiceHTTPServer(s *http.Server, srv CommentServiceHTTPServer)

func RegisterCommentServiceServer

func RegisterCommentServiceServer(s grpc.ServiceRegistrar, srv CommentServiceServer)

Types

type Comment

type Comment struct {

	// 视频评论id
	Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// 评论用户信息
	User *User `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"`
	// 评论内容
	Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"`
	// 评论发布日期,格式 mm-dd
	CreateDate string `protobuf:"bytes,4,opt,name=create_date,proto3" json:"create_date,omitempty"`
	// contains filtered or unexported fields
}

func (*Comment) Descriptor deprecated

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

Deprecated: Use Comment.ProtoReflect.Descriptor instead.

func (*Comment) GetContent

func (x *Comment) GetContent() string

func (*Comment) GetCreateDate

func (x *Comment) GetCreateDate() string

func (*Comment) GetId

func (x *Comment) GetId() uint32

func (*Comment) GetUser

func (x *Comment) GetUser() *User

func (*Comment) ProtoMessage

func (*Comment) ProtoMessage()

func (*Comment) ProtoReflect

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

func (*Comment) Reset

func (x *Comment) Reset()

func (*Comment) String

func (x *Comment) String() string

func (*Comment) Validate

func (m *Comment) Validate() error

Validate checks the field values on Comment with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Comment) ValidateAll

func (m *Comment) ValidateAll() error

ValidateAll checks the field values on Comment with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in CommentMultiError, or nil if none found.

type CommentActionReply

type CommentActionReply struct {

	// 状态码,0-成功,其他值-失败
	StatusCode int32 `protobuf:"varint,1,opt,name=status_code,proto3" json:"status_code,omitempty"`
	// 返回状态描述
	StatusMsg string `protobuf:"bytes,2,opt,name=status_msg,proto3" json:"status_msg,omitempty"`
	// 评论成功返回评论内容,不需要重新拉取整个列表
	Comment *Comment `protobuf:"bytes,3,opt,name=comment,proto3" json:"comment,omitempty"`
	// contains filtered or unexported fields
}

func (*CommentActionReply) Descriptor deprecated

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

Deprecated: Use CommentActionReply.ProtoReflect.Descriptor instead.

func (*CommentActionReply) GetComment

func (x *CommentActionReply) GetComment() *Comment

func (*CommentActionReply) GetStatusCode

func (x *CommentActionReply) GetStatusCode() int32

func (*CommentActionReply) GetStatusMsg

func (x *CommentActionReply) GetStatusMsg() string

func (*CommentActionReply) ProtoMessage

func (*CommentActionReply) ProtoMessage()

func (*CommentActionReply) ProtoReflect

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

func (*CommentActionReply) Reset

func (x *CommentActionReply) Reset()

func (*CommentActionReply) String

func (x *CommentActionReply) String() string

func (*CommentActionReply) Validate

func (m *CommentActionReply) Validate() error

Validate checks the field values on CommentActionReply with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*CommentActionReply) ValidateAll

func (m *CommentActionReply) ValidateAll() error

ValidateAll checks the field values on CommentActionReply with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in CommentActionReplyMultiError, or nil if none found.

type CommentActionReplyMultiError

type CommentActionReplyMultiError []error

CommentActionReplyMultiError is an error wrapping multiple validation errors returned by CommentActionReply.ValidateAll() if the designated constraints aren't met.

func (CommentActionReplyMultiError) AllErrors

func (m CommentActionReplyMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CommentActionReplyMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type CommentActionReplyValidationError

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

CommentActionReplyValidationError is the validation error returned by CommentActionReply.Validate if the designated constraints aren't met.

func (CommentActionReplyValidationError) Cause

Cause function returns cause value.

func (CommentActionReplyValidationError) Error

Error satisfies the builtin error interface

func (CommentActionReplyValidationError) ErrorName

ErrorName returns error name.

func (CommentActionReplyValidationError) Field

Field function returns field value.

func (CommentActionReplyValidationError) Key

Key function returns key value.

func (CommentActionReplyValidationError) Reason

Reason function returns reason value.

type CommentActionRequest

type CommentActionRequest struct {

	// 用户鉴权token
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// 视频id
	VideoId uint32 `protobuf:"varint,2,opt,name=video_id,json=videoId,proto3" json:"video_id,omitempty"`
	// 1-发布评论,2-删除评论
	ActionType uint32 `protobuf:"varint,3,opt,name=action_type,json=actionType,proto3" json:"action_type,omitempty"`
	// 用户填写的评论内容,在action_type=1的时候使用
	CommentText string `protobuf:"bytes,4,opt,name=comment_text,json=commentText,proto3" json:"comment_text,omitempty"`
	// 要删除的评论id,在action_type=2的时候使用
	CommentId uint32 `protobuf:"varint,5,opt,name=comment_id,json=commentId,proto3" json:"comment_id,omitempty"`
	// contains filtered or unexported fields
}

func (*CommentActionRequest) Descriptor deprecated

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

Deprecated: Use CommentActionRequest.ProtoReflect.Descriptor instead.

func (*CommentActionRequest) GetActionType

func (x *CommentActionRequest) GetActionType() uint32

func (*CommentActionRequest) GetCommentId

func (x *CommentActionRequest) GetCommentId() uint32

func (*CommentActionRequest) GetCommentText

func (x *CommentActionRequest) GetCommentText() string

func (*CommentActionRequest) GetToken

func (x *CommentActionRequest) GetToken() string

func (*CommentActionRequest) GetVideoId

func (x *CommentActionRequest) GetVideoId() uint32

func (*CommentActionRequest) ProtoMessage

func (*CommentActionRequest) ProtoMessage()

func (*CommentActionRequest) ProtoReflect

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

func (*CommentActionRequest) Reset

func (x *CommentActionRequest) Reset()

func (*CommentActionRequest) String

func (x *CommentActionRequest) String() string

func (*CommentActionRequest) Validate

func (m *CommentActionRequest) Validate() error

Validate checks the field values on CommentActionRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*CommentActionRequest) ValidateAll

func (m *CommentActionRequest) ValidateAll() error

ValidateAll checks the field values on CommentActionRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in CommentActionRequestMultiError, or nil if none found.

type CommentActionRequestMultiError

type CommentActionRequestMultiError []error

CommentActionRequestMultiError is an error wrapping multiple validation errors returned by CommentActionRequest.ValidateAll() if the designated constraints aren't met.

func (CommentActionRequestMultiError) AllErrors

func (m CommentActionRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CommentActionRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type CommentActionRequestValidationError

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

CommentActionRequestValidationError is the validation error returned by CommentActionRequest.Validate if the designated constraints aren't met.

func (CommentActionRequestValidationError) Cause

Cause function returns cause value.

func (CommentActionRequestValidationError) Error

Error satisfies the builtin error interface

func (CommentActionRequestValidationError) ErrorName

ErrorName returns error name.

func (CommentActionRequestValidationError) Field

Field function returns field value.

func (CommentActionRequestValidationError) Key

Key function returns key value.

func (CommentActionRequestValidationError) Reason

Reason function returns reason value.

type CommentListReply

type CommentListReply struct {

	// 状态码,0-成功,其他值-失败
	StatusCode int32 `protobuf:"varint,1,opt,name=status_code,proto3" json:"status_code,omitempty"`
	// 返回状态描述
	StatusMsg string `protobuf:"bytes,2,opt,name=status_msg,proto3" json:"status_msg,omitempty"`
	// 评论列表
	CommentList []*Comment `protobuf:"bytes,3,rep,name=comment_list,proto3" json:"comment_list,omitempty"`
	// contains filtered or unexported fields
}

func (*CommentListReply) Descriptor deprecated

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

Deprecated: Use CommentListReply.ProtoReflect.Descriptor instead.

func (*CommentListReply) GetCommentList

func (x *CommentListReply) GetCommentList() []*Comment

func (*CommentListReply) GetStatusCode

func (x *CommentListReply) GetStatusCode() int32

func (*CommentListReply) GetStatusMsg

func (x *CommentListReply) GetStatusMsg() string

func (*CommentListReply) ProtoMessage

func (*CommentListReply) ProtoMessage()

func (*CommentListReply) ProtoReflect

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

func (*CommentListReply) Reset

func (x *CommentListReply) Reset()

func (*CommentListReply) String

func (x *CommentListReply) String() string

func (*CommentListReply) Validate

func (m *CommentListReply) Validate() error

Validate checks the field values on CommentListReply with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*CommentListReply) ValidateAll

func (m *CommentListReply) ValidateAll() error

ValidateAll checks the field values on CommentListReply with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in CommentListReplyMultiError, or nil if none found.

type CommentListReplyMultiError

type CommentListReplyMultiError []error

CommentListReplyMultiError is an error wrapping multiple validation errors returned by CommentListReply.ValidateAll() if the designated constraints aren't met.

func (CommentListReplyMultiError) AllErrors

func (m CommentListReplyMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CommentListReplyMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type CommentListReplyValidationError

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

CommentListReplyValidationError is the validation error returned by CommentListReply.Validate if the designated constraints aren't met.

func (CommentListReplyValidationError) Cause

Cause function returns cause value.

func (CommentListReplyValidationError) Error

Error satisfies the builtin error interface

func (CommentListReplyValidationError) ErrorName

ErrorName returns error name.

func (CommentListReplyValidationError) Field

Field function returns field value.

func (CommentListReplyValidationError) Key

Key function returns key value.

func (CommentListReplyValidationError) Reason

Reason function returns reason value.

type CommentListRequest

type CommentListRequest struct {

	// 用户鉴权token
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// 视频id
	VideoId uint32 `protobuf:"varint,2,opt,name=video_id,json=videoId,proto3" json:"video_id,omitempty"`
	// contains filtered or unexported fields
}

func (*CommentListRequest) Descriptor deprecated

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

Deprecated: Use CommentListRequest.ProtoReflect.Descriptor instead.

func (*CommentListRequest) GetToken

func (x *CommentListRequest) GetToken() string

func (*CommentListRequest) GetVideoId

func (x *CommentListRequest) GetVideoId() uint32

func (*CommentListRequest) ProtoMessage

func (*CommentListRequest) ProtoMessage()

func (*CommentListRequest) ProtoReflect

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

func (*CommentListRequest) Reset

func (x *CommentListRequest) Reset()

func (*CommentListRequest) String

func (x *CommentListRequest) String() string

func (*CommentListRequest) Validate

func (m *CommentListRequest) Validate() error

Validate checks the field values on CommentListRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*CommentListRequest) ValidateAll

func (m *CommentListRequest) ValidateAll() error

ValidateAll checks the field values on CommentListRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in CommentListRequestMultiError, or nil if none found.

type CommentListRequestMultiError

type CommentListRequestMultiError []error

CommentListRequestMultiError is an error wrapping multiple validation errors returned by CommentListRequest.ValidateAll() if the designated constraints aren't met.

func (CommentListRequestMultiError) AllErrors

func (m CommentListRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CommentListRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type CommentListRequestValidationError

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

CommentListRequestValidationError is the validation error returned by CommentListRequest.Validate if the designated constraints aren't met.

func (CommentListRequestValidationError) Cause

Cause function returns cause value.

func (CommentListRequestValidationError) Error

Error satisfies the builtin error interface

func (CommentListRequestValidationError) ErrorName

ErrorName returns error name.

func (CommentListRequestValidationError) Field

Field function returns field value.

func (CommentListRequestValidationError) Key

Key function returns key value.

func (CommentListRequestValidationError) Reason

Reason function returns reason value.

type CommentMultiError

type CommentMultiError []error

CommentMultiError is an error wrapping multiple validation errors returned by Comment.ValidateAll() if the designated constraints aren't met.

func (CommentMultiError) AllErrors

func (m CommentMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CommentMultiError) Error

func (m CommentMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type CommentServiceClient

type CommentServiceClient interface {
	// GetCommentList 获取评论列表
	GetCommentList(ctx context.Context, in *CommentListRequest, opts ...grpc.CallOption) (*CommentListReply, error)
	// CommentAction 发布评论或者删除评论
	CommentAction(ctx context.Context, in *CommentActionRequest, opts ...grpc.CallOption) (*CommentActionReply, error)
}

CommentServiceClient is the client API for CommentService 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 CommentServiceHTTPClient

type CommentServiceHTTPClient interface {
	CommentAction(ctx context.Context, req *CommentActionRequest, opts ...http.CallOption) (rsp *CommentActionReply, err error)
	GetCommentList(ctx context.Context, req *CommentListRequest, opts ...http.CallOption) (rsp *CommentListReply, err error)
}

func NewCommentServiceHTTPClient

func NewCommentServiceHTTPClient(client *http.Client) CommentServiceHTTPClient

type CommentServiceHTTPClientImpl

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

func (*CommentServiceHTTPClientImpl) CommentAction

func (*CommentServiceHTTPClientImpl) GetCommentList

type CommentServiceHTTPServer

type CommentServiceHTTPServer interface {
	// CommentAction CommentAction 发布评论或者删除评论
	CommentAction(context.Context, *CommentActionRequest) (*CommentActionReply, error)
	// GetCommentList GetCommentList 获取评论列表
	GetCommentList(context.Context, *CommentListRequest) (*CommentListReply, error)
}

type CommentServiceServer

type CommentServiceServer interface {
	// GetCommentList 获取评论列表
	GetCommentList(context.Context, *CommentListRequest) (*CommentListReply, error)
	// CommentAction 发布评论或者删除评论
	CommentAction(context.Context, *CommentActionRequest) (*CommentActionReply, error)
	// contains filtered or unexported methods
}

CommentServiceServer is the server API for CommentService service. All implementations must embed UnimplementedCommentServiceServer for forward compatibility

type CommentValidationError

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

CommentValidationError is the validation error returned by Comment.Validate if the designated constraints aren't met.

func (CommentValidationError) Cause

func (e CommentValidationError) Cause() error

Cause function returns cause value.

func (CommentValidationError) Error

func (e CommentValidationError) Error() string

Error satisfies the builtin error interface

func (CommentValidationError) ErrorName

func (e CommentValidationError) ErrorName() string

ErrorName returns error name.

func (CommentValidationError) Field

func (e CommentValidationError) Field() string

Field function returns field value.

func (CommentValidationError) Key

func (e CommentValidationError) Key() bool

Key function returns key value.

func (CommentValidationError) Reason

func (e CommentValidationError) Reason() string

Reason function returns reason value.

type UnimplementedCommentServiceServer

type UnimplementedCommentServiceServer struct {
}

UnimplementedCommentServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedCommentServiceServer) CommentAction

func (UnimplementedCommentServiceServer) GetCommentList

type UnsafeCommentServiceServer

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

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

type User

type User struct {

	// 用户id
	Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// 用户名称
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// 关注总数
	FollowCount uint32 `protobuf:"varint,3,opt,name=follow_count,proto3" json:"follow_count,omitempty"`
	// 粉丝总数
	FollowerCount uint32 `protobuf:"varint,4,opt,name=follower_count,proto3" json:"follower_count,omitempty"`
	// true-已关注,false-未关注
	IsFollow bool `protobuf:"varint,5,opt,name=is_follow,proto3" json:"is_follow,omitempty"`
	// 用户头像
	Avatar string `protobuf:"bytes,6,opt,name=avatar,proto3" json:"avatar,omitempty"`
	// 用户个人页顶部大图
	BackgroundImage string `protobuf:"bytes,7,opt,name=background_image,proto3" json:"background_image,omitempty"`
	// 个人简介
	Signature string `protobuf:"bytes,8,opt,name=signature,proto3" json:"signature,omitempty"`
	// 获赞数量
	TotalFavorited uint32 `protobuf:"varint,9,opt,name=total_favorited,proto3" json:"total_favorited,omitempty"`
	// 作品数量
	WorkCount uint32 `protobuf:"varint,10,opt,name=work_count,proto3" json:"work_count,omitempty"`
	// 点赞数量
	FavoriteCount uint32 `protobuf:"varint,11,opt,name=favorite_count,proto3" json:"favorite_count,omitempty"`
	// contains filtered or unexported fields
}

func (*User) Descriptor deprecated

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

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetAvatar

func (x *User) GetAvatar() string

func (*User) GetBackgroundImage

func (x *User) GetBackgroundImage() string

func (*User) GetFavoriteCount

func (x *User) GetFavoriteCount() uint32

func (*User) GetFollowCount

func (x *User) GetFollowCount() uint32

func (*User) GetFollowerCount

func (x *User) GetFollowerCount() uint32

func (*User) GetId

func (x *User) GetId() uint32

func (*User) GetIsFollow

func (x *User) GetIsFollow() bool

func (*User) GetName

func (x *User) GetName() string

func (*User) GetSignature

func (x *User) GetSignature() string

func (*User) GetTotalFavorited

func (x *User) GetTotalFavorited() uint32

func (*User) GetWorkCount

func (x *User) GetWorkCount() uint32

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) ProtoReflect

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

func (*User) Reset

func (x *User) Reset()

func (*User) String

func (x *User) String() string

func (*User) Validate

func (m *User) Validate() error

Validate checks the field values on User with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*User) ValidateAll

func (m *User) ValidateAll() error

ValidateAll checks the field values on User with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in UserMultiError, or nil if none found.

type UserMultiError

type UserMultiError []error

UserMultiError is an error wrapping multiple validation errors returned by User.ValidateAll() if the designated constraints aren't met.

func (UserMultiError) AllErrors

func (m UserMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (UserMultiError) Error

func (m UserMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type UserValidationError

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

UserValidationError is the validation error returned by User.Validate if the designated constraints aren't met.

func (UserValidationError) Cause

func (e UserValidationError) Cause() error

Cause function returns cause value.

func (UserValidationError) Error

func (e UserValidationError) Error() string

Error satisfies the builtin error interface

func (UserValidationError) ErrorName

func (e UserValidationError) ErrorName() string

ErrorName returns error name.

func (UserValidationError) Field

func (e UserValidationError) Field() string

Field function returns field value.

func (UserValidationError) Key

func (e UserValidationError) Key() bool

Key function returns key value.

func (UserValidationError) Reason

func (e UserValidationError) Reason() string

Reason function returns reason value.

Jump to

Keyboard shortcuts

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