Documentation
¶
Index ¶
- Constants
- func Command(_ context.Context, path string, args ...string) *exec.Cmd
- func Deps(ctx context.Context, functions ...interface{})
- func FromBinDir(pathElems ...string) string
- func FromGitRoot(pathElems ...string) string
- func FromSageDir(pathElems ...string) string
- func FromToolsDir(pathElems ...string) string
- func FromWorkDir(pathElems ...string) string
- func GenerateMakefiles(mks ...Makefile)
- func NewLogger(name string) logr.Logger
- func Output(cmd *exec.Cmd) string
- func SerialDeps(ctx context.Context, targets ...interface{})
- type Function
- type Makefile
- type Namespace
Constants ¶
const ( SageDir = ".sage" ToolsDir = "tools" BinDir = "bin" SageFileBinary = "bin/sagefile" )
Variables ¶
This section is empty.
Functions ¶
func Command ¶
Command should be used when returning exec.Cmd from tools to set opinionated standard fields.
func Deps ¶
Deps runs each of the provided functions in parallel.
Dependencies must be of type func(context.Context) error or Function.
Each function will be run exactly once, even across multiple calls to Deps.
func FromBinDir ¶
FromBinDir returns the path relative to where tool binaries are installed.
func FromGitRoot ¶
func FromSageDir ¶
FromSageDir returns the path relative to where the sage files are kept.
func FromToolsDir ¶
FromToolsDir returns the path relative to where tools are downloaded and installed.
func FromWorkDir ¶
func GenerateMakefiles ¶
func GenerateMakefiles(mks ...Makefile)
GenerateMakefiles define which makefiles should be created by go.einride.tech/cmd/build.
func Output ¶
Output runs the given command, and returns all output from stdout in a neatly, trimmed manner, panicking if an error occurs.
func SerialDeps ¶
SerialDeps works like Deps except running all dependencies serially instead of in parallel.
Types ¶
type Function ¶
type Function interface {
// Name is a unique identifier and display name for the function.
Name() string
// Run the function.
Run(ctx context.Context) error
}
Function represents a function that can be run with Deps.