configuration

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Nodes []Node `yaml:"nodes"`
	Links []Link `yaml:"links"`
}

Config holds the aggregated architecture

func LoadConfig

func LoadConfig(filePath string) (*Config, error)

LoadConfig loads and parses a single YAML configuration file from the given path.

func LoadFolder

func LoadFolder(folderPath string) (*Config, error)

func MergeConfigs

func MergeConfigs(configs ...*Config) (*Config, error)

func ParseYAML

func ParseYAML(config string) (*Config, error)

ParseYAML parses a YAML configuration string into a Config struct.

func (*Config) Validate

func (config *Config) Validate() error

ValidateConfig performs all required validations on the configuration.

func (*Config) YamlString

func (c *Config) YamlString() string

YamlString returns the YAML representation of the configuration

type Link struct {
	ID         string                 `yaml:"-"`
	Source     string                 `yaml:"source"`
	Target     string                 `yaml:"target"`
	Type       string                 `yaml:"type"`
	Attributes map[string]interface{} `yaml:"attributes,omitempty"`
}

Link represents an interaction between nodes

type Node

type Node struct {
	ID         string                 `yaml:"id"`
	Type       string                 `yaml:"type"`
	Parent     string                 `yaml:"parent,omitempty"`
	Attributes map[string]interface{} `yaml:"attributes,omitempty"`
}

Node represents a system component

Jump to

Keyboard shortcuts

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