model

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2019 License: MIT Imports: 19 Imported by: 19

README

Build Status Go Report Card

Ekara platform model

Go library containing the Ekara Platform Model along with the YAML descriptor parser/validator.

Godoc here : https://godoc.org/github.com/ekara-platform/model

Documentation

Index

Examples

Constants

View Source
const (

	//MainComponentId The component identifier for the main descriptor
	MainComponentId = "__main__"

	//EkaraComponentId The component identifier for the ekara parent
	EkaraComponentId = "__ekara__"

	//GitExtension represents the extension of the GIT repository extension
	GitExtension = ".git"
)
View Source
const (
	//HookBefore Hook located before a task
	HookBefore hookLocation = "Before"
	//HookAfter Hook located after a task
	HookAfter hookLocation = "After"
)
View Source
const (
	//SchemeFile  scheme for a file
	SchemeFile string = "FILE"
	//SchemeGits  scheme for Git
	SchemeGits string = "GIT"
	//SchemeSvn  scheme for svn
	SchemeSvn string = "SVN"
	//SchemeHttp  scheme for http
	SchemeHttp string = "HTTP"
	//SchemeHttps  scheme for https
	SchemeHttps string = "HTTPS"
	//SchemeUnknown scheme is unknown
	SchemeUnknown string = ""
)
View Source
const (
	//DefaultComponentBase specifies the default base URL where to look for a component
	//
	// For example if component is defined like this:
	//  components:
	//    aws:
	//      repository: ekara-platform/aws-provider
	//      version: 1.2.3
	//
	// We will assume that this is a Git component located in:
	//   https://github.com/: ekara-platform/aws-provider
	//
	DefaultComponentBase = "https://github.com"
)
View Source
const (

	//DefaultDescriptorName specifies the default name of the environment descriptor
	//
	//When the environment descriptor is not specified, for example into a use
	// component then we will look for a default descriptor name "ekara.yaml"
	DefaultDescriptorName = "ekara.yaml"
)
View Source
const (
	//GenericNodeSetName is the name of the generic node set
	//
	//The generic node set is intended to be used for sharing common
	// content, example: parameter, environment variables..., with all
	// others node sets within the whole descriptor.
	GenericNodeSetName = "*"
)

Variables

View Source
var ErrorOnEmptyOrInvalid = validNotEmpty(Error)

ErrorOnEmptyOrInvalid allows to validate interfaces matching the following content:

The created validation errors will be errors.

A String

The string must not be empty.

The string content will be trimmed before the validation.

Any Map

The map cannot be empty.

If the map content implements validatableContent or validatableReference then it will be validated.

Any Slice

The slice cannot be empty.

If the slice content implements validatableContent or validatableReference then it will be validated.

View Source
var ErrorOnInvalid = valid(Error)

ErrorOnInvalid allows to validate interfaces matching the following content:

The created validation errors will be errors.

Maps of structs implementing validatableContent or validatableReference

map[interface{}]validatableContent.

map[interface{}]validatableReference.

Slices of structs implementing validatableContent or validatableReference

[]validatableContent.

[]validatableReference.

Any struct

The structure must implement validatableContent or validatableReference

View Source
var IsAValidQualifier = regexp.MustCompile(`^[a-zA-Z0-9_a-zA-Z0-90-9]+$`).MatchString

IsAValidQualifier is the regular expression used to validate the qualified name of an environment

The qualified name is the concatenation if the environment name and its qualifier separated by a "_"

The name and the qualifier can contain only alphanumerical characters

View Source
var WarningOnEmptyOrInvalid = validNotEmpty(Warning)

WarningOnEmptyOrInvalid allows to validate interfaces matching the following content:

The created validation errors will be warnings.

A string

The string must not be empty.

The string content will be trimmed before the validation.

Any Map

The map cannot be empty.

If the map content implements validatableContent or validatableReference then it will be validated.

Any Slice

The slice cannot be empty.

If the slice content implements validatableContent or validatableReference then it will be validated.

Functions

func ApplyTemplate

func ApplyTemplate(u EkURL, descriptorContent []byte, parameters *TemplateContext) (out bytes.Buffer, err error)

ApplyTemplate apply the parameters on the template represented by the descriptor content

func DirExist

func DirExist(path string) bool

DirExist returns true if a directory corresponding to the given path exixts

func FileExist

func FileExist(path string) (bool, os.FileInfo)

FileExist returns true if a file corresponding to the given path exixts

func ParseYamlDescriptor

func ParseYamlDescriptor(u EkURL, context *TemplateContext) (env yamlEnvironment, err error)

ParseYamlDescriptor returns an environment based on parsing of the descriptor located at the provided URL.

Types

type Base

type Base struct {
	// Url specifies the base location of a component
	Url EkURL
}

Base represents the common location to all components defined into a single descriptor

func CreateBase

func CreateBase(rawurl string) (Base, error)

CreateBase a new Base for the provided url, if the url is not specified then it will be defaulted to DefaultComponentBase

func CreateComponentBase

func CreateComponentBase(yamlEkara yamlEkara) (Base, error)

CreateComponentBase returns a new Base for the url specified in the Ekara section of the provided environment/descriptor, if the url is not defined then it will be defaulted to DefaultComponentBase

func (Base) CreateBasedUrl

func (b Base) CreateBasedUrl(repo string) (EkURL, error)

CreateBasedUrl creates a url under the base location

func (Base) Defaulted

func (b Base) Defaulted() bool

Defaulted returns true if the base is the defaulted one

type Component

type Component struct {
	// Id specifies id of the component
	Id string
	// Repository specifies the location where to look for the component
	Repository Repository
	//Templates Defines the content to template for the component
	Templates Patterns
}

Component represents an element composing an ekara environment

A component is always hosted into a source control management system.

It can be for example a Provider or Software to deploy on the environment

func CreateComponent

func CreateComponent(id string, repo Repository) Component

CreateComponent creates a new component

Parameters

	id: the id of the component
	repo: the repository where to fetch the component

func (Component) Templatable

func (c Component) Templatable() (bool, Patterns)

Templatable indicates if the component contains templates

type ComponentReferencer

type ComponentReferencer interface {
	//Component returns the referenced component
	Component() (Component, error)
	//ComponentName returns the referenced component name
	ComponentName() string
}

ComponentReferencer allows to access to a component through its reference

type Copies

type Copies struct {
	//Content lists all the content to be copies
	Content map[string]Copy
}

Copies represents a list of content to be copied The key of the map is the path where the content should be copied The map content is an array of path patterns to locate the content to be copied

type Copy

type Copy struct {
	// Labels identifies the nodesets where to copy
	Labels Labels
	//Sources identifies the content to copy
	Sources Patterns
}

Copy represents a content to be copied

type Dependencies

type Dependencies struct {
	//Content lists all the stack references on which we depends on
	Content []StackRef
}

Dependencies specifies the stack references on which we depends on

type Describable

type Describable interface {
	//DescType returns the type of the environment part being described,
	//Nodeset, Provider, Stack... Usually the type is harcoded into the
	//implementation
	DescType() string
	// DescName returns the name of the environment part being described
	DescName() string
}

Describable represents a part of the environment descriptor which can describe itself with a type and a name.

Describable is implemented by :

Nodeset
Provider
Stack

The Describable interface can be used for example in logs or even in execution report files in order to provider a human readable vision of what occurred instead providing technical concepts.

func ChainDescribable

func ChainDescribable(descs ...Describable) Describable

ChainDescribable merges the types and names of several Describables

Example
p := Provider{Name: "MyProviderName"}
n := NodeSet{Name: "MyNodesetName"}

c := ChainDescribable(p, n)
fmt.Printf("Chained types:%s, names:%s", c.DescType(), c.DescName())
Output:

Chained types:Provider-NodeSet, names:MyProviderName-MyNodesetName

type DescriptorLocation

type DescriptorLocation struct {
	//Descriptor is the url of the descriptor
	Descriptor string
	//Path is the location into the descriptor
	//
	// For example if the descriptor contains this:
	//  level1:
	//    level2:
	//      level3: ekara-platform/aws-provider
	//
	// The location of "level3" will be "level1.level2.level3"
	//
	Path string
}

DescriptorLocation represents the location of any element within the environment descriptor

type EkURL

type EkURL interface {
	String() string
	//ReadUrl returns the content referenced by the url
	ReadUrl() ([]byte, error)
	Scheme() string
	SetScheme(s string)
	Path() string
	AsFilePath() string
	Host() string
	UpperScheme() string
	SetDefaultScheme()
	CheckSlashSuffix()
	ResolveReference(repo string) (EkURL, error)
	AddPathSuffix(s string)
	RemovePathSuffix(s string)
}

EkURL defines the url used into Ekara

func CreateUrl

func CreateUrl(path string) (EkURL, error)

CreateUrl creates an Ekara url for the given path. The provided path can be a path on a file system or a remote url over http, https, git...

func GetCurrentDirectoryURL

func GetCurrentDirectoryURL(l *log.Logger) (EkURL, error)

GetCurrentDirectoryURL return the working directory as an url

type EnvVars

type EnvVars map[string]string

EnvVars Represents environment variable

type Environment

type Environment struct {

	// The environment name
	Name string
	// The environment qualifier
	Qualifier string
	// The environment description
	Description string

	// The descriptor variables
	Vars Parameters
	// The orchestrator used to manage the environment
	Orchestrator Orchestrator
	// The providers where to create the environment node sets
	Providers Providers
	// The node sets to create
	NodeSets NodeSets
	// The software stacks to install on the created node sets
	Stacks Stacks
	// The tasks which can be ran against the environment
	Tasks Tasks
	// The hooks linked to the environment lifecycle events
	Hooks EnvironmentHooks
	// The global volumes of the environment
	Volumes GlobalVolumes
	// Templates contains the templates defined into a descriptor
	Templates Patterns
	// contains filtered or unexported fields
}

Environment represents an environment build based on a descriptor

func CreateEnvironment

func CreateEnvironment(location string, yamlEnv yamlEnvironment, holder string) (*Environment, error)

CreateEnvironment creates a new environment based on the provided yaml The older passed as parameter y the name of the component holding the ekara.yaml on which the environment has been built

func InitEnvironment

func InitEnvironment() *Environment

InitEnvironment creates an new Environment

func (*Environment) Customize

func (r *Environment) Customize(with *Environment) error

Customize merges the content of the giver environment into the receiver

Note: basic informations (name, qualifier, description) are only accepted once if the are not already defined

Example
root := Environment{Name: "RootName", Qualifier: "RootQualifier"}
other := Environment{Name: "OtherName", Qualifier: "OtherQualifier"}
root.Customize(&other)
fmt.Println(root.QualifiedName())
Output:

RootName_RootQualifier

func (*Environment) Platform

func (r *Environment) Platform() *Platform

Platform Returns the platform on which the environment is built

func (Environment) QualifiedName

func (r Environment) QualifiedName() QualifiedName

QualifiedName returns the concatenation of the environment name and qualifier separated by a "_". If the environment qualifier is not defined it will return just the name

func (Environment) Validate

func (r Environment) Validate() ValidationErrors

Validate validate an environment

type EnvironmentHooks

type EnvironmentHooks struct {
	//Provisione specifies the hook tasks to run when the environment is provisioned
	Provision Hook
	//Deploy specifies the hook tasks to run at the environment deployment
	Deploy Hook
}

EnvironmentHooks represents hooks associated to the environment

func (EnvironmentHooks) HasTasks

func (r EnvironmentHooks) HasTasks() bool

HasTasks returns true if the hook contains at least one task reference

type EnvironmentReferences

type EnvironmentReferences struct {
	Ekara yamlEkara

	OrchestratorRefs struct {
		Component string
	} `yaml:"orchestrator"`

	ProvidersRefs map[string]struct {
		Component string
	} `yaml:"providers"`

	NodesRefs map[string]struct {
		Provider struct {
			Component string `yaml:"name"`
		}
	} `yaml:"nodes"`

	StacksRefs map[string]struct {
		Component string
	} `yaml:"stacks"`

	TasksRefs map[string]struct {
		Component string
	} `yaml:"tasks"`
	// contains filtered or unexported fields
}

EnvironmentReferences represents a light Ekara environment, used to unmarshal component references only

func ParseYamlDescriptorReferences

func ParseYamlDescriptorReferences(url EkURL, context *TemplateContext) (env EnvironmentReferences, err error)

ParseYamlDescriptorReferences returns an the references, declared and used, into the environment based on parsing of the descriptor located at the provided URL.

This parsing must be applied to the main descriptor itself and to all of its parents

func (EnvironmentReferences) Parent

func (er EnvironmentReferences) Parent() (Parent, bool, error)

Parent returns the parent of the component

func (EnvironmentReferences) References

func (er EnvironmentReferences) References(owner string) (*ReferencedComponents, error)

References returns the components referenced into the environment

func (EnvironmentReferences) Uses

func (er EnvironmentReferences) Uses(previousO *Orphans) (*UsedReferences, *Orphans)

Uses returns the references of the components used into the environment

type ErrorType

type ErrorType int

ErrorType type used to represent the type of a validation error

const (
	//Warning allows to mark validation error as Warning
	Warning ErrorType = 0
	//Error allows to mark validation error as Error
	Error ErrorType = 1
)

func (ErrorType) String

func (r ErrorType) String() string

String return the name of the given ErrorType

type FileURL

type FileURL struct {
	// contains filtered or unexported fields
}

FileURL defines a local url, typically a file url of something already downloaded into the platform

func (FileURL) AddPathSuffix

func (ru FileURL) AddPathSuffix(s string)

func (FileURL) AsFilePath

func (fu FileURL) AsFilePath() string

AsFilePath return path corresponding to the file url

func (FileURL) CheckSlashSuffix

func (ru FileURL) CheckSlashSuffix()

func (FileURL) Host

func (ru FileURL) Host() string

func (FileURL) MarshalYAML

func (fu FileURL) MarshalYAML() (interface{}, error)

MarshalYAML serialize the url content into YAML

func (FileURL) Path

func (ru FileURL) Path() string

func (FileURL) ReadUrl

func (fu FileURL) ReadUrl() ([]byte, error)

ReadUrl reads the content referenced by the url

func (FileURL) RemovePathSuffix

func (ru FileURL) RemovePathSuffix(s string)

func (FileURL) ResolveReference

func (fu FileURL) ResolveReference(repository string) (EkURL, error)

ResolveReference resolves the repository URI reference to an absolute URI from the FileURL as base URI

func (FileURL) Scheme

func (ru FileURL) Scheme() string

func (FileURL) SetDefaultScheme

func (ru FileURL) SetDefaultScheme()

func (FileURL) SetScheme

func (ru FileURL) SetScheme(s string)

func (FileURL) String

func (ru FileURL) String() string

func (FileURL) UpperScheme

func (ru FileURL) UpperScheme() string

type GlobalVolume

type GlobalVolume struct {
	Content []VolumeContent
}

GlobalVolume contains the specifications of a shared volume to create

type GlobalVolumes

type GlobalVolumes map[string]*GlobalVolume

GlobalVolumes represents all the volumes shared across the whole environment

type Hook

type Hook struct {
	//Before specifies the tasks to run before the ekara life cycle event occurs
	Before []TaskRef
	//After specifies the tasks to run once the ekara life cycle event has occurred
	After []TaskRef
}

Hook represents tasks to be executed linked to an ekara life cycle event

func (Hook) HasTasks

func (r Hook) HasTasks() bool

HasTasks returns true if the hook contains at least one task reference

type Labels

type Labels map[string]string

Labels represents used defined labels which will be placed on the created environment machines and also on the nodes for Docker

type NodeHook

type NodeHook struct {
	//Provisioned specifies the hook tasks to run when a node set is provisioned
	Provision Hook
}

NodeHook represents hooks associated to a node set

func (NodeHook) HasTasks

func (r NodeHook) HasTasks() bool

HasTasks returns true if the hook contains at least one task reference

type NodeSet

type NodeSet struct {

	// The name of the machines
	Name string
	// The number of machines to create
	Instances int
	// The ref to the provider where to create the machines
	Provider ProviderRef
	// The parameters related to the orchestrator used to manage the machines
	Orchestrator OrchestratorRef
	// The hooks linked to the node set lifecycle events
	Hooks NodeHook
	// The labels associated with the nodeset
	Labels Labels
	// contains filtered or unexported fields
}

NodeSet contains the whole specification of a nodeset to create on a specific cloud provider

func (NodeSet) DescName

func (r NodeSet) DescName() string

DescName returns the Describable name of the node set

func (NodeSet) DescType

func (r NodeSet) DescType() string

DescType returns the Describable type of the node set

Hardcoded to : "NodeSet"

type NodeSets

type NodeSets map[string]NodeSet

NodeSets represents all the node sets of the environment

type Orchestrator

type Orchestrator struct {

	// The orchestrator parameters
	Parameters Parameters
	// The orchestrator environment variables
	EnvVars EnvVars
	// contains filtered or unexported fields
}

Orchestrator specifies the orchestrator used to manage the environment

func (Orchestrator) Component

func (r Orchestrator) Component() (Component, error)

Component returns the referenced component

func (Orchestrator) ComponentName

func (r Orchestrator) ComponentName() string

ComponentName returns the referenced component name

func (Orchestrator) DescName

func (r Orchestrator) DescName() string

DescName returns the Describable name of the node set

func (Orchestrator) DescType

func (r Orchestrator) DescType() string

DescType returns the Describable type of the orchestrator

Hardcoded to : "Orchestrator"

type OrchestratorRef

type OrchestratorRef struct {
	// contains filtered or unexported fields
}

OrchestratorRef represents a reference on an Orchestrator

func (OrchestratorRef) Resolve

func (r OrchestratorRef) Resolve() (Orchestrator, error)

Resolve returns the referenced Orchestrator

type Orphans

type Orphans struct {
	// Set used to avoid duplicated entries
	Refs map[string]struct{}
}

Orphans represents and indirect, unresolved, references used into an environment descriptor

func CreateOrphans

func CreateOrphans() *Orphans

CreateOrphans return an initialized manager

func (*Orphans) AddReference

func (or *Orphans) AddReference(id string)

AddReference adds a new reference to orphan which has already been formated like : ref-king

func (*Orphans) KeyType

func (or *Orphans) KeyType(s string) (key string, kind string)

KeyType returns the key and the type of an.

func (*Orphans) NoMoreAnOrhpan

func (or *Orphans) NoMoreAnOrhpan(ref string)

NoMoreAnOrhpan remove an orphan, which has already been formated like : ref-king.

type Parameters

type Parameters map[string]interface{}

Parameters represents the parameters coming from a descriptor

func CreateParameters

func CreateParameters(src map[string]interface{}) (Parameters, error)

CreateParameters builds Parameters from the specified map

func ParseParameters

func ParseParameters(path string) (Parameters, error)

ParseParameters parses a yaml file into a Parameters

type Parent

type Parent Component

Parent Represents the parent used to run Ekara

func CreateParent

func CreateParent(base Base, yamlEkara yamlEkara) (Parent, bool, error)

CreateParent creates the parent

func (Parent) Component

func (p Parent) Component() (Component, error)

Component returns the referenced component

func (Parent) ComponentName

func (p Parent) ComponentName() string

ComponentName returns the referenced component name

type Patterns

type Patterns struct {
	//Content lists all the path patterns
	Content []string
}

Patterns represent a list of path patterns

type Platform

type Platform struct {
	Base       Base
	Parent     Parent
	HasParent  bool
	Components map[string]Component
}

Platform the platform used to build an environment

func (*Platform) AddComponent

func (p *Platform) AddComponent(c Component)

AddComponent Add the given component to the platform

func (Platform) KeepTemplates

func (p Platform) KeepTemplates(c Component, templates Patterns)

KeepTemplates Stores the template into the given component

type Provider

type Provider struct {

	// The Name of the provider
	Name string
	// The provider parameters
	Parameters Parameters
	// The provider environment variables
	EnvVars EnvVars
	// The provider proxy
	Proxy Proxy
	// contains filtered or unexported fields
}

Provider contains the whole specification of a cloud provider where to create an environemt

func (Provider) Component

func (r Provider) Component() (Component, error)

Component returns the referenced component

func (Provider) ComponentName

func (r Provider) ComponentName() string

ComponentName returns the referenced component name

func (Provider) DescName

func (r Provider) DescName() string

DescName returns the Describable name of the provider

func (Provider) DescType

func (r Provider) DescType() string

DescType returns the Describable type of the provider

Hardcoded to : "Provider"

type ProviderRef

type ProviderRef struct {
	// contains filtered or unexported fields
}

ProviderRef represents a reference to a provider

func (ProviderRef) Component

func (r ProviderRef) Component() (Component, error)

Component returns the referenced component

func (ProviderRef) ComponentName

func (r ProviderRef) ComponentName() string

ComponentName returns the referenced component name

func (ProviderRef) Resolve

func (r ProviderRef) Resolve() (Provider, error)

Resolve returns the referenced Provider

type Providers

type Providers map[string]Provider

Providers lists all the providers required to build the environemt

type Proxy

type Proxy struct {
	Http    string `yaml:"http_proxy" json:",omitempty"`
	Https   string `yaml:"https_proxy" json:",omitempty"`
	NoProxy string `yaml:"no_proxy" json:",omitempty"`
}

Proxy represents the proxy definition

type QualifiedName

type QualifiedName struct {
	// contains filtered or unexported fields
}

QualifiedName The Qualified name of an environment. This name can be used to identify, using for example Tags or Labels, all the content created relatively to the environment on the infrastructure of the desired cloud provider.

func (QualifiedName) String

func (qn QualifiedName) String() string

String returns the qualified name as string

func (QualifiedName) ValidQualifiedName

func (qn QualifiedName) ValidQualifiedName() bool

ValidQualifiedName returns true if the qualified name is valid

type ReferencedComponent

type ReferencedComponent struct {
	Owner     string
	Component Component
}

ReferencedComponent keeps a reference between a component delacation and the one declaring it

type ReferencedComponents

type ReferencedComponents struct {
	Refs []ReferencedComponent
}

ReferencedComponents represents a manager of declarations of components into an environment descriptor

func CreateReferencedComponents

func CreateReferencedComponents() *ReferencedComponents

CreateReferencedComponents return an initialized manager

func (*ReferencedComponents) AddReference

func (rc *ReferencedComponents) AddReference(ref ReferencedComponent) bool

AddReference adds a new referenced component. It will return false is a component with the same id or the same repository as already been registered.

func (*ReferencedComponents) Clean

func (rc *ReferencedComponents) Clean(used UsedReferences)

Clean cleans the referenced component base on the list of used ones

func (*ReferencedComponents) IdReferenced

func (rc *ReferencedComponents) IdReferenced(id string) bool

IdReferenced return true if a component with the given id is referenced

func (*ReferencedComponents) Sorted

func (rc *ReferencedComponents) Sorted() []Component

Sorted Returns the referenced components sorted in alphabetical order based on their names

type RemoteURL

type RemoteURL struct {
	// contains filtered or unexported fields
}

RemoteURL defines a remote url,example over http; https, git...

func (RemoteURL) AddPathSuffix

func (ru RemoteURL) AddPathSuffix(s string)

func (RemoteURL) AsFilePath

func (ru RemoteURL) AsFilePath() string

AsFilePath return "" because it's a remote url

func (RemoteURL) CheckSlashSuffix

func (ru RemoteURL) CheckSlashSuffix()

func (RemoteURL) Host

func (ru RemoteURL) Host() string

func (RemoteURL) MarshalYAML

func (ru RemoteURL) MarshalYAML() (interface{}, error)

MarshalYAML serialize the url content into YAML

func (RemoteURL) Path

func (ru RemoteURL) Path() string

func (RemoteURL) ReadUrl

func (ru RemoteURL) ReadUrl() ([]byte, error)

ReadUrl reads the content referenced by the url

func (RemoteURL) RemovePathSuffix

func (ru RemoteURL) RemovePathSuffix(s string)

func (RemoteURL) ResolveReference

func (ru RemoteURL) ResolveReference(repository string) (EkURL, error)

ResolveReference resolves the repository URI reference to an absolute URI from the RemoteURL as base URI

func (RemoteURL) Scheme

func (ru RemoteURL) Scheme() string

func (RemoteURL) SetDefaultScheme

func (ru RemoteURL) SetDefaultScheme()

func (RemoteURL) SetScheme

func (ru RemoteURL) SetScheme(s string)

func (RemoteURL) String

func (ru RemoteURL) String() string

func (RemoteURL) UpperScheme

func (ru RemoteURL) UpperScheme() string

type Repository

type Repository struct {
	// Scm specifies type of source sontrol management system holding the
	// component
	Scm SCMType
	// Url specifies the repository Url where to fetch the component
	Url EkURL
	// The reference to the branch or tag to fetch. If not specified the default branch will be fetched
	Ref string
	//DescriptorName specifies the name of the descriptor
	DescriptorName string
	// The authentication parameters to use if repository is not publicly accessible
	Authentication Parameters
}

Repository represents a descriptor or component location

func CreateRepository

func CreateRepository(base Base, repo string, ref string, descriptor string) (Repository, error)

CreateRepository creates a repository

Parameters

	base: the base URL where to look for the component
	repo: the repository Url where to fetch the component
	ref: the ref to fetch, if the ref is not specified then the default branch will be fetched
	descriptor: the name of the descriptor, if not specified then it will be defaulted

type RunTimeInfo

type RunTimeInfo struct {
	//TargetType represents the type of the target supporting the current action
	TargetType string
	//TargetName represents the name of the target supporting the current action
	TargetName string
}

RunTimeInfo the context passed to all ekara templates

func (*RunTimeInfo) SetTarget

func (cc *RunTimeInfo) SetTarget(t Describable)

SetTarget defines the target of the running action

type SCMType

type SCMType string

SCMType represents a type of Source Control Management system

const (
	//GitScm type of GIT source control management system
	GitScm SCMType = SCMType(SchemeGits)
	//SvnScm type of SVN source control management system
	SvnScm SCMType = SCMType(SchemeSvn)
	//UnknownScm represents an unknown source control management system
	UnknownScm SCMType = ""
)

type Stack

type Stack struct {

	// The name of the stack
	Name string
	//DependsOn specifies the stack references on which this one depends
	DependsOn Dependencies
	// The hooks linked to the stack lifecycle events
	Hooks StackHook
	// The stack parameters
	Parameters Parameters
	// The stack environment variables
	EnvVars EnvVars
	// The stack content to be copied on volumes
	Copies Copies
	// contains filtered or unexported fields
}

Stack represent an Stack installable on the built environment

func (Stack) Component

func (s Stack) Component() (Component, error)

Component returns the referenced component

func (Stack) ComponentName

func (s Stack) ComponentName() string

ComponentName returns the referenced component name

func (Stack) Dependency

func (s Stack) Dependency() (bool, []Stack)

Dependency returns the potential Stacks on which this one depends

func (Stack) DescName

func (s Stack) DescName() string

DescName returns the Describable name of the stack

func (Stack) DescType

func (s Stack) DescType() string

DescType returns the Describable type of the stack

Hardcoded to : "Stack"

type StackHook

type StackHook struct {
	//Deploy specifies the hook tasks to run when a stack is deployed
	Deploy Hook
}

StackHook represents hooks associated to a task

func (StackHook) HasTasks

func (r StackHook) HasTasks() bool

HasTasks returns true if the hook contains at least one task reference

type StackRef

type StackRef struct {
	// contains filtered or unexported fields
}

StackRef defines a dependency a on stack which must be previously processed

func (StackRef) Resolve

func (s StackRef) Resolve() (Stack, error)

Resolve returns a resolved reference to a stack

type Stacks

type Stacks map[string]Stack

Stacks represent all the stacks of an environment

func (Stacks) ResolveDependencies

func (r Stacks) ResolveDependencies() ([]Stack, error)

ResolveDependencies returns the stacks based on the order of the dependencies

type TBase

type TBase interface {
	//URL returns the url where the base refers
	URL() TURL
}

TBase is a read only base location

type TBaseOnBaseHolder

type TBaseOnBaseHolder struct {
	// contains filtered or unexported fields
}

TBaseOnBaseHolder is the struct containing the Base in order to implement TBase

func CreateTBaseForBase

func CreateTBaseForBase(o Base) TBaseOnBaseHolder

CreateTBaseForBase returns an holder of Base implementing TBase

func (TBaseOnBaseHolder) URL

func (r TBaseOnBaseHolder) URL() TURL

URL returns the url where the base refers

type TComponent

type TComponent interface {
	//ID returns the name of the component
	ID() string
	//Repository returns the repository where the component is located
	Repository() TRepository
	//HasTemplates returns true if the component has defined templates
	HasTemplates() bool
	//Templates returns true if the component templates
	Templates() []string
}

TComponent is a read only component

type TComponentOnComponentHolder

type TComponentOnComponentHolder struct {
	// contains filtered or unexported fields
}

TComponentOnComponentHolder is the struct containing the Component in order to implement TComponent

func CreateTComponentForComponent

func CreateTComponentForComponent(o Component) TComponentOnComponentHolder

CreateTComponentForComponent returns an holder of Component implementing TComponent

func (TComponentOnComponentHolder) HasTemplates

func (r TComponentOnComponentHolder) HasTemplates() bool

HasTemplates returns true if the component has defined templates

func (TComponentOnComponentHolder) ID

ID returns the name of the component

func (TComponentOnComponentHolder) Repository

Repository returns the repository where the component is located

func (TComponentOnComponentHolder) Templates

func (r TComponentOnComponentHolder) Templates() []string

Templates returns true if the component templates

type TComponentOnParentHolder

type TComponentOnParentHolder struct {
	// contains filtered or unexported fields
}

TComponentOnParentHolder is the struct containing the Parent in order to implement TComponent

func CreateTComponentForParent

func CreateTComponentForParent(o Parent) TComponentOnParentHolder

CreateTComponentForParent returns an holder of Parent implementing TComponent

func (TComponentOnParentHolder) HasTemplates

func (r TComponentOnParentHolder) HasTemplates() bool

HasTemplates returns true if the component has defined templates

func (TComponentOnParentHolder) ID

ID returns the name of the component

func (TComponentOnParentHolder) Repository

func (r TComponentOnParentHolder) Repository() TRepository

Repository returns the repository where the component is located

func (TComponentOnParentHolder) Templates

func (r TComponentOnParentHolder) Templates() []string

Templates returns true if the component templates

type TCopy

type TCopy interface {
	//HasLabels returns true if the copy has defined labels
	HasLabels() bool
	//Labels returns the copy labels
	Labels() map[string]string
	//HasSources returns true if the copy has defined sources
	HasSources() bool
	//Sources returns the copy sources
	Sources() []string
}

TCopy is a read only representation of files to be copied

type TCopyOnCopyHolder

type TCopyOnCopyHolder struct {
	// contains filtered or unexported fields
}

TCopyOnCopyHolder is the struct containing the Copy in order to implement TCopy

func CreateTCopyForCopy

func CreateTCopyForCopy(o Copy) TCopyOnCopyHolder

CreateTCopyForCopy returns an holder of Copy implementing TCopy

func (TCopyOnCopyHolder) HasLabels

func (r TCopyOnCopyHolder) HasLabels() bool

HasLabels returns true if the copy has defined labels

func (TCopyOnCopyHolder) HasSources

func (r TCopyOnCopyHolder) HasSources() bool

HasSources returns true if the copy has defined sources

func (TCopyOnCopyHolder) Labels

func (r TCopyOnCopyHolder) Labels() map[string]string

Labels returns the copy labels

func (TCopyOnCopyHolder) Sources

func (r TCopyOnCopyHolder) Sources() []string

Sources returns the copy sources

type TDependencies

type TDependencies interface {
	//HasDependencies returns true if there is dependencies
	HasDependencies() bool
	//Dependencies returns the references of stacks we depend on
	Dependencies() []TStackRef
}

TDependencies is a read only list of stack dependencies

type TDependenciesOnDependenciesHolder

type TDependenciesOnDependenciesHolder struct {
	// contains filtered or unexported fields
}

TDependenciesOnDependenciesHolder is the struct containing the Dependencies in order to implement TDependencies

func CreateTDependenciesForDependencies

func CreateTDependenciesForDependencies(o Dependencies) TDependenciesOnDependenciesHolder

CreateTDependenciesForDependencies returns an holder of Dependencies implementing TDependencies

func (TDependenciesOnDependenciesHolder) Dependencies

func (r TDependenciesOnDependenciesHolder) Dependencies() []TStackRef

Dependencies returns the references of stacks we depend on

func (TDependenciesOnDependenciesHolder) HasDependencies

func (r TDependenciesOnDependenciesHolder) HasDependencies() bool

HasDependencies returns true if there is dependencies

type TEnvironment

type TEnvironment interface {
	//Name returns the name of the environment
	Name() string
	//Qualifier returns the qualifier of the environment
	Qualifier() string
	//Description returns the description of the environment
	Description() string
	//QualifiedName returns the qualified of the environment
	QualifiedName() string
	//Platform returns the platform used to deploy environment
	Platform() TPlatform
	//HasVars returns true if the environment has defined vars
	HasVars() bool
	//Vars returns the environement vars
	Vars() map[string]interface{}
	//Orchestrator returns the orchestrator managing the environment nodes
	Orchestrator() TOrchestrator
	//HasProviders returns true if the environment has providers
	HasProviders() bool
	//Providers returns the environment providers
	Providers() map[string]TProvider
	//HasNodeSets returns true if the environment has nodes
	HasNodeSets() bool
	//Nodesets returns the environment providers
	Nodesets() map[string]TNodeSet
	//HasStacks returns true if the environment has stacks
	HasStacks() bool
	//Stacks returns the environment stacks
	Stacks() map[string]TStack
	//HasTasks returns true if the environment has tasks
	HasTasks() bool
	//Tasks returns the environment tasks
	Tasks() map[string]TTask
	//HasHooks returns true if the environment has hooks
	HasHooks() bool
	//Hooks returns the environment hooks
	Hooks() TEnvironmentHooks
	//HasProvisionHooks returns true if the environment has hooks while provisioning
	HasProvisionHooks() bool
	//HasDeployHooks returns true if the environment has hooks while deploying
	HasDeployHooks() bool
	//HasTemplates returns true if the environment has defined templates
	HasTemplates() bool
	//Templates returns the environment templates
	Templates() []string
}

TEnvironment is a read only environment

type TEnvironmentHooks

type TEnvironmentHooks interface {
	//HasProvision returns true if the hooks has tasks while provisioning
	HasProvision() bool
	//Provision returns the provisioning tasks
	Provision() THook
	//HasDeploy returns true if the hooks has tasks while deploying
	HasDeploy() bool
	//Deploy returns the deploying tasks
	Deploy() THook
}

TEnvironmentHooks is a read only representation of the hooks associated to an environment

type TEnvironmentHooksOnEnvironmentHooksHolder

type TEnvironmentHooksOnEnvironmentHooksHolder struct {
	// contains filtered or unexported fields
}

TEnvironmentHooksOnEnvironmentHooksHolder is the struct containing the EnvironmentHooks in order to implement TEnvironmentHooks

func CreateTEnvironmentHooksForEnvironmentHooks

func CreateTEnvironmentHooksForEnvironmentHooks(o EnvironmentHooks) TEnvironmentHooksOnEnvironmentHooksHolder

CreateTEnvironmentHooksForEnvironmentHooks returns an holder of EnvironmentHooks implementing TEnvironmentHooks

func (TEnvironmentHooksOnEnvironmentHooksHolder) Deploy

Deploy returns the deploying tasks

func (TEnvironmentHooksOnEnvironmentHooksHolder) HasDeploy

HasDeploy returns true if the hooks has tasks while deploying

func (TEnvironmentHooksOnEnvironmentHooksHolder) HasProvision

HasProvision returns true if the hooks has tasks while provisioning

func (TEnvironmentHooksOnEnvironmentHooksHolder) Provision

Provision returns the provisioning tasks

type TEnvironmentOnEnvironmentHolder

type TEnvironmentOnEnvironmentHolder struct {
	// contains filtered or unexported fields
}

TEnvironmentOnEnvironmentHolder is the struct containing the Environment in order to implement TEnvironment

func CreateTEnvironmentForEnvironment

func CreateTEnvironmentForEnvironment(o Environment) TEnvironmentOnEnvironmentHolder

CreateTEnvironmentForEnvironment returns an holder of Environment implementing TEnvironment

func (TEnvironmentOnEnvironmentHolder) Description

func (r TEnvironmentOnEnvironmentHolder) Description() string

Description returns the description of the environment

func (TEnvironmentOnEnvironmentHolder) HasDeployHooks

func (r TEnvironmentOnEnvironmentHolder) HasDeployHooks() bool

HasDeployHooks returns true if the environment has hooks while deploying

func (TEnvironmentOnEnvironmentHolder) HasHooks

HasHooks returns true if the environment has hooks

func (TEnvironmentOnEnvironmentHolder) HasNodeSets

func (r TEnvironmentOnEnvironmentHolder) HasNodeSets() bool

HasNodeSets returns true if the environment has nodes

func (TEnvironmentOnEnvironmentHolder) HasProviders

func (r TEnvironmentOnEnvironmentHolder) HasProviders() bool

HasProviders returns true if the environment has providers

func (TEnvironmentOnEnvironmentHolder) HasProvisionHooks

func (r TEnvironmentOnEnvironmentHolder) HasProvisionHooks() bool

HasProvisionHooks returns true if the environment has hooks while provisioning

func (TEnvironmentOnEnvironmentHolder) HasStacks

func (r TEnvironmentOnEnvironmentHolder) HasStacks() bool

HasStacks returns true if the environment has stacks

func (TEnvironmentOnEnvironmentHolder) HasTasks

HasTasks returns true if the environment has tasks

func (TEnvironmentOnEnvironmentHolder) HasTemplates

func (r TEnvironmentOnEnvironmentHolder) HasTemplates() bool

HasTemplates returns true if the environment has defined templates

func (TEnvironmentOnEnvironmentHolder) HasVars

HasVars returns true if the environment has defined vars

func (TEnvironmentOnEnvironmentHolder) Hooks

Hooks returns the environment hooks

func (TEnvironmentOnEnvironmentHolder) Name

Name returns the name of the environment

func (TEnvironmentOnEnvironmentHolder) Nodesets

Nodesets returns the environment providers

func (TEnvironmentOnEnvironmentHolder) Orchestrator

Orchestrator returns the orchestrator managing the environment nodes

func (TEnvironmentOnEnvironmentHolder) Platform

Platform returns the platform used to deploy environment

func (TEnvironmentOnEnvironmentHolder) Providers

Providers returns the environment providers

func (TEnvironmentOnEnvironmentHolder) QualifiedName

func (r TEnvironmentOnEnvironmentHolder) QualifiedName() string

QualifiedName returns the qualified of the environment

func (TEnvironmentOnEnvironmentHolder) Qualifier

Qualifier returns the qualifier of the environment

func (TEnvironmentOnEnvironmentHolder) Stacks

Stacks returns the environment stacks

func (TEnvironmentOnEnvironmentHolder) Tasks

Tasks returns the environment tasks

func (TEnvironmentOnEnvironmentHolder) Templates

func (r TEnvironmentOnEnvironmentHolder) Templates() []string

Templates returns the environment templates

func (TEnvironmentOnEnvironmentHolder) Vars

func (r TEnvironmentOnEnvironmentHolder) Vars() map[string]interface{}

Vars returns the environement vars

type THook

type THook interface {
	//After returns the references of tasks to run after the hooked action
	After() []TTaskRef
	//Before returns the references of tasks to run before the hooked action
	Before() []TTaskRef
}

THook is a read only hooks

type THookOnHookHolder

type THookOnHookHolder struct {
	// contains filtered or unexported fields
}

THookOnHookHolder is the struct containing the Hook in order to implement THook

func CreateTHookForHook

func CreateTHookForHook(o Hook) THookOnHookHolder

CreateTHookForHook returns an holder of Hook implementing THook

func (THookOnHookHolder) After

func (r THookOnHookHolder) After() []TTaskRef

After returns the references of tasks to run after the hooked action

func (THookOnHookHolder) Before

func (r THookOnHookHolder) Before() []TTaskRef

Before returns the references of tasks to run before the hooked action

type TNodeHook

type TNodeHook interface {
	//HasProvision returns true if the hooks has tasks while provisioning
	HasProvision() bool
	//Provision returns the provisioning tasks
	Provision() THook
}

TNodeHook is a read only representation of the hooks associated to a node

type TNodeHookOnNodeHookHolder

type TNodeHookOnNodeHookHolder struct {
	// contains filtered or unexported fields
}

TNodeHookOnNodeHookHolder is the struct containing the NodeHook in order to implement TNodeHook

func CreateTNodeHookForNodeHook

func CreateTNodeHookForNodeHook(o NodeHook) TNodeHookOnNodeHookHolder

CreateTNodeHookForNodeHook returns an holder of NodeHook implementing TNodeHook

func (TNodeHookOnNodeHookHolder) HasProvision

func (r TNodeHookOnNodeHookHolder) HasProvision() bool

HasProvision returns true if the hooks has tasks while provisioning

func (TNodeHookOnNodeHookHolder) Provision

func (r TNodeHookOnNodeHookHolder) Provision() THook

Provision returns the provisioning tasks

type TNodeSet

type TNodeSet interface {
	//Name returns the name of the node set
	Name() string
	//Instances returns the number of nodes to create for this node set
	Instances() int
	//Orchestrator returns the reference on the orchestrator managing the node
	Orchestrator() TOrchestratorRef
	//Provider returns the reference on the provider wherein the node should be deployed
	Provider() TProviderRef
	//HasHooks returns true if the node has hooks
	HasHooks() bool
	//Hooks returns the node hooks
	Hooks() TNodeHook
	//HasProvisionHooks returns true if the node has hooks while provisioning
	HasProvisionHooks() bool
	//HasLabels returns true if the node has defined labels
	HasLabels() bool
	//Labels returns the node labels
	Labels() map[string]string
}

TNodeSet is a read only node set

type TNodeSetOnNodeSetHolder

type TNodeSetOnNodeSetHolder struct {
	// contains filtered or unexported fields
}

TNodeSetOnNodeSetHolder is the struct containing the NodeSet in order to implement TNodeSet

func CreateTNodeSetForNodeSet

func CreateTNodeSetForNodeSet(o NodeSet) TNodeSetOnNodeSetHolder

CreateTNodeSetForNodeSet returns an holder of NodeSet implementing TNodeSet

func (TNodeSetOnNodeSetHolder) HasHooks

func (r TNodeSetOnNodeSetHolder) HasHooks() bool

HasHooks returns true if the node has hooks

func (TNodeSetOnNodeSetHolder) HasLabels

func (r TNodeSetOnNodeSetHolder) HasLabels() bool

HasLabels returns true if the node has defined labels

func (TNodeSetOnNodeSetHolder) HasProvisionHooks

func (r TNodeSetOnNodeSetHolder) HasProvisionHooks() bool

HasProvisionHooks returns true if the node has hooks while provisioning

func (TNodeSetOnNodeSetHolder) Hooks

Hooks returns the node hooks

func (TNodeSetOnNodeSetHolder) Instances

func (r TNodeSetOnNodeSetHolder) Instances() int

Instances returns the number of nodes to create for this node set

func (TNodeSetOnNodeSetHolder) Labels

func (r TNodeSetOnNodeSetHolder) Labels() map[string]string

Labels returns the node labels

func (TNodeSetOnNodeSetHolder) Name

Name returns the name of the node set

func (TNodeSetOnNodeSetHolder) Orchestrator

func (r TNodeSetOnNodeSetHolder) Orchestrator() TOrchestratorRef

Orchestrator returns the reference on the orchestrator managing the node

func (TNodeSetOnNodeSetHolder) Provider

Provider returns the reference on the provider wherein the node should be deployed

type TOrchestrator

type TOrchestrator interface {
	//Parameters returns the orchestrator parameters
	Parameters() map[string]interface{}
	//EnvVars returns the orchestrator environment variables
	EnvVars() map[string]string
	//Component returns the orchestrator component
	Component() (TComponent, error)
}

TOrchestrator is a read only orchestrator

type TOrchestratorOnOrchestratorHolder

type TOrchestratorOnOrchestratorHolder struct {
	// contains filtered or unexported fields
}

TOrchestratorOnOrchestratorHolder is the struct containing the Orchestrator in order to implement TOrchestrator

func CreateTOrchestratorForOrchestrator

func CreateTOrchestratorForOrchestrator(o Orchestrator) TOrchestratorOnOrchestratorHolder

CreateTOrchestratorForOrchestrator returns an holder of Orchestrator implementing TOrchestrator

func (TOrchestratorOnOrchestratorHolder) Component

Component returns the orchestrator component

func (TOrchestratorOnOrchestratorHolder) EnvVars

EnvVars returns the orchestrator environment variables

func (TOrchestratorOnOrchestratorHolder) Parameters

func (r TOrchestratorOnOrchestratorHolder) Parameters() map[string]interface{}

Parameters returns the orchestrator parameters

type TOrchestratorRef

type TOrchestratorRef interface {
	//Orchestrator returns the orchestrator managing a node
	Orchestrator() (TOrchestrator, error)
}

TOrchestratorRef is a read only reference on the orchestrator

type TOrchestratorRefOnOrchestratorRefHolder

type TOrchestratorRefOnOrchestratorRefHolder struct {
	// contains filtered or unexported fields
}

TOrchestratorRefOnOrchestratorRefHolder is the struct containing the OrchestratorRef in order to implement TOrchestratorRef

func CreateTOrchestratorRefForOrchestratorRef

func CreateTOrchestratorRefForOrchestratorRef(o OrchestratorRef) TOrchestratorRefOnOrchestratorRefHolder

CreateTOrchestratorRefForOrchestratorRef returns an holder of OrchestratorRef implementing TOrchestratorRef

func (TOrchestratorRefOnOrchestratorRefHolder) Orchestrator

Orchestrator returns the orchestrator managing a node

type TPlatform

type TPlatform interface {
	//Base returns the base location of the platform
	Base() TBase
	//Parent returns the parent used by the platform
	Parent() TComponent
	//HasComponents returns true if the platform has components
	HasComponents() bool
}

TPlatform is a read only platform

type TPlatformOnPlatformHolder

type TPlatformOnPlatformHolder struct {
	// contains filtered or unexported fields
}

TPlatformOnPlatformHolder is the struct containing the Platform in order to implement TPlatform

func CreateTPlatformForPlatform

func CreateTPlatformForPlatform(o Platform) TPlatformOnPlatformHolder

CreateTPlatformForPlatform returns an holder of Platform implementing TPlatform

func (TPlatformOnPlatformHolder) Base

Base returns the base location of the platform

func (TPlatformOnPlatformHolder) HasComponents

func (r TPlatformOnPlatformHolder) HasComponents() bool

HasComponents returns true if the platform has components

func (TPlatformOnPlatformHolder) Parent

Parent returns the parent used by the platform

type TProvider

type TProvider interface {
	//Name returns the name of the provider
	Name() string
	//Parameters returns the provider parameters
	Parameters() map[string]interface{}
	//EnvVars returns the provider environment variables
	EnvVars() map[string]string
	//Proxy returns the proxy definition applied to the provider
	Proxy() TProxy
	//Component returns the provider component
	Component() (TComponent, error)
}

TProvider is a read only provider

type TProviderOnProviderHolder

type TProviderOnProviderHolder struct {
	// contains filtered or unexported fields
}

TProviderOnProviderHolder is the struct containing the Provider in order to implement TProvider

func CreateTProviderForProvider

func CreateTProviderForProvider(o Provider) TProviderOnProviderHolder

CreateTProviderForProvider returns an holder of Provider implementing TProvider

func (TProviderOnProviderHolder) Component

func (r TProviderOnProviderHolder) Component() (TComponent, error)

Component returns the provider component

func (TProviderOnProviderHolder) EnvVars

func (r TProviderOnProviderHolder) EnvVars() map[string]string

EnvVars returns the provider environment variables

func (TProviderOnProviderHolder) Name

Name returns the name of the provider

func (TProviderOnProviderHolder) Parameters

func (r TProviderOnProviderHolder) Parameters() map[string]interface{}

Parameters returns the provider parameters

func (TProviderOnProviderHolder) Proxy

Proxy returns the proxy definition applied to the provider

type TProviderRef

type TProviderRef interface {
	//Provider returns the provider wherein the node should be deployed
	Provider() (TProvider, error)
}

TProviderRef is a read only reference on a provider

type TProviderRefOnProviderRefHolder

type TProviderRefOnProviderRefHolder struct {
	// contains filtered or unexported fields
}

TProviderRefOnProviderRefHolder is the struct containing the ProviderRef in order to implement TProviderRef

func CreateTProviderRefForProviderRef

func CreateTProviderRefForProviderRef(o ProviderRef) TProviderRefOnProviderRefHolder

CreateTProviderRefForProviderRef returns an holder of ProviderRef implementing TProviderRef

func (TProviderRefOnProviderRefHolder) Provider

Provider returns the provider wherein the node should be deployed

type TProxy

type TProxy interface {
	//HTTP returns the proxy http definition
	HTTP() string
	//HTTPS returns the proxy https definition
	HTTPS() string
	//NoProxy returns the no proxy definition
	NoProxy() string
}

TProxy is a read only proxy configuration

type TProxyOnProxyHolder

type TProxyOnProxyHolder struct {
	// contains filtered or unexported fields
}

TProxyOnProxyHolder is the struct containing the Proxy in order to implement TProxy

func CreateTProxyForProxy

func CreateTProxyForProxy(o Proxy) TProxyOnProxyHolder

CreateTProxyForProxy returns an holder of Proxy implementing TProxy

func (TProxyOnProxyHolder) HTTP

func (r TProxyOnProxyHolder) HTTP() string

HTTP returns the proxy http definition

func (TProxyOnProxyHolder) HTTPS

func (r TProxyOnProxyHolder) HTTPS() string

HTTPS returns the proxy https definition

func (TProxyOnProxyHolder) NoProxy

func (r TProxyOnProxyHolder) NoProxy() string

NoProxy returns the no proxy definition

type TRepository

type TRepository interface {
	//Scm returns the type of the source control management holding the repository
	Scm() string
	//URL returns the url where the repository is located
	URL() TURL
	//Ref returns the reference (tag,branch, ...) to use within the repository
	Ref() string
	//DescriptorName returns the name of the ekara descriptor for this repository
	DescriptorName() string
}

TRepository is a read only repository

type TRepositoryOnRepositoryHolder

type TRepositoryOnRepositoryHolder struct {
	// contains filtered or unexported fields
}

TRepositoryOnRepositoryHolder is the struct containing the Repository in order to implement TRepository

func CreateTRepositoryForRepository

func CreateTRepositoryForRepository(o Repository) TRepositoryOnRepositoryHolder

CreateTRepositoryForRepository returns an holder of Repository implementing TRepository

func (TRepositoryOnRepositoryHolder) DescriptorName

func (r TRepositoryOnRepositoryHolder) DescriptorName() string

DescriptorName returns the name of the ekara descriptor for this repository

func (TRepositoryOnRepositoryHolder) Ref

Ref returns the reference (tag,branch, ...) to use within the repository

func (TRepositoryOnRepositoryHolder) Scm

Scm returns the type of the source control management holding the repository

func (TRepositoryOnRepositoryHolder) URL

URL returns the url where the repository is located

type TStack

type TStack interface {
	//Name returns the name of the stack
	Name() string
	//Parameters returns the stack parameters
	Parameters() map[string]interface{}
	//EnvVars returns the stack environment variables
	EnvVars() map[string]string
	//HasHooks returns true if the stack has hooks
	HasHooks() bool
	//Hooks returns the stack hooks
	Hooks() TStackHooks
	//HasDeployHooks returns true if the stack has hooks while deploying
	HasDeployHooks() bool
	//Dependencies returns the stack dependencies
	Dependencies() TDependencies
	//HasCopies returns true if the stacks has copies
	HasCopies() bool
	//Copies returns the stack copies
	Copies() map[string]TCopy
}

TStack is a read only stack

type TStackHooks

type TStackHooks interface {
	//HasDeploy returns true if the hooks has tasks while deploying
	HasDeploy() bool
	//Deploy returns the deploying tasks
	Deploy() THook
}

TStackHooks is a read only representation of the hooks associated to a stack

type TStackHooksOnStackHookHolder

type TStackHooksOnStackHookHolder struct {
	// contains filtered or unexported fields
}

TStackHooksOnStackHookHolder is the struct containing the StackHook in order to implement TStackHooks

func CreateTStackHooksForStackHook

func CreateTStackHooksForStackHook(o StackHook) TStackHooksOnStackHookHolder

CreateTStackHooksForStackHook returns an holder of StackHook implementing TStackHooks

func (TStackHooksOnStackHookHolder) Deploy

Deploy returns the deploying tasks

func (TStackHooksOnStackHookHolder) HasDeploy

func (r TStackHooksOnStackHookHolder) HasDeploy() bool

HasDeploy returns true if the hooks has tasks while deploying

type TStackOnStackHolder

type TStackOnStackHolder struct {
	// contains filtered or unexported fields
}

TStackOnStackHolder is the struct containing the Stack in order to implement TStack

func CreateTStackForStack

func CreateTStackForStack(o Stack) TStackOnStackHolder

CreateTStackForStack returns an holder of Stack implementing TStack

func (TStackOnStackHolder) Copies

func (r TStackOnStackHolder) Copies() map[string]TCopy

Copies returns the stack copies

func (TStackOnStackHolder) Dependencies

func (r TStackOnStackHolder) Dependencies() TDependencies

Dependencies returns the stack dependencies

func (TStackOnStackHolder) EnvVars

func (r TStackOnStackHolder) EnvVars() map[string]string

EnvVars returns the stack environment variables

func (TStackOnStackHolder) HasCopies

func (r TStackOnStackHolder) HasCopies() bool

HasCopies returns true if the stacks has copies

func (TStackOnStackHolder) HasDeployHooks

func (r TStackOnStackHolder) HasDeployHooks() bool

HasDeployHooks returns true if the stack has hooks while deploying

func (TStackOnStackHolder) HasHooks

func (r TStackOnStackHolder) HasHooks() bool

HasHooks returns true if the stack has hooks

func (TStackOnStackHolder) Hooks

func (r TStackOnStackHolder) Hooks() TStackHooks

Hooks returns the stack hooks

func (TStackOnStackHolder) Name

func (r TStackOnStackHolder) Name() string

Name returns the name of the stack

func (TStackOnStackHolder) Parameters

func (r TStackOnStackHolder) Parameters() map[string]interface{}

Parameters returns the stack parameters

type TStackRef

type TStackRef interface {
	//Stack returns the stack corresponding to the ref
	Stack() (TStack, error)
}

TStackRef is a read only reference on a stack

type TStackRefOnStackRefHolder

type TStackRefOnStackRefHolder struct {
	// contains filtered or unexported fields
}

TStackRefOnStackRefHolder is the struct containing the StackRef in order to implement TStackRef

func CreateTStackRefForStackRef

func CreateTStackRefForStackRef(o StackRef) TStackRefOnStackRefHolder

CreateTStackRefForStackRef returns an holder of StackRef implementing TStackRef

func (TStackRefOnStackRefHolder) Stack

func (r TStackRefOnStackRefHolder) Stack() (TStack, error)

Stack returns the stack corresponding to the ref

type TTask

type TTask interface {
	//Name returns the name of the task
	Name() string
	//Playbook returns the playbook linked to the task
	Playbook() string
	//Cron returns the cron linked to the task
	Cron() string
	//Parameters returns the task parameters
	Parameters() map[string]interface{}
	//EnvVars returns the task environment variables
	EnvVars() map[string]string
	//HasHooks returns true if the task has hooks
	HasHooks() bool
	//Hooks returns the task hooks
	Hooks() TTaskHooks
}

TTask is a read only task

type TTaskHooks

type TTaskHooks interface {
	//HasExecute returns true if the hooks has tasks while executing
	HasExecute() bool
	//Execute returns the executing tasks
	Execute() THook
}

TTaskHooks is a read only representation of the hooks associated to a task

type TTaskHooksOnTaskHookHolder

type TTaskHooksOnTaskHookHolder struct {
	// contains filtered or unexported fields
}

TTaskHooksOnTaskHookHolder is the struct containing the TaskHook in order to implement TTaskHooks

func CreateTTaskHooksForTaskHook

func CreateTTaskHooksForTaskHook(o TaskHook) TTaskHooksOnTaskHookHolder

CreateTTaskHooksForTaskHook returns an holder of TaskHook implementing TTaskHooks

func (TTaskHooksOnTaskHookHolder) Execute

func (r TTaskHooksOnTaskHookHolder) Execute() THook

Execute returns the executing tasks

func (TTaskHooksOnTaskHookHolder) HasExecute

func (r TTaskHooksOnTaskHookHolder) HasExecute() bool

HasExecute returns true if the hooks has tasks while executing

type TTaskOnTaskHolder

type TTaskOnTaskHolder struct {
	// contains filtered or unexported fields
}

TTaskOnTaskHolder is the struct containing the Task in order to implement TTask

func CreateTTaskForTask

func CreateTTaskForTask(o Task) TTaskOnTaskHolder

CreateTTaskForTask returns an holder of Task implementing TTask

func (TTaskOnTaskHolder) Cron

func (r TTaskOnTaskHolder) Cron() string

Cron returns the cron linked to the task

func (TTaskOnTaskHolder) EnvVars

func (r TTaskOnTaskHolder) EnvVars() map[string]string

EnvVars returns the task environment variables

func (TTaskOnTaskHolder) HasHooks

func (r TTaskOnTaskHolder) HasHooks() bool

HasHooks returns true if the task has hooks

func (TTaskOnTaskHolder) Hooks

func (r TTaskOnTaskHolder) Hooks() TTaskHooks

Hooks returns the task hooks

func (TTaskOnTaskHolder) Name

func (r TTaskOnTaskHolder) Name() string

Name returns the name of the task

func (TTaskOnTaskHolder) Parameters

func (r TTaskOnTaskHolder) Parameters() map[string]interface{}

Parameters returns the task parameters

func (TTaskOnTaskHolder) Playbook

func (r TTaskOnTaskHolder) Playbook() string

Playbook returns the playbook linked to the task

type TTaskRef

type TTaskRef interface {
	//Task returns the task corresponding to the ref
	Task() (TTask, error)
}

TTaskRef is a read only reference on a task

type TTaskRefOnTaskRefHolder

type TTaskRefOnTaskRefHolder struct {
	// contains filtered or unexported fields
}

TTaskRefOnTaskRefHolder is the struct containing the TaskRef in order to implement TTaskRef

func CreateTTaskRefForTaskRef

func CreateTTaskRefForTaskRef(o TaskRef) TTaskRefOnTaskRefHolder

CreateTTaskRefForTaskRef returns an holder of TaskRef implementing TTaskRef

func (TTaskRefOnTaskRefHolder) Task

func (r TTaskRefOnTaskRefHolder) Task() (TTask, error)

Task returns the task corresponding to the ref

type TURL

type TURL interface {
	//String returns the string representation of the whole url
	String() string
	//Scheme returns the url scheme
	Scheme() string
	//Path returns the url path
	Path() string
	//AsFilePath returns the path converted as a file path
	AsFilePath() string
	//Host returns the url host
	Host() string
}

TURL is a read only ekara url

type TURLOnEkURLHolder

type TURLOnEkURLHolder struct {
	// contains filtered or unexported fields
}

TURLOnEkURLHolder is the struct containing the EkURL in order to implement TURL

func CreateTURLForEkURL

func CreateTURLForEkURL(o EkURL) TURLOnEkURLHolder

CreateTURLForEkURL returns an holder of EkURL implementing TURL

func (TURLOnEkURLHolder) AsFilePath

func (r TURLOnEkURLHolder) AsFilePath() string

AsFilePath returns the path converted as a file path

func (TURLOnEkURLHolder) Host

func (r TURLOnEkURLHolder) Host() string

Host returns the url host

func (TURLOnEkURLHolder) Path

func (r TURLOnEkURLHolder) Path() string

Path returns the url path

func (TURLOnEkURLHolder) Scheme

func (r TURLOnEkURLHolder) Scheme() string

Scheme returns the url scheme

func (TURLOnEkURLHolder) String

func (r TURLOnEkURLHolder) String() string

String returns the string representation of the whole url

type Task

type Task struct {

	// Name of the task
	Name string
	// The playbook to execute
	Playbook string
	// The cron expression when the task must be scheduled
	Cron string
	// The task parameters
	Parameters Parameters
	// The task environment variables
	EnvVars EnvVars
	//The hooks linked to the task lifecycle events
	Hooks TaskHook
	// contains filtered or unexported fields
}

Task represent an task executable on the built environment

func (Task) Component

func (r Task) Component() (Component, error)

Component returns the referenced component

func (Task) ComponentName

func (r Task) ComponentName() string

ComponentName returns the referenced component name

func (Task) DescName

func (r Task) DescName() string

DescName returns the Describable name of the task

func (Task) DescType

func (r Task) DescType() string

DescType returns the Describable type of the task

Hardcoded to : "Task"

type TaskHook

type TaskHook struct {
	//Execute specifies the hook tasks to run when a task is executed
	Execute Hook
}

TaskHook represents hooks associated to a task

func (TaskHook) HasTasks

func (r TaskHook) HasTasks() bool

HasTasks returns true if the hook contains at least one task reference

type TaskRef

type TaskRef struct {
	HookLocation hookLocation
	// contains filtered or unexported fields
}

TaskRef represents a reference to a task

func (TaskRef) Resolve

func (r TaskRef) Resolve() (Task, error)

Resolve returns a resolved reference to a task containing all the inherited content from the referenced task

type Tasks

type Tasks map[string]*Task

Tasks represent all the tasks of an environment

type TemplateContext

type TemplateContext struct {
	// Vars represents all variable passed into the context,
	// Thoses variables are the ones commit from the CLI
	// parameters file merged with the ones coming from
	// each environment descriptor.
	Vars Parameters
	// Vars represents the Environment definition, in Read Only
	Model TEnvironment
	//Runtime represents the run time details
	RunTimeInfo *RunTimeInfo
}

TemplateContext the context passed to all ekara templates

func CreateTemplateContext

func CreateTemplateContext(params Parameters) *TemplateContext

CreateTemplateContext Returns a template context

func (*TemplateContext) MergeVars

func (cc *TemplateContext) MergeVars(others Parameters) error

MergeVars merges others parameters into the template context

type UsedReferences

type UsedReferences struct {
	// Set used to avoid duplicated entries
	Refs map[string]struct{}
}

UsedReferences represents a manager of references to components used into an environment descriptor

func CreateUsedReferences

func CreateUsedReferences() *UsedReferences

CreateUsedReferences returns an initialized manager

func (*UsedReferences) AddReference

func (ur *UsedReferences) AddReference(id string)

AddReference adds a new reference on a used component, if a reference with the same id has already been registered then it will be ignored

func (*UsedReferences) IdUsed

func (ur *UsedReferences) IdUsed(id string) bool

IdUsed returns true if a component with the provided id has been referenced as used

type ValidationError

type ValidationError struct {
	// ErrorType represents the type of the error
	ErrorType ErrorType
	// Location represents the place, within the descriptor, where the error occurred
	Location DescriptorLocation
	// Message represents a human readable message telling what need to be
	// fixed into the descriptor to get rid of this error
	Message string
}

ValidationError represents an error created during the construction of the validation or an environment

type ValidationErrors

type ValidationErrors struct {
	Errors []ValidationError
}

ValidationErrors represents a list of all error resulting of the construction or the validation of an environment

func (ValidationErrors) Error

func (ve ValidationErrors) Error() string

Error returns the message resulting of the concatenation of all included ValidationError(s)

func (ValidationErrors) HasErrors

func (ve ValidationErrors) HasErrors() bool

HasErrors returns true if the ValidationErrors contains at least one error

func (ValidationErrors) HasWarnings

func (ve ValidationErrors) HasWarnings() bool

HasWarnings returns true if the ValidationErrors contains at least one warning

func (ValidationErrors) JSonContent

func (ve ValidationErrors) JSonContent() (b []byte, e error)

JSonContent returns the serialized content of all validations errors as JSON

type VolumeContent

type VolumeContent struct {
	// The component holding the content to copy into the volume
	Component componentRef
	// The path, whithin the component, of the content to copy
	Path string
}

VolumeContent represents the detail content of a volume

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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