tasks

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package tasks is the public SDK facade over Harbor's internal/tasks package — the unified foreground/background TaskRegistry, the spawn vocabulary, and the task-group join surface (RFC §3.6, §6.3; D-204). Alias-based re-exports only: no behavior lives here. Event payload structs, the patch mechanism, and Protocol wire projections are deliberately private.

Index

Constants

View Source
const (
	// KindForeground — a foreground task.
	KindForeground = internal.KindForeground
	// KindBackground — a background task.
	KindBackground = internal.KindBackground
)

TaskKind values.

View Source
const (
	// StatusPending — spawned, not yet started.
	StatusPending = internal.StatusPending
	// StatusRunning — executing.
	StatusRunning = internal.StatusRunning
	// StatusPaused — parked on the pause primitive.
	StatusPaused = internal.StatusPaused
	// StatusComplete — terminal success.
	StatusComplete = internal.StatusComplete
	// StatusFailed — terminal failure.
	StatusFailed = internal.StatusFailed
	// StatusCancelled — terminal cancellation.
	StatusCancelled = internal.StatusCancelled
)

TaskStatus values.

View Source
const (
	// GroupOpen — accepting members.
	GroupOpen = internal.GroupOpen
	// GroupSealed — membership frozen.
	GroupSealed = internal.GroupSealed
	// GroupCompleted — terminal success.
	GroupCompleted = internal.GroupCompleted
	// GroupCancelled — terminal cancellation.
	GroupCancelled = internal.GroupCancelled
)

TaskGroupStatus values.

View Source
const (
	// PropagateCascade — cancelling the parent cancels spawned children.
	PropagateCascade = internal.PropagateCascade
	// PropagateIsolate — children survive the parent's cancellation.
	PropagateIsolate = internal.PropagateIsolate
)

Cancellation propagation policies.

View Source
const DefaultDriver = internal.DefaultDriver

DefaultDriver is the driver name Open resolves when the config names none.

Variables

View Source
var (
	// ErrNotFound — no task under that ID.
	ErrNotFound = internal.ErrNotFound
	// ErrInvalidTransition — an illegal lifecycle transition.
	ErrInvalidTransition = internal.ErrInvalidTransition
	// ErrIdempotencyConflict — an idempotency key reused divergently.
	ErrIdempotencyConflict = internal.ErrIdempotencyConflict
	// ErrIdentityRequired — the identity triple is incomplete.
	ErrIdentityRequired = internal.ErrIdentityRequired
	// ErrUnknownDriver — the named task driver is not registered.
	ErrUnknownDriver = internal.ErrUnknownDriver
	// ErrRegistryClosed — the registry has been closed.
	ErrRegistryClosed = internal.ErrRegistryClosed
	// ErrInvalidRequest — the spawn request failed validation.
	ErrInvalidRequest = internal.ErrInvalidRequest
	// ErrGroupNotFound — no group under that ID.
	ErrGroupNotFound = internal.ErrGroupNotFound
	// ErrGroupSealed — a sealed group's membership cannot mutate.
	ErrGroupSealed = internal.ErrGroupSealed
	// ErrGroupNotSealed — resolve requires a sealed group.
	ErrGroupNotSealed = internal.ErrGroupNotSealed
)

Re-exported sentinel errors callers compare via errors.Is.

From extracts the registry from ctx, reporting presence.

View Source
var MustFrom = internal.MustFrom

MustFrom extracts the registry from ctx, panicking when absent.

Open resolves the configured task driver and opens it.

View Source
var OpenDriver = internal.OpenDriver

OpenDriver opens a task driver by explicit name.

View Source
var RegisteredDrivers = internal.RegisteredDrivers

RegisteredDrivers lists the seated task driver names (blank-import sdk/drivers/prod to seat the production set).

View Source
var ValidateRequest = internal.ValidateRequest

ValidateRequest validates a SpawnRequest.

View Source
var WithRegistry = internal.WithRegistry

WithRegistry returns a child context carrying the registry.

Functions

This section is empty.

Types

type Dependencies

type Dependencies = internal.Dependencies

Dependencies carries the registry's construction dependencies.

type GroupCompletion

type GroupCompletion = internal.GroupCompletion

GroupCompletion is the resolved group's typed completion.

type GroupRequest

type GroupRequest = internal.GroupRequest

GroupRequest describes one group creation.

type MemberOutcome

type MemberOutcome = internal.MemberOutcome

MemberOutcome is one member's outcome inside a GroupCompletion.

type SpawnRequest

type SpawnRequest = internal.SpawnRequest

SpawnRequest describes one task spawn.

type SpawnToolRequest

type SpawnToolRequest = internal.SpawnToolRequest

SpawnToolRequest describes one background tool-call spawn.

type Task

type Task = internal.Task

Task is the canonical task record.

type TaskError

type TaskError = internal.TaskError

TaskError is the typed terminal error.

type TaskFilter

type TaskFilter = internal.TaskFilter

TaskFilter scopes a List call.

type TaskGroup

type TaskGroup = internal.TaskGroup

TaskGroup is one spawn group.

type TaskGroupID

type TaskGroupID = internal.TaskGroupID

TaskGroupID identifies one task group.

type TaskGroupStatus

type TaskGroupStatus = internal.TaskGroupStatus

TaskGroupStatus is the group lifecycle state.

type TaskHandle

type TaskHandle = internal.TaskHandle

TaskHandle is the spawn's returned handle.

type TaskID

type TaskID = internal.TaskID

TaskID identifies one task.

type TaskKind

type TaskKind = internal.TaskKind

TaskKind discriminates foreground/background tasks.

type TaskRegistry

type TaskRegistry = internal.TaskRegistry

TaskRegistry is the identity-mandatory task registry interface.

type TaskResult

type TaskResult = internal.TaskResult

TaskResult is the terminal result envelope.

type TaskStatus

type TaskStatus = internal.TaskStatus

TaskStatus is the task lifecycle state.

type TaskSummary

type TaskSummary = internal.TaskSummary

TaskSummary is the compact list projection.

Jump to

Keyboard shortcuts

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