Documentation
¶
Overview ¶
Package compile provides DQL-to-shape compilation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompileError ¶
type CompileError struct {
Diagnostics []*dqlshape.Diagnostic
}
CompileError represents one or more compilation diagnostics.
func (*CompileError) Error ¶
func (e *CompileError) Error() string
type ComponentContract ¶ added in v0.38.0
type ComponentContract struct {
RouteKey string
Method string
URI string
OutputType string
Types []*plan.Type
}
ComponentContract represents resolved component contract metadata.
type ComponentResolver ¶ added in v0.38.0
type ComponentResolver interface {
ResolveContract(ctx context.Context, routeKey string) (*ComponentContract, error)
}
ComponentResolver resolves component contract metadata for a route key.
type DQLCompiler ¶
type DQLCompiler struct{}
DQLCompiler compiles raw DQL into a shape plan that can be materialized by shape/load.
func (*DQLCompiler) Compile ¶
func (c *DQLCompiler) Compile(ctx context.Context, source *shape.Source, opts ...shape.CompileOption) (*shape.PlanResult, error)
Compile implements shape.DQLCompiler.
type RouteIndex ¶ added in v0.38.0
type RouteIndex struct {
ByRouteKey map[string]*RouteIndexEntry
ByNamespace map[string][]*RouteIndexEntry
Conflicts map[string][]string
}
RouteIndex stores source-to-route mapping and lookup structures.
func BuildRouteIndex ¶ added in v0.38.0
func BuildRouteIndex(paths []string, opts ...shape.CompileOption) (*RouteIndex, error)
BuildRouteIndex scans DQL files and builds route-key mapping.
func (*RouteIndex) Resolve ¶ added in v0.38.0
func (r *RouteIndex) Resolve(ref, currentSource string, opts ...shape.CompileOption) (string, bool)
Resolve maps a component reference from current source context to route key. It returns false when route cannot be resolved deterministically.
type RouteIndexEntry ¶ added in v0.38.0
type RouteIndexEntry struct {
RouteKey string
Method string
URI string
SourcePath string
Namespace string
}
RouteIndexEntry maps one source DQL file to one concrete method+URI route key.
type SignatureResolver ¶ added in v0.38.0
type SignatureResolver struct {
// contains filtered or unexported fields
}
SignatureResolver adapts repository/contract/signature service to compile-time component contract resolution.
func NewSignatureResolver ¶ added in v0.38.0
func NewSignatureResolver(ctx context.Context, apiPrefix, routesURL string) (*SignatureResolver, error)
NewSignatureResolver creates signature-backed component resolver.
func (*SignatureResolver) ResolveContract ¶ added in v0.38.0
func (s *SignatureResolver) ResolveContract(_ context.Context, routeKey string) (*ComponentContract, error)
ResolveContract resolves component contract by route key.
Source Files
¶
- column_discovery_policy.go
- compiler.go
- component_route_shape.go
- component_types.go
- doc.go
- enrich.go
- enrich_table.go
- enrich_text.go
- hints.go
- hints_strip.go
- inline_param.go
- legacy_adapter.go
- pathlayout.go
- policy.go
- preprocess_handler.go
- resolver.go
- route_index.go
- span.go
- statedecl.go
- type_support.go
- typectx_defaults.go
- typectx_diagnostics.go
- viewdecl.go
- viewdecl_append.go
- viewdecl_options.go
- viewdecl_parse.go