update

package
v2.0.0-snapshot...-58e3a78 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = models.Command{
	Name:      "update",
	ShortHelp: "Checks for available updates and updates the CLI if a new update is available",
	LongHelp: "`update` is a shortcut to update your CLI instantly. " +
		"If a newer version of the CLI is available, it will be downloaded and installed automatically. " +
		"This is used when you want to apply an update before the CLI automatically applies it on its own. " +
		"Here is a sample command\n\n" +
		"```\ncatalyze update\n```",
	CmdFunc: func(settings *models.Settings) func(cmd *cli.Cmd) {
		return func(cmd *cli.Cmd) {
			cmd.Action = func() {
				err := CmdUpdate(New(settings))
				if err != nil {
					logrus.Fatal(err.Error())
				}
			}
		}
	},
}

Cmd is the contract between the user and the CLI. This specifies the command name, arguments, and required/optional arguments and flags for the command.

Functions

func CmdUpdate

func CmdUpdate(iu IUpdate) error

Types

type IUpdate

type IUpdate interface {
	Check() (bool, error)
	Update() error
	UpdatePods()
}

IUpdate

func New

func New(settings *models.Settings) IUpdate

New returns an instance of IUpdate

type SUpdate

type SUpdate struct {
	Settings *models.Settings
}

SUpdate is a concrete implementation of IUpdate

func (*SUpdate) Check

func (u *SUpdate) Check() (bool, error)

func (*SUpdate) Update

func (u *SUpdate) Update() error

Update updates the CLI if a new update is available.

func (*SUpdate) UpdatePods

func (u *SUpdate) UpdatePods()

UpdatePods retrieves the latest list of pods and refreshes the local cache. If an error occurs, the local cache is unchanged.

Jump to

Keyboard shortcuts

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