yao/tai/volume/pb/volume_grpc.pb.go
Max 43d4ace13c Add Tai SDK tests and update Makefile for Tai integration
- Introduce new Tai SDK tests in the GitHub workflows, requiring a Tai container with Docker socket mount for execution.
- Update the Makefile to include a dedicated target for running Tai SDK tests, enhancing test coverage for the Tai integration.
- Modify the Go module dependencies to include the pierrec/lz4 package, ensuring compatibility with the new tests.
- Adjust test folder selection logic in the Makefile to exclude additional directories, streamlining the testing process.
2026-03-03 20:49:34 +08:00

441 lines
18 KiB
Go

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc v4.25.0
// source: volume/pb/volume.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 (
Volume_SyncPush_FullMethodName = "/volume.Volume/SyncPush"
Volume_SyncPull_FullMethodName = "/volume.Volume/SyncPull"
Volume_ReadFile_FullMethodName = "/volume.Volume/ReadFile"
Volume_WriteFile_FullMethodName = "/volume.Volume/WriteFile"
Volume_Stat_FullMethodName = "/volume.Volume/Stat"
Volume_ListDir_FullMethodName = "/volume.Volume/ListDir"
Volume_Remove_FullMethodName = "/volume.Volume/Remove"
Volume_Rename_FullMethodName = "/volume.Volume/Rename"
Volume_MkdirAll_FullMethodName = "/volume.Volume/MkdirAll"
)
// VolumeClient is the client API for Volume 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.
//
// Volume provides bulk file synchronization and real-time filesystem I/O.
// Shares gRPC port :9100 with Yao Gateway.
type VolumeClient interface {
// SyncPush: Yao sends code to Tai (before container start).
// Bidirectional stream:
// 1. Yao sends SyncManifest (file list with mtime+size)
// 2. Tai diffs, replies with SyncDiff (which files to send)
// 3. Yao sends only needed FileChunks
// 4. Tai replies with SyncResult
SyncPush(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[SyncMessage, SyncMessage], error)
// SyncPull: Yao pulls changes from Tai (after container stop).
// Yao sends its file manifest; Tai diffs internally and streams back changed files.
SyncPull(ctx context.Context, in *SyncManifest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SyncMessage], error)
ReadFile(ctx context.Context, in *FSReadRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[FSDataChunk], error)
WriteFile(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[FSWriteChunk, FSWriteResponse], error)
Stat(ctx context.Context, in *FSRequest, opts ...grpc.CallOption) (*FileInfo, error)
ListDir(ctx context.Context, in *FSRequest, opts ...grpc.CallOption) (*FSListResponse, error)
Remove(ctx context.Context, in *FSRemoveRequest, opts ...grpc.CallOption) (*FSOpResponse, error)
Rename(ctx context.Context, in *FSRenameRequest, opts ...grpc.CallOption) (*FSOpResponse, error)
MkdirAll(ctx context.Context, in *FSRequest, opts ...grpc.CallOption) (*FSOpResponse, error)
}
type volumeClient struct {
cc grpc.ClientConnInterface
}
func NewVolumeClient(cc grpc.ClientConnInterface) VolumeClient {
return &volumeClient{cc}
}
func (c *volumeClient) SyncPush(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[SyncMessage, SyncMessage], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &Volume_ServiceDesc.Streams[0], Volume_SyncPush_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &grpc.GenericClientStream[SyncMessage, SyncMessage]{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 Volume_SyncPushClient = grpc.BidiStreamingClient[SyncMessage, SyncMessage]
func (c *volumeClient) SyncPull(ctx context.Context, in *SyncManifest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SyncMessage], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &Volume_ServiceDesc.Streams[1], Volume_SyncPull_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &grpc.GenericClientStream[SyncManifest, SyncMessage]{ClientStream: stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
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 Volume_SyncPullClient = grpc.ServerStreamingClient[SyncMessage]
func (c *volumeClient) ReadFile(ctx context.Context, in *FSReadRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[FSDataChunk], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &Volume_ServiceDesc.Streams[2], Volume_ReadFile_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &grpc.GenericClientStream[FSReadRequest, FSDataChunk]{ClientStream: stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
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 Volume_ReadFileClient = grpc.ServerStreamingClient[FSDataChunk]
func (c *volumeClient) WriteFile(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[FSWriteChunk, FSWriteResponse], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &Volume_ServiceDesc.Streams[3], Volume_WriteFile_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &grpc.GenericClientStream[FSWriteChunk, FSWriteResponse]{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 Volume_WriteFileClient = grpc.ClientStreamingClient[FSWriteChunk, FSWriteResponse]
func (c *volumeClient) Stat(ctx context.Context, in *FSRequest, opts ...grpc.CallOption) (*FileInfo, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(FileInfo)
err := c.cc.Invoke(ctx, Volume_Stat_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *volumeClient) ListDir(ctx context.Context, in *FSRequest, opts ...grpc.CallOption) (*FSListResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(FSListResponse)
err := c.cc.Invoke(ctx, Volume_ListDir_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *volumeClient) Remove(ctx context.Context, in *FSRemoveRequest, opts ...grpc.CallOption) (*FSOpResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(FSOpResponse)
err := c.cc.Invoke(ctx, Volume_Remove_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *volumeClient) Rename(ctx context.Context, in *FSRenameRequest, opts ...grpc.CallOption) (*FSOpResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(FSOpResponse)
err := c.cc.Invoke(ctx, Volume_Rename_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *volumeClient) MkdirAll(ctx context.Context, in *FSRequest, opts ...grpc.CallOption) (*FSOpResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(FSOpResponse)
err := c.cc.Invoke(ctx, Volume_MkdirAll_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// VolumeServer is the server API for Volume service.
// All implementations must embed UnimplementedVolumeServer
// for forward compatibility.
//
// Volume provides bulk file synchronization and real-time filesystem I/O.
// Shares gRPC port :9100 with Yao Gateway.
type VolumeServer interface {
// SyncPush: Yao sends code to Tai (before container start).
// Bidirectional stream:
// 1. Yao sends SyncManifest (file list with mtime+size)
// 2. Tai diffs, replies with SyncDiff (which files to send)
// 3. Yao sends only needed FileChunks
// 4. Tai replies with SyncResult
SyncPush(grpc.BidiStreamingServer[SyncMessage, SyncMessage]) error
// SyncPull: Yao pulls changes from Tai (after container stop).
// Yao sends its file manifest; Tai diffs internally and streams back changed files.
SyncPull(*SyncManifest, grpc.ServerStreamingServer[SyncMessage]) error
ReadFile(*FSReadRequest, grpc.ServerStreamingServer[FSDataChunk]) error
WriteFile(grpc.ClientStreamingServer[FSWriteChunk, FSWriteResponse]) error
Stat(context.Context, *FSRequest) (*FileInfo, error)
ListDir(context.Context, *FSRequest) (*FSListResponse, error)
Remove(context.Context, *FSRemoveRequest) (*FSOpResponse, error)
Rename(context.Context, *FSRenameRequest) (*FSOpResponse, error)
MkdirAll(context.Context, *FSRequest) (*FSOpResponse, error)
mustEmbedUnimplementedVolumeServer()
}
// UnimplementedVolumeServer 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 UnimplementedVolumeServer struct{}
func (UnimplementedVolumeServer) SyncPush(grpc.BidiStreamingServer[SyncMessage, SyncMessage]) error {
return status.Error(codes.Unimplemented, "method SyncPush not implemented")
}
func (UnimplementedVolumeServer) SyncPull(*SyncManifest, grpc.ServerStreamingServer[SyncMessage]) error {
return status.Error(codes.Unimplemented, "method SyncPull not implemented")
}
func (UnimplementedVolumeServer) ReadFile(*FSReadRequest, grpc.ServerStreamingServer[FSDataChunk]) error {
return status.Error(codes.Unimplemented, "method ReadFile not implemented")
}
func (UnimplementedVolumeServer) WriteFile(grpc.ClientStreamingServer[FSWriteChunk, FSWriteResponse]) error {
return status.Error(codes.Unimplemented, "method WriteFile not implemented")
}
func (UnimplementedVolumeServer) Stat(context.Context, *FSRequest) (*FileInfo, error) {
return nil, status.Error(codes.Unimplemented, "method Stat not implemented")
}
func (UnimplementedVolumeServer) ListDir(context.Context, *FSRequest) (*FSListResponse, error) {
return nil, status.Error(codes.Unimplemented, "method ListDir not implemented")
}
func (UnimplementedVolumeServer) Remove(context.Context, *FSRemoveRequest) (*FSOpResponse, error) {
return nil, status.Error(codes.Unimplemented, "method Remove not implemented")
}
func (UnimplementedVolumeServer) Rename(context.Context, *FSRenameRequest) (*FSOpResponse, error) {
return nil, status.Error(codes.Unimplemented, "method Rename not implemented")
}
func (UnimplementedVolumeServer) MkdirAll(context.Context, *FSRequest) (*FSOpResponse, error) {
return nil, status.Error(codes.Unimplemented, "method MkdirAll not implemented")
}
func (UnimplementedVolumeServer) mustEmbedUnimplementedVolumeServer() {}
func (UnimplementedVolumeServer) testEmbeddedByValue() {}
// UnsafeVolumeServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to VolumeServer will
// result in compilation errors.
type UnsafeVolumeServer interface {
mustEmbedUnimplementedVolumeServer()
}
func RegisterVolumeServer(s grpc.ServiceRegistrar, srv VolumeServer) {
// If the following call panics, it indicates UnimplementedVolumeServer 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(&Volume_ServiceDesc, srv)
}
func _Volume_SyncPush_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(VolumeServer).SyncPush(&grpc.GenericServerStream[SyncMessage, SyncMessage]{ServerStream: stream})
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Volume_SyncPushServer = grpc.BidiStreamingServer[SyncMessage, SyncMessage]
func _Volume_SyncPull_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(SyncManifest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(VolumeServer).SyncPull(m, &grpc.GenericServerStream[SyncManifest, SyncMessage]{ServerStream: stream})
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Volume_SyncPullServer = grpc.ServerStreamingServer[SyncMessage]
func _Volume_ReadFile_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(FSReadRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(VolumeServer).ReadFile(m, &grpc.GenericServerStream[FSReadRequest, FSDataChunk]{ServerStream: stream})
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Volume_ReadFileServer = grpc.ServerStreamingServer[FSDataChunk]
func _Volume_WriteFile_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(VolumeServer).WriteFile(&grpc.GenericServerStream[FSWriteChunk, FSWriteResponse]{ServerStream: stream})
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Volume_WriteFileServer = grpc.ClientStreamingServer[FSWriteChunk, FSWriteResponse]
func _Volume_Stat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FSRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(VolumeServer).Stat(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Volume_Stat_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VolumeServer).Stat(ctx, req.(*FSRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Volume_ListDir_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FSRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(VolumeServer).ListDir(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Volume_ListDir_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VolumeServer).ListDir(ctx, req.(*FSRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Volume_Remove_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FSRemoveRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(VolumeServer).Remove(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Volume_Remove_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VolumeServer).Remove(ctx, req.(*FSRemoveRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Volume_Rename_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FSRenameRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(VolumeServer).Rename(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Volume_Rename_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VolumeServer).Rename(ctx, req.(*FSRenameRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Volume_MkdirAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FSRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(VolumeServer).MkdirAll(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Volume_MkdirAll_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VolumeServer).MkdirAll(ctx, req.(*FSRequest))
}
return interceptor(ctx, in, info, handler)
}
// Volume_ServiceDesc is the grpc.ServiceDesc for Volume service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Volume_ServiceDesc = grpc.ServiceDesc{
ServiceName: "volume.Volume",
HandlerType: (*VolumeServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Stat",
Handler: _Volume_Stat_Handler,
},
{
MethodName: "ListDir",
Handler: _Volume_ListDir_Handler,
},
{
MethodName: "Remove",
Handler: _Volume_Remove_Handler,
},
{
MethodName: "Rename",
Handler: _Volume_Rename_Handler,
},
{
MethodName: "MkdirAll",
Handler: _Volume_MkdirAll_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "SyncPush",
Handler: _Volume_SyncPush_Handler,
ServerStreams: true,
ClientStreams: true,
},
{
StreamName: "SyncPull",
Handler: _Volume_SyncPull_Handler,
ServerStreams: true,
},
{
StreamName: "ReadFile",
Handler: _Volume_ReadFile_Handler,
ServerStreams: true,
},
{
StreamName: "WriteFile",
Handler: _Volume_WriteFile_Handler,
ClientStreams: true,
},
},
Metadata: "volume/pb/volume.proto",
}