buildgo

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Logger = func() *slog2.Logger {
		return slog.NewLogger(
			slog.NewHandler(os.Stdout, &slog2.HandlerOptions{
				Level: slog2.LevelInfo,
			}),
		)
	}()
	CacheDir string
	CacheDb  *sql.DB
	Hasher   = sha256.New
)

Functions

func Cleanup

func Cleanup()

Cleanup cleans up the global variables.

func GetHash

func GetHash(fp string) (h []byte, err error)

GetHash returns the hash for the given file path.

func SetHash

func SetHash(fp string, h []byte) (err error)

SetHash sets the hash for the given file path.

func Setup

func Setup()

Setup sets up the global variables. Warning: will panic if unable to set up successfully.

Types

type Command

type Command interface {
	// Run executes the command.
	Run(ctx context.Context) error
}

Command represents a runnable command as part of a build step.

type Step

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

Step represents a single build step.

func NewStep

func NewStep(name string, commands ...Command) *Step

NewStep creates a new step.

func (*Step) AddFileDeps

func (s *Step) AddFileDeps(patterns ...string) *Step

AddFileDeps adds file dependencies.

func (*Step) Commands

func (s *Step) Commands() []Command

Commands returns the commands of the step.

func (*Step) DependsOn

func (s *Step) DependsOn(steps ...*Step) *Step

DependsOn adds a dependency on other steps.

func (*Step) Done

func (s *Step) Done() bool

Done returns whether the step has been completed.

func (*Step) FileDeps

func (s *Step) FileDeps() []string

FileDeps returns the file dependencies.

func (*Step) Name

func (s *Step) Name() string

Name returns the name of the step.

func (*Step) Run

func (s *Step) Run(ctx context.Context) (err error)

Run runs the step.

func (*Step) SetFileDeps

func (s *Step) SetFileDeps(patterns []string) *Step

SetFileDeps sets the file dependencies.

Directories

Path Synopsis
commands
go

Jump to

Keyboard shortcuts

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