Documentation
¶
Overview ¶
Package annotation defines the public syntax model used by the Spice compiler.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Annotation ¶
Annotation represents one parsed Spice annotation.
type ArgumentDefinition ¶
type ArgumentDefinition struct {
Name string
Kinds []Kind
ListElementKinds []Kind
ValueDomain ValueDomain
Required bool
Positional bool
Variadic bool
}
ArgumentDefinition describes one supported annotation argument.
type Definition ¶
type Definition struct {
Name string
Targets TargetSet
Repeatable bool
Arguments []ArgumentDefinition
}
Definition describes one annotation and where it may be used.
type DefinitionReference ¶
DefinitionReference is the explicit source identity selected for an annotation invocation.
type ImportBinding ¶
ImportBinding maps one exported descriptor symbol to its file-local name.
type ImportDirective ¶
type ImportDirective struct {
Kind ImportKind
Package string
Namespace string
Bindings []ImportBinding
Position token.Position
// PhysicalPosition retains the unadjusted loaded-file identity when the
// source uses a //line directive.
PhysicalPosition token.Position
Raw string
}
ImportDirective is one valid-Go @import declaration comment.
type ImportKind ¶
type ImportKind string
ImportKind identifies the binding form of one file-scoped annotation import.
const ( // ImportNamed binds one or more descriptor symbols directly in the file. ImportNamed ImportKind = "named" // ImportNamespace binds a descriptor package behind one local qualifier. ImportNamespace ImportKind = "namespace" )
type ModuleProvenance ¶
type ModuleProvenance struct {
Path string
Version string
Directory string
ReplacementPath string
ReplacementVersion string
ReplacementDir string
LocalReplacement bool
}
ModuleProvenance identifies the Go-selected module content behind a descriptor or tool package.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is an immutable-by-construction annotation definition lookup.
func MustRegistry ¶
func MustRegistry(definitions ...Definition) Registry
MustRegistry creates a registry or panics.
func NewRegistry ¶
func NewRegistry(definitions ...Definition) (Registry, error)
NewRegistry validates definitions and creates a deterministic registry.
func (Registry) Definitions ¶
func (registry Registry) Definitions() []Definition
Definitions returns every definition sorted by name.
type Target ¶
type Target string
Target identifies a Go declaration kind that an annotation may describe.
type TargetSet ¶
type TargetSet uint8
TargetSet is an immutable bit set of supported annotation targets.
func NewTargetSet ¶
NewTargetSet creates a target set from declaration kinds.
func Targets ¶
Targets creates a target set or panics when a package-owned definition uses an unknown target. Runtime and user-supplied metadata should use NewTargetSet when it needs error-returning validation.
type Value ¶
type Value struct {
Kind Kind
String string
Integer int64
Boolean bool
Identifier string
List []Value
}
Value is one typed annotation argument value.
type ValueDomain ¶
type ValueDomain string
ValueDomain identifies a compiler-owned semantic value space shared by CLI, LSP, and editor clients.
const ( ValueDomainNone ValueDomain = "" ValueDomainGoInterface ValueDomain = "go-interface" )
Directories
¶
| Path | Synopsis |
|---|---|
|
Package async defines the canonical descriptor for generated asynchronous method execution.
|
Package async defines the canonical descriptor for generated asynchronous method execution. |
|
Package builtin defines the annotation metadata shipped with Spice.
|
Package builtin defines the annotation metadata shipped with Spice. |
|
Package cache defines the canonical descriptor for generated cache boundaries.
|
Package cache defines the canonical descriptor for generated cache boundaries. |
|
Package core defines the canonical descriptors for Spice's application and dependency-injection annotations.
|
Package core defines the canonical descriptors for Spice's application and dependency-injection annotations. |
|
Package coretool identifies the official Spice annotation tool dependency.
|
Package coretool identifies the official Spice annotation tool dependency. |
|
Package data defines canonical descriptors for generated data boundaries.
|
Package data defines canonical descriptors for generated data boundaries. |
|
Package event defines canonical descriptors for typed application events.
|
Package event defines canonical descriptors for typed application events. |
|
Package lifecycle defines canonical descriptors for generated application lifecycle callbacks.
|
Package lifecycle defines canonical descriptors for generated application lifecycle callbacks. |
|
Package management defines canonical descriptors for generated management endpoints.
|
Package management defines canonical descriptors for generated management endpoints. |
|
Package modulith defines canonical descriptors for compile-time application module boundaries.
|
Package modulith defines canonical descriptors for compile-time application module boundaries. |
|
Package observability defines canonical descriptors for generated observability features.
|
Package observability defines canonical descriptors for generated observability features. |
|
Package retry defines canonical descriptors for generated bounded retry policies.
|
Package retry defines canonical descriptors for generated bounded retry policies. |
|
Package schedule defines canonical descriptors for generated scheduled execution.
|
Package schedule defines canonical descriptors for generated scheduled execution. |
|
Package sdk defines the stable, statically decoded Spice annotation descriptor contract.
|
Package sdk defines the stable, statically decoded Spice annotation descriptor contract. |
|
protocol
Package protocol defines the versioned framed stdio contract shared by Spice annotation tools and the compiler host.
|
Package protocol defines the versioned framed stdio contract shared by Spice annotation tools and the compiler host. |
|
sdktest
Package sdktest provides deterministic black-box tests for annotation SDK descriptors and handlers.
|
Package sdktest provides deterministic black-box tests for annotation SDK descriptors and handlers. |
|
starter
Package starter defines deterministic compatibility and annotation metadata for opt-in Spice integrations.
|
Package starter defines deterministic compatibility and annotation metadata for opt-in Spice integrations. |
|
Package security defines canonical descriptors for generated authorization policies.
|
Package security defines canonical descriptors for generated authorization policies. |
|
Package web defines canonical descriptors for generated net/http adapters.
|
Package web defines canonical descriptors for generated net/http adapters. |