Documentation
¶
Overview ¶
The Builder can only manage a single generation. This generation first needs to be evaluated and then built.
Index ¶
- Constants
- type Buildator
- type Builder
- func (b *Builder) Eval(ctx context.Context, rs *protobuf.RepositoryStatus) error
- func (b *Builder) IsEvaluating() bool
- func (b *Builder) Resume(ctx context.Context) error
- func (b *Builder) State() *protobuf.Builder
- func (b *Builder) Stop()
- func (b *Builder) SubmitBuild(ctx context.Context, generationUuid string)
- func (b *Builder) Suspend() error
- type Evaluator
- type Exec
- type Runnable
Constants ¶
const ( BuildReasonAlreadyBuilt = "already built" BuildReasonNeedBuild = "need to be built" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 (*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 (*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
SubmitBuild submits a generation for building. If the builder is suspended, the generation is only built once resumed, otherwise, it is built immediately.