schemaquota

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Overview

Package schemaquota carries execution-scoped schema introspection budgets to provider clients and adapters. Built-in connectors charge the quota before appending provider metadata to an in-memory result.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Attached

func Attached(ctx context.Context) bool

Attached reports whether ctx carries an execution-scoped schema quota.

func Charge

func Charge(ctx context.Context, items, bytes int) error

Charge reserves result work before the caller retains provider metadata.

func RemainingBytes

func RemainingBytes(ctx context.Context, fallback int) int

RemainingBytes returns the unreserved byte budget, capped by fallback when fallback is positive. It lets HTTP provider clients bound response reads before JSON decoding allocates provider objects.

func WithQuota

func WithQuota(ctx context.Context, maxItems, maxBytes int) context.Context

WithQuota attaches a fresh quota to ctx. Invalid limits fail closed when the first provider item is charged.

Types

type Quota

type Quota struct {
	// contains filtered or unexported fields
}

Quota is a concurrency-safe work and allocation budget for one introspection.

Jump to

Keyboard shortcuts

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