commentsv1

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Comments_CreateComment_FullMethodName    = "/comments.Comments/CreateComment"
	Comments_GetComments_FullMethodName      = "/comments.Comments/GetComments"
	Comments_GetChildComments_FullMethodName = "/comments.Comments/GetChildComments"
	Comments_DeleteComment_FullMethodName    = "/comments.Comments/DeleteComment"
	Comments_UpdateComment_FullMethodName    = "/comments.Comments/UpdateComment"
)

Variables

View Source
var Comments_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "comments.Comments",
	HandlerType: (*CommentsServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateComment",
			Handler:    _Comments_CreateComment_Handler,
		},
		{
			MethodName: "GetComments",
			Handler:    _Comments_GetComments_Handler,
		},
		{
			MethodName: "GetChildComments",
			Handler:    _Comments_GetChildComments_Handler,
		},
		{
			MethodName: "DeleteComment",
			Handler:    _Comments_DeleteComment_Handler,
		},
		{
			MethodName: "UpdateComment",
			Handler:    _Comments_UpdateComment_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "comments/comments.proto",
}

Comments_ServiceDesc is the grpc.ServiceDesc for Comments 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_comments_comments_proto protoreflect.FileDescriptor

Functions

func RegisterCommentsServer

func RegisterCommentsServer(s grpc.ServiceRegistrar, srv CommentsServer)

Types

type CommentDto

type CommentDto struct {
	Id         string                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`                                    // Идентификатор комментария
	PostId     string                 `protobuf:"bytes,2,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"`              // Идентификатор поста
	AuthorId   string                 `protobuf:"bytes,3,opt,name=author_id,json=authorId,proto3" json:"author_id,omitempty"`        // Идентификатор автора комментария
	Content    string                 `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty"`                          // Текст комментария
	CreatedAt  *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=createdAt,proto3" json:"createdAt,omitempty"`                      // Время создания комментария
	UpdatedAt  *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"`                      // Время обновления комментария
	ParentId   *string                `protobuf:"bytes,7,opt,name=parent_id,json=parentId,proto3,oneof" json:"parent_id,omitempty"`  // Идентификатор родительского комментария
	ChildCount int32                  `protobuf:"varint,8,opt,name=child_count,json=childCount,proto3" json:"child_count,omitempty"` // Количество дочерних комментариев
	// contains filtered or unexported fields
}

func (*CommentDto) Descriptor deprecated

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

Deprecated: Use CommentDto.ProtoReflect.Descriptor instead.

func (*CommentDto) GetAuthorId

func (x *CommentDto) GetAuthorId() string

func (*CommentDto) GetChildCount

func (x *CommentDto) GetChildCount() int32

func (*CommentDto) GetContent

func (x *CommentDto) GetContent() string

func (*CommentDto) GetCreatedAt

func (x *CommentDto) GetCreatedAt() *timestamppb.Timestamp

func (*CommentDto) GetId

func (x *CommentDto) GetId() string

func (*CommentDto) GetParentId

func (x *CommentDto) GetParentId() string

func (*CommentDto) GetPostId

func (x *CommentDto) GetPostId() string

func (*CommentDto) GetUpdatedAt

func (x *CommentDto) GetUpdatedAt() *timestamppb.Timestamp

func (*CommentDto) ProtoMessage

func (*CommentDto) ProtoMessage()

func (*CommentDto) ProtoReflect

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

func (*CommentDto) Reset

func (x *CommentDto) Reset()

func (*CommentDto) String

func (x *CommentDto) String() string

type CommentsClient

type CommentsClient interface {
	CreateComment(ctx context.Context, in *CreateCommentDto, opts ...grpc.CallOption) (*CommentDto, error)
	GetComments(ctx context.Context, in *GetCommentsDto, opts ...grpc.CallOption) (*CommentsResponse, error)
	GetChildComments(ctx context.Context, in *GetChildCommentsDto, opts ...grpc.CallOption) (*CommentsResponse, error)
	DeleteComment(ctx context.Context, in *DeleteCommentDto, opts ...grpc.CallOption) (*DeleteCommentResponse, error)
	UpdateComment(ctx context.Context, in *UpdateCommentDto, opts ...grpc.CallOption) (*CommentDto, error)
}

CommentsClient is the client API for Comments 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 NewCommentsClient

func NewCommentsClient(cc grpc.ClientConnInterface) CommentsClient

type CommentsResponse

type CommentsResponse struct {
	Comments []*CommentDto `protobuf:"bytes,1,rep,name=comments,proto3" json:"comments,omitempty"` // Список комментариев
	Total    int32         `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"`      // Общее количество комментариев
	Skip     int32         `protobuf:"varint,3,opt,name=skip,proto3" json:"skip,omitempty"`        // Количество пропущенных коментариев
	// contains filtered or unexported fields
}

func (*CommentsResponse) Descriptor deprecated

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

Deprecated: Use CommentsResponse.ProtoReflect.Descriptor instead.

func (*CommentsResponse) GetComments

func (x *CommentsResponse) GetComments() []*CommentDto

func (*CommentsResponse) GetSkip added in v0.0.14

func (x *CommentsResponse) GetSkip() int32

func (*CommentsResponse) GetTotal added in v0.0.14

func (x *CommentsResponse) GetTotal() int32

func (*CommentsResponse) ProtoMessage

func (*CommentsResponse) ProtoMessage()

func (*CommentsResponse) ProtoReflect

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

func (*CommentsResponse) Reset

func (x *CommentsResponse) Reset()

func (*CommentsResponse) String

func (x *CommentsResponse) String() string

type CommentsServer

type CommentsServer interface {
	CreateComment(context.Context, *CreateCommentDto) (*CommentDto, error)
	GetComments(context.Context, *GetCommentsDto) (*CommentsResponse, error)
	GetChildComments(context.Context, *GetChildCommentsDto) (*CommentsResponse, error)
	DeleteComment(context.Context, *DeleteCommentDto) (*DeleteCommentResponse, error)
	UpdateComment(context.Context, *UpdateCommentDto) (*CommentDto, error)
	// contains filtered or unexported methods
}

CommentsServer is the server API for Comments service. All implementations must embed UnimplementedCommentsServer for forward compatibility.

type CreateCommentDto

type CreateCommentDto struct {
	PostId   string `protobuf:"bytes,1,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"`       // Идентификатор поста
	AuthorId string `protobuf:"bytes,2,opt,name=author_id,json=authorId,proto3" json:"author_id,omitempty"` // Идентификатор автора комментария
	Content  string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"`                   // Содержимое комментария
	ParentId string `protobuf:"bytes,4,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"` // Идентификатор родительского комментария, если это ответ
	// contains filtered or unexported fields
}

func (*CreateCommentDto) Descriptor deprecated

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

Deprecated: Use CreateCommentDto.ProtoReflect.Descriptor instead.

func (*CreateCommentDto) GetAuthorId

func (x *CreateCommentDto) GetAuthorId() string

func (*CreateCommentDto) GetContent

func (x *CreateCommentDto) GetContent() string

func (*CreateCommentDto) GetParentId

func (x *CreateCommentDto) GetParentId() string

func (*CreateCommentDto) GetPostId

func (x *CreateCommentDto) GetPostId() string

func (*CreateCommentDto) ProtoMessage

func (*CreateCommentDto) ProtoMessage()

func (*CreateCommentDto) ProtoReflect

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

func (*CreateCommentDto) Reset

func (x *CreateCommentDto) Reset()

func (*CreateCommentDto) String

func (x *CreateCommentDto) String() string

type DeleteCommentDto

type DeleteCommentDto struct {
	CommentId string `protobuf:"bytes,1,opt,name=comment_id,json=commentId,proto3" json:"comment_id,omitempty"` // Идентификатор комментария для удаления
	UserId    string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`          // Идентификатор пользователя, выполняющего удаление, для проверки прав
	// contains filtered or unexported fields
}

func (*DeleteCommentDto) Descriptor deprecated

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

Deprecated: Use DeleteCommentDto.ProtoReflect.Descriptor instead.

func (*DeleteCommentDto) GetCommentId

func (x *DeleteCommentDto) GetCommentId() string

func (*DeleteCommentDto) GetUserId

func (x *DeleteCommentDto) GetUserId() string

func (*DeleteCommentDto) ProtoMessage

func (*DeleteCommentDto) ProtoMessage()

func (*DeleteCommentDto) ProtoReflect

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

func (*DeleteCommentDto) Reset

func (x *DeleteCommentDto) Reset()

func (*DeleteCommentDto) String

func (x *DeleteCommentDto) String() string

type DeleteCommentResponse

type DeleteCommentResponse struct {
	Success bool   `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // Успешность операции удаления
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`  // Сообщение о результате операции
	// contains filtered or unexported fields
}

func (*DeleteCommentResponse) Descriptor deprecated

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

Deprecated: Use DeleteCommentResponse.ProtoReflect.Descriptor instead.

func (*DeleteCommentResponse) GetMessage

func (x *DeleteCommentResponse) GetMessage() string

func (*DeleteCommentResponse) GetSuccess

func (x *DeleteCommentResponse) GetSuccess() bool

func (*DeleteCommentResponse) ProtoMessage

func (*DeleteCommentResponse) ProtoMessage()

func (*DeleteCommentResponse) ProtoReflect

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

func (*DeleteCommentResponse) Reset

func (x *DeleteCommentResponse) Reset()

func (*DeleteCommentResponse) String

func (x *DeleteCommentResponse) String() string

type GetChildCommentsDto

type GetChildCommentsDto struct {
	CommentId string `protobuf:"bytes,1,opt,name=comment_id,json=commentId,proto3" json:"comment_id,omitempty"` // Идентификатор комментария, для которого получаем дочерние комментарии
	Take      int32  `protobuf:"varint,2,opt,name=take,proto3" json:"take,omitempty"`                           // Сколько дочерних комментариев вернуть
	Skip      int32  `protobuf:"varint,3,opt,name=skip,proto3" json:"skip,omitempty"`                           // Сколько дочерних комментариев пропустить
	// contains filtered or unexported fields
}

func (*GetChildCommentsDto) Descriptor deprecated

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

Deprecated: Use GetChildCommentsDto.ProtoReflect.Descriptor instead.

func (*GetChildCommentsDto) GetCommentId

func (x *GetChildCommentsDto) GetCommentId() string

func (*GetChildCommentsDto) GetSkip

func (x *GetChildCommentsDto) GetSkip() int32

func (*GetChildCommentsDto) GetTake

func (x *GetChildCommentsDto) GetTake() int32

func (*GetChildCommentsDto) ProtoMessage

func (*GetChildCommentsDto) ProtoMessage()

func (*GetChildCommentsDto) ProtoReflect

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

func (*GetChildCommentsDto) Reset

func (x *GetChildCommentsDto) Reset()

func (*GetChildCommentsDto) String

func (x *GetChildCommentsDto) String() string

type GetCommentsDto

type GetCommentsDto struct {
	PostId string `protobuf:"bytes,1,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"` // Идентификатор поста для извлечения комментариев
	Take   int32  `protobuf:"varint,2,opt,name=take,proto3" json:"take,omitempty"`                  // Сколько комментариев вернуть
	Skip   int32  `protobuf:"varint,3,opt,name=skip,proto3" json:"skip,omitempty"`                  // Сколько комментариев пропустить
	// contains filtered or unexported fields
}

func (*GetCommentsDto) Descriptor deprecated

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

Deprecated: Use GetCommentsDto.ProtoReflect.Descriptor instead.

func (*GetCommentsDto) GetPostId

func (x *GetCommentsDto) GetPostId() string

func (*GetCommentsDto) GetSkip

func (x *GetCommentsDto) GetSkip() int32

func (*GetCommentsDto) GetTake

func (x *GetCommentsDto) GetTake() int32

func (*GetCommentsDto) ProtoMessage

func (*GetCommentsDto) ProtoMessage()

func (*GetCommentsDto) ProtoReflect

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

func (*GetCommentsDto) Reset

func (x *GetCommentsDto) Reset()

func (*GetCommentsDto) String

func (x *GetCommentsDto) String() string

type UnimplementedCommentsServer

type UnimplementedCommentsServer struct{}

UnimplementedCommentsServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedCommentsServer) CreateComment

func (UnimplementedCommentsServer) DeleteComment

func (UnimplementedCommentsServer) GetChildComments

func (UnimplementedCommentsServer) GetComments

func (UnimplementedCommentsServer) UpdateComment

type UnsafeCommentsServer

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

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

type UpdateCommentDto

type UpdateCommentDto struct {
	Id       string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`                             // Идентификатор комментария
	AuthorId string `protobuf:"bytes,2,opt,name=author_id,json=authorId,proto3" json:"author_id,omitempty"` // Идентификатор автора (для проверки прав)
	Content  string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"`                   // Новое содержимое комментария
	// contains filtered or unexported fields
}

func (*UpdateCommentDto) Descriptor deprecated

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

Deprecated: Use UpdateCommentDto.ProtoReflect.Descriptor instead.

func (*UpdateCommentDto) GetAuthorId

func (x *UpdateCommentDto) GetAuthorId() string

func (*UpdateCommentDto) GetContent

func (x *UpdateCommentDto) GetContent() string

func (*UpdateCommentDto) GetId

func (x *UpdateCommentDto) GetId() string

func (*UpdateCommentDto) ProtoMessage

func (*UpdateCommentDto) ProtoMessage()

func (*UpdateCommentDto) ProtoReflect

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

func (*UpdateCommentDto) Reset

func (x *UpdateCommentDto) Reset()

func (*UpdateCommentDto) String

func (x *UpdateCommentDto) String() string

Jump to

Keyboard shortcuts

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