Documentation
¶
Overview ¶
Package gob is the root of the gob library.
This library aims to make it possible to build go projects based on build recipies in go code.
This is heavily inspired by how zig does it, with build.zig.
Usage ¶
You can use this library by making a go file that looks something like this:
//go build ignore package main
import "github.com/phillezi/gob"
func main() {
b := gob.New()
b.Add("", gob.Static())
b.Run()
}
Index ¶
Constants ¶
View Source
const ( GOOSLinux = "linux" GOOSDarwin = "darwin" GOOSWindows = "windows" GOOSFreeBSD = "freebsd" GOOSNetBSD = "netbsd" GOOSOpenBSD = "openbsd" GOOSSolaris = "solaris" GOOSAIX = "aix" )
Common GOOS constants
View Source
const ( GOARCHAMD64 = "amd64" GOARCHARM64 = "arm64" GOARCH386 = "386" GOARCHARM = "arm" GOARCHPPC64 = "ppc64" GOARCHPPC64LE = "ppc64le" GOARCHMIPS = "mips" GOARCHMIPSLE = "mipsle" GOARCHMIPS64 = "mips64" GOARCHMIPS64LE = "mips64le" GOARCHS390X = "s390x" GOARCHRISCV64 = "riscv64" )
Common GOARCH constants
Variables ¶
View Source
var ( ErrTargetNotFound = errors.New("target not found") ErrNoTargets = errors.New("no targets defined") )
View Source
var ( PopularOSes = []string{GOOSLinux, GOOSDarwin, GOOSWindows} PopularArches = []string{GOARCHAMD64, GOARCHARM64} )
Functions ¶
func GitVersion ¶
func GitVersion() string
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func New ¶
func New(opts ...BuilderOption) *Builder
type BuilderConfig ¶
type BuilderOption ¶
type BuilderOption func(cfg *BuilderConfig)
func WithArgs ¶
func WithArgs(args []string) BuilderOption
func WithBuilderConfig ¶
func WithBuilderConfig(cfg BuilderConfig) BuilderOption
func WithDefaultTarget ¶
func WithDefaultTarget(name string) BuilderOption
func WithExitOnError ¶
func WithExitOnError(v bool) BuilderOption
func WithLogger ¶
func WithLogger(l *slog.Logger) BuilderOption
type CMD ¶
type CMD struct {
// contains filtered or unexported fields
}
CMD represents a generic command/task
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithConfig ¶
func WithDynamic ¶
func WithOutDir ¶
func WithSelector ¶
func WithVersionVar ¶
type PrettyHandler ¶
type PrettyHandler struct {
// contains filtered or unexported fields
}
func NewPrettyHandler ¶
func NewPrettyHandler(opts *slog.HandlerOptions) *PrettyHandler
Source Files
¶
Click to show internal directories.
Click to hide internal directories.