xbuild

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerImage

type DockerImage struct {
	Image   string
	Workdir string
	Volumes map[string]string
	Env     map[string]string
}

DockerImage provides based on downloadable docker images.

func (*DockerImage) Executor added in v0.0.7

func (p *DockerImage) Executor(verbose bool) (clitool.Executor, error)

Executor creates the execution environment

func (*DockerImage) Shell added in v0.0.7

func (p *DockerImage) Shell() error

func (*DockerImage) Start added in v0.0.7

func (p *DockerImage) Start() error

Build pulls the required image.

func (*DockerImage) Stop added in v0.0.7

func (p *DockerImage) Stop() error

type DockerRunner added in v0.0.7

type DockerRunner struct {
	Image   *DockerImage
	Keep    bool // keep container
	Verbose bool
}

func (*DockerRunner) Exec added in v0.0.7

func (dr *DockerRunner) Exec(
	ctx context.Context,
	cmd clitool.Command,
	args *clitool.Args,
	stdout, stderr io.Writer,
) (bool, error)

type OSArch

type OSArch struct {
	OS   string
	Arch string
}

OSArch tuple.

type Provider

type Provider interface {
	// Start prepare/starts up the provider
	Start() error

	// Stop shuts down the provider and cleans up resources if possible
	Stop() error

	// Executor creates the execution environment
	Executor(verbose bool) (clitool.Executor, error)

	// Shell starts an interactive shell if possible
	Shell() error
}

Provider defines available functionality all cross build providers MUST implement.

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry of available cross build environment providers.

func NewRegistry

func NewRegistry(tbl map[OSArch]Provider) *Registry

NewRegistry creates a new Regsitry.

func (*Registry) Find

func (r *Registry) Find(os, arch string) (Provider, error)

Find finds a provider by OS and Architecture name. Returns error if no provider can be found.

func (*Registry) With

func (r *Registry) With(os, arch string, fn func(Provider) error) error

Jump to

Keyboard shortcuts

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