project

package
v0.4.0-alfa1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BackendsFactories = map[string]BackendsFactory{}

Functions

func RegisterBackendFactory

func RegisterBackendFactory(f BackendsFactory, provider string) error

Types

type Backend

type Backend interface {
	Name() string
	Provider() string
	GetBackendHCL(Module) ([]byte, error)
	GetRemoteStateHCL(Module) ([]byte, error)
}

type BackendsFactory

type BackendsFactory interface {
	New([]byte, string) (Backend, error)
}

type Dependency

type Dependency struct {
	Module *Module
	Output string
}

type DependencyMarker

type DependencyMarker struct {
	InfraName  string
	ModuleName string
	Output     string
}

type Infrastructure

type Infrastructure struct {
	Name        string
	BackendName string
	Template    []byte
	Variables   map[string]interface{}
}

type Module

type Module struct {
	InfraPtr     *Infrastructure
	ProjectPtr   *Project
	BackendPtr   Backend
	Name         string
	Type         string
	Source       string
	Inputs       map[string]interface{}
	Dependencies []Dependency
}

func (*Module) GenBackendCodeBlockHCL

func (m *Module) GenBackendCodeBlockHCL() ([]byte, error)

func (*Module) GenMainCodeBlockHCL

func (m *Module) GenMainCodeBlockHCL() ([]byte, error)

func (*Module) GetDepsRemoteStatesHCL

func (m *Module) GetDepsRemoteStatesHCL() ([]byte, error)

func (*Module) GetRemoteStateToSelfHCL

func (m *Module) GetRemoteStateToSelfHCL() ([]byte, error)

func (*Module) ReplaceMarkers

func (m *Module) ReplaceMarkers() error

ReplaceMarkers replace all templated markers with values.

type Project

type Project struct {
	Modules           map[string]*Module
	DependencyMarkers map[string]DependencyMarker
	InsertYAMLMarkers map[string]interface{}
	Infrastructures   map[string]*Infrastructure
	TmplFunctionsMap  template.FuncMap
	Backends          map[string]Backend
}

Project describes main config with user-defined variables.

func NewProject

func NewProject(configs [][]byte) (*Project, error)

NewProject creates init and check new infrastructure project.

func (*Project) AddDepMarker

func (p *Project) AddDepMarker(path string) (string, error)

func (*Project) AddYAMLBlockMarker

func (p *Project) AddYAMLBlockMarker(data interface{}) (string, error)

func (*Project) GenCode

func (p *Project) GenCode(codeStructName string) error

Jump to

Keyboard shortcuts

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