driver

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 40 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GRPCStatusToHTTP = grpcStatusToHTTP

grpcStatusToHTTP maps a gRPC status code to an HTTP-like status code so the engine's error classifier and metrics work uniformly across all driver types.

OK(0)                 → 200
InvalidArgument(3)    → 400
OutOfRange(11)        → 400
Unauthenticated(16)   → 401
PermissionDenied(7)   → 403
NotFound(5)           → 404
AlreadyExists(6)      → 409
ResourceExhausted(8)  → 429
Unimplemented(12)     → 501
Unavailable(14)       → 503
DeadlineExceeded(4)   → 504
other                 → 500

GRPCStatusToHTTP is exported for testing.

View Source
var SFTPErrorToHTTP = sftpErrorToHTTP

SFTPErrorToHTTP is exported for tests.

Functions

This section is empty.

Types

type BrowserDriver

type BrowserDriver struct{}

BrowserDriver executes tasks using a headless Chrome browser via chromedp. Each Execute call spawns an isolated browser instance to avoid memory leaks.

func NewBrowserDriver

func NewBrowserDriver() *BrowserDriver

NewBrowserDriver creates a BrowserDriver.

func (*BrowserDriver) Execute

func (d *BrowserDriver) Execute(ctx context.Context, t task.Task) task.Result

Execute navigates to t.URL with a headless Chrome instance.

type DNSDriver

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

DNSDriver performs DNS lookups using the miekg/dns library.

func NewDNSDriver

func NewDNSDriver() *DNSDriver

NewDNSDriver creates a DNSDriver with a shared DNS client.

func (*DNSDriver) Execute

func (d *DNSDriver) Execute(ctx context.Context, t task.Task) task.Result

Execute performs a DNS query for t.URL using the configured resolver and record type.

type Driver

type Driver interface {
	Execute(ctx context.Context, t task.Task) task.Result
}

Driver executes a single task and returns a result.

type GRPCDriver added in v1.1.0

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

GRPCDriver executes unary gRPC requests. It uses server reflection to resolve request/response types so no .proto files are required at runtime. Connections and method descriptors are cached across calls.

URL format:

grpc://host:port/package.Service/Method   — plaintext
grpcs://host:port/package.Service/Method  — TLS

func NewGRPCDriver added in v1.1.0

func NewGRPCDriver() *GRPCDriver

NewGRPCDriver creates a GRPCDriver.

func (*GRPCDriver) Execute added in v1.1.0

func (d *GRPCDriver) Execute(ctx context.Context, t task.Task) task.Result

Execute performs the unary gRPC call described by t.

type HTTPDriver

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

HTTPDriver executes HTTP requests.

func NewHTTPDriver

func NewHTTPDriver() *HTTPDriver

NewHTTPDriver creates an HTTPDriver with a shared transport.

func NewHTTPDriverWithRedirectLimiter added in v1.2.5

func NewHTTPDriverWithRedirectLimiter(redirectLimiter RedirectLimiter) *HTTPDriver

NewHTTPDriverWithRedirectLimiter creates an HTTPDriver that asks redirectLimiter for permission before following cross-host redirects.

func (*HTTPDriver) Execute

func (d *HTTPDriver) Execute(ctx context.Context, t task.Task) task.Result

Execute performs the HTTP request described by t.

type RedirectLimiter added in v1.2.5

type RedirectLimiter func(ctx context.Context, host string) error

RedirectLimiter is called before the HTTP driver follows a redirect to a different host.

type SFTPDriver added in v1.6.0

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

SFTPDriver executes upload, download, and list operations over SFTP.

func NewSFTPDriver added in v1.6.0

func NewSFTPDriver() *SFTPDriver

NewSFTPDriver creates an SFTP driver with a shared connection cache.

func (*SFTPDriver) Execute added in v1.6.0

func (d *SFTPDriver) Execute(ctx context.Context, t task.Task) task.Result

Execute performs the SFTP operation described by t.

type WebSocketDriver

type WebSocketDriver struct{}

WebSocketDriver connects to a WebSocket endpoint, sends messages, and waits.

func NewWebSocketDriver

func NewWebSocketDriver() *WebSocketDriver

NewWebSocketDriver creates a WebSocketDriver.

func (*WebSocketDriver) Execute

func (d *WebSocketDriver) Execute(ctx context.Context, t task.Task) task.Result

Execute opens a WebSocket connection, sends configured messages, optionally waits for expected messages, then holds the connection for duration_s.

Jump to

Keyboard shortcuts

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