v1alpha1

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package v1alpha1 holds the v1alpha1 API types — shared between server, client, and SDK. It imports api/fault for validation errors and github.com/danielgtaylor/huma/v2 for the SchemaProvider methods that carry leaf constraints into the generated OpenAPI (ADR-0048). It remains a public-contract leaf: the ADR-0002 §7 depguard rule still holds — api/** imports nothing from internal/** / pkg/** (huma is a third-party SDK, allowed).

Index

Constants

View Source
const (
	ReasonPlatformRestored = "PlatformRestored"
	ReasonListFailed       = "ListFailed"
	ReasonFoundOnTarget    = "FoundOnTarget"
)

The reasons of ADR-0287: restore run's mark on a restored schedule, a sync whose listing failed, and a Backup whose record a listing of its whole copy on the target made or completed.

View Source
const (
	MaxInvokeTimeout     = time.Hour
	DefaultInvokeTimeout = 60 * time.Second
)

The bounds of an external invoke's response deadline (ADR-0151): FunctionSpec.Timeout and invoke.defaultTimeout.

View Source
const (
	MinTimerInterval   = Duration(100 * time.Millisecond)
	MaxTimerInterval   = Duration(24 * time.Hour)
	MaxLinkTimeout     = Duration(5 * time.Minute)
	MaxIdleTimeout     = Duration(24 * time.Hour)
	MaxWorkflowTimeout = Duration(168 * time.Hour)
	MaxStepTimeout     = Duration(24 * time.Hour)
	MaxRetryBackoff    = Duration(time.Hour)
)

The bounds of the API duration fields, checked by each kind's Validate and named in each field's doc (ADR-0194).

View Source
const (
	// DefaultMaxValueBytes is the default per-value cap (1 MiB) when KVStoreQuota.MaxValueBytes is 0.
	DefaultMaxValueBytes int64 = 1 << 20
	// MaxValueBytesLimit is the largest spec.quota.maxValueBytes a store may declare: the worker-node local API
	// buffers a KV put body up to this size, so a larger cap could never be served.
	MaxValueBytesLimit int64 = 1 << 20
	// DefaultMaxKeyBytes is the default per-key cap (1 KiB) when KVStoreQuota.MaxKeyBytes is 0.
	DefaultMaxKeyBytes int = 1024
	// MaxKeyBytesLimit is the largest spec.quota.maxKeyBytes a store may declare: the durable KV engine (Badger)
	// stores keys of at most 65000 bytes, and the stored key <ns>/<store>/<table>/<key> adds at most 192
	// bytes (three DNS labels and their slashes), so every key within this cap can be stored.
	MaxKeyBytesLimit int = 64000
)

Default per-op caps for a KVStore (ADR-0072): applied where the spec value is read when 0.

View Source
const (
	Group   = "funcd.io"
	Version = "v1alpha1"
)

Group and Version are the wire identity of every funcd resource.

View Source
const (
	// SiteRuntimeConfigFile is the name of the file a Site's runtimeConfig generates (ADR-0239).
	SiteRuntimeConfigFile = "config.json"
	// SiteRuntimeConfigMaxBytes caps the generated file, which the app waits for before it starts (ADR-0239).
	SiteRuntimeConfigMaxBytes = 32 << 10
)
View Source
const ByteSizeGrammar = "a size: 1 to 15 digits and an optional binary unit, Ki, Mi, Gi or Ti, with or without a B (512Ki, 2GiB)"

ByteSizeGrammar says ByteSizePattern in words: the schema's patternDescription, which a refusal at the API names.

View Source
const ByteSizePattern = `^[0-9]{1,15}((Ki|Mi|Gi|Ti)B?)?$`

ByteSizePattern is ADR-0266 Decision 1's grammar: at most 15 digits, so go-humanize's float maths stays exact, and an optional binary unit; it keeps out the decimal units, fractions and spaces humanize.ParseBytes also accepts.

View Source
const ConditionTargetSynced = ConditionType("TargetSynced")

ConditionTargetSynced is a BackupSchedule's condition after a platform restore (ADR-0287): False with ReasonPlatformRestored from funcd restore run, True once a sync recorded the whole copies its target holds after the restored point, False with ReasonListFailed while the listing fails: the target refuses it, or what it lists is over a listing's limits. While it is False the schedule takes no slot.

View Source
const DNSLabel = `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`

DNSLabel is the RFC-1123 DNS-label pattern — the SINGLE source for both server-side validation (dnsLabel below) and the generated OpenAPI schema (the SchemaProvider methods), so the published contract can never drift from the admission check.

View Source
const DefaultBackupTTL = Duration(720 * time.Hour)

DefaultBackupTTL is a BackupSchedule's ttl when unset (ADR-0222 Decision 1).

View Source
const DurationGrammar = "a duration: whole numbers with the units h, m, s and ms, largest unit first (10m, 1h30m, 500ms)"

DurationGrammar describes DurationPattern in words: the OpenAPI patternDescription and every parse error.

View Source
const DurationPattern = `^([0-9]+h([0-9]+m)?([0-9]+s)?([0-9]+ms)?|[0-9]+m([0-9]+s)?([0-9]+ms)?|[0-9]+s([0-9]+ms)?|[0-9]+ms)$`

DurationPattern is the duration grammar (ADR-0194): the single source for ParseDuration and the OpenAPI schema.

View Source
const LakeCatalogBucket = "funcd.lake-catalogs"

LakeCatalogBucket is the S3 bucket under which the S3 gateway serves the catalog store to each Lake's engine (ADR-0293), at the key <bucket>/<prefix>/_ducklake/catalog.db of its location: the dot keeps it out of every Bucket's name, which is a DNS label.

MaxDuration is the largest value the grammar admits (2562047h47m16s854ms); hi = MaxDuration means "no upper bound".

View Source
const MinCPU = 0.01

MinCPU is the smallest cpu a ResourceSpec takes: a hundredth of a core keeps the CFS quota above the kernel's floor.

View Source
const TimestampForm = "an RFC3339 UTC timestamp with exactly 3 fractional digits (2026-10-07T20:03:35.965Z)"

TimestampForm describes TimestampPattern in words: the OpenAPI patternDescription and every decode error.

View Source
const TimestampLayout = "2006-01-02T15:04:05.000Z07:00"

TimestampLayout is the one timestamp form (ADR-0196), applied to a UTC time.

View Source
const TimestampPattern = `^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{3}Z$`

TimestampPattern is TimestampLayout's RE2 form: the single source for UnmarshalJSON and the OpenAPI schema.

Variables

This section is empty.

Functions

func CheckCron added in v0.10.0

func CheckCron(op, exprField, expr, zoneField, zone string) error

CheckCron is the admission check of a cron schedule (ADR-0211): fault.Invalid(op) naming exprField or zoneField, the value and, for the expression, cron.Grammar.

func CheckDuration added in v0.8.0

func CheckDuration(op, field string, d, lo, hi Duration) error

CheckDuration bounds every API duration field and config duration key: fault.Invalid(op) naming field (a field path or config key), d and [lo, hi] in the normalized form ("at least lo" when hi is MaxDuration) when d < lo, d > hi or d is not a whole millisecond.

func ControlledBy added in v0.4.0

func ControlledBy(refs []OwnerReference, kind Kind, uid UID) bool

ControlledBy reports whether refs' controller reference is the object of kind with uid.

func FieldDiffs

func FieldDiffs(d []FieldDiff) string

FieldDiffs renders field diffs into one deterministic message (sorted by field).

func IngressPath added in v0.14.0

func IngressPath(i *Ingress, kind Kind, name ObjectName) string

IngressPath is a resource's own edge path (ADR-0241 Decision 3): ingress.path, else "/" when ingress.host is set, else /<kind>/<name>, kind lowercased.

func IsWaitExpression added in v0.8.0

func IsWaitExpression(wait string) bool

IsWaitExpression reports whether a builtin wait is a ${{ }} expression; apply and the engine both use it.

func LakeCatalogKey added in v0.33.0

func LakeCatalogKey(l LakeLocation) string

LakeCatalogKey is a location's catalog key under LakeCatalogBucket.

func ParseBackupSlotName added in v0.30.0

func ParseBackupSlotName(schedule, name ObjectName) (time.Time, bool)

ParseBackupSlotName is BackupSlotName's inverse: the slot of name when it is <schedule>-<Unix minutes>, written as BackupSlotName writes it (ADR-0287).

func RenderSiteRuntimeConfig added in v0.14.0

func RenderSiteRuntimeConfig(members map[string]string) []byte

RenderSiteRuntimeConfig is the body of a Site's config.json (ADR-0239): one JSON object of the members, in key order, since encoding/json sorts map keys. Admission and the reconciler share it, so both measure the same bytes.

func SlugDigest added in v0.14.0

func SlugDigest(slug string) string

SlugDigest is the digest a digest-scoped key segment names (sha256-<hex> → sha256:<hex>); "" when the segment is not one.

func VolumeEnv added in v0.24.0

func VolumeEnv(name ObjectName) string

VolumeEnv is the env var a worker's code reads a volume's path from (ADR-0262 Decision 2): the name upper-cased.

Types

type Action

type Action struct {
	Name     ObjectName ``                                                                                                         /* 186-byte string literal not displayed */
	On       ObjectName `json:"on" doc:"The name of the dependency whose events run this action, one of the Sensor's on entries."` // the dependency (Dependency.Name) this fires on
	Workflow ObjectName ``                                                                                                         // start a WorkflowRun of this Workflow
	/* 336-byte string literal not displayed */
	Function ObjectName `` // invoke this Function with the CloudEvent
	/* 387-byte string literal not displayed */
	Input json.RawMessage `` // object; literals or ${{ event.* }} (checked at reconcile)
	/* 499-byte string literal not displayed */
}

Action is a named, kind-keyed reaction bound to one dependency (ADR-0109). Exactly one of Workflow/Function is set. Input (optional) is a JSON object whose values are literals or `${{ event.* }}` projections over the firing CloudEvent (the F73 engine); absent ⇒ the event data verbatim.

type App added in v0.9.0

type App struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       AppSpec   `json:"spec"`
	Status     AppStatus `json:"status,omitempty"`
}

App is a namespaced, status-bearing resource that declares a whole app in typed sections (ADR-0199, F113): the App reconciler writes its parts, reports one status and prunes what a new spec drops; the owner GC removes the tree on delete and keeps the data of a retained store.

func (*App) GetStatus added in v0.9.0

func (a *App) GetStatus() *Status

GetStatus returns the shared Status pointer, implementing StatusObject.

func (*App) GroupVersionKind added in v0.9.0

func (a *App) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for App.

func (*App) Parts added in v0.9.0

func (a *App) Parts() []Object

Parts returns each declared entry, in section order, as its kind's object: the entry's name and spec, the App's namespace and resource group, and no owner references. A ref entry is not a part.

func (*App) Refs added in v0.9.0

func (a *App) Refs() []ObjectRef

Refs returns the object each ref entry names, in section order.

func (*App) Validate added in v0.9.0

func (a *App) Validate() error

Validate enforces the store-free rules of Decision 3, each refusal naming its field path: a name of at most 52 characters; each entry either a name or a ref alone; deletion retain or delete; no name repeated within a section; a defined ConfigMap name of at most 52 characters and no two entries with one stored name (ADR-0213 Decision 2); each part valid as its kind; no object that two parts would write (validateWriters); the secrets rules (ADR-0213 Decision 6); the requires rules (ADR-0219 Decision 1). The rules that need the store (quotas, a ref to an object this App controls) and the undeclared-Secret rule (ADR-0213 Decision 7) are the app-parts admission's.

type AppBackupSchedule added in v0.11.0

type AppBackupSchedule struct {
	Name               ObjectName `json:"name,omitempty"`
	Ref                ObjectName `json:"ref,omitempty"`
	BackupScheduleSpec `json:",inline"`
}

AppBackupSchedule is a backupSchedules entry of an App (ADR-0222 Decision 2): a BackupSchedule the App declares by name, or only the ref of an existing one. An empty scope backs up the App itself.

func (AppBackupSchedule) MarshalJSON added in v0.11.0

func (e AppBackupSchedule) MarshalJSON() ([]byte, error)

MarshalJSON writes a ref entry as its ref alone (see marshalEntry).

func (AppBackupSchedule) Schema added in v0.11.0

Schema is BackupScheduleSpec's schema plus name and ref (see entrySchema).

type AppChild added in v0.9.0

type AppChild struct {
	Kind   Kind          `json:"kind" doc:"The object's kind."`
	Name   ObjectName    `json:"name" doc:"The object's name: a ref entry's target, and for a defined ConfigMap its stored name."`
	State  AppChildState `` /* 388-byte string literal not displayed */
	Reason string        `` /* 315-byte string literal not displayed */
}

AppChild is a declared part, or a dropped object not yet deleted (state Pruning), with its state and reason.

type AppChildState added in v0.9.0

type AppChildState string

AppChildState is the state of an App's child (Decision 5).

const (
	AppChildReady      AppChildState = "Ready"
	AppChildNotStarted AppChildState = "NotStarted"
	AppChildPending    AppChildState = "Pending"
	AppChildPruning    AppChildState = "Pruning"
)

The states of an App's child: a part counts toward the App's Ready condition; a Pruning object does not.

func (AppChildState) Schema added in v0.9.0

Schema carries AppChildState's enum into the generated OpenAPI (ADR-0048).

type AppEventSource added in v0.9.0

type AppEventSource struct {
	Name            ObjectName `json:"name,omitempty"`
	Ref             ObjectName `json:"ref,omitempty"`
	EventSourceSpec `json:",inline"`
}

AppEventSource is an eventSources entry: an EventSource the App declares by name, or only the ref of an existing one.

func (AppEventSource) MarshalJSON added in v0.9.0

func (e AppEventSource) MarshalJSON() ([]byte, error)

MarshalJSON writes a ref entry as its ref alone (see marshalEntry).

func (AppEventSource) Schema added in v0.9.0

func (AppEventSource) Schema(r huma.Registry) *huma.Schema

Schema is EventSourceSpec's schema plus name and ref (see entrySchema).

type AppFunction added in v0.9.0

type AppFunction struct {
	Name         ObjectName `json:"name,omitempty"`
	Ref          ObjectName `json:"ref,omitempty"`
	FunctionSpec `json:",inline"`
}

AppFunction is a functions entry: a Function the App declares by name, or only the ref of an existing one.

func (AppFunction) MarshalJSON added in v0.9.0

func (e AppFunction) MarshalJSON() ([]byte, error)

MarshalJSON writes a ref entry as its ref alone (see marshalEntry).

func (AppFunction) Schema added in v0.9.0

func (AppFunction) Schema(r huma.Registry) *huma.Schema

Schema is FunctionSpec's schema plus name and ref (see entrySchema).

type AppHook added in v0.10.0

type AppHook struct {
	Function ObjectName `` /* 402-byte string literal not displayed */
}

AppHook names the functions entry of this App, not a ref, that a hook point calls.

type AppHookCall added in v0.10.0

type AppHookCall struct {
	Point      string     `json:"point" enum:"preApply,postApply" doc:"The hook list the call was made for."`
	Function   ObjectName `json:"function" doc:"The hook Function that was called."`
	Invocation ObjectName `` /* 144-byte string literal not displayed */
	Phase      Phase      `json:"phase" doc:"Ready when the call succeeded and Failed when it did not; no other phase appears here."`
	EndTime    Timestamp  `json:"endTime" doc:"When the call ended."`
}

AppHookCall is one recorded hook call (ADR-0214 Decision 6): its point, its Function, the Invocation that records it, its outcome and its end, a start term of the rollout deadline.

type AppHookInput added in v0.10.0

type AppHookInput struct {
	Event       string     `` /* 192-byte string literal not displayed */
	App         ObjectName `json:"app" doc:"The App's name."`
	From        ObjectName `json:"from,omitempty" doc:"The App's current revision when this one was created, empty on an install."`
	To          ObjectName `json:"to" doc:"This revision's name."`
	FromVersion string     `json:"fromVersion,omitempty" doc:"The spec.version of the from revision, empty on an install or when it sets none."`
	ToVersion   string     `json:"toVersion,omitempty" doc:"This revision's spec.version, empty when it sets none."`
}

AppHookInput is the data of each hook call of one AppRevision, fixed at its stamp (ADR-0214 Decision 2).

type AppHooks added in v0.10.0

type AppHooks struct {
	PreApply  []AppHook `` /* 501-byte string literal not displayed */
	PostApply []AppHook `` /* 304-byte string literal not displayed */
}

AppHooks are the App's lifecycle hooks (ADR-0214 Decision 1), each list called in order: preApply before the parts change, postApply once the new revision is current.

type AppPlan added in v0.10.0

type AppPlan struct {
	// Revision is empty for an unchanged spec.
	Revision ObjectName `` /* 201-byte string literal not displayed */
	Parts    []PlanPart `` /* 205-byte string literal not displayed */
	Hooks    []string   `` /* 196-byte string literal not displayed */
}

AppPlan is what a write of the App would make its rollout do (ADR-0220 Decision 5): the revision the stamp would name, the parts it would create, update or prune, or the one part where a pass would stop, and the hook Functions in call order (ADR-0214 Decision 9). It says what, not when.

type AppRequirement added in v0.10.0

type AppRequirement struct {
	App ObjectName `` /* 158-byte string literal not displayed */
	// Version is an npm-style range such as ^2.0.0; empty accepts any version, even none.
	Version string `` /* 254-byte string literal not displayed */
}

AppRequirement is a requires entry (ADR-0219 Decision 1): an App of the same namespace and an npm-style version range.

func (AppRequirement) Matches added in v0.10.0

func (r AppRequirement) Matches(version string) bool

Matches reports whether version satisfies the range (ADR-0219 Decision 1): always for an empty range; otherwise version must be a SemVer 2.0.0 version that the range accepts, by the library's prerelease rule.

type AppRequirementState added in v0.10.0

type AppRequirementState struct {
	App     ObjectName `json:"app" doc:"The required App, as its spec.requires entry names it."`
	Version string     `json:"version,omitempty" doc:"The required App's spec.version, empty when it sets none or does not exist."`
	Met     bool       `` /* 127-byte string literal not displayed */
}

AppRequirementState is one requires entry's state: the required App's spec.version and whether it is met.

type AppRevision added in v0.9.0

type AppRevision struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       AppRevisionSpec   `json:"spec"`
	Status     AppRevisionStatus `json:"status,omitempty"`
}

AppRevision is the record of one App spec and its rollout (ADR-0200, F114): the App reconciler stamps one per changed spec and alone writes it; its spec and metadata never change after create, and the API serves it read-only.

func (*AppRevision) GetStatus added in v0.9.0

func (r *AppRevision) GetStatus() *Status

GetStatus returns the shared Status pointer, implementing StatusObject.

func (*AppRevision) GroupVersionKind added in v0.9.0

func (r *AppRevision) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for AppRevision.

func (*AppRevision) Validate added in v0.9.0

func (r *AppRevision) Validate() error

Validate checks the envelope, the number's bounds and that the name is AppRevisionName(spec.app.name, spec.number). The spec copy is not checked: the App it was taken from passed App.Validate.

type AppRevisionSpec added in v0.9.0

type AppRevisionSpec struct {
	App    ObjectRef `json:"app" doc:"The App this revision belongs to."`
	Number int64     `` /* 221-byte string literal not displayed */
	Spec   AppSpec   `json:"spec" doc:"The App's spec when this revision was created, without spec.paused. It never changes."`
	// HookInput is the data of this revision's hook calls, set by the stamp when the spec has a hook (ADR-0214
	// Decision 2).
	HookInput *AppHookInput `` /* 160-byte string literal not displayed */
}

AppRevisionSpec names the App and the revision's number, and holds a frozen copy of the App spec.

type AppRevisionStatus added in v0.9.0

type AppRevisionStatus struct {
	Status `json:",inline"`
	// StartedAt is when the requirements were met, the stamp time when none waited; nil while the revision waits; the
	// rollout deadline (ADR-0212 Decision 6) needs it (ADR-0219 Decision 3).
	StartedAt *Timestamp `` /* 380-byte string literal not displayed */
	// Hooks records every hook call of the revision, retries included, in call order (ADR-0214 Decision 6).
	Hooks []AppHookCall `` /* 205-byte string literal not displayed */
}

AppRevisionStatus is the rollout record (Decision 5): phase Deploying, Ready or Failed, and the conditions Applied, ChildrenReady and Current.

type AppRoute added in v0.9.0

type AppRoute struct {
	Name      ObjectName `json:"name,omitempty"`
	Ref       ObjectName `json:"ref,omitempty"`
	RouteSpec `json:",inline"`
}

AppRoute is a routes entry: a Route the App declares by name, or only the ref of an existing one.

func (AppRoute) MarshalJSON added in v0.9.0

func (e AppRoute) MarshalJSON() ([]byte, error)

MarshalJSON writes a ref entry as its ref alone (see marshalEntry).

func (AppRoute) Schema added in v0.9.0

func (AppRoute) Schema(r huma.Registry) *huma.Schema

Schema is RouteSpec's schema plus name and ref (see entrySchema).

type AppSelfHeal added in v0.9.0

type AppSelfHeal struct {
	Kind Kind       `json:"kind" doc:"The kind of the part written back."`
	Name ObjectName `json:"name" doc:"The name of the part written back."`
	At   Timestamp  `json:"at" doc:"When funcd wrote it back."`
}

AppSelfHeal is the last part the App wrote back (ADR-0212 Decision 2).

type AppSensor added in v0.9.0

type AppSensor struct {
	Name       ObjectName `json:"name,omitempty"`
	Ref        ObjectName `json:"ref,omitempty"`
	SensorSpec `json:",inline"`
}

AppSensor is a sensors entry: a Sensor the App declares by name, or only the ref of an existing one.

func (AppSensor) MarshalJSON added in v0.9.0

func (e AppSensor) MarshalJSON() ([]byte, error)

MarshalJSON writes a ref entry as its ref alone (see marshalEntry).

func (AppSensor) Schema added in v0.9.0

func (AppSensor) Schema(r huma.Registry) *huma.Schema

Schema is SensorSpec's schema plus name and ref (see entrySchema).

type AppSite added in v0.9.0

type AppSite struct {
	Name     ObjectName `json:"name,omitempty"`
	Ref      ObjectName `json:"ref,omitempty"`
	SiteSpec `json:",inline"`
}

AppSite is a sites entry: a Site the App declares by name, or only the ref of an existing one.

func (AppSite) MarshalJSON added in v0.9.0

func (e AppSite) MarshalJSON() ([]byte, error)

MarshalJSON writes a ref entry as its ref alone (see marshalEntry).

func (AppSite) Schema added in v0.9.0

func (AppSite) Schema(r huma.Registry) *huma.Schema

Schema is SiteSpec's schema plus name and ref (see entrySchema).

type AppSpec added in v0.9.0

type AppSpec struct {
	// Version is a free label; a requirement's range matches it only when it is a SemVer 2.0.0 version (ADR-0219).
	Version string `` /* 304-byte string literal not displayed */
	// Paused stops every write of the App (ADR-0212); it is not part of an AppRevision.
	Paused bool `` /* 353-byte string literal not displayed */
	// Requires names the shared Apps of this namespace that this App needs before it rolls out (ADR-0219).
	Requires []AppRequirement `` /* 400-byte string literal not displayed */
	KV       []KVStoreEntry   `` /* 268-byte string literal not displayed */
	Buckets  []BucketEntry    `` /* 273-byte string literal not displayed */
	// SQL declares the App's SQL databases (ADR-0236), stores like kv and buckets.
	SQL          []SQLDatabaseEntry `` /* 276-byte string literal not displayed */
	Functions    []AppFunction      `` /* 412-byte string literal not displayed */
	Workflows    []AppWorkflow      `` /* 434-byte string literal not displayed */
	EventSources []AppEventSource   `json:"eventSources,omitempty" doc:"The EventSources that the App declares or refers to; no two entries name the same one."`
	Sensors      []AppSensor        `json:"sensors,omitempty" doc:"The Sensors that the App declares or refers to; no two entries name the same one."`
	Routes       []AppRoute         `` /* 230-byte string literal not displayed */
	Sites        []AppSite          `` /* 323-byte string literal not displayed */
	Lakes        []LakeEntry        `` /* 241-byte string literal not displayed */
	ConfigMaps   []ConfigMapEntry   `` /* 310-byte string literal not displayed */
	// BackupSchedules backs up the App's stores (ADR-0222 Decision 2); an entry with an empty scope backs up this App.
	BackupSchedules []AppBackupSchedule `` /* 272-byte string literal not displayed */
	// Secrets declares the Secrets the parts name, never their values (ADR-0213 Decision 6).
	Secrets []SecretDeclaration `` /* 321-byte string literal not displayed */
	// Hooks names the Functions of this App called before its parts change and after a new revision is current
	// (ADR-0214).
	Hooks *AppHooks `` /* 367-byte string literal not displayed */
}

AppSpec is the App's parts, one section per kind: configMaps first, so a ConfigMap is written before the parts that name it (ADR-0213 Decision 4), then the other sections in this order (Decision 2).

func (AppSpec) WithoutPause added in v0.9.0

func (s AppSpec) WithoutPause() AppSpec

WithoutPause returns s with Paused cleared: what the stamp compares, an AppRevision freezes and rollback compares (ADR-0212 Decision 3).

type AppStatus added in v0.9.0

type AppStatus struct {
	Status          `json:",inline"`
	CurrentRevision ObjectName `` /* 213-byte string literal not displayed */
	LatestRevision  ObjectName `` /* 174-byte string literal not displayed */
	// Version is the spec.version of the current revision.
	Version      string       `json:"version,omitempty" doc:"The spec.version of the current revision."`
	Children     []AppChild   `` /* 303-byte string literal not displayed */
	LastSelfHeal *AppSelfHeal `json:"lastSelfHeal,omitempty" doc:"The last part that funcd wrote back after another writer changed or deleted it, and when."`
	// Requires is the state of each spec.requires entry, in its order (ADR-0219 Decision 5).
	Requires []AppRequirementState `json:"requires,omitempty" doc:"The state of each spec.requires entry, in its order."`
	// RequiredBy is every App of the namespace whose spec.requires names this one, sorted by name.
	RequiredBy []ObjectName `json:"requiredBy,omitempty" doc:"The Apps of this namespace whose spec.requires names this App, sorted by name."`
	// Plan is what the write would do (ADR-0220 Decision 5), set only in a dry-run answer and never stored.
	Plan *AppPlan `` /* 220-byte string literal not displayed */
}

AppStatus is the observed state (ADR-0199 Decision 5): phase Deploying, Ready, Degraded or Failed (ADR-0200 Decision 6), the Ready condition, the current and latest AppRevision, the state of each child, the last part the App wrote back (ADR-0212), its requirements in both directions (ADR-0219) and, in a dry-run answer only, the plan (ADR-0220).

type AppWorkflow added in v0.9.0

type AppWorkflow struct {
	Name         ObjectName `json:"name,omitempty"`
	Ref          ObjectName `json:"ref,omitempty"`
	WorkflowSpec `json:",inline"`
}

AppWorkflow is a workflows entry: a Workflow the App declares by name, or only the ref of an existing one.

func (AppWorkflow) MarshalJSON added in v0.9.0

func (e AppWorkflow) MarshalJSON() ([]byte, error)

MarshalJSON writes a ref entry as its ref alone (see marshalEntry).

func (AppWorkflow) Schema added in v0.9.0

func (AppWorkflow) Schema(r huma.Registry) *huma.Schema

Schema is WorkflowSpec's schema plus name and ref (see entrySchema).

type AssignmentEntry

type AssignmentEntry struct {
	Principal *PrincipalRef `json:"principal,omitempty" doc:"Who the entry grants its role to. When unset, spec.principal."`
	RoleRef   RoleRef       `json:"roleRef" doc:"The role the entry grants."`
	Scope     *ScopeRef     `json:"scope,omitempty" doc:"Where the entry's role applies. When unset, spec.scope."`
}

AssignmentEntry is one (principal, role, scope) grant. Principal/Scope inherit the RolesAssignment's top-level defaults when omitted.

type AuthMode

type AuthMode string

AuthMode selects whether the edge authenticates the caller for a target (ADR-0113, F77).

const (
	// AuthAuthenticated requires a valid bearer + a PDP allow.
	AuthAuthenticated AuthMode = "authenticated"
	// AuthOpen allows anonymous access (the zero/default stance, phased).
	AuthOpen AuthMode = "open"
)

func (AuthMode) Schema

func (AuthMode) Schema(huma.Registry) *huma.Schema

Schema renders the huma enum for AuthMode (empty accepted, normalizes to open).

type Backup added in v0.11.0

type Backup struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       BackupSpec   `json:"spec"`
	Status     BackupStatus `json:"status,omitempty"`
}

Backup is a namespaced, status-bearing run record (ADR-0222): one copy of its schedule's members, made per slot, by hand or by a hook. Its spec is immutable; it outlives its schedule and App until its expireTime.

func (*Backup) GetStatus added in v0.11.0

func (b *Backup) GetStatus() *Status

GetStatus returns the shared Status pointer, implementing StatusObject. Its Phase is unused: BackupStatus.Phase shadows it.

func (*Backup) GroupVersionKind added in v0.11.0

func (b *Backup) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for Backup.

func (*Backup) Validate added in v0.11.0

func (b *Backup) Validate() error

Validate checks the schedule's name and a ttl not negative; the ttl's bound by the schedule's is admission's.

type BackupEncryption added in v0.11.0

type BackupEncryption struct {
	Recipients []string `` /* 387-byte string literal not displayed */
}

BackupEncryption is the age recipients every Backup is sealed to (Decision 6).

type BackupMember added in v0.11.0

type BackupMember struct {
	Kind  Kind       `json:"kind" doc:"The member's kind: KVStore, Bucket, Lake, SQLDatabase, or Function for a Function's local volume."`
	Name  ObjectName `json:"name" doc:"The member's name: the store's, or for a volume, its Function's."`
	Bytes int64      `json:"bytes,omitempty" doc:"The size of the member's sealed copy on the target, in bytes."`
	// Volume, with Kind Function, names the Function's local volume the member is (ADR-0262 Decision 11).
	Volume ObjectName `json:"volume,omitempty" doc:"With kind Function, the name of the Function's local volume that the member is."`
}

BackupMember is one store a Backup copied and the bytes it stored.

type BackupSchedule added in v0.11.0

type BackupSchedule struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       BackupScheduleSpec   `json:"spec"`
	Status     BackupScheduleStatus `json:"status,omitempty"`
}

BackupSchedule is a namespaced, status-bearing resource (ADR-0222, F111): an app owner's definition of which stores to copy, when, to which S3 target and sealed to whom. Its controller creates a Backup per cron slot.

func (*BackupSchedule) GetStatus added in v0.11.0

func (s *BackupSchedule) GetStatus() *Status

GetStatus returns the shared Status pointer, implementing StatusObject.

func (*BackupSchedule) GroupVersionKind added in v0.11.0

func (s *BackupSchedule) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for BackupSchedule.

func (*BackupSchedule) Validate added in v0.11.0

func (s *BackupSchedule) Validate() error

Validate enforces the store-free rules (Decisions 1, 2, 3, 6): a name of at most 54 characters, a cron schedule and time zone, a ttl not negative, one scope form, an s3:// target with its Secret and at least 2 distinct recipients. The recipients' age parse and the target's overlap with the store are the backup-schedule admission's.

type BackupScheduleSpec added in v0.11.0

type BackupScheduleSpec struct {
	Schedule   string           `` /* 338-byte string literal not displayed */
	TimeZone   string           `json:"timeZone,omitempty" doc:"The IANA time zone of schedule, such as Europe/Paris; UTC when empty."`
	TTL        Duration         `` /* 270-byte string literal not displayed */
	Paused     bool             `` /* 211-byte string literal not displayed */
	Scope      BackupScope      `` /* 437-byte string literal not displayed */
	Target     BackupTarget     `json:"target" doc:"Where each Backup writes its copy: an S3 bucket and the Secret of its write key."`
	Encryption BackupEncryption `` /* 163-byte string literal not displayed */
}

BackupScheduleSpec is the definition (Decision 1): a cron schedule in a time zone (ADR-0211), the Backups' ttl, the scope, the target and the recipients.

func (BackupScheduleSpec) EffectiveTTL added in v0.11.0

func (s BackupScheduleSpec) EffectiveTTL() Duration

EffectiveTTL is spec.ttl, DefaultBackupTTL when unset.

type BackupScheduleStatus added in v0.11.0

type BackupScheduleStatus struct {
	Status               `json:",inline"`
	LastScheduleTime     *Timestamp `` /* 178-byte string literal not displayed */
	LastSuccessTime      *Timestamp `json:"lastSuccessTime,omitempty" doc:"When the newest of the schedule's Succeeded Backups that still exist completed."`
	EarliestRestorePoint *Timestamp `` /* 164-byte string literal not displayed */
	Active               ObjectName `json:"active,omitempty" doc:"A Backup of the schedule that is Pending or Running, empty when none is."`
	RPORisk              bool       `` /* 364-byte string literal not displayed */
}

BackupScheduleStatus is the observed state (Decision 9): the slot last taken, the last success, the oldest stored Succeeded Backup, the Backup running and the RPO alert.

type BackupScope added in v0.11.0

type BackupScope struct {
	KVStores  []ObjectName `json:"kvStores,omitempty" doc:"KVStores of the namespace to copy, by name, each once."`
	Buckets   []ObjectName `` /* 208-byte string literal not displayed */
	Lakes     []ObjectName `` /* 321-byte string literal not displayed */
	Databases []ObjectName `` /* 173-byte string literal not displayed */
	// Volumes are local Function volumes, each "<function>/<name>" (ADR-0262 Decision 11).
	Volumes       []string          `` /* 228-byte string literal not displayed */
	App           ObjectName        `` /* 239-byte string literal not displayed */
	ResourceGroup ResourceGroupName `` /* 216-byte string literal not displayed */
}

BackupScope names the members in one form (Decision 2): names, an App, or a ResourceGroup. In each form a Bucket brings in the Lakes on its prefixes as their own members, since its copy holds none of their data (ADR-0312).

type BackupSpec added in v0.11.0

type BackupSpec struct {
	Schedule ObjectName `` /* 260-byte string literal not displayed */
	TTL      Duration   `` /* 203-byte string literal not displayed */
}

BackupSpec names the schedule whose scope, target and recipients the run uses; ttl, at most the schedule's, overrides it.

type BackupStatus added in v0.11.0

type BackupStatus struct {
	Status `json:",inline"`
	// Phase shadows Status.Phase, as WorkflowRunStatus's: Pending → Running → Succeeded | Failed.
	Phase          RunPhase       `` /* 311-byte string literal not displayed */
	StartTime      *Timestamp     `json:"startTime,omitempty" doc:"When the run began."`
	CompletionTime *Timestamp     `json:"completionTime,omitempty" doc:"When the run ended, Succeeded or Failed."`
	ExpireTime     *Timestamp     `` /* 239-byte string literal not displayed */
	Target         string         `` /* 138-byte string literal not displayed */
	Path           string         `json:"path,omitempty" doc:"The copy's directory on the target, <namespace>/<backup>-<uid>/."`
	Members        []BackupMember `` /* 220-byte string literal not displayed */
	// Recipients are the fingerprints of the recipients the run sealed to (ADR-0204 Decision 3).
	Recipients []string `` /* 254-byte string literal not displayed */
}

BackupStatus is the run (Decision 4): its phase, times, where it wrote, what and to whom.

type BackupTarget added in v0.11.0

type BackupTarget struct {
	URL               string     `` /* 470-byte string literal not displayed */
	CredentialsSecret ObjectName `` /* 213-byte string literal not displayed */
}

BackupTarget is an s3:// URL and the Secret of its write credential (Decision 6).

type BlobEvent

type BlobEvent struct {
	Name   ObjectName `` /* 148-byte string literal not displayed */
	Prefix string     `` // only objects under this key prefix fire ("" = whole bucket)
	/* 308-byte string literal not displayed */
	On []BlobEventType `` // default [Created] (set in normalize); only Created supported in V1
	/* 213-byte string literal not displayed */
}

BlobEvent is one named object-store event: a DNS-1123 name, a key prefix, and the object lifecycle events it fires on (ADR-0119).

type BlobEventType

type BlobEventType string

BlobEventType is an object lifecycle event. V1: Created only (Removed/Updated are a named follow-on).

const BlobCreated BlobEventType = "Created"

BlobCreated is the object-created lifecycle event — the only type supported in V1 (ADR-0119).

type BlobRef added in v0.15.0

type BlobRef struct {
	Bucket ObjectName `json:"bucket" doc:"The Bucket that holds the Site's bundles, in the Site's namespace."`
	Prefix string     `` /* 280-byte string literal not displayed */
}

BlobRef names a (bucket, prefix) sub-domain without an alias.

type BlobServiceSpec

type BlobServiceSpec struct {
	Binding string `json:"binding" pattern:"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$"`
}

BlobServiceSpec configures a blob service binding (ADR-0021, F23): the binding name a function references, the key-prefix segment <namespace>/<binding>/<key>.

type BlobSource

type BlobSource struct {
	Bucket ObjectName `` // the ADR-0080 Bucket resource to watch (this namespace)
	/* 172-byte string literal not displayed */
	Events []BlobEvent `json:"events" doc:"The source's events: at least one, with unique names, each watching the objects under its prefix."` // ≥1; unique names
}

BlobSource hosts the blob kind's named events over one Bucket (ADR-0119, F83): a poll watcher lists the Bucket's prefixes and fires a named CloudEvent per new object.

type Bucket

type Bucket struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       BucketSpec   `json:"spec"`
	Status     BucketStatus `json:"status,omitempty"`
}

Bucket is a namespaced blob domain (ADR-0080): the S3 *bucket*, mirroring KVStore — a named domain with a set of sub-domains (prefixes, the medallion layers) each with a single-writer owner, and an optional per-object resource policy. A function reaches a prefix only through a Function.spec.bindings.blob binding (default-deny); the prefix's owner is the single writer. Its status reports the blob storage's health (ADR-0215 Decision 7). Deletion-protected by referencing bindings and by non-empty data.

func (*Bucket) GetStatus added in v0.10.0

func (b *Bucket) GetStatus() *Status

GetStatus returns the shared Status pointer, implementing StatusObject.

func (*Bucket) GroupVersionKind

func (b *Bucket) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for Bucket.

func (*Bucket) Validate

func (b *Bucket) Validate() error

Validate performs envelope validation via the shared validateMeta helper, then the BucketSpec rules JSON Schema can't express: the quota (ADR-0292) and each prefix's; within the bucket, prefix names are unique (⇒ a prefix has exactly one owner) and each is a DNS-1123 label; and a set owner names a Function or a Lake by a DNS-1123 label (ADR-0275).

type BucketEntry added in v0.15.0

type BucketEntry struct {
	Name ObjectName `json:"name,omitempty"`
	Ref  ObjectName `json:"ref,omitempty"`
	// Deletion is retain (or empty, the default: the Bucket and its objects outlive the App) or delete.
	Deletion   DeletionPolicy `json:"deletion,omitempty"`
	BucketSpec `json:",inline"`
}

BucketEntry is a buckets entry: a Bucket a resource declares by name at its root, or only the ref of an existing one (ADR-0248).

func (BucketEntry) Declared added in v0.15.0

func (e BucketEntry) Declared() ObjectName

Declared is the name an entry declares or refers to: Name, else Ref.

func (BucketEntry) MarshalJSON added in v0.15.0

func (e BucketEntry) MarshalJSON() ([]byte, error)

MarshalJSON writes a ref entry as its ref alone (see marshalEntry).

func (BucketEntry) Schema added in v0.15.0

func (BucketEntry) Schema(r huma.Registry) *huma.Schema

Schema is BucketSpec's schema plus name, ref and deletion (see entrySchema).

type BucketPrefix

type BucketPrefix struct {
	// Name is the key prefix; a DNS-1123 label, unique within the bucket. The medallion layer.
	Name string `` /* 164-byte string literal not displayed */
	// Owner is the single writer, a Function or a Lake in this bucket's namespace, named with its kind (ADR-0275).
	// Zero ⇒ no writer (read-only).
	Owner PrefixOwner `` /* 387-byte string literal not displayed */
	// Quota caps the prefix's total size (ADR-0292); a Lake's prefix quota is the Lake's cap.
	Quota SizeQuota `` /* 292-byte string literal not displayed */
}

BucketPrefix is one sub-domain of a Bucket (ADR-0080): a named key prefix with a single-writer owner. Mirrors KVTable. The leading segment of an S3 key selects the prefix; the rest is the object path.

type BucketQuota added in v0.33.0

type BucketQuota struct {
	SizeQuota `json:",inline"`
	// MaxObjectBytes caps one object (a write past it gets 413, ADR-0148); 0 ⇒ only s3gateway.maxUploadBytes applies.
	MaxObjectBytes int64 `` /* 343-byte string literal not displayed */
}

BucketQuota is a Bucket's caps (ADR-0292): its total size and the per-object cap moved from spec.maxObjectBytes.

type BucketSpec

type BucketSpec struct {
	// Prefixes are the bucket's sub-domains (ADR-0080): the medallion layers, each a key prefix with a
	// single-writer Owner. Prefix names are unique within the bucket (so a prefix has exactly one owner
	// by construction). Empty ⇒ a bucket with no writable sub-domains.
	Prefixes []BucketPrefix `` /* 237-byte string literal not displayed */
	// Quota caps the bucket's total size and each object (ADR-0292).
	Quota BucketQuota `` /* 172-byte string literal not displayed */
}

BucketSpec is the desired state of a Bucket (ADR-0080): its sub-domains (prefixes) and an optional per-object resource policy. Each prefix is a key-prefix sub-domain with a single-writer owner.

type BucketStatus added in v0.10.0

type BucketStatus struct {
	Status `json:",inline"`
}

BucketStatus is the observed state of a Bucket (ADR-0215 Decision 7): phase Ready or Degraded, and a Ready condition that follows the blob storage probe.

type BuiltinStep

type BuiltinStep struct {
	// Wait is a timer: a duration string ("30s", ADR-0194) or a ${{ }} goja Select expression evaluating
	// to one. The step blocks in-engine for the duration (on the run context, so the
	// run-timeout interrupts it), then passes its flowing input through as output. A normal step —
	// Running then Succeeded; no special state.
	Wait string `` /* 299-byte string literal not displayed */
	// Pass is a ${{ }} goja Select expression over the step's flowing input + prior step outputs;
	// its result is the step's output. No dispatch.
	Pass string `` /* 261-byte string literal not displayed */
}

BuiltinStep is an engine-native step (ADR-0096) — a nested kind-union of exactly one of Wait / Pass, evaluated in-process (no container, no dispatch). Room to grow (Gate, F66).

type ByteSize added in v0.24.0

type ByteSize string

ByteSize is a size written with an optional binary unit (ADR-0266): "1048576", "512Ki", "2GiB".

func (ByteSize) Bytes added in v0.24.0

func (s ByteSize) Bytes() (int64, error)

Bytes is the size's byte count: Invalid for a string the pattern refuses, else humanize.ParseBytes's count, Invalid past math.MaxInt64.

func (ByteSize) Schema added in v0.43.0

func (ByteSize) Schema(huma.Registry) *huma.Schema

Schema returns a new schema on each call (huma writes field tags into it), with the byte-size grammar as its pattern (ADR-0323 Decision 4), as Duration.Schema does.

type Condition

type Condition struct {
	Type               ConditionType   `json:"type" doc:"What the condition reports, such as Ready."`
	Status             ConditionStatus `json:"status" doc:"Whether the condition holds."`
	ObservedGeneration int64           `json:"observedGeneration,omitempty" doc:"The object's generation when funcd set the condition."`
	LastTransitionTime Timestamp       `json:"lastTransitionTime,omitzero" doc:"When the status last changed."`
	Reason             string          `json:"reason,omitempty" doc:"A short CamelCase reason for the status."`
	Message            string          `json:"message,omitempty" doc:"A sentence that explains the status."`
}

Condition represents a single observed condition on a resource's status.

type ConditionStatus

type ConditionStatus string

ConditionStatus is the state of a condition: True, False, or Unknown.

const (
	ConditionTrue    ConditionStatus = "True"
	ConditionFalse   ConditionStatus = "False"
	ConditionUnknown ConditionStatus = "Unknown"
)

type ConditionType

type ConditionType string

ConditionType is an open string type identifying a condition. Well-known types (Ready, Scheduled, RouteConfigured, …) are defined by the feature ADRs that raise them.

type Conditions

type Conditions []Condition

Conditions is an ordered set of conditions.

func (Conditions) Get

func (cs Conditions) Get(t ConditionType) (Condition, bool)

Get returns the condition with the given Type, and whether it was found.

func (*Conditions) Set

func (cs *Conditions) Set(c Condition)

Set upserts a condition by Type. If a condition of the same Type already exists, it is replaced in place. LastTransitionTime is advanced only when the Status actually changes — the status-bookkeeping contract every controller relies on.

type ConfigMap

type ConfigMap struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       ConfigMapSpec `json:"spec"`
}

ConfigMap is a namespaced, pure-data resource for non-sensitive configuration key/values. ConfigMap does NOT have status — it implements Object, not StatusObject.

func (*ConfigMap) GroupVersionKind

func (c *ConfigMap) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for ConfigMap.

func (*ConfigMap) Validate

func (c *ConfigMap) Validate() error

Validate performs envelope validation, then requires every data key to be an env-var name.

type ConfigMapEntry added in v0.15.0

type ConfigMapEntry struct {
	Name          ObjectName `json:"name,omitempty"`
	Ref           ObjectName `json:"ref,omitempty"`
	ConfigMapSpec `json:",inline"`
}

ConfigMapEntry is a configMaps entry: a ConfigMap a resource defines, stored as AppConfigMapName(name, spec), or only the ref of an existing one (ADR-0213 Decision 2).

func (ConfigMapEntry) MarshalJSON added in v0.15.0

func (e ConfigMapEntry) MarshalJSON() ([]byte, error)

MarshalJSON writes a ref entry as its ref alone (see marshalEntry).

func (ConfigMapEntry) Schema added in v0.15.0

func (ConfigMapEntry) Schema(r huma.Registry) *huma.Schema

Schema is ConfigMapSpec's schema plus name and ref (see entrySchema).

type ConfigMapSpec

type ConfigMapSpec struct {
	Data map[string]string `` /* 486-byte string literal not displayed */
}

ConfigMapSpec holds the configuration data. map[string]string is allowed under ADR-0002 (the any-ban targets interface{}/any/map[string]any).

type DeletionPolicy

type DeletionPolicy string

DeletionPolicy is a workflow-owned store's delete behavior.

const (
	// DeletionRetain leaves the store on workflow delete (the default).
	DeletionRetain DeletionPolicy = "retain"
	// DeletionDelete cascades the store on workflow delete.
	DeletionDelete DeletionPolicy = "delete"
)

func (DeletionPolicy) Schema

Schema carries DeletionPolicy's enum into the generated OpenAPI (ADR-0048).

type Dependency

type Dependency struct {
	Name   ObjectName `json:"name" doc:"The dependency's name, unique among the Sensor's dependencies; an action's on names it."`
	Source ObjectName `json:"source" doc:"The name of an EventSource in the Sensor's namespace."` // the EventSource name
	Event  ObjectName ``                                                                          // the named event of that source
	/* 126-byte string literal not displayed */
}

Dependency is a named, tuple-addressed event dependency: (source, event) in this namespace.

type Duration added in v0.8.0

type Duration time.Duration

Duration is a span of time: int64 nanoseconds in memory, a duration string on the wire (ADR-0194).

func ParseDuration added in v0.8.0

func ParseDuration(s string) (Duration, error)

ParseDuration matches s against DurationPattern, then computes it with time.ParseDuration; a mismatch or an overflow is fault.Invalid naming s and the grammar.

func (Duration) MarshalJSON added in v0.8.0

func (d Duration) MarshalJSON() ([]byte, error)

MarshalJSON writes the normalized form as a JSON string; a negative or sub-millisecond value is refused.

func (Duration) Schema added in v0.8.0

func (Duration) Schema(huma.Registry) *huma.Schema

Schema returns a new schema on each call (huma writes field tags into it): {type: string, pattern: DurationPattern, patternDescription}.

func (Duration) String added in v0.8.0

func (d Duration) String() string

String writes the normalized form; a negative or sub-millisecond value falls back to time.Duration's String.

func (*Duration) UnmarshalJSON added in v0.8.0

func (d *Duration) UnmarshalJSON(b []byte) error

UnmarshalJSON accepts only a JSON string in the grammar; null leaves d unchanged.

type EdgeAuth

type EdgeAuth struct {
	Mode AuthMode `` /* 265-byte string literal not displayed */
}

EdgeAuth is the F77 namespace-default auth stance.

type EdgeDefaults

type EdgeDefaults struct {
	// Auth is the namespace-default edge auth stance (ADR-0113, F77); a Route overrides it. nil ⇒
	// open (the phased default — a namespace opts into default-deny by setting Auth.Mode=authenticated).
	Auth *EdgeAuth `` /* 284-byte string literal not displayed */
}

EdgeDefaults carries namespace-wide edge policy defaults (F74–F78 add typed sub-structs).

type EgressPolicy

type EgressPolicy struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       EgressPolicySpec `json:"spec"`
}

EgressPolicy is a namespaced, pure-policy allow-list (implicit default-deny) governing worker egress (ADR-0117, F81). No status (implements Object, not StatusObject). A namespace with no EgressPolicy ⇒ its workers reach nothing external. It is the first high-level typed policy CRD that compiles to Cedar (internal/auth/cedar.CompileEgressPolicy).

A name needs a domain rule (ADR-0315): the DNS forwarder answers known workers only, and forwards only the names a domain rule that applies to them allows; any other name gets REFUSED, so reaching a CIDR-allowed host by name takes a domain rule too. A domain rule reaches globally reachable addresses only (ADR-0317): an address IANA's special-purpose registries do not mark so, multicast, reserved IPv4 space, Azure's 168.63.129.16 or a node address takes a `cidrs` rule that names it. Example (YAML block syntax):

apiVersion: funcd.io/v1alpha1
kind: EgressPolicy
metadata:
  name: default-egress
  namespace: acme
  resourceGroup: rg1
spec:
  appliesTo: [etl]        # optional; omit ⇒ every Function in the namespace
  rules:
    - to:
        domains: ["api.x.com", "*.x.com"]
        cidrs:   ["10.0.0.0/8"]
      ports: [443, 5432]

func (*EgressPolicy) GroupVersionKind

func (ep *EgressPolicy) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for EgressPolicy.

func (*EgressPolicy) Validate

func (ep *EgressPolicy) Validate() error

Validate performs envelope validation then the allow-list rules: at least one rule; each rule has a non-empty `to` (≥1 domain or CIDR); domains are DNS names or "*."-prefixed wildcards; CIDRs parse (netip.ParsePrefix); ports are 1..65535 (fault.Invalid otherwise).

type EgressPolicySpec

type EgressPolicySpec struct {
	// Rules is the allow-list; each grants egress to its `to` on its `ports`. At least one required.
	Rules []EgressRule `` /* 270-byte string literal not displayed */
	// AppliesTo scopes every rule to these Functions (by name, this namespace); empty ⇒ the whole namespace.
	AppliesTo []ObjectName `` /* 153-byte string literal not displayed */
}

EgressPolicySpec is an allow-list of egress rules, optionally scoped to named Functions.

type EgressRule

type EgressRule struct {
	// To is the destination match; at least one of domains/cidrs is required (Validate enforces).
	To EgressTo `` /* 201-byte string literal not displayed */
	// Ports are the destination ports (1..65535); empty ⇒ any port to the matched destination.
	Ports []int `json:"ports,omitempty" doc:"The destination ports the rule allows, each 1 to 65535, at most 32; empty allows every port."`
}

EgressRule permits egress to a destination set on a port set.

type EgressTo

type EgressTo struct {
	Domains []string `` /* 403-byte string literal not displayed */
	CIDRs   []string `` /* 249-byte string literal not displayed */
}

EgressTo is a destination match: SNI/Host domains (wildcard "*.x.com" ok) and/or CIDRs.

type EventSource

type EventSource struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       EventSourceSpec   `json:"spec"`
	Status     EventSourceStatus `json:"status,omitempty"`
}

EventSource is a namespaced resource that configures an event trigger source. Status-bearing. Behavioral spec fields (source config) owned by F16.

func (*EventSource) GetStatus

func (es *EventSource) GetStatus() *Status

GetStatus returns the shared Status pointer, implementing StatusObject.

func (*EventSource) GroupVersionKind

func (es *EventSource) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for EventSource.

func (*EventSource) Normalize

func (es *EventSource) Normalize()

Normalize fills declared-but-empty defaults that JSON Schema cannot (ADR-0119): each blob event's empty `on` defaults to [Created], and each SQL event's to all three changes (ADR-0235). It is a decode/normalize step — pure defaulting, NOT validation — kept out of Validate so Validate stays non-mutating (ADR-0108). Idempotent; a nil/timer spec is a no-op.

func (*EventSource) Validate

func (es *EventSource) Validate() error

Validate enforces the v2 kind-union rules JSON Schema can't express (ADR-0108/ADR-0048): exactly one source kind set; each kind's events non-empty with unique DNS-1123 names and, for a timer, one valid schedule. The removed v1 `type:`/`function:` keys are rejected at the schema edge (additionalProperties:false → 422).

type EventSourceSpec

type EventSourceSpec struct {
	// Timer is the timer source kind (V1): named events, each on its own interval or cron schedule. The webhook
	// source kind is a named follow-on (it needs an eventing-ingress gateway decision).
	Timer *TimerSource `` /* 177-byte string literal not displayed */
	// Blob is the object-store source kind (ADR-0119, F83): named events that fire on object-created under
	// a watched Bucket prefix, detected by a poll watcher over the ADR-0007 blob.Bucket List seam.
	Blob *BlobSource `` /* 291-byte string literal not displayed */
	// SQL is the SQL change-feed source kind (ADR-0235, F132): named events that fire on a row change of a table of
	// a SQLDatabase in this namespace, from the changes its engine posts to funcd.
	SQL *SQLSource `` /* 342-byte string literal not displayed */
}

EventSourceSpec is a kind-keyed source hosting named events (ADR-0108, F72): exactly one source-kind pointer is non-nil (the source kind), each carrying a list of named events. A firing publishes a named CloudEvent that the F69 Sensor (ADR-0109) binds to actions — the source no longer binds a function.

type EventSourceStatus

type EventSourceStatus struct {
	Status `json:",inline"`
}

EventSourceStatus holds the observed state.

type ExposureMode

type ExposureMode string

ExposureMode selects whether an unrouted Function is reachable at the public edge.

const (
	// ExposureImplicit keeps the /function/<name> path reachable (default, back-compat).
	ExposureImplicit ExposureMode = "implicit"
	// ExposureExplicit gates the edge: no Route ⇒ private (default-deny ingress).
	ExposureExplicit ExposureMode = "explicit"
)

func (ExposureMode) Normalized

func (m ExposureMode) Normalized() ExposureMode

Normalized returns the effective mode, mapping the empty/absent zero value to implicit.

func (ExposureMode) Schema

Schema renders the huma enum for ExposureMode (empty accepted, normalizes to implicit).

type FieldDiff

type FieldDiff struct {
	Field string
	Want  string
	Got   string
}

FieldDiff is one required consumer field a producer or document does not satisfy. Got == "" ⇒ the field is missing; otherwise Got is the actual primitive type and Want the required one. Field == "" ⇒ the whole document is mistyped (a non-null document against a void schema).

func CheckInput

func CheckInput(doc, schema json.RawMessage) []FieldDiff

CheckInput reports the required properties of the schema not satisfied by an actual JSON document (doc↔schema primitive match). A JSON number satisfies integer or number (a doc can't distinguish them). A void schema admits only a null or absent document (ADR-0090). Empty ⇒ valid. Used by WorkflowRun admission and the engine's run-start gate (ADR-0098).

func CheckProps added in v0.3.0

func CheckProps(doc, schema json.RawMessage) []FieldDiff

CheckProps reports the top-level fields of a JSON document whose primitive type does not match the type the schema declares for that property; an undeclared field is not checked. Unlike CheckInput it checks what the document carries, not what the schema requires: a step's spec.params overlay only part of its input (ADR-0094). A non-object document against an object schema is one whole-document diff.

func (FieldDiff) String

func (d FieldDiff) String() string

type Function

type Function struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       FunctionSpec   `json:"spec"`
	Status     FunctionStatus `json:"status,omitempty"`
}

Function is a namespaced resource representing a deployable function/agent. Status-bearing. Behavioral spec fields owned by F10–F14.

NOTE: `json:",inline"` flattens TypeMeta because stdlib encoding/json treats an empty tag name as "anonymous → promote fields" (the `inline` option itself is a no-op in stdlib; it's a yaml/k8s-codec convention). ObjectMeta keeps the name "metadata", so it nests. The roundtrip test guards this — do not rename the TypeMeta tag.

func (*Function) GetStatus

func (f *Function) GetStatus() *Status

GetStatus returns the shared Status pointer, implementing StatusObject.

func (*Function) GroupVersionKind

func (f *Function) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for Function.

func (*Function) Validate

func (f *Function) Validate() error

Validate performs envelope validation via the shared validateMeta helper, then the Function-spec semantic rules JSON Schema can't express (ADR-0046, ADR-0048): Pooling.Worker is a DNS-1123 label when set; the cross-field and conditional-presence checks in FunctionSpec.Validate. Field-local constraints (runtime/handler/uri patterns, replica bounds) are schema-enforced at the edge and are not re-checked here; duration bounds are (ADR-0194).

type FunctionBindings added in v0.15.0

type FunctionBindings struct {
	// KV binds an alias to a (store, table) sub-domain of a KVStore in this namespace, read through ctx.kv (ADR-0073);
	// writes need the table's owner or a writer role (ADR-0136).
	KV []FunctionKV `` /* 292-byte string literal not displayed */
	// Blob binds an alias to a (bucket, prefix) sub-domain, read through ctx.blob and S3 (ADR-0080); writes need the
	// prefix's owner or a writer role.
	Blob []FunctionBlob `` /* 344-byte string literal not displayed */
	// SQL binds an alias to a SQLDatabase, read through ctx.sql (ADR-0233); writes need its owner or a writer role. A
	// missing database holds the Function Pending (SQLDatabaseNotFound).
	SQL []FunctionSQL `` /* 298-byte string literal not displayed */
	// Lake binds an alias to a Lake (ADR-0091): the worker gets FUNCD_LAKE_<ALIAS>_URL and _TOKEN, and
	// the reconcile waits, fail-closed, until the lake is Ready.
	Lake []FunctionLake `` /* 158-byte string literal not displayed */
	// Links binds an alias to a target Function, called through ctx.invoke and ctx.fetch (ADR-0064); with no matching
	// link the call is refused.
	Links []FunctionLink `` /* 361-byte string literal not displayed */
	// Config names ConfigMaps whose Data is injected as env vars, before Secrets, so a bound Secret overrides a config
	// default (ADR-0093); a missing one fails closed (ConfigResolveFailed).
	Config []ObjectName `` /* 319-byte string literal not displayed */
	// Secret names Secrets whose Data is injected as env vars (ADR-0057); only the names are stored, resolution is
	// PDP-authorized, and an unauthorized or missing Secret fails the Function closed.
	Secret []ObjectName `` /* 264-byte string literal not displayed */
}

FunctionBindings are what a Function's code uses (ADR-0246), named like the ctx accessors (ADR-0245). Each binding is its grant: with no matching entry, the accessor on that alias is refused (default-deny). Cross-resource validity (the store, bucket, database, lake, target, ConfigMap or Secret exists) is an admission; Validate checks the structural rules.

type FunctionBlob

type FunctionBlob struct {
	// Alias is the local handle; a DNS-1123 label, unique within Blob.
	Alias string `` /* 162-byte string literal not displayed */
	// Bucket is the name of a Bucket in this function's namespace.
	Bucket ObjectName `json:"bucket" doc:"The Bucket, in the same namespace, that holds the prefix."`
	// Prefix is a sub-domain (BucketPrefix.name) of that bucket; a DNS-1123 label.
	Prefix string `json:"prefix" pattern:"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$" doc:"The prefix, by its name in the Bucket's prefixes."`
}

FunctionBlob declares one blob (S3) binding (ADR-0080, F47): a local alias bound to a (bucket, prefix) sub-domain in the same namespace. The binding is the read grant; writes require this function to be the prefix's owner. Mirrors FunctionKV (the wrangler/spec.bindings.kv convention).

type FunctionKV

type FunctionKV struct {
	// Alias is the local handle the handler passes to context.kv; a DNS-1123 label, unique within KV.
	Alias string `` /* 138-byte string literal not displayed */
	// Store is the name of a KVStore in this function's namespace.
	Store ObjectName `json:"store" doc:"The KVStore, in the same namespace, that holds the table."`
	// Table is a sub-domain (KVStore.spec.tables[].name) of that store; a DNS-1123 label.
	Table string `json:"table" pattern:"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$" doc:"The table, by its name in the store's tables."`
}

FunctionKV declares one KV binding (ADR-0073, F42): a local alias bound to a (store, table) sub-domain in the same namespace. The handler reaches it as context.kv.<verb>(alias, …); reads are coarse-allowed for any bound same-namespace caller, writes require this function to be the table's owner. Mirrors FunctionLink (the wrangler/spec.bindings.links convention).

type FunctionLake added in v0.23.0

type FunctionLake struct {
	// Alias names the FUNCD_LAKE_<ALIAS>_* env pair; a DNS-1123 label, unique within Lakes.
	Alias string `` /* 237-byte string literal not displayed */
	// Lake is the name of a Lake in this function's namespace.
	Lake ObjectName `json:"lake" doc:"The Lake to query, in the same namespace."`
}

FunctionLake binds this function to a Lake it consumes (ADR-0091, F61). Declaring the binding is the grant: funcd injects FUNCD_LAKE_<ALIAS>_URL/_TOKEN, and (V2) grants egress.

type FunctionLink struct {
	// Alias is the local name the handler passes to invoke; a DNS-1123 label, unique within Links.
	Alias string `` /* 152-byte string literal not displayed */
	// Target is the name of a Function in this function's namespace.
	Target ObjectName `json:"target" doc:"The Function to call, in the same namespace."`
	// Timeout bounds the synchronous wait (incl. a cold-start wake).
	Timeout Duration `` /* 137-byte string literal not displayed */
}

FunctionLink declares one synchronous RPC dependency: a local alias bound to a target Function in the same namespace (ADR-0064, F33). The latest-Ready revision of the target is called.

type FunctionName

type FunctionName string

FunctionName is a DNS-label-qualified function identifier.

func (FunctionName) Schema

Schema carries FunctionName's DNS-1123 constraint into the generated OpenAPI.

func (FunctionName) Validate

func (n FunctionName) Validate() error

Validate checks the FunctionName against DNS-label rules.

type FunctionProtocol added in v0.14.0

type FunctionProtocol string

FunctionProtocol is how funcd calls a Function's code (ADR-0243).

const (
	// ProtocolCloudEvent calls the handler with a CloudEvent, the default.
	ProtocolCloudEvent FunctionProtocol = "cloudevent"
	// ProtocolHTTP calls an http(app) export with each request the edge forwards.
	ProtocolHTTP FunctionProtocol = "http"
)

func (FunctionProtocol) Normalized added in v0.14.0

func (p FunctionProtocol) Normalized() FunctionProtocol

Normalized returns the effective protocol, mapping the empty value to cloudevent.

func (FunctionProtocol) Schema added in v0.14.0

Schema renders the huma enum for FunctionProtocol (empty accepted, normalizes to cloudevent).

type FunctionSQL added in v0.13.0

type FunctionSQL struct {
	Alias    string     `` /* 139-byte string literal not displayed */
	Database ObjectName `json:"database" doc:"The SQLDatabase to query, in the same namespace."`
}

FunctionSQL binds this function to a SQLDatabase of its namespace under a local alias (ADR-0233).

type FunctionSpec

type FunctionSpec struct {
	// Scaling configures scale-to-zero / idle reclaim (ADR-0016, F11). V1 honors
	// MinReplicas (0 enables scale-to-zero) and IdleTimeout (0 disables reclaim);
	// MaxReplicas is recorded for forward-compatibility (1→N autoscaling is V3).
	Scaling Scaling `` /* 186-byte string literal not displayed */
	// Runtime is the runtime class / language image (e.g. "nodejs22", "python312") — F13/ADR-0020.
	// Typed RuntimeName so its DNS-1123 constraint reaches the OpenAPI schema (ADR-0048).
	Runtime RuntimeName `` /* 215-byte string literal not displayed */
	// Handler is the entrypoint the shim resolves at materialization (e.g. "app.handler") — F13.
	Handler string `` /* 221-byte string literal not displayed */
	// Protocol is how the shim calls the code (ADR-0243): "cloudevent", the default, or "http", an http(app) export
	// that serves every request and that only the edge calls.
	Protocol FunctionProtocol `` /* 318-byte string literal not displayed */
	// Image is the source artifact OCI ref (oci-layout:// · file:// · a bare registry ref; the tag at the
	// string end), pulled + served by the runtime — F13/ADR-0020, flattened by ADR-0097 (was spec.artifact.uri).
	Image string `` /* 265-byte string literal not displayed */
	// ImageDigest is the content digest pinned into the stamped Revision ("what was validated ships"),
	// system-set at materialization (ADR-0035) — ADR-0097 (was spec.artifact.digest).
	ImageDigest string `` /* 292-byte string literal not displayed */
	// Replicas is the manual replica count (>=0); the effective count also honors Scaling + the
	// activator's wake (ADR-0016/0020) — F13.
	Replicas int `` /* 385-byte string literal not displayed */
	// Timeout bounds an external invoke until its response starts; 0 ⇒ invoke.defaultTimeout. External
	// invokes only: links and steps keep their own limits (ADR-0151).
	Timeout Duration `` /* 134-byte string literal not displayed */
	// Pooling is the per-function worker-pooling opt-in (ADR-0046, F28). Empty ⇒ solo (own
	// worker, the default). Functions sharing (namespace, runtime, Pooling.Worker) and the same
	// access (bindings, owned data, grants) co-locate as handlers in one pool worker; status.pool
	// names it.
	Pooling Pooling `` /* 127-byte string literal not displayed */
	// Resources sizes each solo worker (ADR-0291): its cpu and memory, enforced by the runtime driver; an empty field
	// takes functions.defaultResources. Not with pooling.worker: a pool's heap cap is pool-wide.
	Resources ResourceSpec `` /* 230-byte string literal not displayed */
	// Bindings are what the Function's code uses (ADR-0246): each binding is its grant, named like the ctx accessor
	// that reaches it.
	Bindings FunctionBindings `` /* 428-byte string literal not displayed */
	// KVStores, Buckets, SQLDatabases, Lakes and ConfigMaps are what the Function declares at its root
	// (ADR-0248): by name it owns the resource, which carries its marker; by ref it binds an existing one. An owner
	// left out of a store's tables, prefixes or database is the Function (the function-store-owner admission).
	KVStores     []KVStoreEntry     `` /* 325-byte string literal not displayed */
	Buckets      []BucketEntry      `` /* 392-byte string literal not displayed */
	SQLDatabases []SQLDatabaseEntry `` /* 398-byte string literal not displayed */
	Lakes        []LakeEntry        `` /* 340-byte string literal not displayed */
	ConfigMaps   []ConfigMapEntry   `` /* 375-byte string literal not displayed */
	// SecretDeclarations are the Secrets the Function's bindings name, with the keys it reads (ADR-0213 Decision 8).
	SecretDeclarations []SecretDeclaration `` /* 359-byte string literal not displayed */
	// Volumes are the directories the Function owns (ADR-0262): emptyDir per worker, local durable; its code reads each
	// one's path from FUNCD_VOLUME_<NAME>.
	Volumes []VolumeEntry `` /* 260-byte string literal not displayed */
	// Ingress is the Function's edge exposure (ADR-0241): unset, it answers by name at /function/<name> while its
	// namespace is implicit; a host or a path gives it a Route of its own.
	Ingress *Ingress `` /* 292-byte string literal not displayed */
}

FunctionSpec holds the desired state. Behavioral fields are appended by feature ADRs:

runtime               → F12 (runtime port)
handler/artifact/shape → F13 (function contract & lifecycle)
scaling                → F11 (scale-to-zero)  [this field, ADR-0016]
triggers               → F10/F16 (routes / eventing)
services               → F14 (KV) and the service pattern

func (*FunctionSpec) HasLocalVolume added in v0.24.0

func (s *FunctionSpec) HasLocalVolume() bool

HasLocalVolume reports whether s declares a local volume.

func (*FunctionSpec) PooledWithResources added in v0.33.0

func (s *FunctionSpec) PooledWithResources() bool

PooledWithResources reports a Function that sets spec.resources and joins a pool, which admission refuses and the reconciler blocks (ADR-0291 Decision 4).

func (*FunctionSpec) Validate

func (s *FunctionSpec) Validate() error

Validate enforces the FunctionSpec rule JSON Schema can't express (ADR-0048): the Scaling cross-field bound (minReplicas ≤ maxReplicas when maxReplicas > 0) and the duration bounds (ADR-0194). It deliberately does NOT re-check field PRESENCE (runtime/handler/artifact non-empty) — that is the materialization shape gate's job (ADR-0020: NewBasicValidator + the shim write ShapeValid:False and block Ready), and re-checking it here would duplicate a layer (one constraint, one layer). Field FORMAT (handler/digest patterns, replica bounds) is schema-enforced at the edge.

type FunctionStatus

type FunctionStatus struct {
	Status          `json:",inline"`
	Replicas        int    `json:"replicas,omitempty" doc:"How many of the serving revision's workers are ready."` // workers that listened and get calls (ADR-0161)
	CurrentRevision string ``                                                                                      // the latest stamped Revision name (ADR-0020)
	/* 200-byte string literal not displayed */
	// ServingRevision is the Revision whose workers receive the calls (ADR-0143); empty until the first deploy serves,
	// and again once no replica is desired.
	ServingRevision string `` /* 247-byte string literal not displayed */
	// DrainingRevision is the Revision demoted at the last switch while any of its workers remain, and DrainingSince
	// the time of that switch (ADR-0143); both are cleared together.
	DrainingRevision string     `` /* 426-byte string literal not displayed */
	DrainingSince    *Timestamp `json:"drainingSince,omitempty" doc:"When the last switch moved the calls off drainingRevision; cleared with it."`
	// Pool is the pool worker a pooled Function runs in, "<runtime>/<worker>/<access>"; empty when solo.
	Pool string `` /* 201-byte string literal not displayed */
}

FunctionStatus holds the observed state. Behavioral fields appended by F11/F13.

type FunctionStep

type FunctionStep struct {
	// Image is a full OCI artifact reference the workflow owns and materializes into a Function.
	Image string `` /* 237-byte string literal not displayed */
	// Ref references an existing Function in the namespace (a shared service).
	Ref ObjectName `` /* 250-byte string literal not displayed */
	// Retry is the per-step retry policy; nil ⇒ the engine default.
	Retry *StepRetry `` /* 324-byte string literal not displayed */
	// Timeout is the per-step invocation bound; 0 ⇒ the engine default.
	Timeout Duration `json:"timeout,omitempty" doc:"The per-step invocation bound: 0s to 24h; 0s or unset means workflow.defaultStepTimeout."`
	// Pooling overrides the workflow-level pooling for this step's materialized Function
	// (nil ⇒ inherit spec.pooling); image steps only.
	Pooling *WorkflowPooling `` /* 192-byte string literal not displayed */
	// Bindings are the step's bindings (ADR-0246), copied onto its materialized Function.
	Bindings StepBindings `` /* 263-byte string literal not displayed */
}

FunctionStep is a dispatched step (ADR-0096): sourced from an OWNED Image (materialized into <workflow>-<step>) OR a Ref to an existing Function (exactly one). All dispatch-only knobs live here, so an engine-native (Builtin) step cannot express them by construction.

type Gateway

type Gateway struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Status     GatewayStatus `json:"status,omitempty"`
}

Gateway is a cluster-scoped resource representing the API gateway / ingress controller. Status-bearing. Behavioral fields (listeners, TLS) owned by F10.

func (*Gateway) GetStatus

func (gw *Gateway) GetStatus() *Status

GetStatus returns the shared Status pointer, implementing StatusObject.

func (*Gateway) GroupVersionKind

func (gw *Gateway) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for Gateway.

func (*Gateway) Validate

func (gw *Gateway) Validate() error

Validate performs envelope validation via the shared validateMeta helper.

type GatewayStatus

type GatewayStatus struct {
	Status `json:",inline"`
}

GatewayStatus holds the observed state.

type Grant

type Grant struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       GrantSpec `json:"spec"`
}

Grant is a namespaced, pure-policy resource (KindGrant stays registered). ADR-0072 made it a KV binding ({function, binding, store, mode}); ADR-0073 supersedes that — KV bindings moved to Function.spec.bindings.kv and authorization to the PDP/IAM — so GrantSpec reverts to its reserved empty placeholder. KindGrant remains registered (CRUD plumbing intact) for a future IAM ADR to fill; nothing in KV references Grant anymore. Grant has no status — it implements Object, not StatusObject.

func (*Grant) GroupVersionKind

func (g *Grant) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for Grant.

func (*Grant) Validate

func (g *Grant) Validate() error

Validate performs envelope validation via the shared validateMeta helper. The empty GrantSpec has no structural rules of its own (reserved placeholder — ADR-0073).

type GrantSpec

type GrantSpec struct{}

GrantSpec is the reserved IAM-V2 placeholder (ADR-0073): empty until a future IAM ADR defines it.

type GroupVersionKind

type GroupVersionKind struct {
	Group   string
	Version string
	Kind    Kind
}

GroupVersionKind is the (Group, Version, Kind) triple used for registry lookup, ObjectRef identity, and codegen.

func (GroupVersionKind) APIVersion

func (gvk GroupVersionKind) APIVersion() string

APIVersion returns the wire apiVersion string, e.g. "funcd.io/v1alpha1".

func (GroupVersionKind) String

func (gvk GroupVersionKind) String() string

String returns a human-readable representation.

type HTTPMethod

type HTTPMethod string

HTTPMethod is an allowed request method.

const (
	MethodGet     HTTPMethod = "GET"
	MethodHead    HTTPMethod = "HEAD"
	MethodPost    HTTPMethod = "POST"
	MethodPut     HTTPMethod = "PUT"
	MethodPatch   HTTPMethod = "PATCH"
	MethodDelete  HTTPMethod = "DELETE"
	MethodOptions HTTPMethod = "OPTIONS"
)

func (HTTPMethod) Schema

func (HTTPMethod) Schema(huma.Registry) *huma.Schema

Schema renders the huma enum for HTTPMethod.

type Identity

type Identity struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       IdentitySpec   `json:"spec"`
	Status     IdentityStatus `json:"status,omitempty"`
}

Identity is a user-assigned managed identity (ADR-0135, FEAT-0008/F100): a first-class, namespace-scoped principal for a non-funcd caller. Its controller issues a revocable SigV4 keypair into an owned Secret and registers it so the caller resolves (via the S3 gateway's principalFor) to Identity::"<ns>/<name>". Issuing a credential is AUTHENTICATION only — authorization is granted separately (ADR-0136 RolesAssignment); an Identity with no assignment is default-deny.

func (*Identity) GetStatus

func (i *Identity) GetStatus() *Status

GetStatus returns the shared status base (Identity is a StatusObject — its reconciler reports credential issuance).

func (*Identity) GroupVersionKind

func (i *Identity) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for Identity.

func (*Identity) Validate

func (i *Identity) Validate() error

Validate performs envelope + structural validation. Cross-resource checks (e.g. Secret existence) are reconcile-time, not here (ADR-0121).

type IdentitySpec

type IdentitySpec struct {
	// Type is the identity flavor. V1: only "external". Required.
	Type IdentityType `` /* 242-byte string literal not displayed */
	// CredentialSecretName is the owned Secret the issued keypair is written to. Empty ⇒ the Identity's
	// own name.
	CredentialSecretName ObjectName `` /* 484-byte string literal not displayed */
	// Rotate, when incremented past status.observedRotate, forces the controller to reissue the secret
	// (rotation). The access key id is stable; only the secret changes.
	Rotate int64 `` /* 226-byte string literal not displayed */
}

IdentitySpec declares a managed identity and how its credential is issued.

type IdentityStatus

type IdentityStatus struct {
	Status `json:",inline"`
	// AccessKeyID is the issued, stable SigV4 access key id (the secret lives only in the owned Secret).
	AccessKeyID string `` /* 203-byte string literal not displayed */
	// ObservedRotate mirrors the spec.rotate the currently-issued secret corresponds to.
	ObservedRotate int64 `` /* 132-byte string literal not displayed */
}

IdentityStatus is the observed credential state.

type IdentityType

type IdentityType string

IdentityType is the flavor of a managed Identity. V1 supports only "external" — a non-funcd caller that authenticates with an issued SigV4 keypair. A Function's identity is system-assigned (implicit) and is not modeled as an Identity resource.

const IdentityTypeExternal IdentityType = "external"

IdentityTypeExternal is a user-assigned managed identity for a non-funcd (external) caller.

type Ingress added in v0.14.0

type Ingress struct {
	// Enabled turns the resource's own address on or off. Unset: a Function or a Site follows its namespace's
	// defaultExposure (implicit on, explicit off) and a Lake is off.
	Enabled *bool `` /* 194-byte string literal not displayed */
	// Host is the exact host of the resource's own address; "" is the namespace host (ADR-0240).
	Host string `` /* 210-byte string literal not displayed */
	// Path is the edge path of the resource's own address; "" is "/" when Host is set, else
	// /function/<name>, /site/<name> or /lake/<name>.
	Path string `` /* 222-byte string literal not displayed */
	// Auth is the edge stance of the resource's own address; nil is the namespace default.
	Auth *RouteAuth `` /* 214-byte string literal not displayed */
}

Ingress is the edge exposure of every exposable kind: Function, Site and Lake (ADR-0241).

func (*Ingress) AuthMode added in v0.14.0

func (i *Ingress) AuthMode() AuthMode

AuthMode is the stance of the resource's own address; "" is the namespace default.

func (*Ingress) EnabledIn added in v0.14.0

func (i *Ingress) EnabledIn(mode ExposureMode) bool

EnabledIn reports whether a Function's or a Site's own address is on in a namespace of mode (ADR-0241 Decision 2).

type Invocation

type Invocation struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Status     InvocationStatus `json:"status,omitempty"`
}

Invocation is a namespaced, read-only resource representing a single function invocation record. Status-bearing.

func (*Invocation) GetStatus

func (inv *Invocation) GetStatus() *Status

GetStatus returns the shared Status pointer, implementing StatusObject.

func (*Invocation) GroupVersionKind

func (inv *Invocation) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for Invocation.

func (*Invocation) Validate

func (inv *Invocation) Validate() error

Validate performs envelope validation via the shared validateMeta helper. Note: Invocation is namespaced (KindInvocation.Namespaced() is true).

type InvocationStatus

type InvocationStatus struct {
	Status    `json:",inline"`
	StartTime Timestamp `json:"startTime,omitzero" doc:"When the call started; for a Sensor's action, its first attempt."`
	EndTime   Timestamp `json:"endTime,omitzero" doc:"When the call ended, after its last attempt."`
	Error     string    `json:"error,omitempty" doc:"Why the call failed, on a Failed record; empty when it succeeded."`
}

InvocationStatus holds the observed invocation record. Behavioral fields (retention policy) owned by F16.

type JoinMode

type JoinMode string

JoinMode is a step's fan-in mode.

const (
	// JoinAll requires every parent to have Succeeded (the default).
	JoinAll JoinMode = "all"
	// JoinAny requires at least one parent to have Succeeded (exclusive-branch merge).
	JoinAny JoinMode = "any"
)

func (JoinMode) Schema

func (JoinMode) Schema(huma.Registry) *huma.Schema

Schema carries JoinMode's enum into the generated OpenAPI (ADR-0048).

type KVServiceSpec

type KVServiceSpec struct {
	Binding string `json:"binding" pattern:"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$"`
}

KVServiceSpec configures a KV service binding (ADR-0019, F14): the binding name a function references, which becomes the key-prefix segment <namespace>/<binding>/<key>.

type KVStore

type KVStore struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       KVStoreSpec   `json:"spec"`
	Status     KVStoreStatus `json:"status,omitempty"`
}

KVStore is a namespaced, owned KV resource (ADR-0072, reshaped by ADR-0073): a named domain with per-op caps, a set of sub-domains (tables) each with a single-writer owner, and a Ready lifecycle. A function reaches a table only through a Function.spec.bindings.kv binding (default-deny); the table's owner is the single writer. The store is one Badger prefix <ns>/<store>/; a table is <ns>/<store>/<table>/. Deletion-protected by referencing bindings and by non-empty data.

func (*KVStore) GetStatus

func (s *KVStore) GetStatus() *Status

GetStatus returns the shared Status pointer, implementing StatusObject (the controller's write-back seam).

func (*KVStore) GroupVersionKind

func (s *KVStore) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for KVStore.

func (*KVStore) Validate

func (s *KVStore) Validate() error

Validate performs envelope validation via the shared validateMeta helper, then the KVStoreSpec rules JSON Schema can't express: the caps are non-negative (0 ⇒ default), maxValueBytes is at most MaxValueBytesLimit and maxKeyBytes at most MaxKeyBytesLimit; and within the store, table names are unique (⇒ a table has exactly one owner) and each is a DNS-1123 label. Cross-resource rules (the owner exists) are an admission (ADR-0073), not structural Validate.

type KVStoreEntry added in v0.15.0

type KVStoreEntry struct {
	Name ObjectName `json:"name,omitempty"`
	Ref  ObjectName `json:"ref,omitempty"`
	// Deletion is retain (or empty, the default: the store and its data outlive the App) or delete.
	Deletion    DeletionPolicy `json:"deletion,omitempty"`
	KVStoreSpec `json:",inline"`
}

KVStoreEntry is a kv entry: a KVStore a resource declares by name at its root, or only the ref of an existing one (ADR-0248).

func (KVStoreEntry) MarshalJSON added in v0.15.0

func (e KVStoreEntry) MarshalJSON() ([]byte, error)

MarshalJSON writes a ref entry as its ref alone (see marshalEntry).

func (KVStoreEntry) Schema added in v0.15.0

func (KVStoreEntry) Schema(r huma.Registry) *huma.Schema

Schema is KVStoreSpec's schema plus name, ref and deletion (see entrySchema).

type KVStoreQuota added in v0.33.0

type KVStoreQuota struct {
	SizeQuota `json:",inline"`
	// MaxValueBytes caps a single value's size; 0 ⇒ DefaultMaxValueBytes (1 MiB); at most MaxValueBytesLimit.
	MaxValueBytes int64 `` /* 138-byte string literal not displayed */
	// MaxKeyBytes caps a single key's size; 0 ⇒ DefaultMaxKeyBytes (1 KiB); at most MaxKeyBytesLimit.
	MaxKeyBytes int `json:"maxKeyBytes,omitempty" minimum:"0" maximum:"64000" doc:"The longest key, in bytes. 0 means 1024 (1 KiB)."`
}

KVStoreQuota is a KVStore's caps (ADR-0292): its total size and the per-value and per-key caps moved from the spec's root.

type KVStoreSpec

type KVStoreSpec struct {
	// Quota caps the store's total size, each value and each key (ADR-0292).
	Quota KVStoreQuota `json:"quota,omitzero" doc:"Caps on the store's total size, on each value and on each key."`
	// Tables are the store's sub-domains (ADR-0073): each is a key space <ns>/<store>/<table>/ with a
	// single-writer Owner. Table names are unique within the store (so a table has exactly one owner by
	// construction). Empty ⇒ a store with no writable sub-domains.
	Tables []KVTable `` /* 249-byte string literal not displayed */
}

KVStoreSpec is the desired state of a KVStore (ADR-0072/0073): the per-op caps the facade enforces before a write reaches the driver, and the store's sub-domains (tables). A 0 cap means "use the default" (read at enforcement time).

func (KVStoreSpec) EffectiveMaxKeyBytes

func (s KVStoreSpec) EffectiveMaxKeyBytes() int

EffectiveMaxKeyBytes returns the per-key cap, applying the default when the spec is 0 and clamping to MaxKeyBytesLimit: a store persisted before Validate enforced the limit is never re-validated.

func (KVStoreSpec) EffectiveMaxValueBytes

func (s KVStoreSpec) EffectiveMaxValueBytes() int64

EffectiveMaxValueBytes returns the per-value cap, applying the default when the spec is 0 and clamping to MaxValueBytesLimit: a store persisted before Validate enforced the limit is never re-validated.

type KVStoreStatus

type KVStoreStatus struct {
	Status `json:",inline"`
	// Tables is the number of sub-domains declared on the store (computed by the reconciler).
	Tables int `json:"tables,omitempty" doc:"The number of tables the store declares."`
	// Bindings is the number of Function.spec.bindings.kv entries referencing this store (computed by the reconciler).
	Bindings int `json:"bindings,omitempty" doc:"The number of Function spec.bindings.kv entries that name the store."`
}

KVStoreStatus is the observed state of a KVStore (ADR-0072/0073): the reconciler sets Ready and the count of tables + the count of Function.spec.bindings.kv bindings referencing it. It embeds the shared Status (Phase + Conditions) so the controller's generic write-back seam (StatusObject.GetStatus) points at the live status.

type KVTable

type KVTable struct {
	// Name is the sub-domain name; a DNS-1123 label, unique within the store.
	Name string `json:"name" pattern:"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$" doc:"The table's name, unique within the store."`
	// Owner is a writer by default, a Function in this store's namespace; a writer-role grant adds others (ADR-0136).
	// Cross-resource validity (the owner exists) is an admission, not Validate.
	Owner ObjectName `` /* 632-byte string literal not displayed */
}

KVTable is one sub-domain of a KVStore (ADR-0073): a named key space with a single-writer owner. The typed-record engine (backlog) attaches its Schema/Indexes here (table-scoped) without a re-model.

type Kind

type Kind string

Kind is the typed set of resource kinds.

const (
	KindNamespace     Kind = "Namespace"
	KindResourceGroup Kind = "ResourceGroup"
	KindFunction      Kind = "Function"
	KindRevision      Kind = "Revision"
	KindRoute         Kind = "Route"
	KindService       Kind = "Service"
	KindEventSource   Kind = "EventSource"
	KindConfigMap     Kind = "ConfigMap"
	KindSecret        Kind = "Secret"
	KindGrant         Kind = "Grant"
	KindEgressPolicy  Kind = "EgressPolicy"
	KindInvocation    Kind = "Invocation"
	KindRuntimeClass  Kind = "RuntimeClass"
	KindWorkerNode    Kind = "WorkerNode"
	KindGateway       Kind = "Gateway"
	KindKVStore       Kind = "KVStore"
	KindBucket        Kind = "Bucket"
	KindLake          Kind = "Lake"
	// KindSQLDatabase is a SQL database served by its own rqlite engine (ADR-0232).
	KindSQLDatabase Kind = "SQLDatabase"
	KindPolicy      Kind = "Policy"
	KindWorkflow    Kind = "Workflow"
	KindWorkflowRun Kind = "WorkflowRun"
	KindSensor      Kind = "Sensor"
	// KindIdentity is a user-assigned managed identity (ADR-0135, F100): a stored, status-bearing CRUD
	// resource whose reconciler issues a credential. It resolves on the wire to an S3Identity Cedar
	// principal (KindS3Identity below is the auth-only wire principal; Identity is the CRUD resource).
	KindIdentity Kind = "Identity"
	// KindRole (ADR-0136, F101) is a named data-plane permission set (a stored value-type, like Grant).
	KindRole Kind = "Role"
	// KindRolesAssignment (ADR-0136, F101) grants many (principal, role, scope) entries in one stored
	// value-type; the PDP compiles it to Cedar permits + the single-writer `writers` set.
	KindRolesAssignment Kind = "RolesAssignment"
	// KindSite (ADR-0139, F103) is a declarative static web app: an immutable bundle materialized into a
	// digest-scoped Bucket prefix, owning its Bucket + Route inline; Ready only once servable.
	KindSite Kind = "Site"
	// KindApp (ADR-0199, F113) declares a whole app in typed sections: its parts are applied, reported, pruned and
	// deleted as one.
	KindApp Kind = "App"
	// KindAppRevision (ADR-0200, F114) is an App's history and rollout record: one per changed spec, written only by
	// the App reconciler and served read-only.
	KindAppRevision Kind = "AppRevision"
	// KindBackupSchedule, KindBackup and KindRestore (ADR-0222, F111) are an app owner's backups: a schedule's
	// definition, a run record, and a request to load a run's data.
	KindBackupSchedule Kind = "BackupSchedule"
	KindBackup         Kind = "Backup"
	KindRestore        Kind = "Restore"
	// KindS3Identity is the external SigV4 S3 principal (ADR-0080): NOT a stored/CRUD resource —
	// it has no metastore registration (no NewObject/AllKinds/handlers), it exists only as a Cedar
	// principal type the cedar driver materializes for the external-sigv4 authz path. It is excluded
	// from Kind.Validate's known-CRUD set by design.
	KindS3Identity Kind = "S3Identity"
	// KindNetDestination is the ephemeral egress destination a worker connects to (ADR-0117, F81):
	// an AUTHORIZATION-ONLY kind (the exact KindS3Identity precedent) — NOT a stored/CRUD resource, so
	// it has no metastore registration (excluded from Kind.Validate's CRUD set / NewObject / AllKinds).
	// It exists only as the Cedar resource type the egress capability materializes for an egress::connect
	// decision. Its EntityRef reinterprets the fields: the destination rides the plain-string Path,
	// PINNED encoding Path = "<dst-ip>:<port>#<domain1>,<domain2>,…" (the "#…" domain segment is the
	// forwarder-attested set, empty for a pure-IP/CIDR target); Name/Namespace are unused.
	KindNetDestination Kind = "NetDestination"
)

func AllKinds

func AllKinds() []Kind

AllKinds returns all kinds in a stable order.

func (Kind) GVK

func (k Kind) GVK() GroupVersionKind

GVK returns the GroupVersionKind for this kind.

func (Kind) Namespaced

func (k Kind) Namespaced() bool

Namespaced reports whether this kind is namespaced. Cluster-scoped kinds: Namespace, RuntimeClass, WorkerNode, Gateway.

func (Kind) Validate

func (k Kind) Validate() error

Validate returns fault.Invalid if the Kind is not one of the known kinds.

type Lake added in v0.23.0

type Lake struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       LakeSpec   `json:"spec"`
	Status     LakeStatus `json:"status,omitempty"`
}

Lake is a namespaced add-on-provider instance (ADR-0086, F48): a governed SQL lake + query engine (DuckLake + DuckDB + Quack) over the Parquet a tenant already stores on funcd's blob. Modeled on KVStore — a status-bearing namespaced resource whose reconciler materializes a backing min-replica=1 `duckdb` Function (the declared spec.bindings.blob bindings, so ADR-0085 injects the per-fn S3 keypair). The engine is the deployed Function, exposed through the EXISTING function→gateway path (ADR-0013) — there is NO Route resource. DuckDB reads/writes Parquet only through the F47 S3 surface under binding-as-grant; its DuckLake catalog lives in the platform's catalog store (ADR-0293), outside every Bucket, loaded + checkpointed by the single replica. cgo never touches the daemon — DuckDB runs out-of-process in the curated image.

func (*Lake) GetStatus added in v0.23.0

func (c *Lake) GetStatus() *Status

GetStatus returns the shared Status pointer, implementing StatusObject (the controller's write-back seam).

func (*Lake) GroupVersionKind added in v0.23.0

func (c *Lake) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for Lake.

func (*Lake) Validate added in v0.23.0

func (c *Lake) Validate() error

Validate performs envelope validation via the shared validateMeta helper, then the LakeSpec rules JSON Schema can't express (spec.bindings.blob and spec.bindings.config take the Function binding checks, FunctionSpec.validateBindings): each spec.bindings.blob entry's alias + prefix is a DNS-1123 label and the alias is unique within Blob; Lake.Prefix is a DNS-1123 label; and the lake (bucket, prefix) is one of the spec.bindings.blob bindings (so the engine gets the per-fn S3 keypair and can write its own lake — ADR-0086). Cross-resource validity (the bucket/prefix actually EXIST in the namespace) is the lake-blob-validity admission, NOT structural Validate.

type LakeBindings added in v0.23.0

type LakeBindings struct {
	// Blob binds the lakehouse buckets the engine may read and write, projected onto its backing Function so ADR-0085
	// injects the keypair; the prefix the lake lives under must be owned by this service (single-writer).
	Blob []FunctionBlob `` /* 174-byte string literal not displayed */
	// Config names ConfigMaps whose Data is injected into the engine as env vars: engine tuning (DUCKDB_*).
	Config []ObjectName `` /* 328-byte string literal not displayed */
	// Secret names Secrets whose Data is injected into the engine as env vars: the Quack token (QUACK_TOKEN).
	Secret []ObjectName `` /* 391-byte string literal not displayed */
}

LakeBindings are what a Lake's engine uses (ADR-0246, ADR-0086/0087).

type LakeEntry added in v0.23.0

type LakeEntry struct {
	Name     ObjectName `json:"name,omitempty"`
	Ref      ObjectName `json:"ref,omitempty"`
	LakeSpec `json:",inline"`
}

LakeEntry is a lakes entry: a Lake a resource declares by name at its root, or only the ref of an existing one (ADR-0248).

func (LakeEntry) MarshalJSON added in v0.23.0

func (e LakeEntry) MarshalJSON() ([]byte, error)

MarshalJSON writes a ref entry as its ref alone (see marshalEntry).

func (LakeEntry) Schema added in v0.23.0

func (LakeEntry) Schema(r huma.Registry) *huma.Schema

Schema is LakeSpec's schema plus name and ref (see entrySchema).

type LakeLocation added in v0.23.0

type LakeLocation struct {
	// Bucket is the name of a Bucket in this service's namespace.
	Bucket ObjectName `json:"bucket" doc:"The Bucket that holds the Lake's files, in the Lake's namespace."`
	// Prefix is a sub-domain (BucketPrefix.name) of that bucket; a DNS-1123 label.
	Prefix string `json:"prefix" pattern:"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$" doc:"The prefix of that Bucket, which this Lake must own."`
}

LakeLocation names the bound (bucket, prefix) of a Lake's files (ADR-0086). The prefix must be OWNED by this Lake (single-writer); the catalog, a DuckDB file (ADR-0271), lives in the catalog store under the same location (ADR-0293). Cross-resource validity (the bucket/prefix exist, owner is this Lake) is the reconciler's job, NOT Validate.

type LakeSpec added in v0.23.0

type LakeSpec struct {
	// Bindings are what the engine uses (ADR-0246): the lakehouse buckets, its ConfigMaps and its Secrets.
	Bindings LakeBindings `json:"bindings" doc:"What the Lake's engine uses: Bucket prefixes, and the ConfigMaps and Secrets of its environment."`
	// Location names the bound (bucket, prefix) the Lake's files live under; the prefix must be OWNED by this Lake
	// (single-writer). Its catalog, a DuckDB file (ADR-0271), lives in the catalog store under the same location
	// (ADR-0293).
	Location LakeLocation `` /* 344-byte string literal not displayed */
	// Resources sizes the engine (cpu/mem); DuckDB is memory-hungry. Validate refuses a value that does not parse, and
	// the provider-runtime maps it onto runtime.Limits (ADR-0087, ADR-0291 Decision 2).
	Resources ResourceSpec `` /* 159-byte string literal not displayed */
	// Ingress declares the edge exposure of this lake's lake::query PEP proxy (ADR-0138, ADR-0241), on only
	// with enabled: true; its default path is /lake/<name>. Once Ready, the reconciler programs an edge
	// entry to the PEP PROXY (never the engine), so an external caller is PEP'd on lake::query exactly like an
	// internal one; auth is refused, since the proxy authenticates. Exposure is a network path, not a grant.
	Ingress *Ingress `` /* 251-byte string literal not displayed */
	// Buckets, ConfigMaps and SecretDeclarations are what a standalone Lake declares at its root (ADR-0251):
	// by name it owns the Bucket or ConfigMap, which carries its marker; by ref it binds an existing one. An owner left
	// out of a prefix is the Lake (the lake-store-owner admission). A lake nested in a Function or an
	// App declares nothing here: its declarer's root holds them.
	Buckets            []BucketEntry       `` /* 402-byte string literal not displayed */
	ConfigMaps         []ConfigMapEntry    `` /* 375-byte string literal not displayed */
	SecretDeclarations []SecretDeclaration `` /* 346-byte string literal not displayed */
}

LakeSpec is the desired state of a Lake (ADR-0086): the lakehouse blob bindings the engine may read/write, the (bucket, prefix) the DuckLake catalog syncs under, and the engine's recorded resource sizing.

func (*LakeSpec) HasRootEntries added in v0.23.0

func (s *LakeSpec) HasRootEntries() bool

HasRootEntries reports whether the spec declares anything at its root (ADR-0251), which only a standalone Lake may.

type LakeStatus added in v0.23.0

type LakeStatus struct {
	Status `json:",inline"`
	// Function is the engine identity, "<name>-duckdb" (computed by the reconciler). No Function object has this
	// name: the engine runs as the provider worker named for the Lake (ADR-0086, repointed at the engine).
	Function ObjectName `` /* 143-byte string literal not displayed */
	// Endpoint is the published Quack URL — the backing function's ingress path (computed).
	Endpoint string `` /* 230-byte string literal not displayed */
	// ProxyPort is the port of the lake's PEP proxy listener (ADR-0162), recorded so a restarted daemon binds the
	// same port again and the URL consumers hold keeps reaching this lake (computed).
	ProxyPort int `` /* 241-byte string literal not displayed */
}

LakeStatus is the observed state of a Lake (ADR-0086): the reconciler reflects readiness (Ready once the backing duckdb Function is up), the materialized backing Function, and the published Quack endpoint. It embeds the shared Status (Phase + Conditions) so the controller's generic write-back seam (StatusObject.GetStatus) points at the live status — there is NO separate /status route.

type Namespace

type Namespace struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       NamespaceSpec   `json:"spec,omitempty"`
	Status     NamespaceStatus `json:"status,omitempty"`
}

Namespace is a cluster-scoped resource that defines a tenant boundary. Status-bearing.

func (*Namespace) GetStatus

func (n *Namespace) GetStatus() *Status

GetStatus returns the shared Status pointer, implementing StatusObject.

func (*Namespace) GroupVersionKind

func (n *Namespace) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for Namespace.

func (*Namespace) Validate

func (n *Namespace) Validate() error

Validate performs envelope + spec validation.

type NamespaceName

type NamespaceName string

NamespaceName is a DNS-label-qualified namespace identifier.

func (NamespaceName) Schema

Schema carries NamespaceName's DNS-1123 constraint into the generated OpenAPI.

func (NamespaceName) Validate

func (n NamespaceName) Validate() error

Validate checks the NamespaceName against DNS-label rules.

type NamespaceSpec

type NamespaceSpec struct {
	// DefaultExposure switches the public data-plane front door. Empty/absent ⇒ implicit.
	DefaultExposure ExposureMode `` /* 375-byte string literal not displayed */
	// EdgeDefaults carries the namespace-wide edge policy defaults merged under each Route
	// (F74–F78 add fields; empty in F79).
	EdgeDefaults *EdgeDefaults `` /* 157-byte string literal not displayed */
	// VolumeBudgetBytes caps the volume space the namespace's Functions reserve (ADR-0262 Decision 5); 0 ⇒ only
	// volumes.capacityBytes limits it.
	VolumeBudgetBytes int64 `` /* 175-byte string literal not displayed */
	// VolumeBudget is the same budget with a binary unit, "4Gi" (ADR-0266); at most one of the two is set.
	VolumeBudget ByteSize `` /* 414-byte string literal not displayed */
}

NamespaceSpec is the tenant's edge posture (ADR-0110, F79). A Spec-less namespace (the pre-F79 shape) has the zero value, which normalizes to `implicit` — so existing deployments are unchanged on upgrade.

func (NamespaceSpec) VolumeBudgetOf added in v0.24.0

func (s NamespaceSpec) VolumeBudgetOf() int64

VolumeBudgetOf is the namespace's volume budget in bytes, from whichever form is set; 0 is none.

type NamespaceStatus

type NamespaceStatus struct {
	Status `json:",inline"`
}

NamespaceStatus holds the observed state.

type OCIPlatform added in v0.2.0

type OCIPlatform string

OCIPlatform is an OCI platform "<os>/<architecture>", e.g. "linux/arm64" (ADR-0145): the platform a function artifact was built for, or the platform a worker node runs.

const (
	PlatformLinuxAMD64 OCIPlatform = "linux/amd64"
	PlatformLinuxARM64 OCIPlatform = "linux/arm64"
)

The platforms `funcdctl push --platform` accepts for a function artifact (ADR-0145).

func HostPlatform added in v0.2.0

func HostPlatform() OCIPlatform

HostPlatform is the daemon's own GOOS/GOARCH.

func (OCIPlatform) Arch added in v0.2.0

func (p OCIPlatform) Arch() string

Arch is the platform's CPU architecture ("" when p is not valid).

func (OCIPlatform) OS added in v0.2.0

func (p OCIPlatform) OS() string

OS is the platform's operating system ("" when p is not valid).

func (OCIPlatform) Validate added in v0.2.0

func (p OCIPlatform) Validate() error

Validate checks the "<os>/<arch>" shape: two non-empty segments, no variant.

type Object

type Object interface {
	GroupVersionKind() GroupVersionKind
	GetObjectMeta() *ObjectMeta
	GetName() ObjectName
	GetNamespace() NamespaceName
	GetResourceGroup() ResourceGroupName
	GetGeneration() int64
	Validate() error
}

Object is the generic interface satisfied by every resource kind. The store persists and the controller watches through this interface — no per-kind switch.

func NewObject

func NewObject(k Kind) (Object, bool)

NewObject returns a zero-valued typed Object for the given kind with TypeMeta stamped. Returns false if the kind is unknown.

type ObjectMeta

type ObjectMeta struct {
	// Name is the resource name. omitempty (not "required") so a create may omit it in favour of
	// GenerateName; the store still requires a non-empty Name (ObjectMeta.Validate) once assigned.
	Name ObjectName `` /* 159-byte string literal not displayed */
	// GenerateName is an optional NAME PREFIX for server-side name generation (the k8s pattern): when Name
	// is empty and GenerateName is set, the create path fills Name = GenerateName + a random suffix
	// (GenerateObjectName), retrying on the rare collision. Ignored once Name is set. A plain prefix string
	// (a trailing '-' is idiomatic and allowed — the generated Name is what must be a valid label).
	GenerateName  string            `` /* 170-byte string literal not displayed */
	Namespace     NamespaceName     `json:"namespace,omitempty" doc:"The namespace the object belongs to. A cluster-scoped kind has none."`
	ResourceGroup ResourceGroupName `json:"resourceGroup,omitempty" doc:"The resource group the object belongs to, within its namespace."`
	Tags          Tags              `json:"tags,omitempty" doc:"Labels on the object, as keys and values."`
	UID           UID               `json:"uid,omitempty" doc:"The object's unique ID, which funcd sets when it creates the object."`
	Generation    int64             `json:"generation,omitempty" doc:"Set by funcd: 1 when the object is created, then one more each time its spec changes."`
	// ResourceVersion is opaque: "<timeline>-<n>", or a plain "<n>" on an object written before timelines
	// (ADR-0202). Compare it for equality only; a version minted by another store or before a restore
	// matches none this store holds.
	ResourceVersion string           `` /* 197-byte string literal not displayed */
	CreationTime    Timestamp        `json:"creationTimestamp,omitzero" doc:"When funcd created the object."`
	DeletionTime    *Timestamp       `json:"deletionTimestamp,omitempty" doc:"funcd does not set it."`
	OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" doc:"The objects that own this one. funcd deletes an owned object when its owner goes."`
	Finalizers      []string         `json:"finalizers,omitempty" doc:"funcd does not read it."`
}

ObjectMeta is the shared metadata embedded by every resource kind. resourceGroup is required for namespaced kinds (F22); tags are optional. Carrier bookkeeping fields (UID, Generation, ResourceVersion, …) are set by the store; their lifecycle semantics are owned by the store/controller ADRs.

func (*ObjectMeta) GetGeneration

func (m *ObjectMeta) GetGeneration() int64

GetGeneration returns the current generation.

func (*ObjectMeta) GetName

func (m *ObjectMeta) GetName() ObjectName

GetName returns the resource name.

func (*ObjectMeta) GetNamespace

func (m *ObjectMeta) GetNamespace() NamespaceName

GetNamespace returns the namespace (empty for cluster-scoped kinds).

func (*ObjectMeta) GetObjectMeta

func (m *ObjectMeta) GetObjectMeta() *ObjectMeta

GetObjectMeta returns the ObjectMeta pointer for generic store/admission stamping.

func (*ObjectMeta) GetResourceGroup

func (m *ObjectMeta) GetResourceGroup() ResourceGroupName

GetResourceGroup returns the resource group.

func (*ObjectMeta) Validate

func (m *ObjectMeta) Validate(k Kind) error

Validate checks the ObjectMeta against envelope rules. Scope is derived from k.Namespaced() — the kind is the single source of scope.

type ObjectName

type ObjectName string

ObjectName is a DNS-1123-label-qualified resource name.

func AppConfigMapName added in v0.10.0

func AppConfigMapName(name ObjectName, spec ConfigMapSpec) ObjectName

AppConfigMapName is the stored name of a configMaps entry the App defines (ADR-0213 Decision 2): "<name>-" and 10 hex characters, the first 5 bytes of SHA-256 over json.Marshal(spec), which writes the data keys sorted, so the name follows the data alone.

func AppRevisionName added in v0.9.0

func AppRevisionName(app ObjectName, n int64) ObjectName

AppRevisionName is the name of the App's AppRevision number n: <app>-<n>.

func BackupSlotName added in v0.11.0

func BackupSlotName(schedule ObjectName, slot time.Time) ObjectName

BackupSlotName is the Backup a schedule creates for slot: <schedule>-<slot in Unix minutes> (Decision 3).

func GenerateObjectName

func GenerateObjectName(prefix string) ObjectName

GenerateObjectName builds a unique object name from a prefix: the prefix (truncated so the whole name stays within the 63-char DNS-1123 label limit) followed by a random 8-hex-char suffix. It is the single name-generation convention for server-side ObjectMeta.GenerateName and the Sensor's WorkflowRun names.

func RestoreExportName added in v0.11.0

func RestoreExportName(restore ObjectName) ObjectName

RestoreExportName is the Backup an in-place Restore runs first: <restore>-before (Decision 7).

func StepFunctionName added in v0.6.1

func StepFunctionName(workflow, step ObjectName) ObjectName

StepFunctionName is the name of the Function an image step materializes into: <workflow>-<step> (ADR-0094).

func (ObjectName) Schema

func (ObjectName) Schema(huma.Registry) *huma.Schema

Schema makes ObjectName carry its DNS-1123 constraint into the generated OpenAPI (huma SchemaProvider) — the same pattern Validate() enforces. Every field typed ObjectName inherits it.

func (ObjectName) Validate

func (n ObjectName) Validate() error

Validate checks the ObjectName against DNS-label rules.

type ObjectRef

type ObjectRef struct {
	Kind      Kind          `json:"kind" doc:"The kind of the object it names."`
	Namespace NamespaceName `json:"namespace,omitempty" doc:"The namespace of the object it names."`
	Name      ObjectName    `json:"name" doc:"The name of the object it names."`
}

ObjectRef addresses an object within the single v1alpha1 group/version. Cross-version refs (the v1 graduation) would add an apiVersion field.

type OwnerReference

type OwnerReference struct {
	ObjectRef          `json:",inline"`
	UID                UID  `json:"uid" doc:"The owner's unique ID."`
	Controller         bool `json:"controller,omitempty" doc:"Whether this owner is the one that manages the object."`
	BlockOwnerDeletion bool `json:"blockOwnerDeletion,omitempty" doc:"funcd does not read it."`
}

OwnerReference establishes a parent-child relationship between resources.

func ControllerOf added in v0.4.0

func ControllerOf(refs []OwnerReference) (OwnerReference, bool)

ControllerOf returns the controller OwnerReference of refs, the first one marked Controller.

type PathType

type PathType string

PathType selects exact vs segment-prefix matching.

const (
	PathTypePrefix PathType = "Prefix"
	PathTypeExact  PathType = "Exact"
)

func (PathType) Schema

func (PathType) Schema(huma.Registry) *huma.Schema

Schema renders the huma enum for PathType (empty is accepted and defaults to Prefix).

type Phase

type Phase string

Phase represents the lifecycle phase of a resource per the blueprint resource state machine. Reconciled by ADR-0003 from the ADR-0002 scaffold placeholders.

const (
	PhasePending     Phase = "Pending"
	PhaseDeploying   Phase = "Deploying"
	PhaseReady       Phase = "Ready"
	PhaseIdle        Phase = "Idle"
	PhaseDegraded    Phase = "Degraded"
	PhaseFailed      Phase = "Failed"
	PhaseTerminating Phase = "Terminating"
)

func (Phase) IsTerminal

func (p Phase) IsTerminal() bool

IsTerminal reports whether the phase is terminal (no further transitions expected). Only PhaseTerminating is terminal — it is the sole state with no live successor.

func (Phase) Schema

func (Phase) Schema(huma.Registry) *huma.Schema

Schema carries Phase's enum constraint into the generated OpenAPI (huma SchemaProvider) — the same closed set Validate() enforces, declared once from the Phase consts.

func (Phase) String

func (p Phase) String() string

String returns the string representation of the Phase.

func (Phase) Validate

func (p Phase) Validate() error

Validate checks that the Phase is a known value.

type PlanAction added in v0.10.0

type PlanAction string

PlanAction is what the rollout does to a part (ADR-0220).

const (
	PlanCreate PlanAction = "create"
	PlanUpdate PlanAction = "update"
	PlanPrune  PlanAction = "prune"
)

The actions of a plan's part.

func (PlanAction) Schema added in v0.10.0

func (PlanAction) Schema(huma.Registry) *huma.Schema

Schema carries PlanAction's enum into the generated OpenAPI (ADR-0048).

type PlanPart added in v0.10.0

type PlanPart struct {
	Kind   Kind       `json:"kind" doc:"The object's kind."`
	Name   ObjectName `json:"name" doc:"The object's name; for a defined ConfigMap, its stored name."`
	Action PlanAction `` /* 137-byte string literal not displayed */
	Reason string     `` /* 200-byte string literal not displayed */
}

PlanPart is one line of a plan: a part and its action, or the part where a pass would stop and the reason (ChildNotOwned, SecretNotFound or SecretKeyMissing); a Secret stop has no action.

type Policy

type Policy struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       PolicySpec `json:"spec"`
}

Policy is a namespaced authorization resource (ADR-0074): its spec is Cedar policy text (one or more permit/forbid statements) the cedar driver (internal/auth/cedar) compiles into the PDP's PolicySet. It is how an operator grants a function fine-grained resource access — e.g. permit a Function to kv::read a KVStore. Reads are DEFAULT-DENY: with no permitting Policy, a kv::read is Forbidden; owner-write is a built-in rule (not a user Policy). Structural Validate checks the envelope + that the text is non-empty; the Cedar parse + curated-schema check is the policy-validity admission (ADR-0063), which the driver relies on so a stored Policy compiles.

func (*Policy) GroupVersionKind

func (p *Policy) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for Policy.

func (*Policy) Validate

func (p *Policy) Validate() error

Validate performs envelope validation via the shared validateMeta helper, then the one structural rule JSON Schema can't express: spec.cedar is non-empty. The Cedar parse + curated-schema check is the policy-validity admission (ADR-0074), not structural Validate.

type PolicySpec

type PolicySpec struct {
	// Cedar is one or more Cedar permit/forbid statements (validated by the policy-validity admission
	// against the curated action/entity schema — kv::read/kv::write; Function/KVStore/KVTable).
	Cedar string `` /* 525-byte string literal not displayed */
}

PolicySpec is the desired state of a Policy (ADR-0074): the Cedar policy text.

type Pooling

type Pooling struct {
	// Worker is an owner-chosen worker id. Empty ⇒ solo (own worker). Functions sharing
	// (namespace, runtime, Worker) co-locate as handlers in one worker_threads pool worker.
	Worker string `` /* 535-byte string literal not displayed */
}

Pooling is the per-function pooling opt-in (ADR-0046, F28). Named "Pooling" (not "Placement") to stay clear of scheduler.Placement (node selection, ADR-0017): pooling answers which shared worker within a node a function joins.

type PoolingMode

type PoolingMode string

PoolingMode selects shared-pool vs isolated-container materialization.

const (
	// PoolingShared co-locates same-runtime image steps in one worker pool (default).
	PoolingShared PoolingMode = "shared"
	// PoolingIsolated gives each step its own solo worker/container.
	PoolingIsolated PoolingMode = "isolated"
)

func (PoolingMode) Schema

func (PoolingMode) Schema(huma.Registry) *huma.Schema

Schema carries PoolingMode's enum into the generated OpenAPI (ADR-0048).

type PrefixOwner added in v0.28.0

type PrefixOwner struct {
	Kind Kind       `` /* 132-byte string literal not displayed */
	Name ObjectName `` /* 170-byte string literal not displayed */
}

PrefixOwner is a Bucket prefix's single writer, named with its kind (ADR-0275): a Function and a Lake may share a name (ADR-0152), so the name alone does not say which writes.

func FunctionOwner added in v0.28.0

func FunctionOwner(name ObjectName) PrefixOwner

FunctionOwner names Function name as a prefix's owner.

func LakeOwner added in v0.28.0

func LakeOwner(name ObjectName) PrefixOwner

LakeOwner names Lake name as a prefix's owner.

func (PrefixOwner) IsZero added in v0.28.0

func (o PrefixOwner) IsZero() bool

IsZero reports whether no owner is set.

type PrincipalKind

type PrincipalKind string

PrincipalKind is the kind of a principal a role is assigned to.

const (
	// PrincipalKindFunction is a Function's system-assigned identity.
	PrincipalKindFunction PrincipalKind = "Function"
	// PrincipalKindIdentity is a user-assigned managed Identity (ADR-0135).
	PrincipalKindIdentity PrincipalKind = "Identity"
)

type PrincipalObject

type PrincipalObject interface {
	// contains filtered or unexported methods
}

PrincipalObject is a resolved principal-backing object for the cedar capability registry (ADR-0116): a *Function or a *Lake whose declared bindings (spec.bindings.kv/links/blob) are materialized onto the Cedar principal. It is a CLOSED interface — its marker method is unexported, so only types in this package implement it, which lets the registry's Bind funcs type-switch on it without any.

type PrincipalRef

type PrincipalRef struct {
	Kind PrincipalKind `json:"kind" enum:"Function,Identity" doc:"The kind of the principal: a Function, or an Identity for a caller outside funcd."`
	Name ObjectName    `json:"name" doc:"The principal's name, in the RolesAssignment's namespace. funcd does not check that it exists."`
}

PrincipalRef names the grantee: a typed {kind, name}. This is the "principal side is no longer Function-only" generalization (ADR-0135/0136).

type ReplaySeed

type ReplaySeed struct {
	// Run is the source run to replay (same namespace).
	Run ObjectName `` /* 134-byte string literal not displayed */
	// From is the step to re-run from; `from` and its descendants re-execute, upstream steps are reused.
	From ObjectName `` /* 278-byte string literal not displayed */
	// AllowDrift opts into re-running steps whose resolved artifact digest moved since the source run
	// (a re-materialized workflow) — "same data, current code". Default false ⇒ drift is rejected.
	AllowDrift bool `` /* 246-byte string literal not displayed */
}

ReplaySeed re-runs a finished source run from a chosen step (ADR-0107, F71): a new run seeded from the source's recorded checkpoint. Set by `funcdctl workflow replay`; observed by the run reconciler.

type ResourceGroup

type ResourceGroup struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       ResourceGroupSpec   `json:"spec"`
	Status     ResourceGroupStatus `json:"status,omitempty"`
}

ResourceGroup is a namespaced resource for logical grouping of resources. Status-bearing.

func (*ResourceGroup) GetStatus

func (rg *ResourceGroup) GetStatus() *Status

GetStatus returns the shared Status pointer, implementing StatusObject.

func (*ResourceGroup) GroupVersionKind

func (rg *ResourceGroup) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for ResourceGroup.

func (*ResourceGroup) Validate

func (rg *ResourceGroup) Validate() error

Validate performs envelope validation via the shared validateMeta helper.

type ResourceGroupName

type ResourceGroupName string

ResourceGroupName is a DNS-1123-label-qualified resource group identifier.

func (ResourceGroupName) Schema

Schema carries ResourceGroupName's DNS-1123 constraint into the generated OpenAPI.

func (ResourceGroupName) Validate

func (n ResourceGroupName) Validate() error

Validate checks the ResourceGroupName against DNS-label rules.

type ResourceGroupSpec

type ResourceGroupSpec struct {
	Description string `json:"description,omitempty" doc:"Free text about the group; funcd does not read it."`
}

ResourceGroupSpec holds the desired state. Behavioral fields (cascade-delete behavior) owned by controller ADR (F08).

type ResourceGroupStatus

type ResourceGroupStatus struct {
	Status `json:",inline"`
}

ResourceGroupStatus holds the observed state.

type ResourceSpec

type ResourceSpec struct {
	// CPU is a number of cores, at least MinCPU (e.g. "0.5" or "2").
	CPU string `` /* 258-byte string literal not displayed */
	// Memory is a size in ByteSize's grammar (ADR-0266), e.g. "256Mi" or "4GiB".
	Memory string `` /* 370-byte string literal not displayed */
}

ResourceSpec sizes one worker (ADR-0291): a solo Function's, or the engine of a Lake or a SQLDatabase. Validate is its one check and runtime.LimitsFrom its one mapping onto the worker's limits, which the runtime driver enforces.

func (ResourceSpec) Validate added in v0.33.0

func (r ResourceSpec) Validate(op, path string) error

Validate refuses a cpu that is not a finite number of cores of at least MinCPU, or a memory that is not a positive ByteSize (ADR-0291 Decision 2); path names the field in the error.

type Restore added in v0.11.0

type Restore struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       RestoreSpec   `json:"spec"`
	Status     RestoreStatus `json:"status,omitempty"`
}

Restore is a namespaced, status-bearing request (ADR-0222 Decision 7): load members of a Succeeded Backup into empty stores, or in place. Its spec is immutable.

func (*Restore) Ended added in v0.11.0

func (r *Restore) Ended() bool

Ended reports a Restore Succeeded or Failed (Interrupted included); one not ended is Pending or Running.

func (*Restore) GetStatus added in v0.11.0

func (r *Restore) GetStatus() *Status

GetStatus returns the shared Status pointer, implementing StatusObject. Its Phase is unused: RestoreStatus.Phase shadows it.

func (*Restore) GroupVersionKind added in v0.11.0

func (r *Restore) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for Restore.

func (*Restore) InPlace added in v0.11.0

func (r *Restore) InPlace() bool

InPlace reports a member restored in place, which needs update on the Namespace (Decision 10).

func (*Restore) Validate added in v0.11.0

func (r *Restore) Validate() error

Validate enforces Decision 7's shape: a name of at most 56 characters, the Backup and the two Secrets named, and each member a KVStore, Bucket, Lake, SQLDatabase or Function volume, once, with exactly one target of its kind.

type RestoreMember added in v0.11.0

type RestoreMember struct {
	Kind       Kind          `` /* 156-byte string literal not displayed */
	Name       ObjectName    `` /* 201-byte string literal not displayed */
	As         ObjectName    `` /* 359-byte string literal not displayed */
	AsLocation *LakeLocation `` /* 300-byte string literal not displayed */
	InPlace    bool          `` /* 581-byte string literal not displayed */
	// Volume, with Kind Function, makes the member that Function's local volume; as names another Function whose
	// empty volume of that name receives it (ADR-0262 Decision 11).
	Volume ObjectName `` /* 152-byte string literal not displayed */
}

RestoreMember is one member of the Backup and exactly one target: as (an empty KVStore, Bucket or SQLDatabase, or the empty volume of another Function), asLocation (an empty bucket prefix where no Lake is located, for a Lake) or inPlace. A Bucket's member acts only outside the prefixes of the Lakes on its destination, so restoring a Lake takes naming that Lake too (ADR-0312).

type RestoreSource added in v0.11.0

type RestoreSource struct {
	CredentialsSecret ObjectName `` /* 237-byte string literal not displayed */
	IdentitySecret    ObjectName `` /* 257-byte string literal not displayed */
}

RestoreSource is the Secret of the read credential (get and list) and the Secret holding AGE_IDENTITY.

type RestoreSpec added in v0.11.0

type RestoreSpec struct {
	Backup  ObjectName      `` /* 184-byte string literal not displayed */
	Source  RestoreSource   `json:"source" doc:"The Secrets that read the Backup's copy and open its seal."`
	Members []RestoreMember `` /* 286-byte string literal not displayed */
}

RestoreSpec names the Backup, the Secrets that read and open it, and each member's target.

type RestoreStatus added in v0.11.0

type RestoreStatus struct {
	Status         `json:",inline"`
	Phase          RunPhase   `` /* 256-byte string literal not displayed */
	StartTime      *Timestamp `json:"startTime,omitempty" doc:"When the Restore turned Running, once its Backup and any export had Succeeded."`
	CompletionTime *Timestamp `json:"completionTime,omitempty" doc:"When the Restore ended, Succeeded or Failed."`
	Export         ObjectName `` /* 175-byte string literal not displayed */
}

RestoreStatus is the request's run: its phase, times and, in place, the export Backup.

type Revision

type Revision struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       RevisionSpec   `json:"spec"`
	Status     RevisionStatus `json:"status,omitempty"`
}

Revision is a namespaced, immutable snapshot of a Function at a point in time. Status-bearing. Behavioral fields (frozen snapshot payload) owned by F13.

func (*Revision) GetStatus

func (r *Revision) GetStatus() *Status

GetStatus returns the shared Status pointer, implementing StatusObject.

func (*Revision) GroupVersionKind

func (r *Revision) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for Revision.

func (*Revision) Validate

func (r *Revision) Validate() error

Validate performs envelope validation via the shared validateMeta helper.

type RevisionID

type RevisionID string

RevisionID is a unique identifier for a function revision.

func (RevisionID) Validate

func (r RevisionID) Validate() error

Validate checks that the RevisionID is non-empty.

type RevisionPin added in v0.7.0

type RevisionPin struct {
	Function    ObjectName `json:"function" doc:"The name of a Function the run's steps call."`
	FunctionUID UID        `` /* 158-byte string literal not displayed */
	Revision    ObjectName `json:"revision" doc:"The Revision the run calls: the Function's current revision when the run started."`
	ImageDigest string     `json:"imageDigest,omitempty" doc:"The digest of that Revision's image; empty for a file:// artifact, which has none."` // empty only for a file:// artifact
}

RevisionPin binds a run to one step Function revision (ADR-0190).

type RevisionSpec

type RevisionSpec struct {
	Function    ObjectRef   `json:"function" doc:"The Function whose spec this Revision snapshots."`
	Number      int64       `json:"number" minimum:"1" doc:"The generation of the Function's spec that this Revision snapshots."`
	Runtime     RuntimeName `` /* 136-byte string literal not displayed */
	Handler     string      `` /* 172-byte string literal not displayed */
	Image       string      `` /* 133-byte string literal not displayed */
	ImageDigest string      `` /* 272-byte string literal not displayed */
}

RevisionSpec holds the immutable identity + frozen snapshot of a revision. Number is the revision sequence number. The Runtime/Handler/Image snapshot (F13/ADR-0020, flattened by ADR-0097) pins "what was validated ships" — immutable once stamped.

type RevisionStatus

type RevisionStatus struct {
	Status `json:",inline"`
}

RevisionStatus holds the observed state.

type Role

type Role struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       RoleSpec `json:"spec"`
}

Role is a named, reusable permission set (ADR-0136, FEAT-0008/F101): a set of funcd data-plane action strings a RolesAssignment grants to a principal at a scope. Custom roles complement the fixed built-in lake (Blob Data Reader/Writer, KV Data Reader/Writer, Function Invoker, Reader/Contributor/Owner). A pure value-type (no status), like Grant — the PDP compiles it, the reconciler does not touch it.

func (*Role) GroupVersionKind

func (r *Role) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for Role.

func (*Role) Validate

func (r *Role) Validate() error

Validate performs envelope + structural validation: at least one action.

type RoleRef

type RoleRef struct {
	Kind RoleRefKind `` /* 167-byte string literal not displayed */
	Name string      `` /* 338-byte string literal not displayed */
}

RoleRef names the role: a built-in name or a custom Role.

type RoleRefKind

type RoleRefKind string

RoleRefKind selects a built-in role by name or a custom Role resource.

const (
	// RoleRefKindBuiltin references a built-in role by name (e.g. "Blob Data Writer").
	RoleRefKindBuiltin RoleRefKind = "BuiltinRole"
	// RoleRefKindRole references a custom Role resource by name.
	RoleRefKindRole RoleRefKind = "Role"
)

type RoleSpec

type RoleSpec struct {
	Actions []string `` /* 158-byte string literal not displayed */
}

RoleSpec is the action set. Actions are funcd data-plane action strings ("s3::read", "s3::write", "kv::read", "kv::write", "link::invoke") — kept as strings so api/types imports no internal package.

type RolesAssignment

type RolesAssignment struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       RolesAssignmentSpec `json:"spec"`
}

RolesAssignment grants MANY roles in one object (ADR-0136, FEAT-0008/F101): each entry is a (principal, role, scope) triple with optional top-level principal/scope defaults — no per-role sprawl. A pure value-type (no status): the PDP compiles read/query/invoke entries to Cedar permits and the write entries to the single-writer `writers` set.

func (*RolesAssignment) GroupVersionKind

func (ra *RolesAssignment) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for RolesAssignment.

func (*RolesAssignment) Validate

func (ra *RolesAssignment) Validate() error

Validate performs envelope + structural validation: every entry resolves a principal + role + scope (own or default), with valid kinds.

type RolesAssignmentSpec

type RolesAssignmentSpec struct {
	Principal   *PrincipalRef     `json:"principal,omitempty" doc:"The principal of each entry that sets none."`
	Scope       *ScopeRef         `json:"scope,omitempty" doc:"The scope of each entry that sets none."`
	Assignments []AssignmentEntry `` /* 209-byte string literal not displayed */
}

RolesAssignmentSpec carries the default principal/scope + the assignment entries.

type Route

type Route struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       RouteSpec   `json:"spec"`
	Status     RouteStatus `json:"status,omitempty"`
}

Route is a namespaced resource that declares the edge exposure of one or more Functions (ADR-0110, F79): which Functions are reachable at the edge (host/path → Function) and — via the per-route policy fields added by F74–F78 — how. Status-bearing; Ready once every rule's backend Function exists and the route is programmed into the edge router.

func (*Route) GetStatus

func (r *Route) GetStatus() *Status

GetStatus returns the shared Status pointer, implementing StatusObject.

func (*Route) GroupVersionKind

func (r *Route) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for Route.

func (*Route) Validate

func (r *Route) Validate() error

Validate performs envelope + semantic validation. It is namespace-agnostic: the host-required-in-explicit and cross-namespace (host,path,method) collision rules depend on the namespace mode and the full Route set, so the reconciler enforces those (→ NotReady), not here.

type RouteAuth

type RouteAuth struct {
	Mode AuthMode `` /* 362-byte string literal not displayed */
}

RouteAuth is the F77 auth stance on a Route.

type RouteBackend

type RouteBackend struct {
	// Function is the target Function in this Route's namespace. Optional since F82: a static-only
	// rule sets no function (the `omitempty` reflects the union — exactly one arm is set).
	Function ObjectName `` /* 235-byte string literal not displayed */
	// Static serves a Bucket-prefix static site directly through the edge (F82); nil ⇒ a function backend.
	Static *StaticBackend `` /* 149-byte string literal not displayed */
	// Site serves the current build of the named Site in this Route's namespace (ADR-0242).
	Site ObjectName `` /* 238-byte string literal not displayed */
}

RouteBackend is an exactly-one-of union (ADR-0120, F82, ADR-0242): a Function backend (the activator hop), a Static backend (a Bucket prefix served directly through the edge) or a Site backend (the Site's current build). Validate enforces the one-of. Routes are never shared across namespaces (blueprint.md:467).

type RouteRule

type RouteRule struct {
	Path string `` // must begin "/"
	/* 205-byte string literal not displayed */
	PathType PathType `` // Exact | Prefix (default Prefix)
	/* 299-byte string literal not displayed */
	Methods []HTTPMethod `json:"methods,omitempty" doc:"The request methods the rule matches; empty matches every method."` // empty ⇒ all methods
	Backend RouteBackend `json:"backend" doc:"What the rule serves: set exactly one of function, static and site."`
	// Auth is this rule's stance; nil is the Route's spec.auth (ADR-0241 Decision 8).
	Auth *RouteAuth `` /* 161-byte string literal not displayed */
}

RouteRule matches a path (+ optional methods) and names the backend Function.

type RouteSpec

type RouteSpec struct {
	// Host is an exact host match. "" is the namespace host <namespace>.<baseDomain>, or for default any host but
	// reserved ones (ADR-0240); an `explicit` default requires a non-empty Host (ADR-0110).
	Host string `` /* 715-byte string literal not displayed */
	// Rules lists the path rules, matched longest-prefix-first. At least one is required.
	Rules []RouteRule `` /* 295-byte string literal not displayed */
	// Auth is the edge authentication stance for this Route's rules (ADR-0113, F77); a rule's own auth beats it, and
	// nil inherits the namespace default, else open (ADR-0241 Decision 8).
	Auth *RouteAuth `` /* 141-byte string literal not displayed */
	// Enabled, false, keeps the Route Disabled: it serves and claims nothing. Unset is true, except for a Route a
	// Site or a Function owns in an explicit namespace (ADR-0241 Decision 6).
	Enabled *bool `` /* 245-byte string literal not displayed */
}

RouteSpec is the declarative edge exposure. V1 carries matching + backend + the F77 auth stance; the remaining policy fields (tls/limits/observability/cors) are added by F74/F75/F76/F78.

type RouteStatus

type RouteStatus struct {
	Status `json:",inline"`
	// Host is the host the Route claims: spec.host, else its namespace host, else "" (any host but reserved ones)
	// (ADR-0240).
	Host string `` /* 277-byte string literal not displayed */
}

RouteStatus holds the observed state (Ready / NotReady with reason BackendNotFound | BucketNotFound | SiteNotFound | SiteNotReady | Disabled | HostRequired | HostReserved | RouteConflict, set by the reconciler).

type RunPhase added in v0.6.1

type RunPhase string

RunPhase is a run's execution phase (ADR-0094): Pending → Running ⇄ Paused → Succeeded | Failed | Cancelled.

const (
	RunPending   RunPhase = "Pending"
	RunRunning   RunPhase = "Running"
	RunPaused    RunPhase = "Paused"
	RunSucceeded RunPhase = "Succeeded"
	RunFailed    RunPhase = "Failed"
	RunCancelled RunPhase = "Cancelled"
)

func (RunPhase) Schema added in v0.6.1

func (RunPhase) Schema(huma.Registry) *huma.Schema

Schema carries RunPhase's enum into the generated OpenAPI (ADR-0048).

type RunStepStatus

type RunStepStatus struct {
	Name     ObjectName `json:"name" doc:"The step's name."`
	Phase    StepPhase  `` /* 218-byte string literal not displayed */
	Attempts int        `` /* 160-byte string literal not displayed */
	Revision string     `` /* 190-byte string literal not displayed */
	// StartedAt/EndedAt (ADR-0196) give the step duration; Error is the raw step-level failure
	// cause, capped — the full text lives in the step's span + logs (ADR-0106) — on a Failed step, or
	// the cancel on a step that was running when the run was cancelled (ADR-0146).
	StartedAt Timestamp `json:"startedAt,omitzero" doc:"When the step started running."`
	EndedAt   Timestamp `json:"endedAt,omitzero" doc:"When the step succeeded, failed or was cancelled while running."`
	Error     string    `` /* 136-byte string literal not displayed */
}

RunStepStatus is one step's coarse execution state, including the ADR-0100 troubleshooting facts (timings → duration, populated attempt count, and the capped step-level failure cause).

type RuntimeClass

type RuntimeClass struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       RuntimeClassSpec   `json:"spec"`
	Status     RuntimeClassStatus `json:"status,omitempty"`
}

RuntimeClass is a cluster-scoped resource defining a function runtime environment. Status-bearing. Behavioral fields (flavor params) owned by F12.

func (*RuntimeClass) GetStatus

func (rc *RuntimeClass) GetStatus() *Status

GetStatus returns the shared Status pointer, implementing StatusObject.

func (*RuntimeClass) GroupVersionKind

func (rc *RuntimeClass) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for RuntimeClass.

func (*RuntimeClass) Validate

func (rc *RuntimeClass) Validate() error

Validate performs envelope validation via the shared validateMeta helper.

type RuntimeClassSpec

type RuntimeClassSpec struct {
	Handler string `json:"handler,omitempty" pattern:"^[A-Za-z_][A-Za-z0-9_.]*$"`
}

RuntimeClassSpec holds the desired state. Behavioral fields owned by F12.

type RuntimeClassStatus

type RuntimeClassStatus struct {
	Status `json:",inline"`
}

RuntimeClassStatus holds the observed state.

type RuntimeName

type RuntimeName string

RuntimeName is a DNS-label-qualified RuntimeClass name reference (FunctionSpec.Runtime, RevisionSpec.Runtime) — ADR-0048. Typed so its DNS-1123 constraint reaches both the generated OpenAPI (Schema) and the admission check (Validate) from one declaration.

func (RuntimeName) IsNode added in v0.14.0

func (n RuntimeName) IsNode() bool

IsNode reports whether n is a node-family runtime (e.g. "nodejs22"): the only family the default shim and pool host serve (ADR-0149 Decision 1), and the only one that serves HTTP (ADR-0243).

func (RuntimeName) Schema

func (RuntimeName) Schema(huma.Registry) *huma.Schema

Schema carries RuntimeName's DNS-1123 constraint into the generated OpenAPI.

func (RuntimeName) Validate

func (n RuntimeName) Validate() error

Validate checks the RuntimeName is non-empty and a valid DNS label.

type SQLChangeType added in v0.13.0

type SQLChangeType string

SQLChangeType is a row change (ADR-0235).

const (
	SQLInsert SQLChangeType = "Insert"
	SQLUpdate SQLChangeType = "Update"
	SQLDelete SQLChangeType = "Delete"
)

The row changes a SQL event fires on.

type SQLDatabase added in v0.13.0

type SQLDatabase struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       SQLDatabaseSpec   `json:"spec"`
	Status     SQLDatabaseStatus `json:"status,omitempty"`
}

SQLDatabase is a SQL database served by its own rqlite engine (ADR-0232, FEAT-0011/F128): the SQL reconciler runs one engine container per database through the add-on runtime, with a durable host directory (ADR-0231), and reports it Ready once the engine answers its readiness probe.

func (*SQLDatabase) GetStatus added in v0.13.0

func (d *SQLDatabase) GetStatus() *Status

GetStatus returns the shared Status pointer, implementing StatusObject, so an App judges its database's Ready (ADR-0236 Decision 3).

func (*SQLDatabase) GroupVersionKind added in v0.13.0

func (d *SQLDatabase) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for SQLDatabase.

func (*SQLDatabase) Validate added in v0.13.0

func (d *SQLDatabase) Validate() error

Validate performs envelope validation, then refuses a cpu or memory value the runtime cannot parse, so a bound is never silently ignored (ADR-0232 Decision 1).

type SQLDatabaseEntry added in v0.15.0

type SQLDatabaseEntry struct {
	Name ObjectName `json:"name,omitempty"`
	Ref  ObjectName `json:"ref,omitempty"`
	// Deletion is retain (or empty, the default: the database and its data outlive the App) or delete.
	Deletion        DeletionPolicy `json:"deletion,omitempty"`
	SQLDatabaseSpec `json:",inline"`
}

SQLDatabaseEntry is a sql entry: a SQLDatabase a resource declares by name at its root, or only the ref of an existing one (ADR-0236, ADR-0248).

func (SQLDatabaseEntry) MarshalJSON added in v0.15.0

func (e SQLDatabaseEntry) MarshalJSON() ([]byte, error)

MarshalJSON writes a ref entry as its ref alone (see marshalEntry).

func (SQLDatabaseEntry) Schema added in v0.15.0

Schema is SQLDatabaseSpec's schema plus name, ref and deletion (see entrySchema).

type SQLDatabaseSpec added in v0.13.0

type SQLDatabaseSpec struct {
	Resources ResourceSpec `` /* 180-byte string literal not displayed */
	Owner     ObjectName   `` /* 309-byte string literal not displayed */
	// Quota caps the database's total size (ADR-0292).
	Quota SizeQuota `` /* 222-byte string literal not displayed */
}

SQLDatabaseSpec is the desired state of a SQLDatabase: the engine's cpu and memory bounds and the Function that may write (ADR-0233). An empty memory bound means the reconciler's default (256Mi); the spec is not rewritten.

type SQLDatabaseStatus added in v0.13.0

type SQLDatabaseStatus struct {
	Status   `json:",inline"`
	Bindings int `json:"bindings,omitempty" doc:"The number of Functions whose spec.bindings.sql names the database."`
}

SQLDatabaseStatus is the observed state of a SQLDatabase. Bindings counts the Functions that bind it.

type SQLEvent added in v0.13.0

type SQLEvent struct {
	Name  ObjectName      `` /* 148-byte string literal not displayed */
	Table string          `json:"table" doc:"The table whose row changes fire the event, matched by its exact name, case included."`
	On    []SQLChangeType `json:"on,omitempty" doc:"The row changes that fire the event: Insert, Update or Delete. Empty means all three."`
}

SQLEvent is one named row-change event: a table and the changes it fires on (empty ⇒ all three, by Normalize).

type SQLSource added in v0.13.0

type SQLSource struct {
	Database ObjectName ``                                                                                                   /* 164-byte string literal not displayed */
	Events   []SQLEvent `json:"events" doc:"The source's events: at least one, with unique names, each watching one table."` // ≥1; unique names
}

SQLSource hosts the sql kind's named events (ADR-0235).

type Scaling

type Scaling struct {
	MinReplicas int `` // 0 enables scale-to-zero
	/* 264-byte string literal not displayed */
	MaxReplicas int `` // recorded; 1→N enforcement is V3
	/* 206-byte string literal not displayed */
	IdleTimeout Duration `json:"idleTimeout,omitempty" doc:"The idle time before a worker is reclaimed: 0s to 24h; 0s or unset disables reclaim."`
}

Scaling is the F11 scale-to-zero policy on a Function (ADR-0016). Field validation (non-negative, MinReplicas ≤ MaxReplicas) is the API server's admission job (P-L/F07); the activator reads these defensively.

type SchemaView

type SchemaView struct {
	Type     string
	Props    map[string]string          // property name → primitive type
	Defaults map[string]json.RawMessage // property name → declared default, for the properties that have one
	Required []string
}

SchemaView is the F65-relevant subset of a JSON Schema: a type, typed top-level properties, their declared defaults (ADR-0095), and the required set. A void schema is type "null" (or empty/absent — nothing required).

func ParseSchemaView

func ParseSchemaView(raw json.RawMessage) SchemaView

ParseSchemaView reads the F65-relevant fields from a JSON Schema (tolerant: unknown keywords ignored).

func (SchemaView) IsVoid

func (s SchemaView) IsVoid() bool

IsVoid reports whether a schema declares no data (a null-typed or empty schema — ADR-0090 void).

type ScopeKind

type ScopeKind string

ScopeKind is the granularity a grant applies at.

const (
	// ScopeKindNamespace scopes a grant to every resource in a namespace (inherits down).
	ScopeKindNamespace ScopeKind = "Namespace"
	// ScopeKindBucketPrefix scopes a grant to one blob prefix ("<bucket>/<prefix>").
	ScopeKindBucketPrefix ScopeKind = "BucketPrefix"
	// ScopeKindKVStore scopes a grant to one KV store (or "<store>/<table>").
	ScopeKindKVStore ScopeKind = "KVStore"
	// ScopeKindLake scopes a grant to one lake serving layer ("<lake>") — ADR-0137, F102.
	ScopeKindLake ScopeKind = "Lake"
	// ScopeKindSQLDatabase scopes a grant to one SQL database ("<database>") — ADR-0233, F129.
	ScopeKindSQLDatabase ScopeKind = "SQLDatabase"
)

type ScopeRef

type ScopeRef struct {
	Kind ScopeKind `` /* 234-byte string literal not displayed */
	Name string    `` /* 283-byte string literal not displayed */
}

ScopeRef names the scope: a namespace, a bucket prefix, or a kv store. Name is the scope-relative name ("<bucket>/<prefix>" for BucketPrefix; the namespace is the assignment's own namespace).

type Secret

type Secret struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       SecretSpec `json:"spec"`
}

Secret is a namespaced, pure-data resource for sensitive configuration. Secret does NOT have status — it implements Object, not StatusObject.

func (*Secret) GroupVersionKind

func (s *Secret) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for Secret.

func (*Secret) Validate

func (s *Secret) Validate() error

Validate performs envelope validation, then the data-key rule JSON Schema can't express (ADR-0048): every data key is an env-var name. The `type` enum is schema-enforced at the edge.

type SecretDeclaration added in v0.15.0

type SecretDeclaration struct {
	Name        ObjectName `json:"name"`
	Description string     `json:"description,omitempty"`
	Keys        []string   `json:"keys"`
}

SecretDeclaration declares a Secret of the namespace that a resource or its parts name, and the keys they read (ADR-0213 Decision 6, ADR-0248 Decision 6). No resource ever holds, writes or owns the Secret.

func (SecretDeclaration) Schema added in v0.15.0

Schema is closed: name and at least one key, each an env-var name; description is free text (ADR-0213 Decision 6).

type SecretSpec

type SecretSpec struct {
	Type SecretType        `json:"type,omitempty" doc:"funcd does not read it."`
	Data map[string][]byte `` /* 361-byte string literal not displayed */
}

SecretSpec holds the secret data. SecretType is an open typed-string discriminator whose enumerated values are owned by the secrets ADR (F15).

type SecretType

type SecretType string

SecretType is an open typed-string discriminator for secret kinds. Enumerated values are defined by the secrets ADR (F15).

const (
	// SecretTypeOpaque is the default generic key/value secret (ADR-0022, F15).
	SecretTypeOpaque SecretType = "Opaque"
)

func (SecretType) Schema

func (SecretType) Schema(huma.Registry) *huma.Schema

Schema carries SecretType's enum constraint into the generated OpenAPI (ADR-0048).

type Sensor

type Sensor struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       SensorSpec   `json:"spec"`
	Status     SensorStatus `json:"status,omitempty"`
}

Sensor is the reusable event→action binder (ADR-0109, F69): it subscribes named event dependencies (`spec.on`, tuple-addressed `(source, event)`) and, on a firing, runs kind-keyed actions (`spec.do` — `workflow:` start a run · `function:` invoke), projecting the firing CloudEvent into the target's input. Namespaced, status-bearing. Shared by Functions and Workflows.

func (*Sensor) GetStatus

func (s *Sensor) GetStatus() *Status

GetStatus returns the shared Status pointer (the controller write-back seam).

func (*Sensor) GroupVersionKind

func (s *Sensor) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for Sensor.

func (*Sensor) Validate

func (s *Sensor) Validate() error

Validate enforces the wiring rules JSON Schema can't express (ADR-0109/ADR-0048): unique dependency and action names; each action bound to a declared dependency and exactly one action kind; DNS-1123 labels for source/event/workflow/function. (The `${{ }}` input parse+check is a reconcile-time step — it needs the F73 engine — not a Validate rule.)

type SensorSpec

type SensorSpec struct {
	// On lists the named event dependencies this Sensor subscribes to (≥1, unique names).
	On []Dependency `json:"on" doc:"The events the Sensor subscribes to, as named dependencies: at least one, with unique names."`
	// Do lists the named actions (≥1, unique names); each is bound to one dependency via On.
	Do []Action `` /* 370-byte string literal not displayed */
}

SensorSpec binds event dependencies to actions (ADR-0109).

type SensorStatus

type SensorStatus struct {
	Status `json:",inline"`
}

SensorStatus holds the observed state (Ready/NotReady with a reason).

type Service

type Service struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       ServiceSpec   `json:"spec"`
	Status     ServiceStatus `json:"status,omitempty"`
}

Service is a namespaced resource representing a platform service binding. Status-bearing. Behavioral spec fields (driver config, binding) owned by F14/F23.

func (*Service) GetStatus

func (s *Service) GetStatus() *Status

GetStatus returns the shared Status pointer, implementing StatusObject.

func (*Service) GroupVersionKind

func (s *Service) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for Service.

func (*Service) Validate

func (s *Service) Validate() error

Validate performs envelope validation, then the cross-field rules JSON Schema can't express (ADR-0048): the sub-spec present iff its discriminator matches, and the matching binding non-empty. The `type` enum and binding pattern are schema-enforced at the edge (not re-checked here).

type ServiceSpec

type ServiceSpec struct {
	Type ServiceType `json:"type,omitempty"`
	// KV is set when Type == ServiceTypeKV (ADR-0019, F14).
	KV *KVServiceSpec `json:"kv,omitempty"`
	// Blob is set when Type == ServiceTypeBlob (ADR-0021, F23).
	Blob *BlobServiceSpec `json:"blob,omitempty"`
}

ServiceSpec holds the desired state. Behavioral fields owned by F14/F23. ServiceType is an open typed-string discriminator; enumerated values owned by service ADRs.

type ServiceStatus

type ServiceStatus struct {
	Status `json:",inline"`
}

ServiceStatus holds the observed state.

type ServiceType

type ServiceType string

ServiceType is an open typed-string discriminator for service kinds. Enumerated values are defined by the service ADRs (F14, F23).

const (
	// ServiceTypeKV is the key/value service (ADR-0019, F14).
	ServiceTypeKV ServiceType = "kv"
	// ServiceTypeBlob is the blob storage service (ADR-0021, F23).
	ServiceTypeBlob ServiceType = "blob"
)

func (ServiceType) Schema

func (ServiceType) Schema(huma.Registry) *huma.Schema

Schema carries ServiceType's enum constraint into the generated OpenAPI (ADR-0048).

type Site

type Site struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       SiteSpec   `json:"spec"`
	Status     SiteStatus `json:"status,omitempty"`
}

Site is a namespaced, status-bearing static web deliverable (ADR-0139, F103): an immutable bundle materialized into a governed Bucket prefix and exposed at the edge, with its adjacent Bucket and Route declared inline and owned by it. Ready only once the bundle is materialized and its index is present, so a Site is never Ready over an empty prefix.

func (*Site) EffectivePath

func (s *Site) EffectivePath() string

EffectivePath is where the bundle is served (ADR-0140): spec.ingress.path, else "/" when spec.ingress.host is set, else "/site/<metadata.name>". It lives HERE, not in internal/site, because Validate must check it too and api/** cannot import internal/** — one definition, two callers.

func (*Site) GetStatus

func (s *Site) GetStatus() *Status

GetStatus returns the shared Status pointer, implementing StatusObject.

func (*Site) GroupVersionKind

func (s *Site) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for Site.

func (*Site) RuntimeConfigPath added in v0.14.0

func (s *Site) RuntimeConfigPath() string

RuntimeConfigPath is the edge path of the config.json that spec.runtimeConfig generates: under EffectivePath (ADR-0239), so it moves with the bundle.

func (*Site) RuntimeConfigPrefix added in v0.14.0

func (s *Site) RuntimeConfigPrefix() string

RuntimeConfigPrefix is the key prefix of a Site's generated config.json: <prefix>/_runtime/<site>/, one per Site so two Sites on one prefix never share it (ADR-0239). "_runtime" is never a digest slug, so Served never takes it for the bundle.

func (*Site) Served added in v0.14.0

func (s *Site) Served(rt *Route) (bundle, config *StaticBackend, ok bool)

Served returns the bundle backend the Site's own Route serves and its config.json backend (nil when the Site has none); ok is false when the Site does not control rt with its current UID or rt serves no build (ADR-0242 Decision 3). The bundle rule is found by its digest-scoped prefix <prefix>/<slug>/, never by its edge path, so it survives an ingress.path change (ADR-0140 Decision 5). One definition for the Site reconciler and the Route reconciler.

func (*Site) Validate

func (s *Site) Validate() error

Validate performs envelope + semantic validation: Image non-empty; the one buckets entry and the one bindings.blob entry naming it (validateBucket); Index a relative path (no leading '/'); ingress.path, when set, begins "/" and is "/" or carries no trailing slash, and the RESOLVED path (EffectivePath, derived or explicit) does not collide with an ingress rule — validating only the written field would let a derived collision reach the reconciler as an unmapped store error (ADR-0140); every ingress rule Path begins "/" and is neither "/" nor a duplicate; ingress.public together with ingress.auth.mode == authenticated is Invalid (the ADR-0120 §4 contradiction, caught here so the reconciler never writes a Route the store's Validate refuses). Cross-resource state (does the Bucket exist) is the RECONCILER's (→ NotReady), never Validate.

type SiteBindings added in v0.15.0

type SiteBindings struct {
	Blob []BlobRef `json:"blob" doc:"Exactly one entry: the Bucket and the prefix that hold the Site's bundles."` // exactly one
}

SiteBindings are a Site's bindings (ADR-0248 Decision 7): its served prefix, one alias-free entry.

type SiteIngress

type SiteIngress struct {
	Ingress `json:",inline"`
	// BaseHref makes the Site serve a copy of its index whose <base href> is its mount (ADR-0239 Decision 10).
	BaseHref bool `` /* 181-byte string literal not displayed */
	// Rules are additional bucket prefixes served alongside the app (the data the app fetches). A rule
	// MAY nest under Path (e.g. /bi/data under /bi) — longest-path-first gives the nested rule priority.
	Rules []SiteRule `` /* 267-byte string literal not displayed */
}

SiteIngress declares the Site-owned Route (ADR-0241): the shared Ingress, its path being where the bundle is served (EffectivePath, ADR-0140); a path change re-programs the Route with no re-upload, and the bundle must be built for the new base path unless BaseHref is set. Rules add sibling prefixes.

type SiteRule

type SiteRule struct {
	// Path is the edge path; must begin "/" and must not be "/" (that is the bundle's).
	Path string `` /* 272-byte string literal not displayed */
	// Bucket names a Bucket in this Site's namespace; "" ⇒ the Site's own Bucket.
	Bucket ObjectName `` /* 242-byte string literal not displayed */
	// Prefix is the Bucket sub-domain served at Path.
	Prefix string `` /* 202-byte string literal not displayed */
}

SiteRule serves one bucket prefix at an edge path. Never SPA: a miss is 404, not the app shell.

type SiteRuntimeConfig added in v0.14.0

type SiteRuntimeConfig struct {
	// Values are keys and their string values; a key here wins over the same key from ConfigMap.
	Values map[string]string `` /* 422-byte string literal not displayed */
	// ConfigMap names a ConfigMap of the Site's namespace whose data adds keys.
	ConfigMap ObjectName `` /* 378-byte string literal not displayed */
}

SiteRuntimeConfig holds the members of a Site's generated config.json (ADR-0239).

type SiteSpec

type SiteSpec struct {
	// Image is the site bundle OCI ref (oci-layout://<dir>[:<tag>] or a registry ref; a tag or a
	// digest). A tag is resolved to a digest once per spec generation — the author never types one.
	Image string `` /* 490-byte string literal not displayed */
	// Buckets declares exactly the one Bucket its bindings.blob names (ADR-0248 Decision 7): by name the Site creates
	// it with its served prefix and no owner, and refuses an existing one without its marker; by ref the served prefix
	// must exist without an owner, and the Site never edits the Bucket. deletion: delete is refused (ADR-0139).
	Buckets []BucketEntry `` /* 491-byte string literal not displayed */
	// Bindings names the served prefix: one alias-free {bucket, prefix}; objects land under <prefix>/<digest-slug>/.
	// The prefix is immutable after creation (the site-prefix-immutable admission).
	Bindings SiteBindings `json:"bindings,omitzero" doc:"Where the Site stores and serves its bundles: one Bucket prefix, in blob."`
	// Index is the document served for "/" / a directory / (when SPA) a miss. Default "index.html".
	Index string `` /* 332-byte string literal not displayed */
	// SPA serves Index (200) for an un-matched path under the bundle rule so a client-side router owns
	// routing. It NEVER applies to a data mount (Ingress.Rules), whose miss is always 404.
	SPA bool `` /* 224-byte string literal not displayed */
	// Ingress declares the Site-owned Route (named after the Site). Required in V1.
	Ingress SiteIngress `` /* 215-byte string literal not displayed */
	// RuntimeConfig makes the Site serve one generated config.json beside its bundle (ADR-0239). Not the function
	// runtime.
	RuntimeConfig *SiteRuntimeConfig `` /* 170-byte string literal not displayed */
}

SiteSpec is the desired state: which bundle, where it materializes, and how it is exposed.

func (SiteSpec) BucketEntry added in v0.15.0

func (s SiteSpec) BucketEntry() *BucketEntry

BucketEntry is the Site's one buckets entry, nil when it has none.

func (SiteSpec) ServedBucket added in v0.15.0

func (s SiteSpec) ServedBucket() ObjectName

ServedBucket is the Bucket the Site serves from: its bindings.blob entry's bucket, "" when it has none.

func (SiteSpec) ServedPrefix added in v0.15.0

func (s SiteSpec) ServedPrefix() string

ServedPrefix is the prefix the Site serves from: its bindings.blob entry's prefix, "" when it has none.

type SiteStatus

type SiteStatus struct {
	Status `json:",inline"`
	// Digest is the manifest digest the owned Route currently serves.
	Digest string `` /* 213-byte string literal not displayed */
	// ServingPrefix is the digest-scoped key prefix the owned Route is programmed with.
	ServingPrefix string `` /* 159-byte string literal not displayed */
	// Objects and Bytes are the materialized bundle's observed size.
	Objects int   `` /* 197-byte string literal not displayed */
	Bytes   int64 `json:"bytes,omitempty" doc:"The total size, in bytes, of the files that objects counts."`
}

SiteStatus is the observed state: which build is live and where it is served from. Every field is DERIVED on each reconcile — Digest/ServingPrefix from the owned Route's bundle rule (what is actually served) — never read back as durable: the store is last-writer-wins on status and an apply wipes it. Status.ObservedGeneration gates tag resolution (ADR-0139 Decision §2).

type SizeQuota added in v0.33.0

type SizeQuota struct {
	MaxSize  ByteSize `` /* 173-byte string literal not displayed */
	MaxBytes int64    `json:"maxBytes,omitempty" minimum:"0" doc:"The same cap as a number of bytes. Set maxSize or maxBytes, not both."`
}

SizeQuota caps what a store or a Bucket prefix holds in total (ADR-0292): maxSize in ByteSize's grammar (ADR-0266) or maxBytes in bytes, at most one; neither means no cap. A write that would pass it gets 507.

func (SizeQuota) Limit added in v0.33.0

func (q SizeQuota) Limit() (int64, bool)

Limit is the cap in bytes, ok=false without one. It assumes Validate passed: a size that does not parse reads as no cap.

func (SizeQuota) Validate added in v0.33.0

func (q SizeQuota) Validate(op, path string) error

Validate refuses both forms, a size that does not parse, and a negative or zero byte count, naming path.

type StaticBackend

type StaticBackend struct {
	// Bucket is the Bucket in THIS Route's namespace whose objects are served (binding-as-grant:
	// the Route reads only this declared Bucket; the reconciler validates it exists → BucketNotFound).
	Bucket ObjectName `` /* 145-byte string literal not displayed */
	// Prefix is the key prefix within the Bucket that roots the site; it ends with "/" (e.g. "bi/") so it
	// never also matches a sibling prefix; "" ⇒ the bucket root.
	Prefix string `` /* 193-byte string literal not displayed */
	// Index is the document served for "/" / a directory / (when SPA) a miss. Default "index.html".
	Index string `` /* 204-byte string literal not displayed */
	// SPA, when true, serves Index (200) for any un-matched path so a client-side router owns routing;
	// when false, an un-matched path is 404.
	SPA bool `` /* 163-byte string literal not displayed */
}

StaticBackend serves a Bucket prefix as a static site (ADR-0120, F82): index resolution, content-types, a weak (ModTime,Size) ETag + conditional GET, HTTP Range, an optional SPA fallback, and a pinned three-tier Cache-Control — served through the FEAT-0006 edge with no function code. The bytes are the same per-namespace Bucket view the S3 frontend serves (ADR-0080).

type Status

type Status struct {
	Phase              Phase      `json:"phase,omitempty" doc:"Where the object is in its lifecycle."`
	ObservedGeneration int64      `json:"observedGeneration,omitempty" doc:"The generation of the spec that funcd last acted on."`
	Conditions         Conditions `json:"conditions,omitempty" doc:"The conditions that explain the phase."`
}

Status is the shared status base embedded by kinds with observed state. Pure-data/policy kinds (ConfigMap, Secret, Grant, EgressPolicy) do not have status.

type StatusObject

type StatusObject interface {
	Object
	GetStatus() *Status
}

StatusObject is the optional extension implemented by kinds with observed state, giving the controller a generic status write-back seam. ConfigMap, Secret, Grant, and EgressPolicy do NOT implement it.

type StepBindings added in v0.15.0

type StepBindings struct {
	KV     []FunctionKV   `` /* 254-byte string literal not displayed */
	Blob   []FunctionBlob `` /* 311-byte string literal not displayed */
	SQL    []FunctionSQL  `` /* 257-byte string literal not displayed */
	Lake   []FunctionLake `` /* 188-byte string literal not displayed */
	Config []ObjectName   `` /* 245-byte string literal not displayed */
	Secret []ObjectName   `` /* 194-byte string literal not displayed */
}

StepBindings are a Workflow step's bindings (ADR-0246): FunctionBindings without links, copied onto the step's materialized Function.

func (StepBindings) FunctionBindings added in v0.15.0

func (b StepBindings) FunctionBindings() FunctionBindings

FunctionBindings returns the step's bindings as a Function's, without links.

type StepPhase

type StepPhase string

StepPhase is a step's execution phase within a run.

const (
	StepPending   StepPhase = "Pending"
	StepRunning   StepPhase = "Running"
	StepSucceeded StepPhase = "Succeeded"
	StepFailed    StepPhase = "Failed"
	StepSkipped   StepPhase = "Skipped"
	StepCancelled StepPhase = "Cancelled"
)

func (StepPhase) Schema

func (StepPhase) Schema(huma.Registry) *huma.Schema

Schema carries StepPhase's enum into the generated OpenAPI (ADR-0048).

type StepRetry

type StepRetry struct {
	MaxAttempts int      `` /* 234-byte string literal not displayed */
	Backoff     Duration `` /* 131-byte string literal not displayed */
}

StepRetry is a per-step retry policy: attempts and exponential backoff.

type StepWhen

type StepWhen struct {
	Condition string `` /* 302-byte string literal not displayed */
}

StepWhen holds a native-JS boolean condition (ADR-0095 Condition mode) evaluated against direct-parent outputs and the run input.

type Tags

type Tags map[string]string

Tags is an optional free-form set of key-value labels on a resource. map[string]string is allowed under ADR-0002: the any-ban targets interface{}/any/map[string]any.

type TimerEvent

type TimerEvent struct {
	Name ObjectName `` /* 148-byte string literal not displayed */
	// Interval is the tick period (ADR-0023): the floor bars a fire-storm, the ceiling an unbounded one. Validate
	// checks the bounds, also at store.Create (ADR-0194).
	Interval Duration `json:"interval,omitempty" doc:"The tick period: 100ms to 24h. Exactly one of interval and cron."`
	Cron     string   `` /* 161-byte string literal not displayed */
	TimeZone string   `json:"timeZone,omitempty" doc:"The IANA time zone of cron, such as Europe/Paris; UTC when empty. Only with cron."`
}

TimerEvent is one named timer event: a DNS-1123 name and its own schedule, an interval or a cron expression in a time zone (ADR-0211). Each fires independently and publishes a named CloudEvent (source=<eventsource> URI, type=<name>).

type TimerSource

type TimerSource struct {
	Events []TimerEvent `json:"events" doc:"The timer's events: at least one, with unique names, each firing on its own schedule."` // ≥1; unique names
}

TimerSource hosts the timer kind's named events (ADR-0108).

type Timestamp added in v0.8.0

type Timestamp time.Time

Timestamp is an instant: a time.Time in memory, TimestampLayout in UTC on the wire (ADR-0196).

func NewTimestamp added in v0.8.0

func NewTimestamp(t time.Time) Timestamp

NewTimestamp returns t in UTC, truncated to the millisecond.

func (Timestamp) IsZero added in v0.8.0

func (t Timestamp) IsZero() bool

IsZero reports whether t is the zero instant; omitzero uses it.

func (Timestamp) MarshalJSON added in v0.8.0

func (t Timestamp) MarshalJSON() ([]byte, error)

MarshalJSON writes the form as a JSON string; a year outside 0000–9999 is refused.

func (Timestamp) Schema added in v0.8.0

func (Timestamp) Schema(huma.Registry) *huma.Schema

Schema returns a new schema on each call (huma writes field tags into it): {type: string, format: date-time, pattern: TimestampPattern, patternDescription}.

func (Timestamp) String added in v0.8.0

func (t Timestamp) String() string

String writes the form; UTC and truncation apply again so a converted value cannot escape it.

func (*Timestamp) UnmarshalJSON added in v0.8.0

func (t *Timestamp) UnmarshalJSON(b []byte) error

UnmarshalJSON accepts only a JSON string matching TimestampPattern that parses with TimestampLayout; null leaves t unchanged.

type TypeMeta

type TypeMeta struct {
	APIVersion string `json:"apiVersion"`
	Kind       Kind   `json:"kind"`
}

TypeMeta carries the wire identity of a resource.

type UID

type UID string

UID is a server-assigned opaque unique identifier.

type VolumeEntry added in v0.24.0

type VolumeEntry struct {
	Name ObjectName `` /* 184-byte string literal not displayed */
	Ref  ObjectName `` /* 375-byte string literal not displayed */
	Type VolumeType `` /* 314-byte string literal not displayed */
	// Size and SizeBytes are the volume's size, exactly one of them set (ADR-0266): "2GiB", or a byte count.
	Size      ByteSize       `` /* 303-byte string literal not displayed */
	SizeBytes int64          `json:"sizeBytes,omitempty" minimum:"1" doc:"The same size as a number of bytes. Set size or sizeBytes, not both."`
	Deletion  DeletionPolicy `` /* 235-byte string literal not displayed */
}

VolumeEntry is one volume a Function declares at its root (ADR-0262 Decision 1): by name it owns the volume, by ref it adopts a retained local volume no live Function holds.

func (VolumeEntry) Bytes added in v0.24.0

func (e VolumeEntry) Bytes() int64

Bytes is the entry's size in bytes, from whichever form is set (0 when neither is valid).

func (VolumeEntry) VolumeName added in v0.24.0

func (e VolumeEntry) VolumeName() ObjectName

VolumeName is the entry's volume, by name or by ref.

type VolumeType added in v0.24.0

type VolumeType string

VolumeType is the kind of a Function's volume (ADR-0262 Decision 1).

const (
	// VolumeEmptyDir is one directory per worker, removed with it.
	VolumeEmptyDir VolumeType = "emptyDir"
	// VolumeLocal is a durable directory owned by its Function like a store.
	VolumeLocal VolumeType = "local"
)

func (VolumeType) Schema added in v0.24.0

func (VolumeType) Schema(huma.Registry) *huma.Schema

Schema renders the huma enum for VolumeType.

type WorkerNode

type WorkerNode struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Status     WorkerNodeStatus `json:"status,omitempty"`
}

WorkerNode is a cluster-scoped resource representing a compute node. Status-bearing. Behavioral fields (capacity, heartbeat) owned by multi-node ADR.

func (*WorkerNode) GetStatus

func (w *WorkerNode) GetStatus() *Status

GetStatus returns the shared Status pointer, implementing StatusObject.

func (*WorkerNode) GroupVersionKind

func (w *WorkerNode) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for WorkerNode.

func (*WorkerNode) Validate

func (w *WorkerNode) Validate() error

Validate performs envelope validation via the shared validateMeta helper.

type WorkerNodeStatus

type WorkerNodeStatus struct {
	Status `json:",inline"`
}

WorkerNodeStatus holds the observed state.

type Workflow

type Workflow struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       WorkflowSpec   `json:"spec"`
	Status     WorkflowStatus `json:"status,omitempty"`
}

Workflow is a namespaced, status-bearing resource: a declarative multi-step run definition whose steps are functions (ADR-0094, FEAT-0005/F64). The engine owns and materializes the step Functions; a WorkflowRun is one execution.

func (*Workflow) GetStatus

func (w *Workflow) GetStatus() *Status

GetStatus returns the embedded Status for the controller's write-back seam.

func (*Workflow) GroupVersionKind

func (w *Workflow) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for Workflow.

func (*Workflow) Validate

func (w *Workflow) Validate() error

Validate enforces the Workflow rules JSON Schema can't express (ADR-0094): the step kind-union, unique step names, each image step's <workflow>-<step> Function name fitting a DNS label, dependsOn edge validity + acyclicity, the reserved workflow: kind, the onFailure handler constraints, workflow-owned stores of distinct names whose owners name a step, the declared-contract total-defaults rule, the duration bounds and a literal wait's grammar (ADR-0194). Field-format constraints (retry attempts, enums) are schema-enforced at the edge. Each owned store's tables and each image step's bindings, which the materializer copies into the KVStores and step Functions it writes, also pass those objects' own checks (#927).

type WorkflowContract

type WorkflowContract struct {
	Dialect string          `` /* 128-byte string literal not displayed */
	Input   json.RawMessage `` /* 154-byte string literal not displayed */
	Output  json.RawMessage `` /* 156-byte string literal not displayed */
}

WorkflowContract is a declared or derived I/O contract (ADR-0090 ContractBlob shape).

type WorkflowPooling

type WorkflowPooling struct {
	// Mode is "shared" (default — image steps of the same runtime co-locate in one
	// worker pool, saving memory) or "isolated" (each step runs in its own solo
	// worker / container).
	Mode PoolingMode `` /* 398-byte string literal not displayed */
	// Worker names the shared pool when Mode is shared; empty ⇒ the workflow's name.
	// Steps of different runtimes never share a worker (the pool is per-runtime); this
	// is the logical pool name they group under.
	Worker string `` /* 174-byte string literal not displayed */
	// MinReplicas keeps warm workers: 0 scales to zero (cold start on the first step of
	// the pool), ≥1 avoids the cold-start latency.
	MinReplicas int `` /* 235-byte string literal not displayed */
}

WorkflowPooling governs how a workflow's materialized step Functions are grouped into worker pools and kept warm. It is applied to each owned Function at materialization (a step's own Pooling overrides it).

type WorkflowRef

type WorkflowRef struct {
	Ref ObjectName `` /* 190-byte string literal not displayed */
}

WorkflowRef references a child Workflow by name — a sub-workflow step (F70/ADR-0099).

type WorkflowRun

type WorkflowRun struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata"`
	Spec       WorkflowRunSpec   `json:"spec"`
	Status     WorkflowRunStatus `json:"status,omitempty"`
}

WorkflowRun is a namespaced, status-bearing resource: one execution of a Workflow (ADR-0094, FEAT-0005/F64). Minted by `funcdctl workflow run`, a hand-applied manifest, or (later) a Sensor. The engine drives it to a terminal phase.

func (*WorkflowRun) GetStatus

func (r *WorkflowRun) GetStatus() *Status

GetStatus returns the embedded Status for the controller's write-back seam. Its Phase is unused: the run phase is WorkflowRunStatus.Phase, which shadows it.

func (*WorkflowRun) GroupVersionKind

func (r *WorkflowRun) GroupVersionKind() GroupVersionKind

GroupVersionKind returns the constant GVK for WorkflowRun.

func (*WorkflowRun) Validate

func (r *WorkflowRun) Validate() error

Validate enforces the WorkflowRunSpec rules JSON Schema can't express (ADR-0094): the target workflow is named. Input-vs-contract validation is admission's job (it needs the cached contract), not a field rule.

type WorkflowRunLinks struct {
	Active    []ObjectName `json:"active,omitempty" doc:"The runs not finished yet, newest first."`
	Succeeded int          `` /* 138-byte string literal not displayed */
	Failed    int          `` /* 132-byte string literal not displayed */
	Cancelled int          `` /* 138-byte string literal not displayed */
}

WorkflowRunLinks links a Workflow to its runs: active (in-flight) names + lifetime terminal-phase counts. Bounded (active-only); history lives in engine state.

type WorkflowRunSpec

type WorkflowRunSpec struct {
	// Workflow names the Workflow in this run's namespace.
	Workflow ObjectName `` /* 203-byte string literal not displayed */
	// Input is the run input (validated against the workflow's cached contract at
	// admission); control-plane metadata, size-bounded by the engine.
	Input json.RawMessage `` /* 334-byte string literal not displayed */
	// Paused requests a graceful pause: no new steps dispatch, in-flight steps finish
	// (set by `funcdctl workflow pause`, cleared by `resume`). Ignored once the run is already
	// terminal: the run keeps its phase.
	Paused bool `` /* 287-byte string literal not displayed */
	// Cancel requests cancellation (ADR-0094, ADR-0146): a declarative one-way intent, the same shape
	// as Paused. Set by `funcdctl workflow cancel`, it is observed by the run reconciler on
	// the controller workqueue (never a synchronous endpoint), which closes the in-flight step calls
	// (their late results are discarded), dispatches nothing more, runs no onFailure and terminates
	// the run Cancelled. Ignored once the run is already terminal.
	Cancel bool `` /* 341-byte string literal not displayed */
	// Replay seeds this run from a finished source run's checkpoint (ADR-0107): the engine copies the
	// source's pinned spec/contract/input + the terminal steps outside the replay set, then re-runs
	// `from` + its descendants. When set, Input must be empty (the input comes from the source).
	Replay *ReplaySeed `` /* 342-byte string literal not displayed */
}

WorkflowRunSpec is the desired state: which Workflow, the run input, and the declarative pause flag.

type WorkflowRunStatus

type WorkflowRunStatus struct {
	Status `json:",inline"`
	// Phase shadows the embedded Status.Phase: a run has its own phases (ADR-0094), not the resource ones.
	Phase RunPhase        `` /* 131-byte string literal not displayed */
	Steps []RunStepStatus `` /* 131-byte string literal not displayed */
	// TraceID is the run's W3C trace (ADR-0102), mirrored from the engine record (ADR-0100) so
	// `describe` shows it and `funcdctl workflow logs <run>` (ADR-0106) resolves a run to its logs.
	TraceID string `` // 32 lowercase hex; empty ⇒ a legacy/traceless run
	/* 192-byte string literal not displayed */
	// Pins binds the run to the step Function revisions it started with (ADR-0190): written before the run starts,
	// they hold those revisions while the run is not terminal.
	Pins []RevisionPin `` /* 324-byte string literal not displayed */
	// WorkflowUID is the Workflow's UID at start (ADR-0190 Decision 10); empty for a run started before ADR-0190.
	WorkflowUID UID `` /* 166-byte string literal not displayed */
}

WorkflowRunStatus is the coarse mirror of engine run state (Badger is the truth): the run phase plus per-step summaries.

type WorkflowSpec

type WorkflowSpec struct {
	// Steps are the workflow's steps. List order chains implicitly (no dependsOn ⇒
	// the previous step); dependsOn declares explicit edges.
	Steps []WorkflowStep `` /* 157-byte string literal not displayed */
	// KVStores and Buckets are the stores the Workflow declares at its root (ADR-0248): by name it owns them and their
	// table and prefix owners name steps, materialized to the step Functions; by ref it binds an existing one.
	KVStores []KVStoreEntry `` /* 258-byte string literal not displayed */
	Buckets  []BucketEntry  `` /* 282-byte string literal not displayed */
	// SQLDatabases, Lakes, ConfigMaps and SecretDeclarations are the rest of what the Workflow's steps bind
	// (ADR-0250): a database's or a prefix's owner names a step, or a lake the root declares; a defined ConfigMap
	// or lake goes with the Workflow; a declared Secret holds its keys before any step is materialized.
	SQLDatabases       []SQLDatabaseEntry  `` /* 278-byte string literal not displayed */
	Lakes              []LakeEntry         `` /* 373-byte string literal not displayed */
	ConfigMaps         []ConfigMapEntry    `` /* 262-byte string literal not displayed */
	SecretDeclarations []SecretDeclaration `` /* 270-byte string literal not displayed */
	// Contract is the optional declared I/O contract (ADR-0090 shape); nil ⇒ the
	// effective contract is derived (F65). Every optional property must carry a
	// default (the total-defaults rule).
	Contract *WorkflowContract `` /* 238-byte string literal not displayed */
	// Timeout is the wall-clock bound on a whole run (paused time excluded); 0 ⇒ none.
	Timeout Duration `` /* 129-byte string literal not displayed */
	// OnFailure names a handler function step (defined in Steps, excluded from the DAG)
	// invoked once when the run ends Failed. Empty ⇒ no handler.
	OnFailure ObjectName `` /* 383-byte string literal not displayed */
	// Pooling configures how the workflow's materialized step Functions are pooled and
	// kept warm (ADR-0046 worker pooling + ADR-0016 scaling). Empty ⇒ the default: all
	// image steps share one pool. A step may override it with its own step.pooling.
	Pooling WorkflowPooling `` /* 143-byte string literal not displayed */
}

WorkflowSpec is the desired state: the ordered steps, workflow-owned KV stores, an optional declared I/O contract, a run-level timeout, and an optional onFailure handler step.

func (WorkflowSpec) EffectiveDependsOn added in v0.2.1

func (s WorkflowSpec) EffectiveDependsOn() map[ObjectName][]ObjectName

EffectiveDependsOn returns each step's parents as the engine schedules them (ADR-0094 Control flow): its dependsOn, else the previous step in list order. The onFailure handler is outside the DAG: it gets no implicit parent and is never the previous step.

type WorkflowStatus

type WorkflowStatus struct {
	Status   `json:",inline"`
	Contract *WorkflowContract    `` /* 267-byte string literal not displayed */
	Steps    []WorkflowStepStatus `` /* 192-byte string literal not displayed */
	Runs     *WorkflowRunLinks    `json:"runs,omitempty" doc:"The Workflow's runs: those not finished yet by name, and how many ended in each final phase."`
}

WorkflowStatus is the observed state: phase, the effective contract, the resolved step graph (F65 fills it), and the run link (CronJob status.active pattern).

type WorkflowStep

type WorkflowStep struct {
	// Name is the step's name; a DNS-1123 label, unique within the workflow.
	Name ObjectName `` /* 213-byte string literal not displayed */
	// Function is a dispatched step: an owned image (materialized) or a ref to an existing Function.
	Function *FunctionStep `` /* 182-byte string literal not displayed */
	// Builtin is an engine-native step (wait / pass) — run in-process, never dispatched.
	Builtin *BuiltinStep `` /* 144-byte string literal not displayed */
	// Workflow runs a child Workflow as a step (a sub-workflow, F70/ADR-0099).
	Workflow *WorkflowRef `` /* 346-byte string literal not displayed */
	// DependsOn names the parent steps; empty ⇒ follows the previous step in list order.
	DependsOn []ObjectName `` /* 331-byte string literal not displayed */
	// Join is the fan-in mode: "all" (default) requires every parent Succeeded, "any"
	// requires one (exclusive-branch merges).
	Join JoinMode `` /* 258-byte string literal not displayed */
	// When is an optional gate condition (ADR-0095 native-JS boolean); false ⇒ Skipped.
	When *StepWhen `` /* 180-byte string literal not displayed */
	// Params is a static overlay merged over the step's flowing input (static wins). For a function
	// step it overlays the dispatched input; a pass expression sees the overlaid input; a wait
	// ignores it (output = input verbatim). The onFailure handler takes none (FailureContext only).
	Params json.RawMessage `` /* 334-byte string literal not displayed */
}

WorkflowStep is one step — a kind-keyed union of exactly one of Function / Builtin / Workflow (Workflow runs a child workflow, F70), plus the orchestration fields common to every kind (ADR-0096).

type WorkflowStepStatus

type WorkflowStepStatus struct {
	Name     ObjectName        `json:"name" doc:"The step's name."`
	Image    string            `` /* 195-byte string literal not displayed */
	Contract *WorkflowContract `` /* 150-byte string literal not displayed */
}

WorkflowStepStatus is one step's resolved digest-pinned image + cached contract.

Directories

Path Synopsis
Package examples holds the guide's example manifests (ADR-0325): one scenario per file under <feature>/, applied by pkg/funcd's TestScenarioGuideExamplesApply.
Package examples holds the guide's example manifests (ADR-0325): one scenario per file under <feature>/, applied by pkg/funcd's TestScenarioGuideExamplesApply.

Jump to

Keyboard shortcuts

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