NewRepoAccessCache creates a RepoAccessCache bound to the supplied clients.
(client *githubv4.Client, restClient *github.Client, opts ...RepoAccessOption)
| 76 | |
| 77 | // NewRepoAccessCache creates a RepoAccessCache bound to the supplied clients. |
| 78 | func 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. |
| 98 | type CacheStats struct { |
no outgoing calls