report

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 25 Imported by: 4

Documentation

Overview

Package report derives ordinary cube components from canonical reader components without coupling derivation to MCP or duplicating reader execution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compilation

type Compilation struct {
	// contains filtered or unexported fields
}

Compilation is a complete, unpublished base-and-report artifact set.

func (*Compilation) Artifacts

func (c *Compilation) Artifacts() []*ComponentArtifact

func (*Compilation) RuntimeComponents

func (c *Compilation) RuntimeComponents(ctx context.Context, configurator RuntimeConfigurator) ([]*registry.RegisteredComponent, error)

RuntimeComponents builds one complete temporary registration set. Callers publish it only after this method succeeds.

func (*Compilation) Types

func (c *Compilation) Types() (*typecatalog.Catalog, error)

type ComponentArtifact

type ComponentArtifact struct {
	// contains filtered or unexported fields
}

ComponentArtifact is one compiled component awaiting concrete runtime capabilities such as a SQL reader or custom handler.

func (*ComponentArtifact) Component

func (a *ComponentArtifact) Component() *spec.Component

Component returns detached canonical metadata.

func (*ComponentArtifact) HasLinkedHandler

func (a *ComponentArtifact) HasLinkedHandler() bool

HasLinkedHandler reports whether bootstrap resolved an authored handler factory. The handler itself is installed only by canonical artifact registration.

func (*ComponentArtifact) InputContract

func (a *ComponentArtifact) InputContract() *registry.InputContract

InputContract returns the immutable compiled input contract.

func (*ComponentArtifact) InputType

func (a *ComponentArtifact) InputType() reflect.Type

func (*ComponentArtifact) IsReport

func (a *ComponentArtifact) IsReport() bool

func (*ComponentArtifact) NewViewProvider

func (a *ComponentArtifact) NewViewProvider(config bootstrap.ViewRuntimeConfig) (locator.Provider, error)

NewViewProvider attaches SQL to compiled independent views without exposing their plans or moving canonical input binding into the host. Components without independent views return nil.

func (*ComponentArtifact) OutputType

func (a *ComponentArtifact) OutputType() reflect.Type

func (*ComponentArtifact) ReaderCompilation

func (a *ComponentArtifact) ReaderCompilation() *bootstrap.CompiledReader

ReaderCompilation returns the bootstrap-owned immutable reader products.

type ComposeResponse

type ComposeResponse struct {
	Columns []cubecompose.Column `json:"columns"`
	Data    any                  `json:"data"`
}

type Derived

type Derived struct {
	Component  *spec.Component
	InputType  reflect.Type
	OutputType reflect.Type
	Handler    handler.Handler
	Plan       *Plan
	Type       *x.Type
}

Derived is one ordinary cube component ready for normal artifact compilation and runtime registration.

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler translates one typed report input into selector and filter providers, then delegates to the exact source component.

func NewHandler

func NewHandler(plan *Plan) *Handler

func (*Handler) Execute

func (h *Handler) Execute(ctx context.Context, invocation rhandler.Invocation) (any, error)

type Plan

type Plan struct {
	// contains filtered or unexported fields
}

Plan is immutable execution metadata for one derived cube route.

func (*Plan) InputType

func (p *Plan) InputType() reflect.Type

func (*Plan) OutputType

func (p *Plan) OutputType() reflect.Type

func (*Plan) Target

func (p *Plan) Target() exec.ComponentTarget

type Project

type Project struct {
	// contains filtered or unexported fields
}

Project contains the detached base metadata and newly derived components.

func (*Project) Components

func (p *Project) Components() []*spec.Component

func (*Project) Derived

func (p *Project) Derived() []*Derived

type ProjectCompiler

type ProjectCompiler struct {
	// contains filtered or unexported fields
}

ProjectCompiler derives cube components from base components whose exact input contracts have already been compiled.

func NewProjectCompiler

func NewProjectCompiler(config ProjectConfig) *ProjectCompiler

func (*ProjectCompiler) Compile

func (c *ProjectCompiler) Compile(sources []Source) (*Project, error)

func (*ProjectCompiler) CompileArtifacts

func (c *ProjectCompiler) CompileArtifacts(inputs []bootstrap.ArtifactInput) (*Compilation, error)

CompileArtifacts compiles base artifacts, derives reports from their exact contracts, and compiles the derived artifacts against one isolated catalog.

type ProjectConfig

type ProjectConfig struct {
	// Registry supplies compiled package exports; CompileArtifacts snapshots it
	// once for the whole unpublished component generation.
	Registry  *x.Registry
	Types     *typecatalog.Catalog
	Authority typecatalog.Authority
}

type ProjectedComponent

type ProjectedComponent struct {
	Name        string
	Method      string
	Path        string
	MCPEnabled  bool
	Description string
}

ProjectedComponent describes one derived runtime component produced from a grouped reader. It is the catalog-level identity used by hosts and authoring tools; compilation remains owned by ProjectCompiler.

func ProjectedComponents

func ProjectedComponents(component *spec.Component) []ProjectedComponent

ProjectedComponents returns the cube and optional cube-compose components Datly will derive for a grouped reader, using the same identity rules as the report compiler.

type RuntimeCapabilities

type RuntimeCapabilities struct {
	Handler    handler.Handler
	Reader     exec.Reader
	Invocation handler.InvocationCapabilities
	Providers  []locator.Provider
	DataSource exec.DataSource
}

RuntimeCapabilities contains only the concrete runtime attachments that project composition permits an application to supply.

type RuntimeConfigurator

type RuntimeConfigurator interface {
	Configure(context.Context, *ComponentArtifact) (RuntimeCapabilities, error)
}

RuntimeConfigurator resolves concrete runtime capabilities from a compiled artifact without receiving the canonical registration carrier.

type RuntimeConfigureFunc

type RuntimeConfigureFunc func(context.Context, *ComponentArtifact) (RuntimeCapabilities, error)

func (RuntimeConfigureFunc) Configure

type Source

type Source struct {
	Component  *spec.Component
	Input      *registry.InputContract
	OutputType reflect.Type
}

Source is an authority-resolved base component after its canonical input contract has been compiled and before runtime registration.

Directories

Path Synopsis
Package cubecompose validates and renders bounded compositions of typed cube queries.
Package cubecompose validates and renders bounded compositions of typed cube queries.

Jump to

Keyboard shortcuts

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