manifest

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckComponentsExist

func CheckComponentsExist(components []ComponentRef, toCheck ...string)

func ComponentQualifiedNameFromMeta

func ComponentQualifiedNameFromMeta(meta *Metadata) string

func ComponentQualifiedNameFromRef

func ComponentQualifiedNameFromRef(ref *ComponentRef) string

func ComponentSourceDirFromRef

func ComponentSourceDirFromRef(component *ComponentRef, stackBaseDir, componentsBaseDir string) string

func ComponentSourceDirNameFromRef

func ComponentSourceDirNameFromRef(component *ComponentRef) string

func ComponentsNamesFromManifests

func ComponentsNamesFromManifests(manifests []Manifest) []string

func ComponentsNamesFromRefs

func ComponentsNamesFromRefs(components []ComponentRef) []string

func GenerateLifecycleOrder added in v1.0.10

func GenerateLifecycleOrder(manifest *Manifest) ([]string, error)

func ParameterQualifiedName

func ParameterQualifiedName(name, component string) string

func ParseManifest

func ParseManifest(manifestFilenames []string) (*Manifest, []Manifest, string, error)

Types

type ComponentRef

type ComponentRef struct {
	Name        string
	Source      SourceLocation    `yaml:",omitempty"`
	Depends     []string          `yaml:",omitempty"`
	Annotations map[string]string `yaml:",omitempty"`
	Hooks       []Hook            `yaml:",omitempty"`
}

func ComponentRefByName

func ComponentRefByName(components []ComponentRef, componentName string) *ComponentRef

type Git

type Git struct {
	Remote   string
	Ref      string `yaml:",omitempty"`
	SubDir   string `yaml:"subDir,omitempty"`
	LocalDir string `yaml:"localDir,omitempty"`
}

type Hook added in v1.0.7

type Hook struct {
	File     string   `yaml:",omitempty"`
	Brief    string   `yaml:",omitempty"`
	Triggers []string `yaml:",omitempty"`
	Error    string   `yaml:",omitempty"`
}

type Lifecycle

type Lifecycle struct {
	Bare            string            `yaml:",omitempty"`
	Verbs           []string          `yaml:",omitempty"`
	Order           []string          `yaml:",omitempty"`
	Mandatory       []string          `yaml:",omitempty"`
	Optional        []string          `yaml:",omitempty"`
	Requires        RequiresTuning    `yaml:",omitempty"` // TODO use pointer?
	ReadyConditions []ReadyCondition  `yaml:"readyConditions,omitempty"`
	Options         *LifecycleOptions `yaml:",omitempty"`
}

type LifecycleOptions

type LifecycleOptions struct {
	Random *struct {
		Bytes int `yaml:",omitempty"`
	} `yaml:",omitempty"`
}

type Manifest

type Manifest struct {
	Version int
	Kind    string
	Meta    Metadata

	Components []ComponentRef `yaml:",omitempty"`

	Requires []string         `yaml:",omitempty"`
	Provides []string         `yaml:",omitempty"`
	Platform PlatformMetadata `yaml:",omitempty"`

	Lifecycle  Lifecycle     `yaml:",omitempty"`
	Outputs    []Output      `yaml:",omitempty"`
	Parameters []Parameter   `yaml:",omitempty"`
	Templates  TemplateSetup `yaml:",omitempty"`

	Document string `yaml:",omitempty"`
}

func ComponentManifestByRef

func ComponentManifestByRef(componentsManifests []Manifest, component *ComponentRef) *Manifest

func ParseComponentsManifests

func ParseComponentsManifests(components []ComponentRef, stackBaseDir string, componentsBaseDir string) ([]Manifest, error)

func ParseComponentsManifestsWithExclusion

func ParseComponentsManifestsWithExclusion(components []ComponentRef, excludedComponents []string,
	stackBaseDir string, componentsBaseDir string) ([]Manifest, error)

type Metadata

type Metadata struct {
	Name        string
	Origin      string            `yaml:",omitempty"`
	Kind        string            `yaml:",omitempty"`
	Title       string            `yaml:",omitempty"`
	Brief       string            `yaml:",omitempty"`
	Description string            `yaml:",omitempty"`
	Version     string            `yaml:",omitempty"`
	Maturity    string            `yaml:",omitempty"`
	License     string            `yaml:",omitempty"`
	Icon        string            `yaml:",omitempty"`
	Source      SourceLocation    `yaml:",omitempty"`
	FromStack   string            `yaml:"fromStack,omitempty"`
	Annotations map[string]string `yaml:",omitempty"`
}

type Output

type Output struct {
	Name        string
	Brief       string `yaml:",omitempty"`
	Description string `yaml:",omitempty"`

	Value     interface{} `yaml:",omitempty"`
	FromTfVar string      `yaml:"fromTfVar,omitempty"`
	Kind      string      `yaml:",omitempty"`
}

type Parameter

type Parameter struct {
	Name        string
	Component   string `yaml:",omitempty"` // target specific component instance
	Kind        string `yaml:",omitempty"`
	Brief       string `yaml:",omitempty"`
	Description string `yaml:",omitempty"`

	Default interface{} `yaml:",omitempty"`
	Value   interface{} `yaml:",omitempty"`
	Empty   string      `yaml:",omitempty"` // "allow"

	FromEnv  string `yaml:"fromEnv,omitempty"`
	FromFile string `yaml:"fromFile,omitempty"`

	Env string `yaml:",omitempty"`

	Parameters []Parameter `yaml:",omitempty"`
}

func FlattenParameters

func FlattenParameters(parameters []Parameter, tag string) []Parameter

func MakeParameters

func MakeParameters(names []string) []Parameter

func (*Parameter) QName

func (p *Parameter) QName() string

type ParametersBundle

type ParametersBundle struct {
	Name       string
	Parameters []string
}

type ParametersManifest

type ParametersManifest struct {
	Parameters []Parameter `yaml:",omitempty"`
	Outputs    []Output    `yaml:",omitempty"`
}

func ParseParametersManifest

func ParseParametersManifest(manifestFilenames []string) (*ParametersManifest, string, error)

type PlatformMetadata

type PlatformMetadata struct {
	Provides []string `yaml:",omitempty"`
}

type ReadyCondition

type ReadyCondition struct {
	DNS          string `yaml:"dns,omitempty"`
	URL          string `yaml:"url,omitempty"`
	WaitSeconds  int    `yaml:"waitSeconds,omitempty"`
	PauseSeconds int    `yaml:"pauseSeconds,omitempty"`
}

type RequiresTuning

type RequiresTuning struct {
	Optional []string `yaml:",omitempty"`
}

type SourceLocation

type SourceLocation struct {
	Dir string `yaml:",omitempty"`
	S3  string `yaml:",omitempty"`
	Git Git    `yaml:",omitempty"`
}

type TemplateSetup

type TemplateSetup struct {
	Kind        string           `yaml:",omitempty"`
	Directories []string         `yaml:",omitempty"`
	Files       []string         `yaml:",omitempty"`
	Extra       []TemplateTarget `yaml:",omitempty"`
}

type TemplateTarget

type TemplateTarget struct {
	Kind        string   `yaml:",omitempty"`
	Directories []string `yaml:",omitempty"`
	Files       []string `yaml:",omitempty"`
}

type WellKnownParametersManifest

type WellKnownParametersManifest struct {
	Parameters []Parameter
	Bundles    []ParametersBundle
}

func GetWellKnownParametersManifest

func GetWellKnownParametersManifest() (*WellKnownParametersManifest, error)

Jump to

Keyboard shortcuts

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