Documentation
¶
Index ¶
- func InitBgTasks(redisHost string, redisPort int, concurrency uint, codeboxInstanceId string) error
- func RemoveWorkspace(workspace models.Workspace, skipErrors bool) error
- func StopWorkspace(workspace *models.Workspace, skipErrors bool) error
- type Context
- func (jobContext *Context) DeleteRunnerTask(job *work.Job) error
- func (jobContext *Context) DeleteUserTask(job *work.Job) error
- func (jobContext *Context) DeleteWorkspaceTask(job *work.Job) error
- func (jobContext *Context) PingAgentsTask(job *work.Job) error
- func (jobContext *Context) PingRunnersTask(job *work.Job) error
- func (jobContext *Context) StartWorkspaceTask(job *work.Job) error
- func (jobContext *Context) StopWorkspaceTask(job *work.Job) error
- func (jobContext *Context) UpdateWorkspaceConfigFilesTask(job *work.Job) error
- type EnqueuerInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitBgTasks ¶
func InitBgTasks( redisHost string, redisPort int, concurrency uint, codeboxInstanceId string, ) error
Initialize bg tasks system, register all the tasks and start the worker pool
func RemoveWorkspace ¶ added in v0.0.51
Function that removes a workspace and all its associated data It's a separate function so it can be called from multiple places
Types ¶
type Context ¶
type Context struct {
WorkspaceID uint
}
func (*Context) DeleteRunnerTask ¶ added in v0.0.47
Delete a runner: - stop all workspaces running on this runner (ignoring errors) - set workspace runner as nil - delete the runner
func (*Context) DeleteUserTask ¶ added in v0.0.47
Background task that deletes a user, this task deletes the user and all his workspaces
func (*Context) DeleteWorkspaceTask ¶ added in v0.0.47
Background task that deletes a workspace, this task deletes the workspace and all its associated data
func (*Context) PingAgentsTask ¶ added in v0.0.47
Ping all workspaces agents to check if they are online
func (*Context) PingRunnersTask ¶ added in v0.0.47
Ping all runners to check if they are online and get their version
func (*Context) StartWorkspaceTask ¶ added in v0.0.47
func (*Context) StopWorkspaceTask ¶ added in v0.0.47
Stop a running workspace, this is the background task
func (*Context) UpdateWorkspaceConfigFilesTask ¶ added in v0.0.47
Update workspace configuration files, this task fetches the latest configuration files from the git repository or updates the template version if the config source is template then restarts the workspace
type EnqueuerInterface ¶ added in v0.0.47
type EnqueuerInterface interface {
Enqueue(jobName string, args map[string]interface{}) (*work.Job, error)
}
var (
BgTasksEnqueuer EnqueuerInterface
)