server

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package server provides gRPC server implementations for sandbox and codebase services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CodebaseServiceServer

type CodebaseServiceServer struct {
	pb.UnimplementedCodebaseServiceServer
	// contains filtered or unexported fields
}

CodebaseServiceServer implements the CodebaseService gRPC interface.

func NewCodebaseServiceServer

func NewCodebaseServiceServer(manager *codebase.Manager) *CodebaseServiceServer

NewCodebaseServiceServer creates a new CodebaseServiceServer.

func (*CodebaseServiceServer) CreateCodebase

func (s *CodebaseServiceServer) CreateCodebase(ctx context.Context, req *pb.CreateCodebaseRequest) (*pb.Codebase, error)

CreateCodebase creates a new codebase.

func (*CodebaseServiceServer) DeleteCodebase

func (s *CodebaseServiceServer) DeleteCodebase(ctx context.Context, req *pb.DeleteCodebaseRequest) (*pb.Empty, error)

DeleteCodebase deletes a codebase.

func (*CodebaseServiceServer) DownloadFile

DownloadFile downloads a file from a codebase.

func (*CodebaseServiceServer) GetCodebase

GetCodebase retrieves information about a codebase.

func (*CodebaseServiceServer) ListCodebases

ListCodebases lists all codebases for an owner.

func (*CodebaseServiceServer) ListFiles

ListFiles lists files in a codebase directory.

func (*CodebaseServiceServer) UploadFiles

UploadFiles uploads files to a codebase via streaming.

type Config

type Config struct {
	GRPCAddr string
	RESTAddr string // Optional REST gateway address
}

Config holds server configuration.

type SandboxServiceServer

type SandboxServiceServer struct {
	pb.UnimplementedSandboxServiceServer
	// contains filtered or unexported fields
}

SandboxServiceServer implements the SandboxService gRPC interface.

func NewSandboxServiceServer

func NewSandboxServiceServer(rt sbruntime.RuntimeWithExecutor, cbManager *codebase.Manager) *SandboxServiceServer

NewSandboxServiceServer creates a new SandboxServiceServer.

func (*SandboxServiceServer) CreateSandbox

func (s *SandboxServiceServer) CreateSandbox(ctx context.Context, req *pb.CreateSandboxRequest) (*pb.Sandbox, error)

CreateSandbox creates a new sandbox with specified configuration.

func (*SandboxServiceServer) CreateSession

func (s *SandboxServiceServer) CreateSession(ctx context.Context, req *pb.CreateSessionRequest) (*pb.Session, error)

CreateSession creates a new shell session within a sandbox.

func (*SandboxServiceServer) DestroySandbox

func (s *SandboxServiceServer) DestroySandbox(ctx context.Context, req *pb.DestroySandboxRequest) (*pb.Empty, error)

DestroySandbox destroys a sandbox and releases resources.

func (*SandboxServiceServer) DestroySession

func (s *SandboxServiceServer) DestroySession(ctx context.Context, req *pb.DestroySessionRequest) (*pb.Empty, error)

DestroySession destroys a session and kills all its child processes.

func (*SandboxServiceServer) Exec

Exec executes a command in a sandbox.

func (*SandboxServiceServer) ExecStream

ExecStream executes a command and streams output.

func (*SandboxServiceServer) GetSandbox

func (s *SandboxServiceServer) GetSandbox(ctx context.Context, req *pb.GetSandboxRequest) (*pb.Sandbox, error)

GetSandbox retrieves information about a sandbox.

func (*SandboxServiceServer) GetSession

func (s *SandboxServiceServer) GetSession(ctx context.Context, req *pb.GetSessionRequest) (*pb.Session, error)

GetSession retrieves information about a session.

func (*SandboxServiceServer) ListSandboxes

ListSandboxes lists all sandboxes.

func (*SandboxServiceServer) ListSessions

ListSessions lists all sessions for a sandbox.

func (*SandboxServiceServer) SessionExec

SessionExec executes a command within a session (stateful).

func (*SandboxServiceServer) SessionExecStream

SessionExecStream executes a command within a session and streams output.

func (*SandboxServiceServer) StartSandbox

func (s *SandboxServiceServer) StartSandbox(ctx context.Context, req *pb.StartSandboxRequest) (*pb.Sandbox, error)

StartSandbox starts a pending sandbox.

func (*SandboxServiceServer) StopSandbox

func (s *SandboxServiceServer) StopSandbox(ctx context.Context, req *pb.StopSandboxRequest) (*pb.Sandbox, error)

StopSandbox stops a running sandbox.

type Server

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

Server represents the gRPC server.

func New

func New(cfg *Config, rt sbruntime.RuntimeWithExecutor, cbManager *codebase.Manager) (*Server, error)

New creates a new gRPC server.

func (*Server) Start

func (s *Server) Start() error

Start starts the gRPC server.

func (*Server) StartWithGateway

func (s *Server) StartWithGateway() error

StartWithGateway starts both gRPC and REST gateway servers.

func (*Server) Stop

func (s *Server) Stop()

Stop gracefully stops the server.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL