goiac

package
v0.0.0-...-f383bcb Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Goiac main object.

Functions

func ReadAndTemplate

func ReadAndTemplate(path string) (*viper.Viper, error)

Types

type Facts

type Facts struct {
	SysInfo SysInfo
	Var     map[string]interface{}
	Env     map[string]string
}
var F Facts

type GoIAC

type GoIAC struct {
	Globals config.Globals
	Log     *zerolog.Logger
	Stages  []*Stage
	Scripts []*Script
	Modules []*Module
	Project *Project
	Facts   Facts
}
var G *GoIAC

func NewGoIAC

func NewGoIAC(g config.Globals) *GoIAC

func (*GoIAC) ReadConfig

func (g *GoIAC) ReadConfig() error

type Host

type Host struct {
	Roles    map[string]string `mapstructure:"roles"`
	Platform string            `mapstructure:"platform,omitempty"`
	Arch     string            `mapstructure:"arch,omitempty"`
	Os       string            `mapstructure:"os,omitempty"`
}

type Module

type Module struct {
	Name        string   `mapstructure:"name"`
	Description string   `mapstructure:"description,omitempty"`
	Version     int      `mapstructure:"version"`
	Author      string   `mapstructure:"author,omitempty"`
	License     string   `mapstructure:"license,omitempty"`
	ScriptFiles []string `mapstructure:"scripts"`
	S           []*Script
	Project     *Project
	Idx         int
}

Working with modules.

func ReadModule

func ReadModule(path string, project *Project, idx int) (*Module, error)

Read module from directory.

type Project

type Project struct {
	Name        string              `mapstructure:"name"`
	Description string              `mapstructure:"description,omitempty"`
	Platform    string              `mapstructure:"platform,omitempty"`
	Arch        string              `mapstructure:"arch,omitempty"`
	Roles       map[string][]string `mapstructure:"roles,omitempty"`
	Hosts       map[string]Host     `mapstructure:"hosts,omitempty"`
	Modules     []*Module
	Var         map[string]interface{} `mapstructure:"var,omitempty"`
}

func ReadProject

func ReadProject(path string, hostName string) (*Project, error)

Read module from directory.

type Script

type Script struct {
	Name        string   `mapstructure:"name"`
	Description string   `mapstructure:"description,omitempty"`
	Stages      []*Stage `mapstructure:"stages"`
	Module      *Module
	Idx         int
}

func ReadScript

func ReadScript(path string, module *Module, idx int) (*Script, error)

Read script from file and return Script object.

type Stage

type Stage struct {
	Name        string `mapstructure:"name"`
	Description string `mapstructure:"description,omitempty"`
	Provider    string `mapstructure:"provider"`
	// Options for provider.
	Options *interface{} `mapstructure:"options,omitempty"`
	Script  *Script
}

func (*Stage) ValidateStage

func (s *Stage) ValidateStage(script *Script, idx int) error

type SysInfo

type SysInfo struct {
	Platform string
	Arch     string
	Linux    map[string]string
	Os       string
	Hostname string
}

Jump to

Keyboard shortcuts

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