whoami

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:      "whoami",
	ShortHelp: "Retrieve your user ID",
	LongHelp: "`whoami` prints out the currently logged in user's users ID. " +
		"This is used with Catalyze support engineers. Here is a sample command\n\n" +
		"```\ncatalyze whoami\n```",
	CmdFunc: func(settings *models.Settings) func(cmd *cli.Cmd) {
		return func(cmd *cli.Cmd) {
			cmd.Action = func() {
				if _, err := auth.New(settings, prompts.New()).Signin(); err != nil {
					logrus.Fatal(err.Error())
				}
				err := CmdWhoAmI(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 CmdWhoAmI

func CmdWhoAmI(w IWhoAmI) error

Types

type IWhoAmI

type IWhoAmI interface {
	WhoAmI() (string, error)
}

IWhoAmI

func New

func New(settings *models.Settings) IWhoAmI

New returns an instance of IWhoAmI

type SWhoAmI

type SWhoAmI struct {
	Settings *models.Settings
}

SWhoAmI is a concrete implementation of IWhoAmI

func (*SWhoAmI) WhoAmI

func (w *SWhoAmI) WhoAmI() (string, error)

WhoAmI prints out your user ID. This can be used for adding users to environments via `catalyze adduser`, removing users from an environment via `catalyze rmuser`, when contacting Catalyze Support, etc.

Jump to

Keyboard shortcuts

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