capsule AI-native Unix-like composition layer

src/server/internal/pb/avatar_grpc.pb.go

9,300 bytes · 231 lines · capsule://quake0day/[email protected] raw on github

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc             v5.29.3
// source: avatar.proto

package pb

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 (
	AvatarService_SetAvatar_FullMethodName      = "/cyberverse.AvatarService/SetAvatar"
	AvatarService_GenerateStream_FullMethodName = "/cyberverse.AvatarService/GenerateStream"
	AvatarService_Reset_FullMethodName          = "/cyberverse.AvatarService/Reset"
	AvatarService_GetInfo_FullMethodName        = "/cyberverse.AvatarService/GetInfo"
)

// AvatarServiceClient is the client API for AvatarService 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 AvatarServiceClient interface {
	SetAvatar(ctx context.Context, in *SetAvatarRequest, opts ...grpc.CallOption) (*SetAvatarResponse, error)
	GenerateStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[AudioChunk, VideoChunk], error)
	Reset(ctx context.Context, in *ResetRequest, opts ...grpc.CallOption) (*ResetResponse, error)
	GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*AvatarInfo, error)
}

type avatarServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewAvatarServiceClient(cc grpc.ClientConnInterface) AvatarServiceClient {
	return &avatarServiceClient{cc}
}

func (c *avatarServiceClient) SetAvatar(ctx context.Context, in *SetAvatarRequest, opts ...grpc.CallOption) (*SetAvatarResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(SetAvatarResponse)
	err := c.cc.Invoke(ctx, AvatarService_SetAvatar_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *avatarServiceClient) GenerateStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[AudioChunk, VideoChunk], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &AvatarService_ServiceDesc.Streams[0], AvatarService_GenerateStream_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[AudioChunk, VideoChunk]{ClientStream: stream}
	return x, nil
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type AvatarService_GenerateStreamClient = grpc.BidiStreamingClient[AudioChunk, VideoChunk]

func (c *avatarServiceClient) Reset(ctx context.Context, in *ResetRequest, opts ...grpc.CallOption) (*ResetResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ResetResponse)
	err := c.cc.Invoke(ctx, AvatarService_Reset_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *avatarServiceClient) GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*AvatarInfo, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(AvatarInfo)
	err := c.cc.Invoke(ctx, AvatarService_GetInfo_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// AvatarServiceServer is the server API for AvatarService service.
// All implementations must embed UnimplementedAvatarServiceServer
// for forward compatibility.
type AvatarServiceServer interface {
	SetAvatar(context.Context, *SetAvatarRequest) (*SetAvatarResponse, error)
	GenerateStream(grpc.BidiStreamingServer[AudioChunk, VideoChunk]) error
	Reset(context.Context, *ResetRequest) (*ResetResponse, error)
	GetInfo(context.Context, *GetInfoRequest) (*AvatarInfo, error)
	mustEmbedUnimplementedAvatarServiceServer()
}

// UnimplementedAvatarServiceServer 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 UnimplementedAvatarServiceServer struct{}

func (UnimplementedAvatarServiceServer) SetAvatar(context.Context, *SetAvatarRequest) (*SetAvatarResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method SetAvatar not implemented")
}
func (UnimplementedAvatarServiceServer) GenerateStream(grpc.BidiStreamingServer[AudioChunk, VideoChunk]) error {
	return status.Error(codes.Unimplemented, "method GenerateStream not implemented")
}
func (UnimplementedAvatarServiceServer) Reset(context.Context, *ResetRequest) (*ResetResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method Reset not implemented")
}
func (UnimplementedAvatarServiceServer) GetInfo(context.Context, *GetInfoRequest) (*AvatarInfo, error) {
	return nil, status.Error(codes.Unimplemented, "method GetInfo not implemented")
}
func (UnimplementedAvatarServiceServer) mustEmbedUnimplementedAvatarServiceServer() {}
func (UnimplementedAvatarServiceServer) testEmbeddedByValue()                       {}

// UnsafeAvatarServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AvatarServiceServer will
// result in compilation errors.
type UnsafeAvatarServiceServer interface {
	mustEmbedUnimplementedAvatarServiceServer()
}

func RegisterAvatarServiceServer(s grpc.ServiceRegistrar, srv AvatarServiceServer) {
	// If the following call panics, it indicates UnimplementedAvatarServiceServer 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(&AvatarService_ServiceDesc, srv)
}

func _AvatarService_SetAvatar_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SetAvatarRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AvatarServiceServer).SetAvatar(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AvatarService_SetAvatar_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AvatarServiceServer).SetAvatar(ctx, req.(*SetAvatarRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _AvatarService_GenerateStream_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(AvatarServiceServer).GenerateStream(&grpc.GenericServerStream[AudioChunk, VideoChunk]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type AvatarService_GenerateStreamServer = grpc.BidiStreamingServer[AudioChunk, VideoChunk]

func _AvatarService_Reset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ResetRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AvatarServiceServer).Reset(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AvatarService_Reset_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AvatarServiceServer).Reset(ctx, req.(*ResetRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _AvatarService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetInfoRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AvatarServiceServer).GetInfo(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AvatarService_GetInfo_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AvatarServiceServer).GetInfo(ctx, req.(*GetInfoRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// AvatarService_ServiceDesc is the grpc.ServiceDesc for AvatarService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AvatarService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "cyberverse.AvatarService",
	HandlerType: (*AvatarServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SetAvatar",
			Handler:    _AvatarService_SetAvatar_Handler,
		},
		{
			MethodName: "Reset",
			Handler:    _AvatarService_Reset_Handler,
		},
		{
			MethodName: "GetInfo",
			Handler:    _AvatarService_GetInfo_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "GenerateStream",
			Handler:       _AvatarService_GenerateStream_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "avatar.proto",
}