logout

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = models.Command{
	Name:      "logout",
	ShortHelp: "Clear the stored user information from your local machine",
	LongHelp: "When using the CLI, your username and password are **never** stored in any file on your filesystem. " +
		"However, in order to not type in your username and password each and every command, a session token is stored in the CLI's configuration file and used until it expires. " +
		"`logout` removes this session token from the configuration file. Here is a sample command\n\n" +
		"```\ncatalyze logout\n```",
	CmdFunc: func(settings *models.Settings) func(cmd *cli.Cmd) {
		return func(cmd *cli.Cmd) {
			cmd.Action = func() {
				err := CmdLogout(New(settings), auth.New(settings, prompts.New()))
				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 CmdLogout

func CmdLogout(il ILogout, ia auth.IAuth) error

Types

type ILogout

type ILogout interface {
	Clear() error
}

ILogout

func New

func New(settings *models.Settings) ILogout

New returns an instance of ILogout

type SLogout

type SLogout struct {
	Settings *models.Settings
}

SLogout is a concrete implementation of ILogout

func (*SLogout) Clear

func (l *SLogout) Clear() error

Clear clears the stored user information from the local machine. This does not remove environment data.

Jump to

Keyboard shortcuts

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