Documentation ¶
Index ¶
- Constants
- func NewClusterCommand(c cli.Interface) *cobra.Command
- func NewCreateCommand(c cli.Interface) *cobra.Command
- func NewListCommand(c cli.Interface) *cobra.Command
- func NewNodeCommand(c cli.Interface) *cobra.Command
- func NewNodeListCommand(c cli.Interface) *cobra.Command
- func NewRemoveCommand(c cli.Interface) *cobra.Command
- func NewStatusCommand(c cli.Interface) *cobra.Command
- func NewUpdateCommand(c cli.Interface) *cobra.Command
- func Run(c cli.Interface, args []string, env map[string]string) error
- func RunContainer(c cli.Interface, img string, dockerOpts docker, args []string, ...) error
- type Plugin
- type PluginConfig
Constants ¶
const ( Local = "local" AWS = "aws" )
Supported plugin providers used by the factory function `NewPlugin`
Variables ¶
This section is empty.
Functions ¶
func NewClusterCommand ¶
NewClusterCommand returns a new instance of the cluster command.
func NewCreateCommand ¶
NewCreateCommand returns a new instance of the create command for bootstrapping an cluster.
func NewListCommand ¶
NewListCommand returns a new instance of the list command for amp clusters.
func NewNodeCommand ¶ added in v0.9.1
NewNodeCommand returns a new instance of the cluster node command.
func NewNodeListCommand ¶ added in v0.9.1
NewNodeListCommand returns a new instance of the list command for amp clusters.
func NewRemoveCommand ¶
NewRemoveCommand returns a new instance of the remove command for destroying a cluster.
func NewStatusCommand ¶
NewStatusCommand returns a new instance of the status command for querying the state of amp cluster.
func NewUpdateCommand ¶
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)) 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.