engine

package
v4.1.14 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2025 License: GPL-2.0 Imports: 28 Imported by: 0

Documentation

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 DBInterfaceLister

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

DBLister lists network interfaces from DB.

func NewDBInterfaceLister

func NewDBInterfaceLister(dbPath string) *DBInterfaceLister

Constructor for DBInterfaceLister

func (DBInterfaceLister) ListInterfaces

func (dbLister DBInterfaceLister) ListInterfaces() ([]string, error)

Implementation of the interface function that uses existing functionality.

type QueryRunner

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

QueryRunner implements the Runner interface to execute queries against the goDB flow database

func NewQueryRunner

func NewQueryRunner(dbPath string, opts ...RunnerOption) *QueryRunner

NewQueryRunner creates a new query runner

func (*QueryRunner) Run

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

Run implements the query.Runner interface

func (*QueryRunner) RunStatement

func (qr *QueryRunner) RunStatement(ctx context.Context, stmt *query.Statement, send sse.Sender) (res *results.Result, err error)

RunStatement executes the prepared statement and generates the results

func (*QueryRunner) RunStreaming

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

RunStreaming implements the api.SSEQueryRunner interface

type RunnerOption

type RunnerOption func(*QueryRunner)

RunnerOption allows to configure the query runner

func WithLiveData

func WithLiveData(captureManager *capture.Manager) RunnerOption

WithLiveData adds a capture manager which allows to query live data in addition to the data fetched from the DB

func WithMaxConcurrent

func WithMaxConcurrent(sem chan struct{}) RunnerOption

WithMaxConcurrent sets a maximum number of concurrent running queries

func WithStatsCallbacks

func WithStatsCallbacks(callbacks ...workload.StatsFunc) RunnerOption

WithStatsCallbacks configures the DBWorkManager to emit feedback on query processing. They will be called in the order they are provided

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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