tasks

package
v1.28.2 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 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). 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 (
	// ProgressFractionMin is the inclusive lower bound of Fraction.
	ProgressFractionMin = internal.ProgressFractionMin
	// ProgressFractionMax is the inclusive upper bound of Fraction.
	ProgressFractionMax = internal.ProgressFractionMax
	// ProgressPhaseMaxLen bounds one Phase label in bytes.
	ProgressPhaseMaxLen = internal.ProgressPhaseMaxLen
	// ProgressMessageMaxLen bounds one Message in bytes.
	ProgressMessageMaxLen = internal.ProgressMessageMaxLen
	// ProgressMaxTags bounds the number of Tags entries.
	ProgressMaxTags = internal.ProgressMaxTags
	// ProgressTagMaxLen bounds one Tag entry in bytes.
	ProgressTagMaxLen = internal.ProgressTagMaxLen
)

ReportProgress field bounds — the registry validates the raw caller input against these before any state is touched.

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.

View Source
var DefaultProgressPolicy = internal.DefaultProgressPolicy

DefaultProgressPolicy returns the bounded default coalescing/rate policy every registry applies unless overridden at construction.

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 ValidateProgressRequest = internal.ValidateProgressRequest

ValidateProgressRequest validates a ReportProgressRequest (fraction bounds + phase/message/tag bounds) before any state is touched.

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 ProgressPolicy added in v1.27.0

type ProgressPolicy = internal.ProgressPolicy

ProgressPolicy bounds the ReportProgress coalescing/rate policy.

type ProgressReportResult added in v1.27.0

type ProgressReportResult = internal.ProgressReportResult

ProgressReportResult reports what one ReportProgress call did.

type ProgressReporter added in v1.27.0

type ProgressReporter = internal.ProgressReporter

ProgressReporter is permanently bound to one task; it has no target argument and is the normal SDK progress surface.

type ProgressReporterRegistry added in v1.27.0

type ProgressReporterRegistry = internal.ProgressReporterRegistry

ProgressReporterRegistry issues reporters bound to a task identity.

type ReportProgressRequest added in v1.27.0

type ReportProgressRequest = internal.ReportProgressRequest

ReportProgressRequest is the ReportProgress input shape.

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 TaskProgressSnapshot added in v1.27.0

type TaskProgressSnapshot = internal.TaskProgressSnapshot

TaskProgressSnapshot is the canonical durable progress record.

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