Help us shape the future of Go! Take the 2026 Go Developer Survey

driver

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: Apache-2.0 Imports: 13 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotConnecting = errors.Errorf("driver not connecting")
View Source
var ErrNotRunning = errors.Errorf("driver not running")

Functions

func Boot

func Boot(ctx, clientContext context.Context, d Driver, pw progress.Writer) (*client.Client, error)

func GetFactories added in v0.3.0

func GetFactories() map[string]Factory

func Register

func Register(f Factory)

Types

type Auth added in v0.5.0

type Auth interface {
	GetAuthConfig(registryHostname string) (clitypes.AuthConfig, error)
}

type BuildkitConfig

type BuildkitConfig struct {
}

type Driver

type Driver interface {
	Factory() Factory
	Bootstrap(context.Context, progress.Logger) error
	Info(context.Context) (*Info, error)
	Stop(ctx context.Context, force bool) error
	Rm(ctx context.Context, force bool, rmVolume bool) error
	Client(ctx context.Context) (*client.Client, error)
	Features() map[Feature]bool
	IsMobyDriver() bool
	Config() InitConfig
}

func GetDriver

func GetDriver(ctx context.Context, name string, f Factory, api dockerclient.APIClient, auth Auth, kcc KubeClientConfig, flags []string, config string, do map[string]string, platforms []specs.Platform, contextPathHash string) (Driver, error)

type Factory

type Factory interface {
	Name() string
	Usage() string
	Priority(context.Context, dockerclient.APIClient) int
	New(ctx context.Context, cfg InitConfig) (Driver, error)
	AllowsInstances() bool
}

func GetDefaultFactory

func GetDefaultFactory(ctx context.Context, c dockerclient.APIClient, instanceRequired bool) (Factory, error)

func GetFactory

func GetFactory(name string, instanceRequired bool) Factory

type Feature

type Feature string
const CacheExport Feature = "cache export"
const DockerExporter Feature = "Docker exporter"
const MultiPlatform Feature = "multiple platforms"
const OCIExporter Feature = "OCI exporter"

type Info

type Info struct {
	Status Status
	// DynamicNodes must be empty if the actual nodes are statically listed in the store
	DynamicNodes []store.Node
}

type InitConfig

type InitConfig struct {
	// This object needs updates to be generic for different drivers
	Name             string
	DockerAPI        dockerclient.APIClient
	KubeClientConfig KubeClientConfig
	BuildkitFlags    []string
	ConfigFile       string
	DriverOpts       map[string]string
	Auth             Auth
	Platforms        []specs.Platform
	// ContextPathHash can be used for determining pods in the driver instance
	ContextPathHash string
}

type KubeClientConfig added in v0.5.0

type KubeClientConfig interface {
	ClientConfig() (*rest.Config, error)
	Namespace() (string, bool, error)
}

type KubeClientConfigInCluster added in v0.5.0

type KubeClientConfigInCluster struct{}

func (KubeClientConfigInCluster) ClientConfig added in v0.5.0

func (k KubeClientConfigInCluster) ClientConfig() (*rest.Config, error)

func (KubeClientConfigInCluster) Namespace added in v0.5.0

func (k KubeClientConfigInCluster) Namespace() (string, bool, error)

type Status

type Status int
const (
	Inactive Status = iota
	Starting
	Running
	Stopping
	Stopped
)

func (Status) String

func (s Status) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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