orgwatch

package
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 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 orgwatch remembers, per pod and in memory, the provider organization each credential's served responses name, and reports an account whose credentials name different ones: those keys are separate organizations with separate upstream limits, which the account counts as one.

It only reports, with one warning log line and one count of relay_account_org_mismatch_total per account and pair of organizations. It never moves a key or writes a row; detecting a key's account and moving it are the operator's actions on the control plane.

Out of scope: sharing what one pod saw with the others, and forgetting deleted credentials (their entries stay until restart, bounded by the credentials the pod served).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Watch

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

Watch is the per-pod memory of the organization each credential last named. Safe for concurrent use.

func New

func New(log *slog.Logger) *Watch

New returns an empty Watch logging to log.

func (*Watch) ObserveOrg

func (w *Watch) ObserveOrg(accountID, credentialID, orgID string)

ObserveOrg records that credentialID, in accountID, was served under orgID. The repeat of what the credential last named takes a read lock and allocates nothing; anything new is compared against the account's other credentials.

Jump to

Keyboard shortcuts

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