Documentation
¶
Overview ¶
Package api holds the leaf types and injection seam shared between the module render service and the CueX module provider. It does not import pkg/module/service, which would cycle through the CueX compiler. It does import the core API types, because ModuleRequest carries a Placement.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetDefaultRenderer ¶
func SetDefaultRenderer(r Renderer)
SetDefaultRenderer installs the process-wide renderer (called once at startup).
Types ¶
type ModuleRequest ¶
type ModuleRequest struct {
Module string
Registry string
// Namespace is where the module's definitions install. Empty means the
// default system namespace. It does not place the owned Application, which
// always lives in the system namespace. The module is still installed once
// cluster-wide.
Namespace string
// Version selects the module package version (the OCI/ECR tag vela module
// publish writes from _module.cue's version field). Empty resolves the
// highest published semver tag.
Version string
// Placement is the installer's request for where this module's runtime
// objects land. Nil means the installer did not ask. A hub marker on the
// module can still partition the render on its own.
Placement *v1alpha1.Placement
}
ModuleRequest is the resolved input for rendering one module. There is no per-line selector: enablement is the module author's, via each line's enabled flag.
type ModuleResult ¶
type ModuleResult struct {
Application map[string]interface{}
}
ModuleResult is the rendered output: the module's owned Application as a generic map, ready to hand back to CUE.
type Renderer ¶
type Renderer interface {
RenderModule(ctx context.Context, req ModuleRequest) (*ModuleResult, error)
}
Renderer fetches a module and renders its owned Application without dispatching anything to the cluster.
func DefaultRenderer ¶
func DefaultRenderer() Renderer
DefaultRenderer returns the installed renderer, or nil if startup has not wired one.