execsvc

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinTimeout = 1
	MaxTimeout = 600
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecuteRequest

type ExecuteRequest struct {
	Code      string
	Timeout   int
	SessionID string
	OwnerID   string
}

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

func (s *Service) BuildSandboxEnv() (map[string]string, error)

BuildSandboxEnv collects environment variables from all initialized modules and adds the sandbox API URL.

func (*Service) CreateSession

func (s *Service) CreateSession(ctx context.Context, ownerID string) (string, error)

CreateSession creates a new persistent sandbox session.

func (*Service) DestroySession

func (s *Service) DestroySession(ctx context.Context, sessionID, ownerID string) error

DestroySession destroys a persistent sandbox session.

func (*Service) Execute

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

func (s *Service) SessionsEnabled() bool

SessionsEnabled reports whether the sandbox supports persistent sessions.

Jump to

Keyboard shortcuts

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