xbuild

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2019 License: Apache-2.0 Imports: 3 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) Build

func (p DockerImage) Build() error

Build pulls the required image.

func (DockerImage) Run

func (p DockerImage) Run(env map[string]string, cmdAndArgs ...string) error

Run executes the command in a temporary docker container. The container is deleted after its execution.

type OSArch

type OSArch struct {
	OS   string
	Arch string
}

OSArch tuple.

type Provider

type Provider interface {
	// Build the environment
	Build() error

	// Run command within environment.
	Run(env map[string]string, cmdAndArgs ...string) 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

With calls fn with a provider matching the requires OS and ARCH. Returns and error if no provider can be found or function itself errors.

Jump to

Keyboard shortcuts

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