draft grpc

This commit is contained in:
2026-03-13 02:17:18 +00:00
parent ea2edbb9e0
commit 91e5e3542b
116 changed files with 44505 additions and 558 deletions

View File

@@ -0,0 +1,311 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc (unknown)
// source: app/v1/videos.proto
package appv1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
VideosService_GetUploadUrl_FullMethodName = "/stream.app.v1.VideosService/GetUploadUrl"
VideosService_CreateVideo_FullMethodName = "/stream.app.v1.VideosService/CreateVideo"
VideosService_ListVideos_FullMethodName = "/stream.app.v1.VideosService/ListVideos"
VideosService_GetVideo_FullMethodName = "/stream.app.v1.VideosService/GetVideo"
VideosService_UpdateVideo_FullMethodName = "/stream.app.v1.VideosService/UpdateVideo"
VideosService_DeleteVideo_FullMethodName = "/stream.app.v1.VideosService/DeleteVideo"
)
// VideosServiceClient is the client API for VideosService 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 VideosServiceClient interface {
GetUploadUrl(ctx context.Context, in *GetUploadUrlRequest, opts ...grpc.CallOption) (*GetUploadUrlResponse, error)
CreateVideo(ctx context.Context, in *CreateVideoRequest, opts ...grpc.CallOption) (*CreateVideoResponse, error)
ListVideos(ctx context.Context, in *ListVideosRequest, opts ...grpc.CallOption) (*ListVideosResponse, error)
GetVideo(ctx context.Context, in *GetVideoRequest, opts ...grpc.CallOption) (*GetVideoResponse, error)
UpdateVideo(ctx context.Context, in *UpdateVideoRequest, opts ...grpc.CallOption) (*UpdateVideoResponse, error)
DeleteVideo(ctx context.Context, in *DeleteVideoRequest, opts ...grpc.CallOption) (*MessageResponse, error)
}
type videosServiceClient struct {
cc grpc.ClientConnInterface
}
func NewVideosServiceClient(cc grpc.ClientConnInterface) VideosServiceClient {
return &videosServiceClient{cc}
}
func (c *videosServiceClient) GetUploadUrl(ctx context.Context, in *GetUploadUrlRequest, opts ...grpc.CallOption) (*GetUploadUrlResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetUploadUrlResponse)
err := c.cc.Invoke(ctx, VideosService_GetUploadUrl_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *videosServiceClient) CreateVideo(ctx context.Context, in *CreateVideoRequest, opts ...grpc.CallOption) (*CreateVideoResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(CreateVideoResponse)
err := c.cc.Invoke(ctx, VideosService_CreateVideo_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *videosServiceClient) ListVideos(ctx context.Context, in *ListVideosRequest, opts ...grpc.CallOption) (*ListVideosResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListVideosResponse)
err := c.cc.Invoke(ctx, VideosService_ListVideos_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *videosServiceClient) GetVideo(ctx context.Context, in *GetVideoRequest, opts ...grpc.CallOption) (*GetVideoResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetVideoResponse)
err := c.cc.Invoke(ctx, VideosService_GetVideo_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *videosServiceClient) UpdateVideo(ctx context.Context, in *UpdateVideoRequest, opts ...grpc.CallOption) (*UpdateVideoResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(UpdateVideoResponse)
err := c.cc.Invoke(ctx, VideosService_UpdateVideo_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *videosServiceClient) DeleteVideo(ctx context.Context, in *DeleteVideoRequest, opts ...grpc.CallOption) (*MessageResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(MessageResponse)
err := c.cc.Invoke(ctx, VideosService_DeleteVideo_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// VideosServiceServer is the server API for VideosService service.
// All implementations must embed UnimplementedVideosServiceServer
// for forward compatibility.
type VideosServiceServer interface {
GetUploadUrl(context.Context, *GetUploadUrlRequest) (*GetUploadUrlResponse, error)
CreateVideo(context.Context, *CreateVideoRequest) (*CreateVideoResponse, error)
ListVideos(context.Context, *ListVideosRequest) (*ListVideosResponse, error)
GetVideo(context.Context, *GetVideoRequest) (*GetVideoResponse, error)
UpdateVideo(context.Context, *UpdateVideoRequest) (*UpdateVideoResponse, error)
DeleteVideo(context.Context, *DeleteVideoRequest) (*MessageResponse, error)
mustEmbedUnimplementedVideosServiceServer()
}
// UnimplementedVideosServiceServer 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.
type UnimplementedVideosServiceServer struct{}
func (UnimplementedVideosServiceServer) GetUploadUrl(context.Context, *GetUploadUrlRequest) (*GetUploadUrlResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetUploadUrl not implemented")
}
func (UnimplementedVideosServiceServer) CreateVideo(context.Context, *CreateVideoRequest) (*CreateVideoResponse, error) {
return nil, status.Error(codes.Unimplemented, "method CreateVideo not implemented")
}
func (UnimplementedVideosServiceServer) ListVideos(context.Context, *ListVideosRequest) (*ListVideosResponse, error) {
return nil, status.Error(codes.Unimplemented, "method ListVideos not implemented")
}
func (UnimplementedVideosServiceServer) GetVideo(context.Context, *GetVideoRequest) (*GetVideoResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetVideo not implemented")
}
func (UnimplementedVideosServiceServer) UpdateVideo(context.Context, *UpdateVideoRequest) (*UpdateVideoResponse, error) {
return nil, status.Error(codes.Unimplemented, "method UpdateVideo not implemented")
}
func (UnimplementedVideosServiceServer) DeleteVideo(context.Context, *DeleteVideoRequest) (*MessageResponse, error) {
return nil, status.Error(codes.Unimplemented, "method DeleteVideo not implemented")
}
func (UnimplementedVideosServiceServer) mustEmbedUnimplementedVideosServiceServer() {}
func (UnimplementedVideosServiceServer) testEmbeddedByValue() {}
// UnsafeVideosServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to VideosServiceServer will
// result in compilation errors.
type UnsafeVideosServiceServer interface {
mustEmbedUnimplementedVideosServiceServer()
}
func RegisterVideosServiceServer(s grpc.ServiceRegistrar, srv VideosServiceServer) {
// If the following call panics, it indicates UnimplementedVideosServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&VideosService_ServiceDesc, srv)
}
func _VideosService_GetUploadUrl_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetUploadUrlRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(VideosServiceServer).GetUploadUrl(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: VideosService_GetUploadUrl_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VideosServiceServer).GetUploadUrl(ctx, req.(*GetUploadUrlRequest))
}
return interceptor(ctx, in, info, handler)
}
func _VideosService_CreateVideo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateVideoRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(VideosServiceServer).CreateVideo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: VideosService_CreateVideo_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VideosServiceServer).CreateVideo(ctx, req.(*CreateVideoRequest))
}
return interceptor(ctx, in, info, handler)
}
func _VideosService_ListVideos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListVideosRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(VideosServiceServer).ListVideos(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: VideosService_ListVideos_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VideosServiceServer).ListVideos(ctx, req.(*ListVideosRequest))
}
return interceptor(ctx, in, info, handler)
}
func _VideosService_GetVideo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetVideoRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(VideosServiceServer).GetVideo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: VideosService_GetVideo_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VideosServiceServer).GetVideo(ctx, req.(*GetVideoRequest))
}
return interceptor(ctx, in, info, handler)
}
func _VideosService_UpdateVideo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateVideoRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(VideosServiceServer).UpdateVideo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: VideosService_UpdateVideo_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VideosServiceServer).UpdateVideo(ctx, req.(*UpdateVideoRequest))
}
return interceptor(ctx, in, info, handler)
}
func _VideosService_DeleteVideo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteVideoRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(VideosServiceServer).DeleteVideo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: VideosService_DeleteVideo_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VideosServiceServer).DeleteVideo(ctx, req.(*DeleteVideoRequest))
}
return interceptor(ctx, in, info, handler)
}
// VideosService_ServiceDesc is the grpc.ServiceDesc for VideosService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var VideosService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "stream.app.v1.VideosService",
HandlerType: (*VideosServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetUploadUrl",
Handler: _VideosService_GetUploadUrl_Handler,
},
{
MethodName: "CreateVideo",
Handler: _VideosService_CreateVideo_Handler,
},
{
MethodName: "ListVideos",
Handler: _VideosService_ListVideos_Handler,
},
{
MethodName: "GetVideo",
Handler: _VideosService_GetVideo_Handler,
},
{
MethodName: "UpdateVideo",
Handler: _VideosService_UpdateVideo_Handler,
},
{
MethodName: "DeleteVideo",
Handler: _VideosService_DeleteVideo_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "app/v1/videos.proto",
}