constellation

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 License: MIT Imports: 10 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 {
	Name          string         `yaml:"Name" validate:"empty=false"`
	ID            guid.GUID      `yaml:"Id" validate:"empty=false"`
	Services      []Service      `yaml:"Services" validate:"empty=false"`
	Relationships []Relationship `yaml:"Relationships"`
}

Config -- The DAG config for a deployment

func (*Config) FindDuplicateIDs

func (m *Config) FindDuplicateIDs() (duplicates []string)

FindDuplicateIDs checks for duplicate Relationship and Service IDs in a constellation file.

func (*Config) FindRelationship

func (m *Config) FindRelationship(relationshipID string) *Relationship

FindRelationship -- Find a Relationship by id.

func (*Config) FindRelationshipByFromName

func (m *Config) FindRelationshipByFromName(relationshipFromName string) (res []Relationship)

FindRelationshipByFromName -- Find a Relationship by the name that is the source of the rel.

func (*Config) FindRelationshipByToName

func (m *Config) FindRelationshipByToName(relationshipToName string) (res []Relationship)

FindRelationshipByToName -- Find a Relationship by the name that is the target of the rel.

func (*Config) FindService

func (m *Config) FindService(serviceID string) *Service

FindService -- Find a Service by id.

func (*Config) GenerateGraph

func (readGraph *Config) GenerateGraph(out io.Writer) (string, error)

GenerateGraph - function to take a dagconfigService structure and create a graph object that contains the representation of the graph. Also outputs a string representation (GraphViz dot notation) of the resulting graph this can be passed on to GraphViz to graphically render the resulting graph

func (*Config) IsEmpty

func (m *Config) IsEmpty() bool

IsEmpty checks if config is empty.

func (*Config) LoadFile

func (m *Config) LoadFile(fileName string) (err error)

LoadFile -- New DAG info instance from the named file.

func (*Config) LoadString

func (m *Config) LoadString(yamlString string) error

LoadString -- New DAG info instance from the given yaml string.

func (*Config) ServiceExists

func (m *Config) ServiceExists() (missing map[string][]string)

ServiceExists loops through each Relationship and checks if the services are declared.

func (*Config) ValidateModel

func (m *Config) ValidateModel() error

ValidateModel checks if constellation has all required felids

type Property

type Property interface{}

Property - an individual property in the DAG. For now, these are just interfaces as the value types are not firmed up for individual properties. As the entire set of properties becomes known, each should be promoted out of the Properties collection to the main struct -- handling presence/absence via using pointer members, so as to allow for nil value == absence.

type Relationship

type Relationship struct {
	ID          string              `yaml:"Id" validate:"empty=false"`
	Description string              `yaml:"Description"`
	From        string              `yaml:"From" validate:"empty=false"`
	To          string              `yaml:"To" validate:"empty=false"`
	Properties  map[string]Property `yaml:"Properties"`
}

Relationship -- a relationship between Services

type Service

type Service struct {
	ID         string              `yaml:"Id" validate:"empty=false"`
	Type       string              `yaml:"Type" validate:"empty=false"`
	Properties map[string]Property `yaml:"Properties"`
}

Service -- a DAG Service description

Jump to

Keyboard shortcuts

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