mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
9ceabf68c4
Replace the host bind-mount + containerd exec approach with a per-bot
in-container gRPC server (ContainerService, port 9090). All file I/O,
exec, and MCP stdio sessions now go through gRPC instead of running
shell commands or reading host-mounted directories.
Architecture changes:
- cmd/mcp: rewritten as a gRPC server (ContainerService) with full
file and exec API (ReadFile, WriteFile, ListDir, ReadRaw, WriteRaw,
Exec, Stat, Mkdir, Rename, DeleteFile)
- internal/mcp/mcpcontainer: protobuf definitions and generated stubs
- internal/mcp/mcpclient: gRPC client wrapper with connection pool
(Pool) and Provider interface for dependency injection
- mcp.Manager: add per-bot IP cache, gRPC connection pool, and
SetContainerIP/MCPClient methods; remove DataDir/Exec helpers
- containerd.Service: remove ExecTask/ExecTaskStreaming; network setup
now returns NetworkResult{IP} for pool routing
- internal/fs/service.go: deleted (replaced by mcpclient)
- handlers/fs.go: deleted; MCP stdio session logic moved to mcp_stdio.go
- container provider Executor: all tools (read/write/list/edit/exec)
now call gRPC client instead of running shell via exec
- storefs, containerfs, media, skills, memory: all I/O ported to
mcpclient.Provider
Database:
- migration 0022: drop host_path column from containers table
One-time data migration:
- migrateBindMountData: on first Start() after upgrade, copies old
bind-mount data into the container via gRPC, then renames src dir
to prevent re-migration; runs in background goroutine
Bug fixes:
- mcp_stdio: callRaw now returns full JSON-RPC envelope
{"jsonrpc","id","result"|"error"} matching protocol spec;
explicit "initialize" call now advances session init state to
prevent duplicate handshake on next non-initialize call
- mcpclient Pool: properly evict stale gRPC connection after snapshot
replace (container process recreated); use SetContainerIP instead
of direct map write so IP changes always evict pool entry
- migrateBindMountData: walkErr on directories now counted as failure
so partially-walked trees don't get incorrectly marked as migrated
- cmd/mcp/Dockerfile: removed dead file (docker/Dockerfile.mcp is the
canonical production build)
Tests:
- provider_test.go: restored with bufconn in-process gRPC mock
(fakeContainerService + staticProvider), 14 cases covering all 5
tools plus edge cases
- mcp_session_test.go: new, covers JSON-RPC envelope, init state
machine, pending cleanup on cancel/close, readLoop cancel
- storefs/service_test.go: restored (pure function roundtrip tests)
455 lines
19 KiB
Go
455 lines
19 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.5.1
|
|
// - protoc v4.25.3
|
|
// source: internal/mcp/mcpcontainer/mcpcontainer.proto
|
|
|
|
package mcpcontainer
|
|
|
|
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 (
|
|
ContainerService_ReadFile_FullMethodName = "/mcpcontainer.ContainerService/ReadFile"
|
|
ContainerService_WriteFile_FullMethodName = "/mcpcontainer.ContainerService/WriteFile"
|
|
ContainerService_ListDir_FullMethodName = "/mcpcontainer.ContainerService/ListDir"
|
|
ContainerService_Stat_FullMethodName = "/mcpcontainer.ContainerService/Stat"
|
|
ContainerService_Mkdir_FullMethodName = "/mcpcontainer.ContainerService/Mkdir"
|
|
ContainerService_Rename_FullMethodName = "/mcpcontainer.ContainerService/Rename"
|
|
ContainerService_Exec_FullMethodName = "/mcpcontainer.ContainerService/Exec"
|
|
ContainerService_ReadRaw_FullMethodName = "/mcpcontainer.ContainerService/ReadRaw"
|
|
ContainerService_WriteRaw_FullMethodName = "/mcpcontainer.ContainerService/WriteRaw"
|
|
ContainerService_DeleteFile_FullMethodName = "/mcpcontainer.ContainerService/DeleteFile"
|
|
)
|
|
|
|
// ContainerServiceClient is the client API for ContainerService 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 ContainerServiceClient interface {
|
|
ReadFile(ctx context.Context, in *ReadFileRequest, opts ...grpc.CallOption) (*ReadFileResponse, error)
|
|
WriteFile(ctx context.Context, in *WriteFileRequest, opts ...grpc.CallOption) (*WriteFileResponse, error)
|
|
ListDir(ctx context.Context, in *ListDirRequest, opts ...grpc.CallOption) (*ListDirResponse, error)
|
|
Stat(ctx context.Context, in *StatRequest, opts ...grpc.CallOption) (*StatResponse, error)
|
|
Mkdir(ctx context.Context, in *MkdirRequest, opts ...grpc.CallOption) (*MkdirResponse, error)
|
|
Rename(ctx context.Context, in *RenameRequest, opts ...grpc.CallOption) (*RenameResponse, error)
|
|
Exec(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[ExecInput, ExecOutput], error)
|
|
ReadRaw(ctx context.Context, in *ReadRawRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[DataChunk], error)
|
|
WriteRaw(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[WriteRawChunk, WriteRawResponse], error)
|
|
DeleteFile(ctx context.Context, in *DeleteFileRequest, opts ...grpc.CallOption) (*DeleteFileResponse, error)
|
|
}
|
|
|
|
type containerServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewContainerServiceClient(cc grpc.ClientConnInterface) ContainerServiceClient {
|
|
return &containerServiceClient{cc}
|
|
}
|
|
|
|
func (c *containerServiceClient) ReadFile(ctx context.Context, in *ReadFileRequest, opts ...grpc.CallOption) (*ReadFileResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ReadFileResponse)
|
|
err := c.cc.Invoke(ctx, ContainerService_ReadFile_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *containerServiceClient) WriteFile(ctx context.Context, in *WriteFileRequest, opts ...grpc.CallOption) (*WriteFileResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(WriteFileResponse)
|
|
err := c.cc.Invoke(ctx, ContainerService_WriteFile_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *containerServiceClient) ListDir(ctx context.Context, in *ListDirRequest, opts ...grpc.CallOption) (*ListDirResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ListDirResponse)
|
|
err := c.cc.Invoke(ctx, ContainerService_ListDir_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *containerServiceClient) Stat(ctx context.Context, in *StatRequest, opts ...grpc.CallOption) (*StatResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(StatResponse)
|
|
err := c.cc.Invoke(ctx, ContainerService_Stat_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *containerServiceClient) Mkdir(ctx context.Context, in *MkdirRequest, opts ...grpc.CallOption) (*MkdirResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(MkdirResponse)
|
|
err := c.cc.Invoke(ctx, ContainerService_Mkdir_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *containerServiceClient) Rename(ctx context.Context, in *RenameRequest, opts ...grpc.CallOption) (*RenameResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(RenameResponse)
|
|
err := c.cc.Invoke(ctx, ContainerService_Rename_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *containerServiceClient) Exec(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[ExecInput, ExecOutput], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &ContainerService_ServiceDesc.Streams[0], ContainerService_Exec_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[ExecInput, ExecOutput]{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 ContainerService_ExecClient = grpc.BidiStreamingClient[ExecInput, ExecOutput]
|
|
|
|
func (c *containerServiceClient) ReadRaw(ctx context.Context, in *ReadRawRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[DataChunk], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &ContainerService_ServiceDesc.Streams[1], ContainerService_ReadRaw_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[ReadRawRequest, DataChunk]{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 ContainerService_ReadRawClient = grpc.ServerStreamingClient[DataChunk]
|
|
|
|
func (c *containerServiceClient) WriteRaw(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[WriteRawChunk, WriteRawResponse], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &ContainerService_ServiceDesc.Streams[2], ContainerService_WriteRaw_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[WriteRawChunk, WriteRawResponse]{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 ContainerService_WriteRawClient = grpc.ClientStreamingClient[WriteRawChunk, WriteRawResponse]
|
|
|
|
func (c *containerServiceClient) DeleteFile(ctx context.Context, in *DeleteFileRequest, opts ...grpc.CallOption) (*DeleteFileResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(DeleteFileResponse)
|
|
err := c.cc.Invoke(ctx, ContainerService_DeleteFile_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// ContainerServiceServer is the server API for ContainerService service.
|
|
// All implementations must embed UnimplementedContainerServiceServer
|
|
// for forward compatibility.
|
|
type ContainerServiceServer interface {
|
|
ReadFile(context.Context, *ReadFileRequest) (*ReadFileResponse, error)
|
|
WriteFile(context.Context, *WriteFileRequest) (*WriteFileResponse, error)
|
|
ListDir(context.Context, *ListDirRequest) (*ListDirResponse, error)
|
|
Stat(context.Context, *StatRequest) (*StatResponse, error)
|
|
Mkdir(context.Context, *MkdirRequest) (*MkdirResponse, error)
|
|
Rename(context.Context, *RenameRequest) (*RenameResponse, error)
|
|
Exec(grpc.BidiStreamingServer[ExecInput, ExecOutput]) error
|
|
ReadRaw(*ReadRawRequest, grpc.ServerStreamingServer[DataChunk]) error
|
|
WriteRaw(grpc.ClientStreamingServer[WriteRawChunk, WriteRawResponse]) error
|
|
DeleteFile(context.Context, *DeleteFileRequest) (*DeleteFileResponse, error)
|
|
mustEmbedUnimplementedContainerServiceServer()
|
|
}
|
|
|
|
// UnimplementedContainerServiceServer 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 UnimplementedContainerServiceServer struct{}
|
|
|
|
func (UnimplementedContainerServiceServer) ReadFile(context.Context, *ReadFileRequest) (*ReadFileResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ReadFile not implemented")
|
|
}
|
|
func (UnimplementedContainerServiceServer) WriteFile(context.Context, *WriteFileRequest) (*WriteFileResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method WriteFile not implemented")
|
|
}
|
|
func (UnimplementedContainerServiceServer) ListDir(context.Context, *ListDirRequest) (*ListDirResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ListDir not implemented")
|
|
}
|
|
func (UnimplementedContainerServiceServer) Stat(context.Context, *StatRequest) (*StatResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Stat not implemented")
|
|
}
|
|
func (UnimplementedContainerServiceServer) Mkdir(context.Context, *MkdirRequest) (*MkdirResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Mkdir not implemented")
|
|
}
|
|
func (UnimplementedContainerServiceServer) Rename(context.Context, *RenameRequest) (*RenameResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Rename not implemented")
|
|
}
|
|
func (UnimplementedContainerServiceServer) Exec(grpc.BidiStreamingServer[ExecInput, ExecOutput]) error {
|
|
return status.Errorf(codes.Unimplemented, "method Exec not implemented")
|
|
}
|
|
func (UnimplementedContainerServiceServer) ReadRaw(*ReadRawRequest, grpc.ServerStreamingServer[DataChunk]) error {
|
|
return status.Errorf(codes.Unimplemented, "method ReadRaw not implemented")
|
|
}
|
|
func (UnimplementedContainerServiceServer) WriteRaw(grpc.ClientStreamingServer[WriteRawChunk, WriteRawResponse]) error {
|
|
return status.Errorf(codes.Unimplemented, "method WriteRaw not implemented")
|
|
}
|
|
func (UnimplementedContainerServiceServer) DeleteFile(context.Context, *DeleteFileRequest) (*DeleteFileResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method DeleteFile not implemented")
|
|
}
|
|
func (UnimplementedContainerServiceServer) mustEmbedUnimplementedContainerServiceServer() {}
|
|
func (UnimplementedContainerServiceServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeContainerServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to ContainerServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeContainerServiceServer interface {
|
|
mustEmbedUnimplementedContainerServiceServer()
|
|
}
|
|
|
|
func RegisterContainerServiceServer(s grpc.ServiceRegistrar, srv ContainerServiceServer) {
|
|
// If the following call pancis, it indicates UnimplementedContainerServiceServer 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(&ContainerService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _ContainerService_ReadFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ReadFileRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ContainerServiceServer).ReadFile(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ContainerService_ReadFile_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ContainerServiceServer).ReadFile(ctx, req.(*ReadFileRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ContainerService_WriteFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(WriteFileRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ContainerServiceServer).WriteFile(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ContainerService_WriteFile_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ContainerServiceServer).WriteFile(ctx, req.(*WriteFileRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ContainerService_ListDir_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ListDirRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ContainerServiceServer).ListDir(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ContainerService_ListDir_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ContainerServiceServer).ListDir(ctx, req.(*ListDirRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ContainerService_Stat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(StatRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ContainerServiceServer).Stat(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ContainerService_Stat_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ContainerServiceServer).Stat(ctx, req.(*StatRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ContainerService_Mkdir_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(MkdirRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ContainerServiceServer).Mkdir(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ContainerService_Mkdir_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ContainerServiceServer).Mkdir(ctx, req.(*MkdirRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ContainerService_Rename_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(RenameRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ContainerServiceServer).Rename(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ContainerService_Rename_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ContainerServiceServer).Rename(ctx, req.(*RenameRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ContainerService_Exec_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
return srv.(ContainerServiceServer).Exec(&grpc.GenericServerStream[ExecInput, ExecOutput]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type ContainerService_ExecServer = grpc.BidiStreamingServer[ExecInput, ExecOutput]
|
|
|
|
func _ContainerService_ReadRaw_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(ReadRawRequest)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(ContainerServiceServer).ReadRaw(m, &grpc.GenericServerStream[ReadRawRequest, DataChunk]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type ContainerService_ReadRawServer = grpc.ServerStreamingServer[DataChunk]
|
|
|
|
func _ContainerService_WriteRaw_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
return srv.(ContainerServiceServer).WriteRaw(&grpc.GenericServerStream[WriteRawChunk, WriteRawResponse]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type ContainerService_WriteRawServer = grpc.ClientStreamingServer[WriteRawChunk, WriteRawResponse]
|
|
|
|
func _ContainerService_DeleteFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(DeleteFileRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ContainerServiceServer).DeleteFile(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ContainerService_DeleteFile_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ContainerServiceServer).DeleteFile(ctx, req.(*DeleteFileRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// ContainerService_ServiceDesc is the grpc.ServiceDesc for ContainerService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var ContainerService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "mcpcontainer.ContainerService",
|
|
HandlerType: (*ContainerServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "ReadFile",
|
|
Handler: _ContainerService_ReadFile_Handler,
|
|
},
|
|
{
|
|
MethodName: "WriteFile",
|
|
Handler: _ContainerService_WriteFile_Handler,
|
|
},
|
|
{
|
|
MethodName: "ListDir",
|
|
Handler: _ContainerService_ListDir_Handler,
|
|
},
|
|
{
|
|
MethodName: "Stat",
|
|
Handler: _ContainerService_Stat_Handler,
|
|
},
|
|
{
|
|
MethodName: "Mkdir",
|
|
Handler: _ContainerService_Mkdir_Handler,
|
|
},
|
|
{
|
|
MethodName: "Rename",
|
|
Handler: _ContainerService_Rename_Handler,
|
|
},
|
|
{
|
|
MethodName: "DeleteFile",
|
|
Handler: _ContainerService_DeleteFile_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "Exec",
|
|
Handler: _ContainerService_Exec_Handler,
|
|
ServerStreams: true,
|
|
ClientStreams: true,
|
|
},
|
|
{
|
|
StreamName: "ReadRaw",
|
|
Handler: _ContainerService_ReadRaw_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
{
|
|
StreamName: "WriteRaw",
|
|
Handler: _ContainerService_WriteRaw_Handler,
|
|
ClientStreams: true,
|
|
},
|
|
},
|
|
Metadata: "internal/mcp/mcpcontainer/mcpcontainer.proto",
|
|
}
|