functions

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service handles JavaScript function execution

func NewService

func NewService(
	cfg *config.Config,
	log *logger.Logger,
	functionRepository models.FunctionRepository,
	executionRepository models.ExecutionRepository,
	teeManager *tee.Manager,
) *Service

NewService creates a new functions service

func (*Service) CreateFunction

func (s *Service) CreateFunction(userID int, name, description, sourceCode string, timeout, memory int, secrets []string) (*models.Function, error)

CreateFunction creates a new function

func (*Service) DeleteFunction

func (s *Service) DeleteFunction(id, userID int) error

DeleteFunction deletes a function

func (*Service) ExecuteFunction

func (s *Service) ExecuteFunction(ctx context.Context, id, userID int, params map[string]interface{}, async bool) (*models.ExecutionResult, error)

ExecuteFunction executes a function

func (*Service) GetExecution

func (s *Service) GetExecution(executionID string, userID int) (*models.ExecutionResult, error)

GetExecution gets details of a function execution

func (*Service) GetFunction

func (s *Service) GetFunction(id, userID int) (*models.Function, error)

GetFunction gets a function by ID

func (*Service) ListExecutions

func (s *Service) ListExecutions(functionID, userID int, page, limit int) ([]*models.Execution, error)

ListExecutions lists executions for a function

func (*Service) ListFunctions

func (s *Service) ListFunctions(userID int, page, limit int) ([]*models.Function, error)

ListFunctions lists functions for a user

func (*Service) UpdateFunction

func (s *Service) UpdateFunction(id, userID int, name, description, sourceCode string, timeout, memory int, secrets []string) (*models.Function, error)

UpdateFunction updates an existing function

Jump to

Keyboard shortcuts

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