cluster

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2017 License: Apache-2.0 Imports: 21 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 NewNodeCommand added in v0.9.1

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

NewNodeCommand returns a new instance of the cluster node command.

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 Run

func Run(c cli.Interface, args []string, env map[string]string) error

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)) 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 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