nulecule

package
v0.0.0-...-a3f5b52 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2015 License: LGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSourceImage

func GetSourceImage(component Component) (string, error)

GetSourceImage fetches the sanitized source path of the image

func IsExternal

func IsExternal(component Component) bool

IsExternal returns true if the component is an external resource, and false if the component is A local resource

func SaveArtifact

func SaveArtifact(data []byte, targetPath, name string) error

SaveArtifact writes a templated artifact to the .workdir directory. If .workdir does not exist, it is created. data - a []byte of the templated file name - the name of the file to write to

Types

type Answers

type Answers map[string]string

Answers is a map of configuration parameters and the value to set for them

type ArtifactEntry

type ArtifactEntry struct {
	Path string
	Repo SrcControlRepo
}

ArtifactEntry is a source control repository struct used to specify an artifact

func (*ArtifactEntry) SetYAML

func (a *ArtifactEntry) SetYAML(tag string, value interface{}) bool

SetYAML is implemented by v1 of the go-yaml package. This method is invoked when go-yaml attempts to parse an ArtifactEntry via Unmarshal() Because of the way that Nulecule specifies an artifact, we have to define our own rules for parsing Artifact structs. An artifact contains either a Source Control Repository object or a URL. The former is represented as a structured set of parameters, while the latter is represneted as an unlabeled string. Therefore, because an artifact entry can be either a struct or an unlabeled string (and the parser is not smart enough to know how to deal with this), we must do it ourselves.

type Base

type Base struct {
	AnswersData map[string]Answers

	MainfileData *Mainfile

	Nodeps  bool
	DryRun  bool
	AppPath string

	WriteSampleAnswers bool
	// contains filtered or unexported fields
}

Base contains a set of nulecule config properties It is set by the atomicapp subcommands

func New

func New(targetPath, app string, dryRun bool) *Base

New creates a new base Nulecule object and initializes the fields

func (*Base) AnswersDir

func (b *Base) AnswersDir() string

AnswersDir returns the base directory in which the answers file lives

func (*Base) App

func (b *Base) App() string

App is a getter for the nulecule base's app field

func (*Base) CheckAllArtifacts

func (b *Base) CheckAllArtifacts()

CheckAllArtifacts will iterate through each entry in graph and check for validity

func (*Base) CheckComponentArtifacts

func (b *Base) CheckComponentArtifacts(c Component) []string

CheckComponentArtifacts will verify that valid artifacts exist for each provider in the component

func (*Base) CheckSpecVersion

func (b *Base) CheckSpecVersion() error

CheckSpecVersion verifies that a proper spec version has been provided

func (*Base) GetExternallAppDirectory

func (b *Base) GetExternallAppDirectory(c Component) string

GetExternallAppDirectory returns the directory in which an external app is installed to

func (*Base) Install

func (b *Base) Install() error

Install starts the install process

func (*Base) InstallDependencies

func (b *Base) InstallDependencies() error

InstallDependencies install all external sources

func (*Base) LoadAnswers

func (b *Base) LoadAnswers() error

LoadAnswers Unmarshals the answers from the answers.conf file into the base AnswersData

func (*Base) ReadMainFile

func (b *Base) ReadMainFile() error

ReadMainFile will read the Nulecule file and fill the MainfileData field

func (*Base) Run

func (b *Base) Run(ask bool, answersFile string)

Run starts the nulecule run process to deploy a clustered application

func (*Base) Stop

func (b *Base) Stop()

Stop starts the nulecule run process to undeploy a clustered application

func (*Base) Target

func (b *Base) Target() string

Target is a getter for nulecule base's target field

func (*Base) WriteAnswersSample

func (b *Base) WriteAnswersSample() error

WriteAnswersSample creates a new answers.conf.sample file to update to

type Component

type Component struct {
	Name      string
	Source    string
	Params    []Param
	Artifacts map[string][]ArtifactEntry
}

Component represents a graph item of the Nulecule file

type Constraint

type Constraint struct {
	AllowedPattern string `json:"allowed_pattern",yaml:"allowed_pattern"`
	Description    string
}

Constraint is a struct representing a constaint for a parameter object

type Mainfile

type Mainfile struct {
	Specversion string
	ID          string
	Graph       []Component
}

Mainfile is a struct representation of the Nulecule specification file

type Param

type Param struct {
	Name        string
	Description string
	Constraints []Constraint
	Default     string
	Hidden      bool
	AskedFor    bool
}

Param represents the Component parameters

type SrcControlRepo

type SrcControlRepo struct {
	Inherit []string
	Source  string
	Path    string
	Type    string
	Branch  string
	Tag     string
}

Jump to

Keyboard shortcuts

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