Search and commands

↑ ↓ to select · Enter to open · Esc to close

Type to search packages.

driver

v1.1.1
djinn-ci.com/driver

Documentation

pkg.go.dev ↗

Table of contents

↓ to select · Enter to jump· Shift+Enter for source

14 matches

Top ↑

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

Functions

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

IsValid

func IsValid(typ string) bool

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

Types

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
}

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 uint8

Type represents the type of driver being used.

SSH (3 declarations)

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

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.

Type.String

func (i Type) String() string

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.

Type.Value

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

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

Dependency graph