Documentation ¶
Index ¶
- Variables
- func ListFeatures(suitableFor string) ([]interface{}, error)
- func UploadFile(localpath string, host *pb.Host, remotepath, owner, group, rights string) (err error)
- func UploadStringToRemoteFile(content string, host *pb.Host, filename string, owner, group, rights string) error
- type ClusterTarget
- type Feature
- func (f *Feature) Add(t Target, v Variables, s Settings) (_ Results, err error)
- func (f *Feature) Applyable(t Target) bool
- func (f *Feature) Check(t Target, v Variables, s Settings) (_ Results, err error)
- func (f *Feature) DisplayFilename() string
- func (f *Feature) DisplayName() string
- func (f *Feature) Filename() string
- func (f *Feature) Remove(t Target, v Variables, s Settings) (_ Results, err error)
- func (f *Feature) Specs() *viper.Viper
- type HostTarget
- type Installer
- type KongController
- type NodeTarget
- type Results
- func (r Results) AllErrorMessages() string
- func (r Results) ErrorMessagesOfHost(name string) string
- func (r Results) ErrorMessagesOfStep(name string) string
- func (r Results) Keys() []string
- func (r Results) ResultsOfStep(name string) StepResults
- func (r Results) Successful() bool
- func (r Results) Transpose() Results
- type Settings
- type StepResults
- type Target
- type Variables
Constants ¶
This section is empty.
Variables ¶
var ( // EmptyValues corresponds to no values for the feature EmptyValues = map[string]interface{}{} )
Functions ¶
func ListFeatures ¶
ListFeatures lists all features suitable for hosts or clusters
Types ¶
type ClusterTarget ¶
type ClusterTarget struct {
// contains filtered or unexported fields
}
ClusterTarget defines a target of type Host, satisfying TargetAPI
func (*ClusterTarget) Installed ¶
func (t *ClusterTarget) Installed() []string
Installed returns a list of installed feature
func (*ClusterTarget) Methods ¶
func (t *ClusterTarget) Methods() map[uint8]Method.Enum
Methods returns a list of packaging managers usable on the target
func (*ClusterTarget) Name ¶
func (t *ClusterTarget) Name() string
Name returns the name of the cluster
func (*ClusterTarget) Type ¶
func (t *ClusterTarget) Type() string
Type returns the type of the Target
type Feature ¶
type Feature struct {
// contains filtered or unexported fields
}
Feature contains the information about an installable feature
func NewEmbeddedFeature ¶
func NewEmbeddedFeature(task concurrency.Task, name string) (_ *Feature, err error)
NewEmbeddedFeature searches for an embedded featured named 'name' and initializes a new Feature object with its content
func NewFeature ¶
func NewFeature(task concurrency.Task, name string) (_ *Feature, err error)
NewFeature searches for a spec file name 'name' and initializes a new Feature object with its content
func (*Feature) Add ¶
Add installs the feature on the target Installs succeeds if error == nil and Results.Successful() is true
func (*Feature) Check ¶
Check if feature is installed on target Check is ok if error is nil and Results.Successful() is true
func (*Feature) DisplayFilename ¶
DisplayFilename returns the full file name, with [embedded] added at the end if the feature is embedded.
func (*Feature) DisplayName ¶
DisplayName returns the name of the feature
type HostTarget ¶
type HostTarget struct {
// contains filtered or unexported fields
}
HostTarget defines a target of type Host, satisfying TargetAPI
func (*HostTarget) Installed ¶
func (t *HostTarget) Installed() []string
Installed returns a list of installed features
type Installer ¶
type Installer interface { // Check checks if the feature is installed Check(*Feature, Target, Variables, Settings) (Results, error) // Add executes installation of feature Add(*Feature, Target, Variables, Settings) (Results, error) // Remove executes deletion of feature Remove(*Feature, Target, Variables, Settings) (Results, error) }
Installer defines the API of an Installer
func NewAptInstaller ¶
func NewAptInstaller() Installer
NewAptInstaller creates a new instance of Installer using script
func NewBashInstaller ¶
func NewBashInstaller() Installer
NewBashInstaller creates a new instance of Installer using script
func NewDcosInstaller ¶
func NewDcosInstaller() Installer
NewDcosInstaller creates a new instance of Installer using DCOS
func NewDnfInstaller ¶
func NewDnfInstaller() Installer
NewDnfInstaller creates a new instance of Installer using script
func NewYumInstaller ¶
func NewYumInstaller() Installer
NewYumInstaller creates a new instance of Installer using script
type KongController ¶
type KongController struct {
// contains filtered or unexported fields
}
KongController allows to control Kong, installed on a host
func NewKongController ¶
func NewKongController(svc iaas.Service, network *resources.Network, addressPrimaryGateway bool) (*KongController, error)
NewKongController ... func NewKongController(host *pb.Host) (*KongController, error) {
type NodeTarget ¶
type NodeTarget struct {
*HostTarget
}
NodeTarget defines a target of type Node of cluster, including a master
type Results ¶
type Results map[string]StepResults
Results ...
func (Results) ErrorMessagesOfHost ¶
ErrorMessagesOfHost ...
func (Results) ErrorMessagesOfStep ¶
ErrorMessagesOfStep ...
func (Results) ResultsOfStep ¶
func (r Results) ResultsOfStep(name string) StepResults
ResultsOfStep ...
type Settings ¶
type Settings struct { // SkipProxy to tell not to try to set reverse proxy SkipProxy bool // Serialize force not to parallel hosts in step Serialize bool // SkipFeatureRequirements tells not to install required features SkipFeatureRequirements bool // SkipSizingRequirements tells not to check sizing requirements SkipSizingRequirements bool // AddUnconditionally tells to not check before addition (no effect for check or removal) AddUnconditionally bool }
Settings are used to tune the feature
type StepResults ¶
type StepResults map[string]stepResult
StepResults contains the errors of the step for each host target
func (StepResults) Completed ¶
func (s StepResults) Completed() bool
Completed tells if all the scripts corresponding to action have been completed.
func (StepResults) ErrorMessages ¶
func (s StepResults) ErrorMessages() string
ErrorMessages returns a string containing all the errors registered
func (StepResults) Successful ¶
func (s StepResults) Successful() bool
Successful tells if all the steps have been successful
func (StepResults) UncompletedEntries ¶
func (s StepResults) UncompletedEntries() []string
UncompletedEntries returns an array of string of all keys where the script to run action wasn't completed
type Target ¶
type Target interface { // Name returns the name of the target Name() string // Type returns the name of the target Type() string // Methods returns a list of installation methods usable on the target, ordered from // upper to lower priority (1 = highest priority) Methods() map[uint8]Method.Enum // Installed returns a list of installed features Installed() []string }
Target is an interface that target must satisfy to be able to install something on it
func NewClusterTarget ¶
func NewClusterTarget(task concurrency.Task, cluster clusterapi.Cluster) (Target, error)
NewClusterTarget ...