commander

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2020 License: Apache-2.0 Imports: 0 Imported by: 0

README

k8s-commander

A golang library to create Kubernetes recipes following the command design pattern.

Recipe Example

You can find an example of a k8s recipe here

make run-example

Check here how to run recipe with the k8s commander. Example:

	cm := commander.New()

	// create a recipe with a set of commands
	opts := recipeOpts{
		Name:           "es",
		Namespace:      "default",
		ContainerImage: "elastic/elasticsearch",
		ContainerPort:  9200,
		ContainerTag:   "7.8.1",
	}
	recipe := NewElasticsearchDeployment(opts, clientset, logger)

	// Execute the recipe
	err = cm.Execute(recipe)
	if err != nil {
		logger.WithError(err).Error()
		os.Exit(-1)
	}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command interface {
	Execute() error
}

Command describes a command

type Commander

type Commander struct{}

Commander is a recipe executor

func New

func New() *Commander

New factory method

func (*Commander) Execute

func (*Commander) Execute(r Recipe) error

Execute will execute the set of commands of a recipe

type Executor

type Executor interface {
	Execute(r Recipe) error
}

Executor executes recipes

type Recipe

type Recipe interface {
	Build() []Command
}

Recipe will create the commands for the recipe execution

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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