Documentation
¶
Index ¶
- type Service
- func (s *Service) CreateFunction(userID int, name, description, sourceCode string, timeout, memory int, ...) (*models.Function, error)
- func (s *Service) DeleteFunction(id, userID int) error
- func (s *Service) ExecuteFunction(ctx context.Context, id, userID int, params map[string]interface{}, async bool) (*models.ExecutionResult, error)
- func (s *Service) GetExecution(executionID string, userID int) (*models.ExecutionResult, error)
- func (s *Service) GetFunction(id, userID int) (*models.Function, error)
- func (s *Service) ListExecutions(functionID, userID int, page, limit int) ([]*models.Execution, error)
- func (s *Service) ListFunctions(userID int, page, limit int) ([]*models.Function, error)
- func (s *Service) UpdateFunction(id, userID int, name, description, sourceCode string, timeout, memory int, ...) (*models.Function, error)
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 ¶
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 ¶
GetExecution gets details of a function execution
func (*Service) GetFunction ¶
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 ¶
ListFunctions lists functions for a user
Click to show internal directories.
Click to hide internal directories.