cmd

package
v0.26.1-rc Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2017 License: BSD-3-Clause Imports: 51 Imported by: 8

Documentation

Overview

Package cmd contains all of the Torus cli commands

Index

Constants

View Source
const (

	// GlobalRoot is the global root of the Torus config
	GlobalRoot = "/etc/torus"

	// EnvironmentFile is the environment file that stores machine information
	EnvironmentFile = "token.environment"
)
View Source
const PasswordMask = '●'

PasswordMask is the character used to mask password inputs

Variables

View Source
var Cmds []cli.Command

Cmds is the list of all cli commands

Functions

func AskPerform added in v0.17.0

func AskPerform(label, indent string) error

AskPerform prompts the user if they want to do a specified action

func ConfirmDialogue added in v0.15.0

func ConfirmDialogue(ctx *cli.Context, labelOverride, warningOverride *string, defaultValue string, allowSkip bool) error

ConfirmDialogue prompts the user to confirm their action

func EmailPrompt

func EmailPrompt(defaultValue string) (string, error)

EmailPrompt prompts the user to input an email

func FullNamePrompt

func FullNamePrompt(name string) (string, error)

FullNamePrompt prompts the user to input a person's name

func InviteCodePrompt

func InviteCodePrompt(defaultValue string) (string, error)

InviteCodePrompt prompts the user to input an invite code

func NamePrompt

func NamePrompt(override *string, defaultValue string, autoAccept bool) (string, error)

NamePrompt prompts the user to input a person's name

func NewAPIClient added in v0.13.0

func NewAPIClient(ctx *context.Context, client *api.Client) (context.Context, *api.Client, error)

NewAPIClient loads config and creates a new api client

func PasswordPrompt

func PasswordPrompt(shouldConfirm bool, labelOverride *string) (string, error)

PasswordPrompt prompts the user to input a password value

func SelectAcceptAction

func SelectAcceptAction() (int, string, error)

SelectAcceptAction prompts the user to select an org from a list, or enter a new name

func SelectCreateOrg

func SelectCreateOrg(c context.Context, client *api.Client, name string) (*envelope.Org, string, bool, error)

SelectCreateOrg prompts the user to select an org from at list of orgs populated via api request.

The user may select to create a new org, or they may preselect an org via a non-empty name parameter.

It returns the object of the selected org (if created a new org was not chosed), the name of the selected org, and a boolean indicating if a new org should be created.

func SelectCreateProject

func SelectCreateProject(c context.Context, client *api.Client, orgID *identity.ID, name string) (*envelope.Project, string, bool, error)

SelectCreateProject prompts the user to select a project from at list of projects populated via api request.

The user may select to create a new project, or they may preselect an project via a non-empty name parameter.

It returns the object of the selected project (if created a new project was not chosed), the name of the selected project, and a boolean indicating if a new project should be created.

func SelectCreateRole added in v0.16.0

func SelectCreateRole(c context.Context, client *api.Client, orgID *identity.ID, name string) (*envelope.Team, string, bool, error)

SelectCreateRole prompts the user to select a machine team from a list of teams for the given org.

The user may select to create a new team, or they may may preselect a team via a non-empty name parameter.

It returns the object of the selected team, the name of the selected team, and a boolean indicating if a new team should be created.

func SelectOrgPrompt

func SelectOrgPrompt(orgs []envelope.Org) (int, string, error)

SelectOrgPrompt prompts the user to select an org from a list, or enter a new name

func SelectProfileAction added in v0.17.0

func SelectProfileAction() (int, string, error)

SelectProfileAction prompts the user to select an option from a list

func SelectProjectPrompt

func SelectProjectPrompt(projects []envelope.Project) (int, string, error)

SelectProjectPrompt prompts the user to select an org from a list, or enter a new name

func SelectTeamPrompt added in v0.15.0

func SelectTeamPrompt(teams []envelope.Team, label, addLabel string) (int, string, error)

SelectTeamPrompt prompts the user to select a team from a list or enter a new name, an optional label can be provided.

func UsernamePrompt

func UsernamePrompt(un string) (string, error)

UsernamePrompt prompts the user to input a person's name

func VerificationPrompt added in v0.13.0

func VerificationPrompt() (string, error)

VerificationPrompt prompts the user to input an email verify code

func VersionLookup

func VersionLookup(ctx *cli.Context) error

VersionLookup ensures the environment is ready and then executes version cmd

Types

type PolicyPredicate added in v0.25.0

type PolicyPredicate func(envelope.Policy) bool

PolicyPredicate is a signature for a function that tests if a Policy satisfies some condition

func AllPredicate added in v0.25.0

func AllPredicate(predicates ...PolicyPredicate) PolicyPredicate

AllPredicate is a compound Predicate that tests if a policy satisfies all predicates

Jump to

Keyboard shortcuts

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