Help us shape the future of Go! Take the 2026 Go Developer Survey

budget

package
v0.1.1392 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 4 Imported by: 0

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