docker

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstallDriver

func InstallDriver(language, commit string) error

InstallDriver downloads driver's repository, checkouts to a given commit, builds docker image and installs driver's image to bblfshd container. Requires bblfshd container running.

func RunBblfshd

func RunBblfshd(tag string) (string, func(), error)

RunBblfshd pulls and runs bblfshd container with a given tag, waits until the port is ready and returns endpoint address and a closer that performs post-cleanup

Types

type Driver added in v0.0.6

type Driver struct {
	// Address is a driver's GRPC address
	Address string
	// Pool contains docker client for further interaction with container
	Pool *dockertest.Pool
	// Resource contains container metadata
	Resource *dockertest.Resource
}

Driver is a struct that eases interaction with driver container

func RunDriver added in v0.0.6

func RunDriver(image *Image, mounts ...string) (*Driver, error)

RunDriver runs driver of given image and mounts

func (*Driver) Close added in v0.0.6

func (d *Driver) Close()

Close removes container

func (*Driver) Exec added in v0.0.6

func (d *Driver) Exec(ctx context.Context, envs []string, cmd ...string) error

Exec executes given command inside the driver, sends output to Stdout and returns error if commands exit code != 0

func (*Driver) GetResults added in v0.0.6

func (d *Driver) GetResults(ctx context.Context, src string) ([]byte, error)

GetResults reads result files inside the container Do not use it on large files!

func (*Driver) Upload added in v0.0.6

func (d *Driver) Upload(ctx context.Context, src, dst string) error

TODO(lwsanty): use UploadToContainer for more various data Upload uploads given file from host to container source file's descriptor is used as input stream docker executes cat command to redirect this stream to the destination file

type Image added in v0.0.6

type Image struct {
	Org  string
	Name string
	Tag  string
}

Image is a struct that eases work with docker image and tag handling represented in form org/name:tag

func DownloadAndBuildDriver added in v0.0.6

func DownloadAndBuildDriver(language, commit string) (*Image, error)

DownloadAndBuildDriver creates directory in the temporary folder, clones driver's repository there, checkouts to a given commit and runs docker image build script. Arguments: language - name of the supported language(check docker/conf/drivers.json) commit - commit hash to checkout to

Jump to

Keyboard shortcuts

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