load

package
v0.38.0 Latest Latest
Warning

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

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

Documentation

Overview

Package load defines materialization responsibilities for runtime artifacts.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyViewPlan = errors.New("shape load: no views available in plan")
)

Functions

func RefineSummarySchemas added in v0.38.0

func RefineSummarySchemas(resource *view.Resource)

RefineSummarySchemas reapplies summary schema refinement using current view schema/column metadata. This is useful after late column discovery updated view columns post-load.

Types

type Component

type Component struct {
	Name             string
	URI              string
	Method           string
	ComponentRoutes  []*plan.ComponentRoute
	RootView         string
	Views            []string
	Relations        []*plan.Relation
	ViewRelations    []*view.Relation
	Declarations     map[string]*plan.ViewDeclaration
	QuerySelectors   map[string][]string
	Predicates       map[string][]*plan.ViewPredicate
	TypeContext      *typectx.Context
	Directives       *dqlshape.Directives
	Report           *dqlshape.ReportDirective
	ColumnsDiscovery bool
	TypeSpecs        map[string]*TypeSpec

	Input  []*plan.State
	Output []*plan.State
	Meta   []*plan.State
	Async  []*plan.State
	Other  []*plan.State
}

Component is a shape-loaded runtime-neutral component artifact. It intentionally avoids repository package coupling to keep shape/load reusable.

func ComponentFrom added in v0.38.0

func ComponentFrom(a *shape.ComponentArtifact) (*Component, bool)

ComponentFrom extracts the typed component from a ComponentArtifact. Returns (nil, false) when a is nil or contains an unexpected concrete type.

func (*Component) InputParameters added in v0.38.0

func (c *Component) InputParameters() state.Parameters

InputParameters returns input states as state.Parameters for type generation.

func (*Component) InputReflectType added in v0.38.0

func (c *Component) InputReflectType(pkgPath string, lookupType xreflect.LookupType, opts ...state.ReflectOption) (reflect.Type, error)

InputReflectType builds the Input struct reflect.Type using state.Parameters.ReflectType. This produces the same struct shape as the legacy codegen (with parameter tags, Has markers, etc.).

func (*Component) OutputParameters added in v0.38.0

func (c *Component) OutputParameters() state.Parameters

OutputParameters returns output states as state.Parameters for type generation.

func (*Component) OutputReflectType added in v0.38.0

func (c *Component) OutputReflectType(pkgPath string, lookupType xreflect.LookupType, opts ...state.ReflectOption) (reflect.Type, error)

OutputReflectType builds the Output struct reflect.Type using state.Parameters.ReflectType.

func (*Component) ShapeSpecKind added in v0.38.0

func (c *Component) ShapeSpecKind() string

ShapeSpecKind implements shape.ComponentSpec.

type Loader

type Loader struct{}

Loader materializes runtime view artifacts from normalized shape plan.

func New

func New() *Loader

New returns shape loader implementation.

func (*Loader) LoadComponent

func (l *Loader) LoadComponent(ctx context.Context, planned *shape.PlanResult, opts ...shape.LoadOption) (*shape.ComponentArtifact, error)

LoadComponent implements shape.Loader.

func (*Loader) LoadResource added in v0.38.0

func (l *Loader) LoadResource(ctx context.Context, planned *shape.PlanResult, opts ...shape.LoadOption) (*shape.ResourceArtifacts, error)

LoadResource implements shape.Loader.

func (*Loader) LoadViews

func (l *Loader) LoadViews(ctx context.Context, planned *shape.PlanResult, opts ...shape.LoadOption) (*shape.ViewArtifacts, error)

LoadViews implements shape.Loader.

type TypeRole added in v0.38.0

type TypeRole string
const (
	TypeRoleInput  TypeRole = "input"
	TypeRoleOutput TypeRole = "output"
	TypeRoleView   TypeRole = "view"
)

type TypeSpec added in v0.38.0

type TypeSpec struct {
	Key       string
	Role      TypeRole
	Alias     string
	TypeName  string
	Dest      string
	Inherited bool
	Source    string
}

Jump to

Keyboard shortcuts

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