config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Change

type Change struct {
	Type         ChangeType
	ResourceID   string
	ResourceKind string
	ResourceName string
	Properties   map[string]interface{}
	OldValues    map[string]interface{} // For updates
	NewValues    map[string]interface{} // For updates
}

Change represents a planned change to infrastructure

type ChangeSummary

type ChangeSummary struct {
	Create  int
	Update  int
	Delete  int
	Changes []Change
}

ChangeSummary represents a summary of planned changes

type ChangeType

type ChangeType string

ChangeType represents the type of change to be made

const (
	ChangeTypeCreate ChangeType = "create"
	ChangeTypeUpdate ChangeType = "update"
	ChangeTypeDelete ChangeType = "delete"
)

type Config

type Config struct {
	Project     string                 `yaml:"project"`
	Environment string                 `yaml:"environment"`
	Variables   map[string]interface{} `yaml:"variables,omitempty"`
	Providers   map[string]Provider    `yaml:"providers"`
	Modules     map[string]Module      `yaml:"modules,omitempty"`
	Resources   []Resource             `yaml:"resources"`
}

Config represents the main Runestone configuration

type DriftPolicy

type DriftPolicy struct {
	AutoHeal   bool `yaml:"autoHeal"`
	NotifyOnly bool `yaml:"notifyOnly"`
}

DriftPolicy defines how to handle drift for a resource

type ExecutionResult

type ExecutionResult struct {
	Success  bool
	Duration time.Duration
	Changes  []Change
	Errors   []error
}

ExecutionResult represents the result of executing changes

type Module

type Module struct {
	Source  string                 `yaml:"source"`
	Version string                 `yaml:"version"`
	Inputs  map[string]interface{} `yaml:"inputs,omitempty"`
}

Module represents a reusable module

type Parser

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

Parser handles parsing and processing of Runestone configuration files

func NewParser

func NewParser() *Parser

NewParser creates a new configuration parser

func (*Parser) ExpandResources

func (p *Parser) ExpandResources(resources []Resource) ([]ResourceInstance, error)

ExpandResources expands resources with count and for_each into individual instances

func (*Parser) Parse

func (p *Parser) Parse(data []byte) (*Config, error)

Parse parses Runestone configuration from YAML data

func (*Parser) ParseFile

func (p *Parser) ParseFile(filename string) (*Config, error)

ParseFile parses a Runestone configuration file

func (*Parser) ParseFromString

func (p *Parser) ParseFromString(configYAML string) (*Config, error)

ParseFromString parses a Runestone configuration from a string

type Provider

type Provider struct {
	Region  string `yaml:"region,omitempty"`
	Profile string `yaml:"profile,omitempty"`
}

Provider represents a cloud provider configuration

type Resource

type Resource struct {
	Kind        string                 `yaml:"kind"`
	Name        string                 `yaml:"name"`
	Count       interface{}            `yaml:"count,omitempty"`    // Can be int or expression
	ForEach     interface{}            `yaml:"for_each,omitempty"` // Can be array or expression
	Properties  map[string]interface{} `yaml:"properties,omitempty"`
	DriftPolicy *DriftPolicy           `yaml:"driftPolicy,omitempty"`
	DependsOn   []string               `yaml:"depends_on,omitempty"`
}

Resource represents an infrastructure resource

type ResourceInstance

type ResourceInstance struct {
	ID          string
	Kind        string
	Name        string
	Properties  map[string]interface{}
	DriftPolicy *DriftPolicy
	DependsOn   []string
}

ResourceInstance represents an expanded resource instance

Jump to

Keyboard shortcuts

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