ratelimit

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 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

This section is empty.

Types

type Limits

type Limits struct {
	BurstPerMin   int
	QuotaPerMonth int
	MaxInstances  int
}

Limits are plan caps; QuotaPerMonth == 0 means unlimited, MaxInstances == 0 means unlimited. Create inherits the highest sibling tier so MaxInstances stays consistent under immutable entitlements.

func LimitsFor

func LimitsFor(tier string) (Limits, bool)

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