cluster

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2018 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Local = "local"
	AWS   = "aws"
)

Supported plugin providers used by the factory function `NewPlugin`

Variables

This section is empty.

Functions

func NewClusterCommand

func NewClusterCommand(c cli.Interface) *cobra.Command

NewClusterCommand returns a new instance of the cluster command.

func NewCreateCommand

func NewCreateCommand(c cli.Interface) *cobra.Command

NewCreateCommand returns a new instance of the create command for bootstrapping an cluster.

func NewListCommand

func NewListCommand(c cli.Interface) *cobra.Command

NewListCommand returns a new instance of the list command for amp clusters.

func NewNodeCleanupCommand added in v0.18.0

func NewNodeCleanupCommand(c cli.Interface) *cobra.Command

NewNodeCleanupCommand returns a new instance of the cleanup command for amp clusters.

func NewNodeCommand added in v0.9.1

func NewNodeCommand(c cli.Interface) *cobra.Command

NewNodeCommand returns a new instance of the cluster node command.

func NewNodeInspectCommand added in v0.17.0

func NewNodeInspectCommand(c cli.Interface) *cobra.Command

NewNodeInspectCommand returns a new instance of the node inspect command for amp clusters.

func NewNodeListCommand added in v0.9.1

func NewNodeListCommand(c cli.Interface) *cobra.Command

NewNodeListCommand returns a new instance of the list command for amp clusters.

func NewRemoveCommand

func NewRemoveCommand(c cli.Interface) *cobra.Command

NewRemoveCommand returns a new instance of the remove command for destroying a cluster.

func NewStatusCommand

func NewStatusCommand(c cli.Interface) *cobra.Command

NewStatusCommand returns a new instance of the status command for querying the state of amp cluster.

func NewUpdateCommand

func NewUpdateCommand(c cli.Interface) *cobra.Command

NewUpdateCommand returns a new instance of the update command for updating an cluster.

func RunContainer added in v0.12.0

func RunContainer(c cli.Interface, img string, dockerOpts docker, args []string, env map[string]string, f func(r io.Reader, c chan bool)) error

RunContainer starts a container using the specified image for the cluster plugin. Cluster plugin commands are `init`, `update`, and `destroy` (provided as the single `args` value). Additional arguments are supplied as environment variables in `env`, not `args`. If f is not nil, then your func will be called (as a goroutine) with stdout from the container process; otherwise stdout from the container will be printed to the amp console stdout.

Types

type ByRole added in v0.17.0

type ByRole []*cluster.NodeReply

ByRole implements sort.Interface for []NodeReply based on the Role field.

func (ByRole) Len added in v0.17.0

func (a ByRole) Len() int

func (ByRole) Less added in v0.17.0

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

func (ByRole) Swap added in v0.17.0

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

type Plugin added in v0.12.0

type Plugin interface {
	// Provider returns the name of the provider, such as "local" or "aws"
	Provider() string

	// Run executes the plugin with the specified arguments and environment variables
	Run(c cli.Interface, args []string, env map[string]string) error
}

Plugin declares the methods that all plugin providers, such as local and aws, must implement

func NewPlugin added in v0.12.0

func NewPlugin(config PluginConfig) (Plugin, error)

NewPlugin is a simple factory function to return a new instance of a specific cluster plugin based on the supplied config (config.Provider must be set to a valid provider or this function will return an error).

type PluginConfig added in v0.12.0

type PluginConfig struct {
	// Provider is the name of the cluster provider, such as "local" or "aws"
	Provider   string
	Options    map[string]string
	DockerOpts docker
}

PluginConfig is used by the factory function `NewClusterPlugin` to create a new plugin instance.

Jump to

Keyboard shortcuts

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