Documentation
¶
Index ¶
- Constants
- type ExecuteRequest
- type Service
- func (s *Service) BuildSandboxEnv() (map[string]string, error)
- func (s *Service) CreateSession(ctx context.Context, ownerID string) (string, error)
- func (s *Service) DestroySession(ctx context.Context, sessionID, ownerID string) error
- func (s *Service) Execute(ctx context.Context, req ExecuteRequest) (*sandbox.ExecutionResult, error)
- func (s *Service) ListSessions(ctx context.Context, ownerID string) ([]sandbox.SessionInfo, int, error)
- func (s *Service) SessionsEnabled() bool
Constants ¶
View Source
const ( MinTimeout = 1 MaxTimeout = 600 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecuteRequest ¶
ExecuteRequest describes a sandbox execution request.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service orchestrates sandbox execution with module-provided env and runtime tokens.
func New ¶
func New( log logrus.FieldLogger, sandboxSvc sandbox.Service, cfg *config.Config, moduleReg *module.Registry, runtimeTokens *tokenstore.Store, ) *Service
New creates a new execution service.
func (*Service) BuildSandboxEnv ¶
BuildSandboxEnv collects environment variables from all initialized modules and adds the sandbox API URL.
func (*Service) CreateSession ¶
CreateSession creates a new persistent sandbox session.
func (*Service) DestroySession ¶
DestroySession destroys a persistent sandbox session.
func (*Service) Execute ¶
func (s *Service) Execute(ctx context.Context, req ExecuteRequest) (*sandbox.ExecutionResult, error)
Execute runs code in the sandbox.
func (*Service) ListSessions ¶
func (s *Service) ListSessions(ctx context.Context, ownerID string) ([]sandbox.SessionInfo, int, error)
ListSessions returns all sessions for the given owner.
func (*Service) SessionsEnabled ¶
SessionsEnabled reports whether the sandbox supports persistent sessions.
Click to show internal directories.
Click to hide internal directories.