MCPcopy Create free account
hub / github.com/rilldata/rill / get

Method get

runtime/catalog_cache.go:139–155  ·  view source on GitHub ↗

get returns a resource from the catalog. Unlike other catalog functions, it is safe to call get concurrently with calls to list and flush (i.e. under a read lock).

(n *runtimev1.ResourceName, withDeleted, clone bool)

Source from the content-addressed store, hash-verified

137// get returns a resource from the catalog.
138// Unlike other catalog functions, it is safe to call get concurrently with calls to list and flush (i.e. under a read lock).
139func (c *catalogCache) get(n *runtimev1.ResourceName, withDeleted, clone bool) (*runtimev1.Resource, error) {
140 rs := c.resources[n.Kind]
141 if rs == nil {
142 return nil, drivers.ErrResourceNotFound
143 }
144 r, ok := rs[strings.ToLower(n.Name)]
145 if !ok {
146 return nil, drivers.ErrResourceNotFound
147 }
148 if r.Meta.DeletedOn != nil && !withDeleted {
149 return nil, drivers.ErrResourceNotFound
150 }
151 if clone {
152 return c.clone(r), nil
153 }
154 return r, nil
155}
156
157// list returns a list of resources in the catalog.
158// It optionally supports filtering by kind, path, and soft-deleted status.

Callers 12

flushMethod · 0.95
createMethod · 0.95
renameMethod · 0.95
clearRenamedFromMethod · 0.95
updateMetaMethod · 0.95
updateSpecMethod · 0.95
updateStateMethod · 0.95
updateErrorAndWarningMethod · 0.95
updateDeletedMethod · 0.95
updateStatusMethod · 0.95
deleteMethod · 0.95
retryCyclicRefsMethod · 0.95

Calls 1

cloneMethod · 0.95

Tested by

no test coverage detected