Documentation
¶
Index ¶
Constants ¶
View Source
const NoopName = "noop"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Factory ¶
Factory constructs a quota Provider from shared runtime dependencies and provider-specific parameters. Passing nil args is legal for Providers that take no parameters (e.g. Noop).
type Noop ¶
type Noop struct{}
Noop is a Provider that reports the quota feature as disabled. It is the default for open-source builds where no quota backend is configured.
type Provider ¶
type Provider interface {
// Enabled reports whether the provider can answer queries. False means
// the quota feature is unavailable (no backend configured, CRD missing,
// etc.) — callers should skip quota checks gracefully.
Enabled() bool
// ListForUser returns all quotas visible to the (user, team) pair.
// Returns (nil, nil) when the provider is disabled or the user has no
// visible quotas; returns an AppError only on transient/system failures.
ListForUser(ctx context.Context, user, team string) ([]QuotaInfo, *domain.AppError)
}
Provider exposes read-only access to quota information.
A nil Provider is not valid; callers should always hold at least a Noop. Use Enabled() to decide whether to expose quota-related UI.
Click to show internal directories.
Click to hide internal directories.