MCPcopy
hub / github.com/github/github-mcp-server / NewRepoAccessCache

Function NewRepoAccessCache

pkg/lockdown/lockdown.go:78–95  ·  view source on GitHub ↗

NewRepoAccessCache creates a RepoAccessCache bound to the supplied clients.

(client *githubv4.Client, restClient *github.Client, opts ...RepoAccessOption)

Source from the content-addressed store, hash-verified

76
77// NewRepoAccessCache creates a RepoAccessCache bound to the supplied clients.
78func NewRepoAccessCache(client *githubv4.Client, restClient *github.Client, opts ...RepoAccessOption) *RepoAccessCache {
79 c := &RepoAccessCache{
80 client: client,
81 restClient: restClient,
82 cache: cache2go.Cache(defaultRepoAccessCacheKey),
83 ttl: defaultRepoAccessTTL,
84 trustedBotLogins: map[string]struct{}{
85 "copilot": {},
86 "github-actions[bot]": {},
87 },
88 }
89 for _, opt := range opts {
90 if opt != nil {
91 opt(c)
92 }
93 }
94 return c
95}
96
97// CacheStats summarizes cache activity counters.
98type CacheStats struct {

Calls

no outgoing calls