MCPcopy Index your code
hub / github.com/git-bug/git-bug / NewSubCache

Function NewSubCache

cache/subcache.go:64–89  ·  view source on GitHub ↗
(
	repo repository.ClockedRepo,
	resolvers func() entity.Resolvers, getUserIdentity getUserIdentityFunc,
	makeCached func(entity EntityT, entityUpdated func(id entity.Id) error) CacheT,
	makeExcerpt func(CacheT) ExcerptT,
	makeIndexData func(CacheT) []string,
	actions Actions[EntityT],
	typename, namespace string,
	version uint, maxLoaded int)

Source from the content-addressed store, hash-verified

62}
63
64func NewSubCache[EntityT entity.Interface, ExcerptT Excerpt, CacheT CacheEntity](
65 repo repository.ClockedRepo,
66 resolvers func() entity.Resolvers, getUserIdentity getUserIdentityFunc,
67 makeCached func(entity EntityT, entityUpdated func(id entity.Id) error) CacheT,
68 makeExcerpt func(CacheT) ExcerptT,
69 makeIndexData func(CacheT) []string,
70 actions Actions[EntityT],
71 typename, namespace string,
72 version uint, maxLoaded int) *SubCache[EntityT, ExcerptT, CacheT] {
73 return &SubCache[EntityT, ExcerptT, CacheT]{
74 repo: repo,
75 resolvers: resolvers,
76 getUserIdentity: getUserIdentity,
77 makeCached: makeCached,
78 makeExcerpt: makeExcerpt,
79 makeIndexData: makeIndexData,
80 actions: actions,
81 typename: typename,
82 namespace: namespace,
83 version: version,
84 maxLoaded: maxLoaded,
85 excerpts: make(map[entity.Id]ExcerptT),
86 cached: make(map[entity.Id]CacheT),
87 lru: newLRUIdCache(),
88 }
89}
90
91func (sc *SubCache[EntityT, ExcerptT, CacheT]) Typename() string {
92 return sc.typename

Callers 2

NewRepoCacheIdentityFunction · 0.85
NewRepoCacheBugFunction · 0.85

Calls 1

newLRUIdCacheFunction · 0.85

Tested by

no test coverage detected