pb

package
v0.0.0-...-fe7ef4e Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package pb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var Comment_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "comment.pb.Comment",
	HandlerType: (*CommentServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Healthz",
			Handler:    _Comment_Healthz_Handler,
		},
		{
			MethodName: "ListComment",
			Handler:    _Comment_ListComment_Handler,
		},
		{
			MethodName: "CreateComment",
			Handler:    _Comment_CreateComment_Handler,
		},
		{
			MethodName: "UpdateComment",
			Handler:    _Comment_UpdateComment_Handler,
		},
		{
			MethodName: "DeleteComment",
			Handler:    _Comment_DeleteComment_Handler,
		},
		{
			MethodName: "DeleteCommentByVideoID",
			Handler:    _Comment_DeleteCommentByVideoID_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "modules/comment/pb/rpc.proto",
}

Comment_ServiceDesc is the grpc.ServiceDesc for Comment 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_modules_comment_pb_message_proto protoreflect.FileDescriptor
View Source
var File_modules_comment_pb_rpc_proto protoreflect.FileDescriptor

Functions

func RegisterCommentHandler

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

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

func RegisterCommentHandlerClient

func RegisterCommentHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CommentClient) error

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

func RegisterCommentHandlerFromEndpoint

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

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

func RegisterCommentHandlerServer

func RegisterCommentHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CommentServer) error

RegisterCommentHandlerServer registers the http handlers for service Comment to "mux". UnaryRPC :call CommentServer 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 RegisterCommentHandlerFromEndpoint instead.

func RegisterCommentServer

func RegisterCommentServer(s grpc.ServiceRegistrar, srv CommentServer)

Types

type CommentClient

type CommentClient interface {
	Healthz(ctx context.Context, in *HealthzRequest, opts ...grpc.CallOption) (*HealthzResponse, error)
	ListComment(ctx context.Context, in *ListCommentRequest, opts ...grpc.CallOption) (*ListCommentResponse, error)
	CreateComment(ctx context.Context, in *CreateCommentRequest, opts ...grpc.CallOption) (*CreateCommentResponse, error)
	UpdateComment(ctx context.Context, in *UpdateCommentRequest, opts ...grpc.CallOption) (*UpdateCommentResponse, error)
	DeleteComment(ctx context.Context, in *DeleteCommentRequest, opts ...grpc.CallOption) (*DeleteCommentResponse, error)
	DeleteCommentByVideoID(ctx context.Context, in *DeleteCommentByVideoIDRequest, opts ...grpc.CallOption) (*DeleteCommentByVideoIDResponse, error)
}

CommentClient is the client API for Comment 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 NewCommentClient

func NewCommentClient(cc grpc.ClientConnInterface) CommentClient

type CommentInfo

type CommentInfo struct {
	Id        string                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	VideoId   string                 `protobuf:"bytes,2,opt,name=video_id,json=videoId,proto3" json:"video_id,omitempty"`
	Content   string                 `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"`
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

func (*CommentInfo) Descriptor deprecated

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

Deprecated: Use CommentInfo.ProtoReflect.Descriptor instead.

func (*CommentInfo) GetContent

func (x *CommentInfo) GetContent() string

func (*CommentInfo) GetCreatedAt

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

func (*CommentInfo) GetId

func (x *CommentInfo) GetId() string

func (*CommentInfo) GetUpdatedAt

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

func (*CommentInfo) GetVideoId

func (x *CommentInfo) GetVideoId() string

func (*CommentInfo) ProtoMessage

func (*CommentInfo) ProtoMessage()

func (*CommentInfo) ProtoReflect

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

func (*CommentInfo) Reset

func (x *CommentInfo) Reset()

func (*CommentInfo) String

func (x *CommentInfo) String() string

type CommentServer

CommentServer is the server API for Comment service. All implementations must embed UnimplementedCommentServer for forward compatibility

type CreateCommentRequest

type CreateCommentRequest struct {
	VideoId string `protobuf:"bytes,1,opt,name=video_id,json=videoId,proto3" json:"video_id,omitempty"`
	Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateCommentRequest) Descriptor deprecated

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

Deprecated: Use CreateCommentRequest.ProtoReflect.Descriptor instead.

func (*CreateCommentRequest) GetContent

func (x *CreateCommentRequest) GetContent() string

func (*CreateCommentRequest) GetVideoId

func (x *CreateCommentRequest) GetVideoId() string

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 {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateCommentResponse) Descriptor deprecated

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

Deprecated: Use CreateCommentResponse.ProtoReflect.Descriptor instead.

func (*CreateCommentResponse) GetId

func (x *CreateCommentResponse) GetId() string

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 DeleteCommentByVideoIDRequest

type DeleteCommentByVideoIDRequest struct {
	VideoId string `protobuf:"bytes,1,opt,name=video_id,json=videoId,proto3" json:"video_id,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteCommentByVideoIDRequest) Descriptor deprecated

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

Deprecated: Use DeleteCommentByVideoIDRequest.ProtoReflect.Descriptor instead.

func (*DeleteCommentByVideoIDRequest) GetVideoId

func (x *DeleteCommentByVideoIDRequest) GetVideoId() string

func (*DeleteCommentByVideoIDRequest) ProtoMessage

func (*DeleteCommentByVideoIDRequest) ProtoMessage()

func (*DeleteCommentByVideoIDRequest) ProtoReflect

func (*DeleteCommentByVideoIDRequest) Reset

func (x *DeleteCommentByVideoIDRequest) Reset()

func (*DeleteCommentByVideoIDRequest) String

type DeleteCommentByVideoIDResponse

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

func (*DeleteCommentByVideoIDResponse) Descriptor deprecated

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

Deprecated: Use DeleteCommentByVideoIDResponse.ProtoReflect.Descriptor instead.

func (*DeleteCommentByVideoIDResponse) ProtoMessage

func (*DeleteCommentByVideoIDResponse) ProtoMessage()

func (*DeleteCommentByVideoIDResponse) ProtoReflect

func (*DeleteCommentByVideoIDResponse) Reset

func (x *DeleteCommentByVideoIDResponse) Reset()

func (*DeleteCommentByVideoIDResponse) String

type DeleteCommentRequest

type DeleteCommentRequest struct {
	Id string `protobuf:"bytes,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() string

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 {
	// contains filtered or unexported fields
}

func (*DeleteCommentResponse) Descriptor deprecated

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

Deprecated: Use DeleteCommentResponse.ProtoReflect.Descriptor instead.

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 HealthzRequest

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

func (*HealthzRequest) Descriptor deprecated

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

Deprecated: Use HealthzRequest.ProtoReflect.Descriptor instead.

func (*HealthzRequest) ProtoMessage

func (*HealthzRequest) ProtoMessage()

func (*HealthzRequest) ProtoReflect

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

func (*HealthzRequest) Reset

func (x *HealthzRequest) Reset()

func (*HealthzRequest) String

func (x *HealthzRequest) String() string

type HealthzResponse

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

func (*HealthzResponse) Descriptor deprecated

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

Deprecated: Use HealthzResponse.ProtoReflect.Descriptor instead.

func (*HealthzResponse) GetStatus

func (x *HealthzResponse) GetStatus() string

func (*HealthzResponse) ProtoMessage

func (*HealthzResponse) ProtoMessage()

func (*HealthzResponse) ProtoReflect

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

func (*HealthzResponse) Reset

func (x *HealthzResponse) Reset()

func (*HealthzResponse) String

func (x *HealthzResponse) String() string

type ListCommentRequest

type ListCommentRequest struct {
	VideoId string `protobuf:"bytes,1,opt,name=video_id,json=videoId,proto3" json:"video_id,omitempty"`
	Limit   int32  `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
	Offset  int32  `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"`
	// contains filtered or unexported fields
}

func (*ListCommentRequest) Descriptor deprecated

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

Deprecated: Use ListCommentRequest.ProtoReflect.Descriptor instead.

func (*ListCommentRequest) GetLimit

func (x *ListCommentRequest) GetLimit() int32

func (*ListCommentRequest) GetOffset

func (x *ListCommentRequest) GetOffset() int32

func (*ListCommentRequest) GetVideoId

func (x *ListCommentRequest) GetVideoId() string

func (*ListCommentRequest) ProtoMessage

func (*ListCommentRequest) ProtoMessage()

func (*ListCommentRequest) ProtoReflect

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

func (*ListCommentRequest) Reset

func (x *ListCommentRequest) Reset()

func (*ListCommentRequest) String

func (x *ListCommentRequest) String() string

type ListCommentResponse

type ListCommentResponse struct {
	Comments []*CommentInfo `protobuf:"bytes,1,rep,name=comments,proto3" json:"comments,omitempty"`
	// contains filtered or unexported fields
}

func (*ListCommentResponse) Descriptor deprecated

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

Deprecated: Use ListCommentResponse.ProtoReflect.Descriptor instead.

func (*ListCommentResponse) GetComments

func (x *ListCommentResponse) GetComments() []*CommentInfo

func (*ListCommentResponse) ProtoMessage

func (*ListCommentResponse) ProtoMessage()

func (*ListCommentResponse) ProtoReflect

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

func (*ListCommentResponse) Reset

func (x *ListCommentResponse) Reset()

func (*ListCommentResponse) String

func (x *ListCommentResponse) String() string

type UnimplementedCommentServer

type UnimplementedCommentServer struct {
}

UnimplementedCommentServer must be embedded to have forward compatible implementations.

func (UnimplementedCommentServer) CreateComment

func (UnimplementedCommentServer) DeleteComment

func (UnimplementedCommentServer) Healthz

func (UnimplementedCommentServer) ListComment

func (UnimplementedCommentServer) UpdateComment

type UnsafeCommentServer

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

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

type UpdateCommentRequest

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

func (*UpdateCommentRequest) Descriptor deprecated

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

Deprecated: Use UpdateCommentRequest.ProtoReflect.Descriptor instead.

func (*UpdateCommentRequest) GetContent

func (x *UpdateCommentRequest) GetContent() string

func (*UpdateCommentRequest) GetId

func (x *UpdateCommentRequest) GetId() string

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 {
	Comment *CommentInfo `protobuf:"bytes,1,opt,name=comment,proto3" json:"comment,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateCommentResponse) Descriptor deprecated

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

Deprecated: Use UpdateCommentResponse.ProtoReflect.Descriptor instead.

func (*UpdateCommentResponse) GetComment

func (x *UpdateCommentResponse) GetComment() *CommentInfo

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