ratelimit

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TierFree       = "free"
	TierStandard   = "standard"
	TierEnterprise = "enterprise"
)

Variables

View Source
var ErrInstanceLimit = fmt.Errorf("ratelimit: instance limit reached: %w", commonerrors.ErrConflict)

ErrInstanceLimit is returned when a tenant already has the tier's max instances. On tier downgrade this means the tenant still has more gateways than the new tier allows — delete excess gateways (or keep them on a higher tier) before lowering the plan.

Functions

func IsKnownTier added in v0.18.0

func IsKnownTier(tier string) bool

IsKnownTier reports whether name is a recognized plan label (no numeric caps here).

Types

type Limits

type Limits struct {
	BurstPerMin   int
	QuotaPerMonth int
	MaxInstances  int
}

Limits are plan caps stamped by the control plane onto each instance. QuotaPerMonth == 0 means unlimited, MaxInstances == 0 means unlimited.

func (Limits) HasInstanceCap

func (l Limits) HasInstanceCap() bool

func (Limits) HasMonthlyQuota

func (l Limits) HasMonthlyQuota() bool

Jump to

Keyboard shortcuts

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