Documentation
¶
Index ¶
- Variables
- func Delete(db gorp.SqlExecutor, id string) error
- func DeleteDeadWorkers(ctx context.Context, db *gorp.DbMap) error
- func DisableDeadWorkers(ctx context.Context, db *gorp.DbMap) error
- func Initialize(c context.Context, DBFunc func() *gorp.DbMap, store cache.Store) error
- func Insert(ctx context.Context, db gorpmapper.SqlExecutorWithTx, w *sdk.Worker) error
- func LoadAll(ctx context.Context, db gorp.SqlExecutor) ([]sdk.Worker, error)
- func LoadAllByHatcheryID(ctx context.Context, db gorp.SqlExecutor, hatcheryID int64) ([]sdk.Worker, error)
- func LoadByConsumerID(ctx context.Context, db gorp.SqlExecutor, id string) (*sdk.Worker, error)
- func LoadByID(ctx context.Context, db gorp.SqlExecutor, id string, ...) (*sdk.Worker, error)
- func LoadDeadWorkers(ctx context.Context, db gorp.SqlExecutor, timeout float64, status []string) ([]sdk.Worker, error)
- func LoadWorkerByName(ctx context.Context, db gorp.SqlExecutor, workerName string) (*sdk.Worker, error)
- func LoadWorkerByNameWithDecryptKey(ctx context.Context, db gorp.SqlExecutor, workerName string) (*sdk.Worker, error)
- func ReAttachAllToHatchery(ctx context.Context, db gorpmapper.SqlExecutorWithTx, hatchery sdk.Service) error
- func RefreshWorker(db gorp.SqlExecutor, id string) error
- func RegisterWorker(ctx context.Context, db gorpmapper.SqlExecutorWithTx, store cache.Store, ...) (*sdk.Worker, error)
- func ReleaseAllFromHatchery(db gorp.SqlExecutor, hatcheryID int64) error
- func SetStatus(ctx context.Context, db gorpmapper.SqlExecutorWithTx, workerID string, ...) error
- func SetToBuilding(ctx context.Context, db gorpmapper.SqlExecutorWithTx, workerID string, ...) error
- type RegistrationForm
- type TakeForm
Constants ¶
This section is empty.
Variables ¶
var ErrNoWorker = fmt.Errorf("cds: no worker found")
ErrNoWorker means the given worker ID is not found
Functions ¶
func Delete ¶
func Delete(db gorp.SqlExecutor, id string) error
Delete remove worker from database, it also removes the associated consumer.
func DeleteDeadWorkers ¶
DeleteDeadWorkers delete all workers which is disabled
func DisableDeadWorkers ¶
DisableDeadWorkers put status disabled to all dead workers with status Registering, Waiting or Building
func Initialize ¶
Initialize init the package
func Insert ¶
func Insert(ctx context.Context, db gorpmapper.SqlExecutorWithTx, w *sdk.Worker) error
func LoadAllByHatcheryID ¶
func LoadByConsumerID ¶
func LoadByID ¶
func LoadByID(ctx context.Context, db gorp.SqlExecutor, id string, opts ...gorpmapping.GetOptionFunc) (*sdk.Worker, error)
func LoadDeadWorkers ¶
func LoadWorkerByName ¶
func LoadWorkerByName(ctx context.Context, db gorp.SqlExecutor, workerName string) (*sdk.Worker, error)
LoadWorkerByIDWithDecryptKey load worker with decrypted private key
func LoadWorkerByNameWithDecryptKey ¶
func LoadWorkerByNameWithDecryptKey(ctx context.Context, db gorp.SqlExecutor, workerName string) (*sdk.Worker, error)
LoadWorkerByIDWithDecryptKey load worker with decrypted private key
func ReAttachAllToHatchery ¶
func ReAttachAllToHatchery(ctx context.Context, db gorpmapper.SqlExecutorWithTx, hatchery sdk.Service) error
ReAttachAllToHatchery search for workers without hatchery an re-attach workers if the hatchery consumer match worker consumer's parent.
func RefreshWorker ¶
func RefreshWorker(db gorp.SqlExecutor, id string) error
RefreshWorker Update worker last_beat
func RegisterWorker ¶
func RegisterWorker(ctx context.Context, db gorpmapper.SqlExecutorWithTx, store cache.Store, spawnArgs hatchery.SpawnArgumentsJWT, hatcheryService sdk.Service, hatcheryConsumer *sdk.AuthUserConsumer, workerConsumer *sdk.AuthUserConsumer, registrationForm sdk.WorkerRegistrationForm, runNodeJob *sdk.WorkflowNodeJobRun) (*sdk.Worker, error)
RegisterWorker Register new worker
func ReleaseAllFromHatchery ¶
func ReleaseAllFromHatchery(db gorp.SqlExecutor, hatcheryID int64) error
ReleaseAllFromHatchery remove dependency to given given hatchery for all workers linked to it.
func SetStatus ¶
func SetStatus(ctx context.Context, db gorpmapper.SqlExecutorWithTx, workerID string, status string) error
SetStatus sets job_run_id and status to building on given worker
func SetToBuilding ¶
func SetToBuilding(ctx context.Context, db gorpmapper.SqlExecutorWithTx, workerID string, jobRunID int64, key []byte) error
SetToBuilding sets job_run_id and status to building on given worker