masonry

package
v0.0.0-...-6b8a513 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeDaggerOutput = partybus.EventType("dagger.output")
	EventTypeDaggerError  = partybus.EventType("dagger.error")
	EventTypeRenderPlan   = partybus.EventType("plan.render")
	EventTypeApplyPlan    = partybus.EventType("plan.apply")
)
View Source
const (
	MasonDirName       = ".mason"
	WorkDirPrefix      = ".work"
	BlueprintDirPrefix = "blueprint"
	PlanDirPrefix      = "plan"
)

Variables

View Source
var Phases = map[string]string{
	"test":    "Run tests",
	"lint":    "Run linters",
	"package": "Package artifacts",
	"publish": "Publish artifacts",
	"run":     "Run the application",
	"review":  "Review the source code",
}

Functions

This section is empty.

Types

type Blueprint

type Blueprint struct {
	Bricks []Brick
	// contains filtered or unexported fields
}

func (Blueprint) Filter

func (b Blueprint) Filter(selector labels.Selector) Blueprint

func (Blueprint) RenderPlan

func (b Blueprint) RenderPlan() (*Plan, error)

type Brick

type Brick struct {
	Kind      string        `json:"kind"`
	ModuleRef ModuleRef     `json:"moduleRef"`
	Metadata  BrickMetadata `json:"metadata"`
	Spec      any           `json:"spec"`
}

func (Brick) IsValid

func (b Brick) IsValid() bool

type BrickMetadata

type BrickMetadata struct {
	Name        string            `json:"name"`
	Labels      map[string]string `json:"labels"`
	ExtraPhases []string          `json:"extraPhases"`
	PostRun     PostRun           `json:"postRun"`
}

type Mason

type Mason struct {
	RootPath             string
	IgnoredDirs          []string
	DaggerEnv            []string
	DaggerArgs           []string
	DaggerBinary         string
	DaggerOutputDisabled bool

	EventBus *partybus.Bus
	Logger   logger.Logger
	// contains filtered or unexported fields
}

func NewMason

func NewMason() *Mason

func (Mason) CleanWorkDirs

func (m Mason) CleanWorkDirs() error

func (*Mason) DetectWorkspaces

func (m *Mason) DetectWorkspaces() ([]Workspace, error)

func (Mason) WorkDirs

func (m Mason) WorkDirs() []string

type ModuleRef

type ModuleRef string

func (ModuleRef) SanitizedName

func (m ModuleRef) SanitizedName() string

type Plan

type Plan struct {
	DirPath                string
	SourceScripts          []Script
	Phase                  string
	MergedScript           string
	PostRunOnSuccessScript string
	PostRunOnFailureScript string
	// contains filtered or unexported fields
}

func ParsePlanFromDir

func ParsePlanFromDir(dirPath string) (*Plan, error)

func (Plan) FilterForPhase

func (p Plan) FilterForPhase(phase string) (*Plan, error)

func (Plan) IsEmpty

func (p Plan) IsEmpty() bool

func (Plan) Run

func (p Plan) Run() error

type PostRun

type PostRun string
const (
	PostRunAlways    PostRun = "always"
	PostRunOnSuccess PostRun = "on_success"
	PostRunOnFailure PostRun = "on_failure"
	PostRunNever     PostRun = ""
)

type Script

type Script struct {
	ModuleName string
	Phase      string
	PostRun    PostRun
	Name       string
	Content    dagger.Script
}

func ScriptFromFile

func ScriptFromFile(filePath string) (*Script, error)

func (Script) Equals

func (s Script) Equals(other Script) bool

type Workspace

type Workspace struct {
	RootPath     string
	RelativePath string // relative to the workspace root
	// contains filtered or unexported fields
}

func (Workspace) Dir

func (w Workspace) Dir() string

func (Workspace) LoadBlueprint

func (w Workspace) LoadBlueprint() (*Blueprint, error)

func (Workspace) MasonDir

func (w Workspace) MasonDir() string

func (Workspace) WorkDir

func (w Workspace) WorkDir() string

Jump to

Keyboard shortcuts

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