querycounter

package
v1.65.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetQueryCount

func GetQueryCount(ctx context.Context) int

GetQueryCount returns the current value of the query counter from the context. Returns 0 if no counter was initialized.

func Increment

func Increment(ctx context.Context)

Increment atomically increments the query counter stored in ctx. If no counter was initialized (e.g., in tests without middleware), this is a no-op.

func Init

func Init(ctx context.Context) context.Context

Init stores a new atomic counter in the context and returns the new context. Call this once per request (e.g., in middleware).

Types

This section is empty.

Jump to

Keyboard shortcuts

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