drivers

package
v1.0.0-beta.12 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvDaggerCloudToken = "DAGGER_CLOUD_TOKEN"
	EnvGPUSupport       = "_EXPERIMENTAL_DAGGER_GPU_SUPPORT"
)
View Source
const InstrumentationLibrary = "dagger.io/client.drivers"
View Source
const (
	TLSDialTimeout = 10 * time.Second
)

Variables

View Source
var TLSHandshakeTimeout = 15 * time.Second

Functions

func CleanupOldEngines added in v0.21.0

func CleanupOldEngines(ctx context.Context, preserveVersions []string) error

CleanupOldEngines removes local engine containers while preserving the versions that are expected to be used by the current command.

func RegisteredSchemes

func RegisteredSchemes() []string

RegisteredSchemes returns the driver registry keys, sorted. Error messages use it, so it reports what the client can dial, not what help documents.

func SchemeCompletions

func SchemeCompletions() []string

SchemeCompletions returns the values to offer for shell completion of an engine selector. Deprecated values are left out.

func SchemeHelp

func SchemeHelp() string

SchemeHelp renders the full catalog, grouped, for a help topic.

func SchemePrefix

func SchemePrefix(value string) string

SchemePrefix returns the part of a value that a user types before the target: "image://" for "image://IMAGE", and "cloud" for a value that is not a URI.

func SchemeSummary

func SchemeSummary() string

SchemeSummary names the main engine selector values on one line. The `--engine` flag usage uses it.

Types

type Connector

type Connector interface {
	// Connect creates a connection to a dagger instance.
	//
	// Connect can be called multiple times during attempts to establish a
	// connection - but a connector can choose to block this call until
	// previously returned connections have been closed.
	Connect(ctx context.Context) (net.Conn, error)

	// If available, a unique identifier for the engine, otherwise empty string.
	EngineID() string
}

type DaggerCloudConnector added in v0.19.7

type DaggerCloudConnector struct {
	EngineSpec cloud.EngineSpec
}

func (*DaggerCloudConnector) Connect added in v0.19.7

func (dc *DaggerCloudConnector) Connect(ctx context.Context) (net.Conn, error)

func (*DaggerCloudConnector) EngineID added in v0.19.7

func (dc *DaggerCloudConnector) EngineID() string

type Driver

type Driver interface {
	// Available returns true if the driver backend is running and available for use.
	Available(ctx context.Context) (bool, error)

	// Provision creates any underlying resources for a driver, and returns a
	// Connector that can connect to it.
	Provision(ctx context.Context, url *url.URL, opts *DriverOpts) (Connector, error)

	// ImageLoader returns an optional associated image loader - not all
	// drivers will have this!
	ImageLoader(ctx context.Context) imageload.Backend
}

func GetDriver

func GetDriver(ctx context.Context, name string) (Driver, error)

type DriverOpts

type DriverOpts struct {
	DaggerCloudToken string
	GPUSupport       string
	Module           string
	Function         string
	ExecCmd          []string
	ClientID         string
	CloudAuth        *auth.Cloud
}

type Scheme

type Scheme struct {
	// Scheme is the key that the driver registry uses.
	Scheme string
	// Value is the form to write after `--engine=`.
	Value string
	// Note explains the value when the syntax alone is not enough.
	Note string
	// Group titles a set of related values in the help topic.
	Group string
	// Primary marks a value that the short flag usage names.
	Primary bool
	// Deprecated marks a value that remains for compatibility. Help and
	// completion leave these out; the help topic still lists them.
	Deprecated bool
}

Scheme describes one engine selector value for user-facing help. The catalog below is the single source of truth for the `--engine` flag usage, the `dagger help engine` topic, and shell completion. A test asserts that it covers the driver registry exactly, so the three surfaces cannot drift from the drivers that the CLI can actually use.

func SchemeCatalog

func SchemeCatalog() []Scheme

SchemeCatalog returns the engine selector values, in help order.

Jump to

Keyboard shortcuts

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