builder

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

The Builder can only manage a single generation. This generation first needs to be evaluated and then built.

Index

Constants

View Source
const (
	BuildReasonAlreadyBuilt = "already built"
	BuildReasonNeedBuild    = "need to be built"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Buildator

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

func (*Buildator) Run

func (r *Buildator) Run(ctx context.Context) (err error)

type Builder

type Builder struct {

	// GenerationUuid is the generation UUID currently managed by
	// the builder. This generation can be evaluating, evaluated,
	// building or built.
	// To access this generation, you need to query the store.
	GenerationUuid string

	// EvaluationDone is used to be notified a evaluation is finished. Be careful since only a single goroutine can listen it.
	EvaluationDone chan string
	// BuildDone is used to be notified a build is finished. Be careful since only a single goroutine can listen it.
	BuildDone chan string
	// contains filtered or unexported fields
}

func New

func New(store *store.Store, executor executor.Executor, repositoryPath, repositoryDir, systemAttr, hostname string, submodules bool, evalTimeout time.Duration, buildTimeout time.Duration) *Builder

func (*Builder) Eval

Eval evaluates a generation. It cancels current any generation evaluation or build.

At the end of the evaluation, if the storepath is already in the Nix store, it then consider the build is done. In this case, it doesn't notify for the end of the evaluation but for the end of the build.

func (*Builder) IsEvaluating

func (b *Builder) IsEvaluating() bool

func (*Builder) Resume added in v0.9.0

func (b *Builder) Resume(ctx context.Context) error

func (*Builder) State

func (b *Builder) State() *protobuf.Builder

func (*Builder) Stop

func (b *Builder) Stop()

Stop stops the evaluator and the builder is required and wait until they have been actually stopped.

func (*Builder) SubmitBuild added in v0.9.0

func (b *Builder) SubmitBuild(ctx context.Context, generationUuid string)

SubmitBuild submits a generation for building. If the builder is suspended, the generation is only built once resumed, otherwise, it is built immediately.

func (*Builder) Suspend added in v0.9.0

func (b *Builder) Suspend() error

type Evaluator

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

func (*Evaluator) Run

func (r *Evaluator) Run(ctx context.Context) (err error)

type Exec

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

Exec runs a runnable object asyncronously while recording start time, finish time and

func NewExec

func NewExec(r Runnable, timeout time.Duration) Exec

func (*Exec) Start

func (e *Exec) Start(ctx context.Context)

func (*Exec) Stop

func (e *Exec) Stop()

func (*Exec) Wait

func (e *Exec) Wait()

type Runnable

type Runnable interface {
	Run(c context.Context) error
}

Jump to

Keyboard shortcuts

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