budget

package
v0.1.4967 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package budget holds each gateway key to the limits its owner set (#585): the tokens or estimated cost it may use in a window. While a key has a limit, it stays on.

It is the limiter of the gateway's budget point (P3 of docs/subsystems/plugin-runtime.md): Apply serves internal/budget's, and the point fails closed: a request of a key held to a limit is not sent while no limiter serves it. What a key has used is the core's, read from the usage records, so the Settings page, `magpie keys` and /v1/magpie/limit tell it either way.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InUse

func InUse() (int, error)

InUse counts the gateway keys held to a limit; caller-keys.json that can't be read is not known, so it stays on.

Types

This section is empty.

Jump to

Keyboard shortcuts

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