blueprint

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: MPL-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultBlueprint = BlueprintV1Alpha1{
	Kind:       "Blueprint",
	ApiVersion: "blueprints.windsorcli.dev/v1alpha1",
	Metadata: MetadataV1Alpha1{
		Name:        "default",
		Description: "A default blueprint",
		Authors:     []string{},
	},
	Sources:             []SourceV1Alpha1{},
	TerraformComponents: []TerraformComponentV1Alpha1{},
}

Functions

This section is empty.

Types

type BaseBlueprintHandler

type BaseBlueprintHandler struct {
	BlueprintHandler
	// contains filtered or unexported fields
}

BaseBlueprintHandler is a base implementation of the BlueprintHandler interface

func NewBlueprintHandler

func NewBlueprintHandler(injector di.Injector) *BaseBlueprintHandler

Create a new blueprint handler

func (*BaseBlueprintHandler) GetMetadata

func (b *BaseBlueprintHandler) GetMetadata() MetadataV1Alpha1

GetMetadata retrieves the metadata for the blueprint

func (*BaseBlueprintHandler) GetSources

func (b *BaseBlueprintHandler) GetSources() []SourceV1Alpha1

GetSources retrieves the sources for the blueprint

func (*BaseBlueprintHandler) GetTerraformComponents

func (b *BaseBlueprintHandler) GetTerraformComponents() []TerraformComponentV1Alpha1

GetTerraformComponents retrieves the Terraform components for the blueprint

func (*BaseBlueprintHandler) Initialize

func (b *BaseBlueprintHandler) Initialize() error

Initialize initializes the blueprint handler

func (*BaseBlueprintHandler) LoadConfig

func (b *BaseBlueprintHandler) LoadConfig(path ...string) error

LoadConfig Loads the blueprint from the specified path

func (*BaseBlueprintHandler) SetMetadata

func (b *BaseBlueprintHandler) SetMetadata(metadata MetadataV1Alpha1) error

SetMetadata sets the metadata for the blueprint

func (*BaseBlueprintHandler) SetSources

func (b *BaseBlueprintHandler) SetSources(sources []SourceV1Alpha1) error

SetSources sets the sources for the blueprint

func (*BaseBlueprintHandler) SetTerraformComponents

func (b *BaseBlueprintHandler) SetTerraformComponents(terraformComponents []TerraformComponentV1Alpha1) error

SetTerraformComponents sets the Terraform components for the blueprint

func (*BaseBlueprintHandler) WriteConfig

func (b *BaseBlueprintHandler) WriteConfig(path ...string) error

WriteConfig writes the current blueprint to a specified path or a default location

type BlueprintHandler

type BlueprintHandler interface {
	// Initialize initializes the blueprint handler
	Initialize() error

	// LoadConfig loads the blueprint from the specified path
	LoadConfig(path ...string) error

	// GetMetadata retrieves the metadata for the blueprint
	GetMetadata() MetadataV1Alpha1

	// GetSources retrieves the sources for the blueprint
	GetSources() []SourceV1Alpha1

	// GetTerraformComponents retrieves the Terraform components for the blueprint
	GetTerraformComponents() []TerraformComponentV1Alpha1

	// SetMetadata sets the metadata for the blueprint
	SetMetadata(metadata MetadataV1Alpha1) error

	// SetSources sets the sources for the blueprint
	SetSources(sources []SourceV1Alpha1) error

	// SetTerraformComponents sets the Terraform components for the blueprint
	SetTerraformComponents(terraformComponents []TerraformComponentV1Alpha1) error

	// WriteConfig writes the current blueprint to the specified path
	WriteConfig(path ...string) error
}

BlueprintHandler defines the interface for handling blueprint operations

type BlueprintV1Alpha1

type BlueprintV1Alpha1 struct {
	Kind                string                       `yaml:"kind"`       // The Kind of the blueprint
	ApiVersion          string                       `yaml:"apiVersion"` // The API Version of the blueprint
	Metadata            MetadataV1Alpha1             `yaml:"metadata"`   // The Metadata for the blueprint
	Sources             []SourceV1Alpha1             `yaml:"sources"`    // The Sources for the blueprint
	TerraformComponents []TerraformComponentV1Alpha1 `yaml:"terraform"`  // The Terraform components
}

A Blueprint is a collection of metadata that can be used to initialize a project

type MetadataV1Alpha1

type MetadataV1Alpha1 struct {
	Name        string   `yaml:"name"`                  // The Name of the blueprint
	Description string   `yaml:"description,omitempty"` // The Description of the blueprint
	Authors     []string `yaml:"authors,omitempty"`     // The Authors of the blueprint
}

Metadata describes the metadata for a blueprint

type MockBlueprintHandler

type MockBlueprintHandler struct {
	InitializeFunc             func() error
	LoadConfigFunc             func(path ...string) error
	GetMetadataFunc            func() MetadataV1Alpha1
	GetSourcesFunc             func() []SourceV1Alpha1
	GetTerraformComponentsFunc func() []TerraformComponentV1Alpha1
	SetMetadataFunc            func(metadata MetadataV1Alpha1) error
	SetSourcesFunc             func(sources []SourceV1Alpha1) error
	SetTerraformComponentsFunc func(terraformComponents []TerraformComponentV1Alpha1) error
	WriteConfigFunc            func(path ...string) error
}

MockBlueprintHandler is a mock implementation of the BlueprintHandler interface for testing purposes

func NewMockBlueprintHandler

func NewMockBlueprintHandler(injector di.Injector) *MockBlueprintHandler

NewMockBlueprintHandler creates a new instance of MockBlueprintHandler

func (*MockBlueprintHandler) GetMetadata

func (m *MockBlueprintHandler) GetMetadata() MetadataV1Alpha1

GetMetadata calls the mock GetMetadataFunc if set, otherwise returns a reasonable default MetadataV1Alpha1

func (*MockBlueprintHandler) GetSources

func (m *MockBlueprintHandler) GetSources() []SourceV1Alpha1

GetSources calls the mock GetSourcesFunc if set, otherwise returns a reasonable default slice of SourceV1Alpha1

func (*MockBlueprintHandler) GetTerraformComponents

func (m *MockBlueprintHandler) GetTerraformComponents() []TerraformComponentV1Alpha1

GetTerraformComponents calls the mock GetTerraformComponentsFunc if set, otherwise returns a reasonable default slice of TerraformComponentV1Alpha1

func (*MockBlueprintHandler) Initialize

func (m *MockBlueprintHandler) Initialize() error

Initialize initializes the blueprint handler

func (*MockBlueprintHandler) LoadConfig

func (m *MockBlueprintHandler) LoadConfig(path ...string) error

LoadConfig calls the mock LoadConfigFunc if set, otherwise returns nil

func (*MockBlueprintHandler) SetMetadata

func (m *MockBlueprintHandler) SetMetadata(metadata MetadataV1Alpha1) error

SetMetadata calls the mock SetMetadataFunc if set, otherwise returns nil

func (*MockBlueprintHandler) SetSources

func (m *MockBlueprintHandler) SetSources(sources []SourceV1Alpha1) error

SetSources calls the mock SetSourcesFunc if set, otherwise returns nil

func (*MockBlueprintHandler) SetTerraformComponents

func (m *MockBlueprintHandler) SetTerraformComponents(terraformComponents []TerraformComponentV1Alpha1) error

SetTerraformComponents calls the mock SetTerraformComponentsFunc if set, otherwise returns nil

func (*MockBlueprintHandler) WriteConfig

func (m *MockBlueprintHandler) WriteConfig(path ...string) error

WriteConfig calls the mock WriteConfigFunc if set, otherwise returns nil

type SourceV1Alpha1

type SourceV1Alpha1 struct {
	Name       string `yaml:"name"`                 // The Name of the source
	Url        string `yaml:"url"`                  // The URL of the source
	PathPrefix string `yaml:"pathPrefix,omitempty"` // The Path Prefix of the source
	Ref        string `yaml:"ref"`                  // The Ref of the source
}

Source describes a source for a blueprint

type TerraformComponentV1Alpha1

type TerraformComponentV1Alpha1 struct {
	Source string                 `yaml:"source,omitempty"` // The Source of the module
	Path   string                 `yaml:"path"`             // The Path of the module
	Values map[string]interface{} `yaml:"values,omitempty"` // The Values for the module
}

TerraformComponent describes a Terraform component for a blueprint

type TerraformVariableV1Alpha1

type TerraformVariableV1Alpha1 struct {
	Name        string      `yaml:"name"`                  // The Name of the variable
	Type        string      `yaml:"type,omitempty"`        // The Type of the variable
	Default     interface{} `yaml:"default,omitempty"`     // The Default value of the variable
	Description string      `yaml:"description,omitempty"` // The Description of the variable
}

TerraformVariable describes a Terraform variable for a Terraform component

Jump to

Keyboard shortcuts

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