Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheStats ¶ added in v0.22.0
CacheStats summarizes cache activity counters.
type RepoAccessCache ¶ added in v0.22.0
type RepoAccessCache struct {
// contains filtered or unexported fields
}
RepoAccessCache caches repository metadata related to lockdown checks so that multiple tools can reuse the same access information safely across goroutines.
func GetInstance ¶ added in v0.22.0
func GetInstance(client *githubv4.Client, opts ...RepoAccessOption) *RepoAccessCache
GetInstance returns the singleton instance of RepoAccessCache. It initializes the instance on first call with the provided client and options. Subsequent calls ignore the client and options parameters and return the existing instance. This is the preferred way to access the cache in production code.
func (*RepoAccessCache) IsSafeContent ¶ added in v0.22.0
func (*RepoAccessCache) SetLogger ¶ added in v0.22.0
func (c *RepoAccessCache) SetLogger(logger *slog.Logger)
SetLogger updates the logger used for cache diagnostics.
type RepoAccessInfo ¶ added in v0.22.0
RepoAccessInfo captures repository metadata needed for lockdown decisions.
type RepoAccessOption ¶ added in v0.22.0
type RepoAccessOption func(*RepoAccessCache)
RepoAccessOption configures RepoAccessCache at construction time.
func WithCacheName ¶ added in v0.22.0
func WithCacheName(name string) RepoAccessOption
WithCacheName overrides the cache table name used for storing entries. This option is intended for tests that need isolated cache instances.
func WithLogger ¶ added in v0.22.0
func WithLogger(logger *slog.Logger) RepoAccessOption
WithLogger sets the logger used for cache diagnostics.
func WithTTL ¶ added in v0.22.0
func WithTTL(ttl time.Duration) RepoAccessOption
WithTTL overrides the default TTL applied to cache entries. A non-positive duration disables expiration.