Documentation
¶
Index ¶
- Constants
- Variables
- func CleanupOldEngines(ctx context.Context, preserveVersions []string) error
- func RegisteredSchemes() []string
- func SchemeCompletions() []string
- func SchemeHelp() string
- func SchemePrefix(value string) string
- func SchemeSummary() string
- type Connector
- type DaggerCloudConnector
- type Driver
- type DriverOpts
- type Scheme
Constants ¶
const ( EnvDaggerCloudToken = "DAGGER_CLOUD_TOKEN" EnvGPUSupport = "_EXPERIMENTAL_DAGGER_GPU_SUPPORT" )
const InstrumentationLibrary = "dagger.io/client.drivers"
const (
TLSDialTimeout = 10 * time.Second
)
Variables ¶
var TLSHandshakeTimeout = 15 * time.Second
Functions ¶
func CleanupOldEngines ¶ added in v0.21.0
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 ¶
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) 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
}
type DriverOpts ¶
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.