build

package
v0.0.0-...-e537141 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrArchNotFound = fmt.Errorf("could not map ArchKind to GOARCH value")
View Source
var ErrOsNotFound = fmt.Errorf("could not map OsKind to GOOS value")

Functions

func DoRename

func DoRename(r Renamer, srcs string, rn ToRename) error

func RunCmd

func RunCmd(env map[string]string, cmd string, args ...any) error

Types

type ArchKind

type ArchKind int
const (
	Arch386 ArchKind = iota
	ArchAmd64
	ArchAmd64P32
	ArchArm
	ArchArm64
	ArchPPC64
	ArchPPC64Le
	ArchMips
	ArchMips64
	ArchMips64P32
	ArchMips64P32Le
	ArchPPC
	ArchS390
	ArchS390x
	ArchSparc
	ArchSparc64
)

func MustParseArch

func MustParseArch(name string) ArchKind

func ParseArch

func ParseArch(name string) (ArchKind, error)

func (ArchKind) String

func (arch ArchKind) String() string

type Env

type Env struct {
	Fs afero.Fs
	// contains filtered or unexported fields
}

func DefaultEnv

func DefaultEnv(fs afero.Fs) (Env, error)

func MustDefaultEnv

func MustDefaultEnv(fs afero.Fs) Env

func (Env) RunGo

func (e Env) RunGo(env RunEnv, args ...string) error

func (Env) WithWorkdir

func (env Env) WithWorkdir(parts ...string) string

type FlagCache

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

func NewFlagCache

func NewFlagCache() FlagCache

func (FlagCache) GenFlags

func (fc FlagCache) GenFlags(opt GenOption) []string

func (FlagCache) Generate

func (fc FlagCache) Generate(cfg GenConfig, run Runner) error

func (FlagCache) GetFlags

func (fc FlagCache) GetFlags(opt GenOption) []string

type GOARCHtoArch

type GOARCHtoArch map[string]ArchKind

type GOOSToOs

type GOOSToOs map[string]OsKind

type GenConfig

type GenConfig struct {
	Generate   ToGen
	Executable string
}

type GenOption

type GenOption uint8
const (
	GenMarhsal GenOption = 1 << iota
	GenLower
	GenNoPrefix
)

type Generator

type Generator interface {
	Generate(cfg GenConfig, env Env) error
}

type OsKind

type OsKind int
const (
	OsWindows OsKind = iota
	OsLinux
	OsDarwin
	OsAndroid
	OsDragonfly
	OsFreeBsd
	OsNaCl
	OsNetBsd
	OsOpenBsd
	OsPlan9
	OsSolaris
)

func MustParseOs

func MustParseOs(name string) OsKind

func ParseOs

func ParseOs(name string) (OsKind, error)

func (OsKind) String

func (os OsKind) String() string

type Renamer

type Renamer interface {
	Rename(srcs string, to ToRename) error
}

type RunEnv

type RunEnv map[string]string

type RunWith

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

func NewRunWith

func NewRunWith(env RunEnv) RunWith

func (RunWith) Run

func (rw RunWith) Run(cmd string, args ...string) error

type Runner

type Runner interface {
	Run(cmd string, args ...string) error
}

type ToGen

type ToGen map[string]GenOption

type ToRename

type ToRename map[string]string

type ToolConfig

type ToolConfig struct {
	Dir   string
	Tools []string
}

func (ToolConfig) Install

func (tc ToolConfig) Install(env Env) error

func (ToolConfig) RunTool

func (tc ToolConfig) RunTool(env Env, tool string, args ...string) error

func (ToolConfig) Update

func (tc ToolConfig) Update(env Env) error

type ToolOp

type ToolOp int
const (
	ToolInstall ToolOp = iota
	ToolUpdate
)

Jump to

Keyboard shortcuts

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