distributed

package
v4.2.14-rc0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: GPL-2.0 Imports: 20 Imported by: 1

Documentation

Overview

Package distributed handles distributed queries across multiple hosts

Index

Constants

View Source
const (
	// DefaultSemTimeout is the default / fallback amount of time to wait for acquisition
	// of a semaphore when performing concurrent queries
	DefaultSemTimeout = time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type QueryOption

type QueryOption func(*QueryRunner)

QueryOption configures the query runner

func WithMaxConcurrent

func WithMaxConcurrent(sem chan struct{}) QueryOption

WithMaxConcurrent sets a maximum number of concurrent running queries

func WithScopeEnforcement

func WithScopeEnforcement() QueryOption

WithScopeEnforcement makes the runner require a scope on every query and narrow the resolved host list with it before fan-out. Without it, the runner ignores scopes. The principal on the runner's log lines comes from the context logger the authorization middleware attaches; a runner driven with a scope placed on the context by other means logs no principal

type QueryRunner

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

QueryRunner denotes a query runner / executor, wrapping a Querier interface instance with other fields required to perform a distributed query

func NewQueryRunner

func NewQueryRunner(resolvers *hosts.ResolverMap, querier distributed.Querier, opts ...QueryOption) (qr *QueryRunner)

NewQueryRunner instantiates a new distributed query runner

func (*QueryRunner) Run

func (q *QueryRunner) Run(ctx context.Context, args *query.Args) (*results.Result, error)

Run executes / runs the query and creates the final result structure

func (*QueryRunner) RunStreaming

func (q *QueryRunner) RunStreaming(ctx context.Context, args *query.Args, send sse.Sender) (*results.Result, error)

Jump to

Keyboard shortcuts

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