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

Method link

runtime/catalog_cache.go:435–455  ·  view source on GitHub ↗

link adds a resource to the cache and its indexes.

(r *runtimev1.Resource)

Source from the content-addressed store, hash-verified

433
434// link adds a resource to the cache and its indexes.
435func (c *catalogCache) link(r *runtimev1.Resource) {
436 if c.resources[r.Meta.Name.Kind] == nil {
437 c.resources[r.Meta.Name.Kind] = make(map[string]*runtimev1.Resource)
438 }
439 c.resources[r.Meta.Name.Kind][strings.ToLower(r.Meta.Name.Name)] = r
440
441 s := nameStr(r.Meta.Name)
442
443 if r.Meta.DeletedOn == nil {
444 ok := c.dag.Add(r.Meta.Name, r.Meta.Refs...)
445 if !ok {
446 c.cyclic[s] = r.Meta.Name
447 }
448 } else {
449 c.deleted[s] = r.Meta.Name
450 }
451
452 if r.Meta.RenamedFrom != nil {
453 c.renamed[s] = r.Meta.Name
454 }
455}
456
457// unlink reverses a previous call to link.
458func (c *catalogCache) unlink(r *runtimev1.Resource) {

Callers 10

newCatalogCacheFunction · 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

Calls 2

nameStrFunction · 0.85
AddMethod · 0.65

Tested by

no test coverage detected