dep

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// See: https://kubernetes.io/docs/reference/kubectl.
	DependencyKubectl = Dependency{
		Name:    "kubectl",
		Version: "1.16.2",
		URL: "https://storage.googleapis.com/kubernetes-release/" +
			"release/v{{.version}}/bin/{{.os}}/{{.arch}}/kubectl{{.extension}}",
	}

	// See: https://github.com/kubernetes/kops.
	DependencyKops = Dependency{
		Name:    "kops",
		Version: "1.15.0-beta.1-20f7d4c8c",
		URL: "https://spotinst-public.s3.amazonaws.com/integrations/kubernetes/kops/" +
			"v{{.version}}/{{.os}}/{{.arch}}/kops",
	}
)
View Source
var ErrNotImplemented = errors.New("deps: not implemented")

ErrNotImplemented is the error returned if a method is not implemented.

Functions

func DefaultBinaryDir

func DefaultBinaryDir() string

DefaultBinaryDir returns default binary directory path.

Builds the binary directory path based on the OS's platform.

  • Linux/Unix: $HOME/.spotinst/bin
  • Windows: %USERPROFILE%\.spotinst\bin

Types

type Dependency

type Dependency struct {
	Name    string
	Version string
	URL     string
}

Dependency represents an executable package.

func DefaultDependencyListKubernetes

func DefaultDependencyListKubernetes() []Dependency

DefaultDependencyListKubernetes returns default list of required dependencies to work with Kubernetes.

type InstallOption

type InstallOption func(*InstallOptions)

InstallOption allows specifying various settings configurable by the dependency manager for overriding the defaults used when calling the `Install` method.

func WithBinaryDir

func WithBinaryDir(path string) InstallOption

WithBinaryDir sets the binary directory.

func WithDryRun

func WithDryRun(value bool) InstallOption

WithDryRun toggles the dry-run mode on/off.

func WithNoninteractive

func WithNoninteractive(value bool) InstallOption

WithNoninteractive toggles the noninteractive mode on/off.

type InstallOptions

type InstallOptions struct {
	// BinaryDir specifies the binary directory that the manager should download
	// and install the binary to.
	BinaryDir string

	// Noninteractive disables the interactive mode user interface by quieting the
	// configuration prompts.
	Noninteractive bool

	// DryRun configures the dependency manager to print the actions that would
	// be executed, without executing them.
	DryRun bool
}

type Interface

type Interface interface {
	// Install installs a new dependency.
	Install(ctx context.Context, dep Dependency, options ...InstallOption) error

	// InstallBulk installs a bulk of new dependencies.
	InstallBulk(ctx context.Context, deps []Dependency, options ...InstallOption) error
}

Interface defines the interface of a Dependency Manager.

func New

func New(survey survey.Interface) Interface

Jump to

Keyboard shortcuts

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