allowlist

package
v1.40.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package allowlist provides a mechanism restrict which repos can go through Packhorse's caching mechanism. Repositories not in the allowlist would be proxied to the upstream.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Allowlist

type Allowlist struct {
	// contains filtered or unexported fields
}

Allowlist holds the set of repos that should be routed through Packhorse's caching path. If repos is empty, no repos are cached. If disabled is true, all repos will be cached.

func New

func New(repos []string, disabled bool) *Allowlist

New builds an Allowlist from a list of repositories in the form of "group/project" - e.g. "gitlab-org/gitlab".

func (*Allowlist) Allowed

func (a *Allowlist) Allowed(repo string) bool

Allowed returns whether the given repository should go through Packhorse's caching path. Note: An empty struct e.g. `var list *allowlist.Allowlist` produces the same behavior as a disabled allowlist (allows all repositories).

func (*Allowlist) Bounded added in v1.25.0

func (a *Allowlist) Bounded() bool

Bounded reports whether the allowlist limits which repos can be cached (active, not nil or disabled). When true, labelling metrics by repository is cardinality-safe.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL