MCPcopy Index your code
hub / github.com/rilldata/rill / newCachedResolverResult

Function newCachedResolverResult

runtime/resolver.go:404–415  ·  view source on GitHub ↗

newCachedResolverResult wraps a ResolverResult such that it is cacheable. Unlike other ResolverResult implementations, it can be kept in memory for a long time and read multiple times. When used multiple times, call .copy() to get a copy with a reset iteration cursor.

(res ResolverResult)

Source from the content-addressed store, hash-verified

402// Unlike other ResolverResult implementations, it can be kept in memory for a long time and read multiple times.
403// When used multiple times, call .copy() to get a copy with a reset iteration cursor.
404func newCachedResolverResult(res ResolverResult) (*cachedResolverResult, error) {
405 data, err := res.MarshalJSON()
406 if err != nil {
407 return nil, err
408 }
409
410 return &cachedResolverResult{
411 data: data,
412 meta: res.Meta(),
413 schema: res.Schema(),
414 }, nil
415}
416
417type cachedResolverResult struct {
418 data []byte

Callers 1

ResolveMethod · 0.85

Calls 3

MarshalJSONMethod · 0.65
MetaMethod · 0.65
SchemaMethod · 0.65

Tested by

no test coverage detected