Documentation
¶
Overview ¶
Package distributed handles distributed queries across multiple hosts
Index ¶
Constants ¶
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