gox

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package gox provides a spell incantation for the "github.com/mitchellh/gox" Go module command, a dead simple, no frills Go cross compile tool that behaves a lot like the standard Go toolchain "build" command.

See https://pkg.go.dev/github.com/mitchellh/gox for more details about "gox". The source code of the "gox" is available at https://github.com/mitchellh/gox.

Index

Constants

View Source
const (
	// DefaultGoModulePath is the default "gox" module command import path.
	DefaultGoModulePath = "github.com/mitchellh/gox"

	// DefaultGoModuleVersion is the default "gox" module version.
	DefaultGoModuleVersion = "v1.0.1"
)

Variables

View Source
var (
	// DefaultCrossCompileBinaryNameTemplate is the default name template for cross-compilation binary artifacts.
	DefaultCrossCompileBinaryNameTemplate = func(name string) string {
		return name + "-{{.OS}}-{{.Arch}}"
	}

	// DefaultCrossCompileTargetPlatforms are the names of default cross-compile platform targets.
	//
	// See `go tool dist list` and https://github.com/golang/go/blob/master/src/cmd/dist/build.go
	// for more details and a list of supported platforms.
	DefaultCrossCompileTargetPlatforms = []string{
		"darwin/amd64",
		"linux/amd64",
		"windows/amd64",
	}
)

Functions

This section is empty.

Types

type Option

type Option func(*Options)

Option is a spell incantation option for the "github.com/mitchellh/gox" Go module command.

func WithEnv

func WithEnv(env map[string]string) Option

WithEnv sets the spell incantation specific environment.

func WithGoBuildOptions

func WithGoBuildOptions(goBuildOpts ...spellGoBuild.Option) Option

WithGoBuildOptions sets options for the Go toolchain "build" command.

func WithGoCmd

func WithGoCmd(goCmd string) Option

WithGoCmd sets the path to the Go toolchain executable.

func WithGoOptions

func WithGoOptions(goOpts ...spellGo.Option) Option

WithGoOptions sets shared Go toolchain command options.

func WithModulePath

func WithModulePath(path string) Option

WithModulePath sets the "gox" module command import path. Defaults to DefaultGoModulePath.

func WithModuleVersion

func WithModuleVersion(version *semver.Version) Option

WithModuleVersion sets the "gox" module version. Defaults to DefaultGoModuleVersion.

func WithOutputTemplate

func WithOutputTemplate(outputTemplate string) Option

WithOutputTemplate sets the name template for cross-compile platform targets. Defaults to DefaultCrossCompileBinaryNameTemplate.

func WithVerboseOutput

func WithVerboseOutput(verbose bool) Option

WithVerboseOutput indicates whether the output should be verbose.

type Options

type Options struct {
	*spellGoBuild.Options
	// contains filtered or unexported fields
}

Options are spell incantation options for the "github.com/mitchellh/gox" Go module command.

func NewOptions

func NewOptions(opts ...Option) (*Options, error)

NewOptions creates new spell incantation options for the "github.com/mitchellh/gox" Go module command.

type Spell

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

Spell is a spell incantation for the "github.com/mitchellh/gox" Go module command.

func New

func New(wand wand.Wand, ac app.Config, opts ...Option) (*Spell, error)

New creates a new spell incantation for the "github.com/mitchellh/gox" Go module command, a dead simple, no frills Go cross compile tool that behaves a lot like the standard Go toolchain "build" command.

func (*Spell) Env

func (s *Spell) Env() map[string]string

Env returns spell incantation specific environment variables.

func (*Spell) Formula

func (s *Spell) Formula() []string

Formula returns the spell incantation formula.

func (*Spell) GoModuleID

func (s *Spell) GoModuleID() *project.GoModuleID

GoModuleID returns partial Go module identifier information.

func (*Spell) Kind

func (s *Spell) Kind() spell.Kind

Kind returns the spell incantation kind.

func (*Spell) Options

func (s *Spell) Options() interface{}

Options returns the spell incantation options.

Jump to

Keyboard shortcuts

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