domain

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscoverConfigurationPathsRecursively

func DiscoverConfigurationPathsRecursively(rootPath string) ([]string, error)

DiscoverConfigurationPathsRecursively scans for supported node configuration files.

func ResolveConfigurationPath

func ResolveConfigurationPath(path string) (string, error)

ResolveConfigurationPath returns the best config file under a directory.

Types

type DependencyError

type DependencyError struct {
	Message string
	Cause   error
}

DependencyError indicates dependency graph issues.

func (*DependencyError) Error

func (errorValue *DependencyError) Error() string

func (*DependencyError) Unwrap

func (errorValue *DependencyError) Unwrap() error

type DependencyGraph

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

DependencyGraph stores nodes and dependency edges.

Edges are stored as dependencyID -> dependentID.

func BuildDependencyGraph

func BuildDependencyGraph(nodes []OrchestrationNode) (*DependencyGraph, error)

BuildDependencyGraph constructs and validates a graph from orchestration nodes.

func (*DependencyGraph) ResolveStartupOrder

func (graph *DependencyGraph) ResolveStartupOrder() ([]OrchestrationNode, error)

ResolveStartupOrder returns a stable topological order.

func (*DependencyGraph) ResolveStartupWaves

func (graph *DependencyGraph) ResolveStartupWaves() ([][]OrchestrationNode, error)

ResolveStartupWaves returns dependency-safe execution groups.

type DiscoveryError

type DiscoveryError struct {
	Message string
	Cause   error
}

DiscoveryError indicates configuration discovery failures.

func (*DiscoveryError) Error

func (errorValue *DiscoveryError) Error() string

func (*DiscoveryError) Unwrap

func (errorValue *DiscoveryError) Unwrap() error

type EnvironmentDefinition

type EnvironmentDefinition struct {
	Name      string   `yaml:"name"`
	Files     []string `yaml:"files"`
	Variables []string `yaml:"variables"`
}

EnvironmentDefinition defines inherited environment files and variables.

type HealthCheckDefinition

type HealthCheckDefinition struct {
	Test     []string      `yaml:"test"`
	Interval time.Duration `yaml:"interval"`
	Timeout  time.Duration `yaml:"timeout"`
	Retries  int           `yaml:"retries"`
}

HealthCheckDefinition defines subordinate readiness checks.

type ManeuverDefinition

type ManeuverDefinition struct {
	Call        string   `yaml:"call"`
	Description string   `yaml:"description"`
	Action      []string `yaml:"action"`
}

ManeuverDefinition declares an executable maneuver.

type NodeConfiguration

type NodeConfiguration struct {
	Role      NodeRole             `yaml:"role"`
	ID        string               `yaml:"id"`
	Binary    string               `yaml:"binary"`
	Reactor   ReactorDefinition    `yaml:"reactor"`
	Manifest  []NodeReference      `yaml:"manifest"`
	Maneuvers []ManeuverDefinition `yaml:"maneuvers"`
}

NodeConfiguration is a YAML representation for squadron and unit configs.

type NodeReference

type NodeReference struct {
	ID          string                 `yaml:"id"`
	Path        string                 `yaml:"path"`
	Tags        []string               `yaml:"tags"`
	After       []string               `yaml:"after"`
	HealthCheck *HealthCheckDefinition `yaml:"healthcheck"`
}

NodeReference declares one subordinate entry in a squadron manifest.

type NodeRole

type NodeRole string

NodeRole defines supported orchestration node roles.

const (
	// NodeRoleSquadron is a recursive orchestrator node.
	NodeRoleSquadron NodeRole = "squadron"
	// NodeRoleUnit is an atomic leaf execution node.
	NodeRoleUnit NodeRole = "unit"
)

type OrchestrationNode

type OrchestrationNode interface {
	GetID() string
	GetRole() NodeRole
	GetPath() string
	GetTags() []string
	GetDependencies() []string
	GetSubordinates() []OrchestrationNode
	ResolveSubordinateByID(subordinateID string) (OrchestrationNode, error)
	CollectDescendantNodes() []OrchestrationNode
	BuildEffectiveEnvironmentByName(
		environmentName string,
		parentEnvironment EnvironmentDefinition,
	) (EnvironmentDefinition, error)
	ExecuteManeuverByName(maneuverName string) ([]string, error)
}

OrchestrationNode is the common node behavior contract.

type ReactorBlueprint

type ReactorBlueprint struct {
	EnvironmentName string   `yaml:"env"`
	Path            string   `yaml:"path"`
	Action          []string `yaml:"action"`
}

ReactorBlueprint maps an environment to a path or inline action.

type ReactorDefinition

type ReactorDefinition struct {
	Provider     ReactorProvider         `yaml:"provider"`
	Network      string                  `yaml:"network"`
	ContextPath  string                  `yaml:"context"`
	Blueprints   []ReactorBlueprint      `yaml:"blueprints"`
	Environments []EnvironmentDefinition `yaml:"environments"`
}

ReactorDefinition configures node runtime behavior.

type ReactorProvider

type ReactorProvider string

ReactorProvider identifies the runtime execution provider.

const (
	// ReactorProviderTilt identifies Tilt-driven execution.
	ReactorProviderTilt ReactorProvider = "tilt"
	// ReactorProviderNative identifies direct command execution.
	ReactorProviderNative ReactorProvider = "native"
)

type SignalRoutingError

type SignalRoutingError struct {
	Message string
	Cause   error
}

SignalRoutingError indicates failures while routing a signal command.

func (*SignalRoutingError) Error

func (errorValue *SignalRoutingError) Error() string

func (*SignalRoutingError) Unwrap

func (errorValue *SignalRoutingError) Unwrap() error

type SquadronNode

type SquadronNode struct {
	ID           string
	Path         string
	Tags         []string
	After        []string
	Reactor      ReactorDefinition
	Maneuvers    []ManeuverDefinition
	Subordinates []OrchestrationNode
}

SquadronNode models a recursive orchestration node.

func (*SquadronNode) BuildEffectiveEnvironmentByName

func (squadron *SquadronNode) BuildEffectiveEnvironmentByName(
	environmentName string,
	parentEnvironment EnvironmentDefinition,
) (EnvironmentDefinition, error)

func (*SquadronNode) CollectDescendantNodes

func (squadron *SquadronNode) CollectDescendantNodes() []OrchestrationNode

func (*SquadronNode) ExecuteManeuverByName

func (squadron *SquadronNode) ExecuteManeuverByName(maneuverName string) ([]string, error)

func (*SquadronNode) GetDependencies

func (squadron *SquadronNode) GetDependencies() []string

func (*SquadronNode) GetID

func (squadron *SquadronNode) GetID() string

func (*SquadronNode) GetPath

func (squadron *SquadronNode) GetPath() string

func (*SquadronNode) GetRole

func (squadron *SquadronNode) GetRole() NodeRole

func (*SquadronNode) GetSubordinates

func (squadron *SquadronNode) GetSubordinates() []OrchestrationNode

func (*SquadronNode) GetTags

func (squadron *SquadronNode) GetTags() []string

func (*SquadronNode) ResolveSubordinateByID

func (squadron *SquadronNode) ResolveSubordinateByID(subordinateID string) (OrchestrationNode, error)

type UnitNode

type UnitNode struct {
	ID        string
	Path      string
	Tags      []string
	After     []string
	Reactor   ReactorDefinition
	Maneuvers []ManeuverDefinition
}

UnitNode models a leaf execution node.

func (*UnitNode) BuildEffectiveEnvironmentByName

func (unit *UnitNode) BuildEffectiveEnvironmentByName(
	environmentName string,
	parentEnvironment EnvironmentDefinition,
) (EnvironmentDefinition, error)

func (*UnitNode) CollectDescendantNodes

func (unit *UnitNode) CollectDescendantNodes() []OrchestrationNode

func (*UnitNode) ExecuteManeuverByName

func (unit *UnitNode) ExecuteManeuverByName(maneuverName string) ([]string, error)

func (*UnitNode) GetDependencies

func (unit *UnitNode) GetDependencies() []string

func (*UnitNode) GetID

func (unit *UnitNode) GetID() string

func (*UnitNode) GetPath

func (unit *UnitNode) GetPath() string

func (*UnitNode) GetRole

func (unit *UnitNode) GetRole() NodeRole

func (*UnitNode) GetSubordinates

func (unit *UnitNode) GetSubordinates() []OrchestrationNode

func (*UnitNode) GetTags

func (unit *UnitNode) GetTags() []string

func (*UnitNode) ResolveSubordinateByID

func (unit *UnitNode) ResolveSubordinateByID(subordinateID string) (OrchestrationNode, error)

type ValidationError

type ValidationError struct {
	Message string
	Cause   error
}

ValidationError indicates invalid domain data.

func (*ValidationError) Error

func (errorValue *ValidationError) Error() string

func (*ValidationError) Unwrap

func (errorValue *ValidationError) Unwrap() error

Jump to

Keyboard shortcuts

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