seed

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package seed decides how a stack's first up fills it with data: which volumes come from a snapshot, and which services run a seed command. Everything here is a pure function.

Index

Constants

View Source
const (
	Label        = "dev.siding.seed"
	LabelCommand = "dev.siding.seed.command"
)

Labels on a service.

View Source
const (
	Volume = "volume"
	None   = "none"
	Script = "script"
)

Values of Label.

Variables

This section is empty.

Functions

func FirstUp

func FirstUp(containers, volumes int) bool

FirstUp reports whether the project has never run: no containers and no volumes yet.

Types

type Plan

type Plan struct {
	// Volumes are the keys of the own named volumes that come from the snapshot.
	Volumes []string
	// Scripts run in compose order once their service is ready.
	Scripts []Run
}

Plan is what a first up seeds.

func Make

func Make(p *compose.Project, withSnapshot bool) (Plan, error)

Make validates the seed labels of p and returns the plan of a first up. Volumes are only planned when there is a snapshot to seed from; scripts always run on a first up.

func (Plan) Has

func (p Plan) Has(key string) bool

Has reports whether the plan seeds the volume key.

func (Plan) Uses

func (p Plan) Uses() bool

Uses reports whether the plan seeds anything.

type Run

type Run struct {
	Service string
	Command string
}

Run is a seed command to run once in a service.

Jump to

Keyboard shortcuts

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