MCPcopy
hub / github.com/rilldata/rill / Resolver

Interface Resolver

runtime/resolver.go:40–62  ·  view source on GitHub ↗

Resolver represents logic, such as a SQL query, that produces output data. Resolvers are used to evaluate API requests, alerts, reports, etc. A resolver has two levels of configuration: static properties and dynamic arguments. For example, a SQL resolver has a static property for the SQL query and

Source from the content-addressed store, hash-verified

38// For example, a SQL resolver has a static property for the SQL query and dynamic arguments for the query parameters.
39// The static properties are usually declared in advance, such as in the YAML for a custom API, whereas the dynamic arguments are provided just prior to execution, such as in an API request.
40type Resolver interface {
41 // Close is called when done with the resolver.
42 // Note that the Resolve method may not have been called when Close is called (in case of cache hits or validation failures).
43 Close() error
44 // CacheKey returns a key that can be used for caching. It can be a large string since the value will be hashed.
45 // The key should include all the properties and args that affect the output.
46 // It does not need to include the instance ID or resolver name, as those are added separately to the cache key.
47 //
48 // If the resolver result is not cacheable, ok is set to false.
49 CacheKey(ctx context.Context) (key []byte, ok bool, err error)
50 // Refs access by the resolver. The output may be approximate, i.e. some of the refs may not exist.
51 // The output should avoid duplicates and be stable between invocations.
52 // This is also used while resolving transitive access rules, resources retuned by Refs() will be given access.
53 Refs() []*runtimev1.ResourceName
54 // Validate the properties and args without running any expensive operations.
55 Validate(ctx context.Context) error
56 // ResolveInteractive resolves data for interactive use (e.g. API requests or alerts).
57 ResolveInteractive(ctx context.Context) (ResolverResult, error)
58 // ResolveExport resolve data for export (e.g. downloads or reports).
59 ResolveExport(ctx context.Context, w io.Writer, opts *ResolverExportOptions) error
60 // InferRequiredSecurityRules attempts to infer the security rules that are required to be able to execute the resolver for the currently configured properties.
61 InferRequiredSecurityRules() ([]*runtimev1.SecurityRule, error)
62}
63
64// ResolverResult is the result of a resolver's execution.
65type ResolverResult interface {

Callers 32

closeMethod · 0.65
openAndMigrateMethod · 0.65
InstanceHealthMethod · 0.65
ResolveMethod · 0.65
CloseMethod · 0.65
NextMethod · 0.65
MarshalJSONMethod · 0.65
CloseMethod · 0.65
ResolveMethod · 0.65
CacheKeyMethod · 0.65
ResolveInteractiveMethod · 0.65
ResolveMethod · 0.65

Implementers 13

legacyMetricsResolverruntime/resolvers/legacy_metrics.go
metricsAnnotationsResolverruntime/resolvers/annotations.go
sqlResolverruntime/resolvers/sql.go
projectStorageResolverruntime/resolvers/project_storage.go
metricsSummaryResolverruntime/resolvers/metricsview_summary.
unionResolverruntime/resolvers/union.go
textResolverruntime/resolvers/text.go
resourceStatusResolverruntime/resolvers/resource_status.go
metricsResolverruntime/resolvers/metrics.go
metricsViewTimeRangeResolverruntime/resolvers/metricsview_time_ran
globResolverruntime/resolvers/glob.go
aiResolverruntime/resolvers/ai.go

Calls

no outgoing calls

Tested by

no test coverage detected