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 ¶
New builds an Allowlist from a list of repositories in the form of "group/project" - e.g. "gitlab-org/gitlab".
func (*Allowlist) Allowed ¶
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
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.
func (*Allowlist) Contains ¶ added in v1.41.0
Contains reports whether the repository is literally in the set, regardless of the disabled flag. Unlike Allowed, Contains does not treat a nil or disabled allowlist as matching every repo — the return is a raw set-membership check. Used by opt-in features (like dry-run mode) whose "enabled for this repo" question is the opposite of the caching path's "allow this repo" question.