driver

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package driver has implementations of the runner.Driver interface for the different drivers available in Djinn.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateScript

func CreateScript(j *runner.Job) *bytes.Buffer

CreateScript returns a bytes.Buffer that contains a concatenation of the given runner.Job commands into a shell script. Each shell script is prepended with the given header,

#!/bin/sh
exec 2>&1
set -ex

func IsValid

func IsValid(typ string) bool

IsValid checks to see if the given driver type is valid.

Types

type Config

type Config interface {
	// Apply applies the current configuration to the given Driver. This should
	// configure the Driver ready for build execution.
	Apply(d runner.Driver)

	// Merge in the given driver configuration from a build manifest, and return
	// a copy of the original config with the merged in values.
	Merge(m map[string]string) Config
}

type Init

type Init func(io.Writer, Config) runner.Driver

Init is the function for fully initializing a driver with the given io.Writer, and configuration passed in via the map.

type Type

type Type uint8

Type represents the type of driver being used.

const (
	SSH    Type = iota // ssh
	QEMU               // qemu
	Docker             // docker
)

func (*Type) Scan

func (t *Type) Scan(val interface{}) error

Scan assumes the given interface value is either a byte slice or a string, and turns the underlying value into the corresponding Type.

func (Type) String

func (i Type) String() string

func (*Type) UnmarshalText

func (t *Type) UnmarshalText(b []byte) error

UnmarshalText unmarshals the given byte slice setting the underlying Type for that driver. If the byte slice is not of a valid driver then an error is returned.

func (Type) Value

func (t Type) Value() (driver.Value, error)

Value returns a string value of the driver Type to be inserted into the database.

Directories

Path Synopsis
Package docker providers an implementation of a Driver driver for job execution.
Package docker providers an implementation of a Driver driver for job execution.
Package qemu provides an implementation of a Driver driver for job execution.
Package qemu provides an implementation of a Driver driver for job execution.
Package ssh provides an implemention of an Driver driver for executing jobs on.
Package ssh provides an implemention of an Driver driver for executing jobs on.

Jump to

Keyboard shortcuts

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