types

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetModConfig

func GetModConfig[T any](b *BuildConfig, name string) (*T, error)

Types

type Arch

type Arch string
const (
	AMD64 Arch = "amd64"
	ARM64 Arch = "arm64"
	ARM   Arch = "arm"
)

func ParseArch

func ParseArch(s string) (Arch, error)

type BuildConfig

type BuildConfig struct {
	Name        string   `yaml:"name"`
	Targets     []Target `yaml:"targets"`
	Cwd         string
	Modules     []ModuleConfig `yaml:"modules"`
	IncludeDirs []string       `yaml:"includeDirs"`
	Produced    []string
}

type Module

type Module interface {
	Name() string
	RunModule(*log.Logger) error
	Configure(*BuildConfig) error
	Requires() []string
	OnFail() error
}

type ModuleConfig

type ModuleConfig struct {
	Name   string                 `yaml:"name"`
	Config map[string]interface{} `yaml:"config"`
}

type OS

type OS string
const (
	Windows OS = "windows"
	Linux   OS = "linux"
	MacOS   OS = "darwin"
)

func ParseOS

func ParseOS(s string) (OS, error)

type Target

type Target struct {
	OS   OS   `yaml:"os"`
	Arch Arch `yaml:"arch"`
}

func ParseTarget

func ParseTarget(s string) (Target, error)

func (Target) CleanName added in v0.1.0

func (t Target) CleanName(n string, addExe bool) string

func (Target) ExeName added in v0.1.0

func (t Target) ExeName(n string, addExe bool) string

func (Target) String

func (t Target) String() string

func (*Target) Validate

func (t *Target) Validate() error

Jump to

Keyboard shortcuts

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