addon

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddOn

type AddOn interface {
	// GetMetaData returns the meta data of this addon.
	MetaData() AddOnMeta

	// Commands returns a Command slice of the commands this addon consists of.
	Commands() []command.Command

	// InstallPath returns the path under which the addon is installed.
	InstallPath() string

	// IsEnabled returns true, if this addon is currently enabled and getting applied as part of OpenShift
	// provisioning. Returns false, is this addon is not enabled.
	IsEnabled() bool

	// SetEnabled sets this addon as en- or disabled.
	SetEnabled(enabled bool)

	// GetPriority returns the priority of this add on in terms of the order in which it gets applied
	GetPriority() int

	// SetPriority sets the priority of this addon in terms of its installation order. Addons with lower priority
	// gets installed first
	SetPriority(priority int)
}

AddOn is the internal representation of an AddOn including the addon metadata and the actual commands the Addon consists off.

func NewAddOn

func NewAddOn(meta AddOnMeta, commands []command.Command, path string) AddOn

type AddOnConfig

type AddOnConfig struct {
	Name     string
	Enabled  bool
	Priority float64
}

type AddOnMeta

type AddOnMeta interface {
	Name() string
	Description() string
	GetValue(key string) string
}

AddOnMeta defines a set of meta data for a AddOn. Name and Description are required. Others are optional.

func NewAddOnMeta

func NewAddOnMeta(headers map[string]string) (AddOnMeta, error)

type ByPriority

type ByPriority []AddOn

ByPriority implements sort.Interface for []AddOn based on the Priority field.

func (ByPriority) Len

func (a ByPriority) Len() int

func (ByPriority) Less

func (a ByPriority) Less(i, j int) bool

func (ByPriority) Swap

func (a ByPriority) Swap(i, j int)

type ByStatusThenName

type ByStatusThenName []AddOn

ByStatusThenName implements sort.Interface for []AddOn based primarily on the addon enable state and secondarily on the addon name.

func (ByStatusThenName) Len

func (a ByStatusThenName) Len() int

func (ByStatusThenName) Less

func (a ByStatusThenName) Less(i, j int) bool

func (ByStatusThenName) Swap

func (a ByStatusThenName) Swap(i, j int)

type ByStatusThenPriorityThenName

type ByStatusThenPriorityThenName []AddOn

ByStatusThenPriority implements sort.Interface for []AddOn based primarily on the addon enable state and secondarily on the addon priority. Lastly the name is considered

func (ByStatusThenPriorityThenName) Len

func (ByStatusThenPriorityThenName) Less

func (a ByStatusThenPriorityThenName) Less(i, j int) bool

func (ByStatusThenPriorityThenName) Swap

func (a ByStatusThenPriorityThenName) Swap(i, j int)

type DefaultAddOn

type DefaultAddOn struct {
	AddOn
	// contains filtered or unexported fields
}

DefaultAddOn provides the default implementation of the AddOn interface

func (*DefaultAddOn) Commands

func (a *DefaultAddOn) Commands() []command.Command

func (*DefaultAddOn) GetPriority

func (a *DefaultAddOn) GetPriority() int

func (*DefaultAddOn) InstallPath

func (a *DefaultAddOn) InstallPath() string

func (*DefaultAddOn) IsEnabled

func (a *DefaultAddOn) IsEnabled() bool

func (*DefaultAddOn) MetaData

func (a *DefaultAddOn) MetaData() AddOnMeta

func (*DefaultAddOn) SetEnabled

func (a *DefaultAddOn) SetEnabled(enabled bool)

func (*DefaultAddOn) SetPriority

func (a *DefaultAddOn) SetPriority(priority int)

func (*DefaultAddOn) String

func (meta *DefaultAddOn) String() string

type DefaultAddOnMeta

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

func (*DefaultAddOnMeta) Description

func (meta *DefaultAddOnMeta) Description() string

func (*DefaultAddOnMeta) GetValue

func (meta *DefaultAddOnMeta) GetValue(key string) string

func (*DefaultAddOnMeta) Name

func (meta *DefaultAddOnMeta) Name() string

func (*DefaultAddOnMeta) String

func (meta *DefaultAddOnMeta) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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