queryRecorder

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxQueries is the maximum number of queries to keep
	MaxQueries = 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type QueryInfo

type QueryInfo struct {
	Query string              `json:"query"`
	Count int                 `json:"count"`
	Devs  map[string]struct{} `json:"devs"`
	// contains filtered or unexported fields
}

QueryInfo contains information about a recorded query

type QueryRecorder

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

QueryRecorder tracks unique raw queries that have been seen

func New

func New() *QueryRecorder

New creates a new QueryRecorder instance

func (*QueryRecorder) Add

func (qr *QueryRecorder) Add(query string, devID string)

Add records a new query or updates an existing one

func (*QueryRecorder) GetQueries

func (qr *QueryRecorder) GetQueries() []QueryInfo

GetQueries returns a copy of all recorded queries

func (*QueryRecorder) Handler

func (qr *QueryRecorder) Handler() http.Handler

Handler returns an HTTP handler that serves the list of recorded queries

type QueryRecordingExtension

type QueryRecordingExtension struct {
	Recorder *QueryRecorder
}

QueryRecordingExtension creates a GraphQL extension that records queries

func (QueryRecordingExtension) ExtensionName

func (QueryRecordingExtension) ExtensionName() string

func (QueryRecordingExtension) InterceptResponse

func (QueryRecordingExtension) Validate

Jump to

Keyboard shortcuts

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