v1

package
v0.0.0-...-182277c Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var CommentService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.protobuf.comment.v1.CommentService",
	HandlerType: (*CommentServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateComment",
			Handler:    _CommentService_CreateComment_Handler,
		},
		{
			MethodName: "CreateCommentCompensate",
			Handler:    _CommentService_CreateCommentCompensate_Handler,
		},
		{
			MethodName: "GetComment",
			Handler:    _CommentService_GetComment_Handler,
		},
		{
			MethodName: "GetCommentByUUID",
			Handler:    _CommentService_GetCommentByUUID_Handler,
		},
		{
			MethodName: "UpdateComment",
			Handler:    _CommentService_UpdateComment_Handler,
		},
		{
			MethodName: "DeleteComment",
			Handler:    _CommentService_DeleteComment_Handler,
		},
		{
			MethodName: "DeleteCommentCompensate",
			Handler:    _CommentService_DeleteCommentCompensate_Handler,
		},
		{
			MethodName: "DeleteCommentsByPostID",
			Handler:    _CommentService_DeleteCommentsByPostID_Handler,
		},
		{
			MethodName: "DeleteCommentsByPostIDCompensate",
			Handler:    _CommentService_DeleteCommentsByPostIDCompensate_Handler,
		},
		{
			MethodName: "ListCommentsByPostID",
			Handler:    _CommentService_ListCommentsByPostID_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/protobuf/comment/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_api_protobuf_comment_v1_comment_proto protoreflect.FileDescriptor

Functions

func RegisterCommentServiceHandler

func RegisterCommentServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterCommentServiceHandler registers the http handlers for service CommentService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterCommentServiceHandlerClient

func RegisterCommentServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CommentServiceClient) error

RegisterCommentServiceHandlerClient registers the http handlers for service CommentService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CommentServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CommentServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "CommentServiceClient" to call the correct interceptors.

func RegisterCommentServiceHandlerFromEndpoint

func RegisterCommentServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterCommentServiceHandlerFromEndpoint is same as RegisterCommentServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterCommentServiceHandlerServer

func RegisterCommentServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CommentServiceServer) error

RegisterCommentServiceHandlerServer registers the http handlers for service CommentService to "mux". UnaryRPC :call CommentServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterCommentServiceHandlerFromEndpoint instead.

func RegisterCommentServiceServer

func RegisterCommentServiceServer(s grpc.ServiceRegistrar, srv CommentServiceServer)

Types

type Comment

type Comment struct {
	Id        uint64                 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Uuid      string                 `protobuf:"bytes,2,opt,name=uuid,proto3" json:"uuid,omitempty"`
	Content   string                 `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"`
	PostId    uint64                 `protobuf:"varint,4,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"`
	UserId    uint64                 `protobuf:"varint,5,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,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) GetCreatedAt

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

func (*Comment) GetId

func (x *Comment) GetId() uint64

func (*Comment) GetPostId

func (x *Comment) GetPostId() uint64

func (*Comment) GetUpdatedAt

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

func (*Comment) GetUserId

func (x *Comment) GetUserId() uint64

func (*Comment) GetUuid

func (x *Comment) GetUuid() string

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

type CommentServiceClient

type CommentServiceClient interface {
	CreateComment(ctx context.Context, in *CreateCommentRequest, opts ...grpc.CallOption) (*CreateCommentResponse, error)
	CreateCommentCompensate(ctx context.Context, in *CreateCommentRequest, opts ...grpc.CallOption) (*CreateCommentResponse, error)
	GetComment(ctx context.Context, in *GetCommentRequest, opts ...grpc.CallOption) (*GetCommentResponse, error)
	GetCommentByUUID(ctx context.Context, in *GetCommentByUUIDRequest, opts ...grpc.CallOption) (*GetCommentByUUIDResponse, error)
	UpdateComment(ctx context.Context, in *UpdateCommentRequest, opts ...grpc.CallOption) (*UpdateCommentResponse, error)
	DeleteComment(ctx context.Context, in *DeleteCommentRequest, opts ...grpc.CallOption) (*DeleteCommentResponse, error)
	DeleteCommentCompensate(ctx context.Context, in *DeleteCommentRequest, opts ...grpc.CallOption) (*DeleteCommentResponse, error)
	DeleteCommentsByPostID(ctx context.Context, in *DeleteCommentsByPostIDRequest, opts ...grpc.CallOption) (*DeleteCommentsByPostIDResponse, error)
	DeleteCommentsByPostIDCompensate(ctx context.Context, in *DeleteCommentsByPostIDRequest, opts ...grpc.CallOption) (*DeleteCommentsByPostIDResponse, error)
	ListCommentsByPostID(ctx context.Context, in *ListCommentsByPostIDRequest, opts ...grpc.CallOption) (*ListCommentsByPostIDResponse, 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 CommentServiceServer

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

type CreateCommentRequest

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

func (*CreateCommentRequest) Descriptor deprecated

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

Deprecated: Use CreateCommentRequest.ProtoReflect.Descriptor instead.

func (*CreateCommentRequest) GetComment

func (x *CreateCommentRequest) GetComment() *Comment

func (*CreateCommentRequest) ProtoMessage

func (*CreateCommentRequest) ProtoMessage()

func (*CreateCommentRequest) ProtoReflect

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

func (*CreateCommentRequest) Reset

func (x *CreateCommentRequest) Reset()

func (*CreateCommentRequest) String

func (x *CreateCommentRequest) String() string

type CreateCommentResponse

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

func (*CreateCommentResponse) Descriptor deprecated

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

Deprecated: Use CreateCommentResponse.ProtoReflect.Descriptor instead.

func (*CreateCommentResponse) GetComment

func (x *CreateCommentResponse) GetComment() *Comment

func (*CreateCommentResponse) ProtoMessage

func (*CreateCommentResponse) ProtoMessage()

func (*CreateCommentResponse) ProtoReflect

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

func (*CreateCommentResponse) Reset

func (x *CreateCommentResponse) Reset()

func (*CreateCommentResponse) String

func (x *CreateCommentResponse) String() string

type DeleteCommentRequest

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

func (*DeleteCommentRequest) Descriptor deprecated

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

Deprecated: Use DeleteCommentRequest.ProtoReflect.Descriptor instead.

func (*DeleteCommentRequest) GetId

func (x *DeleteCommentRequest) GetId() uint64

func (*DeleteCommentRequest) ProtoMessage

func (*DeleteCommentRequest) ProtoMessage()

func (*DeleteCommentRequest) ProtoReflect

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

func (*DeleteCommentRequest) Reset

func (x *DeleteCommentRequest) Reset()

func (*DeleteCommentRequest) String

func (x *DeleteCommentRequest) String() string

type DeleteCommentResponse

type DeleteCommentResponse struct {
	Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteCommentResponse) Descriptor deprecated

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

Deprecated: Use DeleteCommentResponse.ProtoReflect.Descriptor instead.

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 DeleteCommentsByPostIDRequest

type DeleteCommentsByPostIDRequest struct {
	PostId uint64 `protobuf:"varint,1,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteCommentsByPostIDRequest) Descriptor deprecated

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

Deprecated: Use DeleteCommentsByPostIDRequest.ProtoReflect.Descriptor instead.

func (*DeleteCommentsByPostIDRequest) GetPostId

func (x *DeleteCommentsByPostIDRequest) GetPostId() uint64

func (*DeleteCommentsByPostIDRequest) ProtoMessage

func (*DeleteCommentsByPostIDRequest) ProtoMessage()

func (*DeleteCommentsByPostIDRequest) ProtoReflect

func (*DeleteCommentsByPostIDRequest) Reset

func (x *DeleteCommentsByPostIDRequest) Reset()

func (*DeleteCommentsByPostIDRequest) String

type DeleteCommentsByPostIDResponse

type DeleteCommentsByPostIDResponse struct {
	Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteCommentsByPostIDResponse) Descriptor deprecated

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

Deprecated: Use DeleteCommentsByPostIDResponse.ProtoReflect.Descriptor instead.

func (*DeleteCommentsByPostIDResponse) GetSuccess

func (x *DeleteCommentsByPostIDResponse) GetSuccess() bool

func (*DeleteCommentsByPostIDResponse) ProtoMessage

func (*DeleteCommentsByPostIDResponse) ProtoMessage()

func (*DeleteCommentsByPostIDResponse) ProtoReflect

func (*DeleteCommentsByPostIDResponse) Reset

func (x *DeleteCommentsByPostIDResponse) Reset()

func (*DeleteCommentsByPostIDResponse) String

type GetCommentByUUIDRequest

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

func (*GetCommentByUUIDRequest) Descriptor deprecated

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

Deprecated: Use GetCommentByUUIDRequest.ProtoReflect.Descriptor instead.

func (*GetCommentByUUIDRequest) GetUuid

func (x *GetCommentByUUIDRequest) GetUuid() string

func (*GetCommentByUUIDRequest) ProtoMessage

func (*GetCommentByUUIDRequest) ProtoMessage()

func (*GetCommentByUUIDRequest) ProtoReflect

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

func (*GetCommentByUUIDRequest) Reset

func (x *GetCommentByUUIDRequest) Reset()

func (*GetCommentByUUIDRequest) String

func (x *GetCommentByUUIDRequest) String() string

type GetCommentByUUIDResponse

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

func (*GetCommentByUUIDResponse) Descriptor deprecated

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

Deprecated: Use GetCommentByUUIDResponse.ProtoReflect.Descriptor instead.

func (*GetCommentByUUIDResponse) GetComment

func (x *GetCommentByUUIDResponse) GetComment() *Comment

func (*GetCommentByUUIDResponse) ProtoMessage

func (*GetCommentByUUIDResponse) ProtoMessage()

func (*GetCommentByUUIDResponse) ProtoReflect

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

func (*GetCommentByUUIDResponse) Reset

func (x *GetCommentByUUIDResponse) Reset()

func (*GetCommentByUUIDResponse) String

func (x *GetCommentByUUIDResponse) String() string

type GetCommentRequest

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

func (*GetCommentRequest) Descriptor deprecated

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

Deprecated: Use GetCommentRequest.ProtoReflect.Descriptor instead.

func (*GetCommentRequest) GetId

func (x *GetCommentRequest) GetId() uint64

func (*GetCommentRequest) ProtoMessage

func (*GetCommentRequest) ProtoMessage()

func (*GetCommentRequest) ProtoReflect

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

func (*GetCommentRequest) Reset

func (x *GetCommentRequest) Reset()

func (*GetCommentRequest) String

func (x *GetCommentRequest) String() string

type GetCommentResponse

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

func (*GetCommentResponse) Descriptor deprecated

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

Deprecated: Use GetCommentResponse.ProtoReflect.Descriptor instead.

func (*GetCommentResponse) GetComment

func (x *GetCommentResponse) GetComment() *Comment

func (*GetCommentResponse) ProtoMessage

func (*GetCommentResponse) ProtoMessage()

func (*GetCommentResponse) ProtoReflect

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

func (*GetCommentResponse) Reset

func (x *GetCommentResponse) Reset()

func (*GetCommentResponse) String

func (x *GetCommentResponse) String() string

type ListCommentsByPostIDRequest

type ListCommentsByPostIDRequest struct {
	PostId uint64 `protobuf:"varint,1,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"`
	Offset int32  `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
	Limit  int32  `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
	// contains filtered or unexported fields
}

func (*ListCommentsByPostIDRequest) Descriptor deprecated

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

Deprecated: Use ListCommentsByPostIDRequest.ProtoReflect.Descriptor instead.

func (*ListCommentsByPostIDRequest) GetLimit

func (x *ListCommentsByPostIDRequest) GetLimit() int32

func (*ListCommentsByPostIDRequest) GetOffset

func (x *ListCommentsByPostIDRequest) GetOffset() int32

func (*ListCommentsByPostIDRequest) GetPostId

func (x *ListCommentsByPostIDRequest) GetPostId() uint64

func (*ListCommentsByPostIDRequest) ProtoMessage

func (*ListCommentsByPostIDRequest) ProtoMessage()

func (*ListCommentsByPostIDRequest) ProtoReflect

func (*ListCommentsByPostIDRequest) Reset

func (x *ListCommentsByPostIDRequest) Reset()

func (*ListCommentsByPostIDRequest) String

func (x *ListCommentsByPostIDRequest) String() string

type ListCommentsByPostIDResponse

type ListCommentsByPostIDResponse struct {
	Comments []*Comment `protobuf:"bytes,1,rep,name=comments,proto3" json:"comments,omitempty"`
	Total    uint64     `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"`
	// contains filtered or unexported fields
}

func (*ListCommentsByPostIDResponse) Descriptor deprecated

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

Deprecated: Use ListCommentsByPostIDResponse.ProtoReflect.Descriptor instead.

func (*ListCommentsByPostIDResponse) GetComments

func (x *ListCommentsByPostIDResponse) GetComments() []*Comment

func (*ListCommentsByPostIDResponse) GetTotal

func (x *ListCommentsByPostIDResponse) GetTotal() uint64

func (*ListCommentsByPostIDResponse) ProtoMessage

func (*ListCommentsByPostIDResponse) ProtoMessage()

func (*ListCommentsByPostIDResponse) ProtoReflect

func (*ListCommentsByPostIDResponse) Reset

func (x *ListCommentsByPostIDResponse) Reset()

func (*ListCommentsByPostIDResponse) String

type UnimplementedCommentServiceServer

type UnimplementedCommentServiceServer struct {
}

UnimplementedCommentServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedCommentServiceServer) CreateComment

func (UnimplementedCommentServiceServer) CreateCommentCompensate

func (UnimplementedCommentServiceServer) DeleteComment

func (UnimplementedCommentServiceServer) DeleteCommentCompensate

func (UnimplementedCommentServiceServer) DeleteCommentsByPostIDCompensate

func (UnimplementedCommentServiceServer) GetComment

func (UnimplementedCommentServiceServer) GetCommentByUUID

func (UnimplementedCommentServiceServer) UpdateComment

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 UpdateCommentRequest

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

func (*UpdateCommentRequest) Descriptor deprecated

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

Deprecated: Use UpdateCommentRequest.ProtoReflect.Descriptor instead.

func (*UpdateCommentRequest) GetComment

func (x *UpdateCommentRequest) GetComment() *Comment

func (*UpdateCommentRequest) ProtoMessage

func (*UpdateCommentRequest) ProtoMessage()

func (*UpdateCommentRequest) ProtoReflect

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

func (*UpdateCommentRequest) Reset

func (x *UpdateCommentRequest) Reset()

func (*UpdateCommentRequest) String

func (x *UpdateCommentRequest) String() string

type UpdateCommentResponse

type UpdateCommentResponse struct {
	Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateCommentResponse) Descriptor deprecated

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

Deprecated: Use UpdateCommentResponse.ProtoReflect.Descriptor instead.

func (*UpdateCommentResponse) GetSuccess

func (x *UpdateCommentResponse) GetSuccess() bool

func (*UpdateCommentResponse) ProtoMessage

func (*UpdateCommentResponse) ProtoMessage()

func (*UpdateCommentResponse) ProtoReflect

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

func (*UpdateCommentResponse) Reset

func (x *UpdateCommentResponse) Reset()

func (*UpdateCommentResponse) String

func (x *UpdateCommentResponse) String() string

Jump to

Keyboard shortcuts

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