Documentation ¶
Overview ¶
Package cmd contains all of the Torus cli commands
Index ¶
- Constants
- Variables
- func AskPerform(label, indent string) error
- func ConfirmDialogue(ctx *cli.Context, labelOverride, warningOverride *string, defaultValue string, ...) error
- func EmailPrompt(defaultValue string) (string, error)
- func FullNamePrompt(name string) (string, error)
- func InviteCodePrompt(defaultValue string) (string, error)
- func NamePrompt(override *string, defaultValue string, autoAccept bool) (string, error)
- func NewAPIClient(ctx *context.Context, client *api.Client) (context.Context, *api.Client, error)
- func PasswordPrompt(shouldConfirm bool, labelOverride *string) (string, error)
- func SelectAcceptAction() (int, string, error)
- func SelectCreateOrg(c context.Context, client *api.Client, name string) (*envelope.Org, string, bool, error)
- func SelectCreateProject(c context.Context, client *api.Client, orgID *identity.ID, name string) (*envelope.Project, string, bool, error)
- func SelectCreateRole(c context.Context, client *api.Client, orgID *identity.ID, name string) (*envelope.Team, string, bool, error)
- func SelectOrgPrompt(orgs []envelope.Org) (int, string, error)
- func SelectProfileAction() (int, string, error)
- func SelectProjectPrompt(projects []envelope.Project) (int, string, error)
- func SelectTeamPrompt(teams []envelope.Team, label, addLabel string) (int, string, error)
- func UsernamePrompt(un string) (string, error)
- func VerificationPrompt() (string, error)
- func VersionLookup(ctx *cli.Context) error
- type PolicyPredicate
Constants ¶
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" )
const PasswordMask = '●'
PasswordMask is the character used to mask password inputs
Variables ¶
var Cmds []cli.Command
Cmds is the list of all cli commands
Functions ¶
func AskPerform ¶ added in v0.17.0
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 ¶
EmailPrompt prompts the user to input an email
func FullNamePrompt ¶
FullNamePrompt prompts the user to input a person's name
func InviteCodePrompt ¶
InviteCodePrompt prompts the user to input an invite code
func NamePrompt ¶
NamePrompt prompts the user to input a person's name
func NewAPIClient ¶ added in v0.13.0
NewAPIClient loads config and creates a new api client
func PasswordPrompt ¶
PasswordPrompt prompts the user to input a password value
func SelectAcceptAction ¶
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 ¶
SelectOrgPrompt prompts the user to select an org from a list, or enter a new name
func SelectProfileAction ¶ added in v0.17.0
SelectProfileAction prompts the user to select an option from a list
func SelectProjectPrompt ¶
SelectProjectPrompt prompts the user to select an org from a list, or enter a new name
func SelectTeamPrompt ¶ added in v0.15.0
SelectTeamPrompt prompts the user to select a team from a list or enter a new name, an optional label can be provided.
func UsernamePrompt ¶
UsernamePrompt prompts the user to input a person's name
func VerificationPrompt ¶ added in v0.13.0
VerificationPrompt prompts the user to input an email verify code
func VersionLookup ¶
VersionLookup ensures the environment is ready and then executes version cmd
Types ¶
type PolicyPredicate ¶ added in v0.25.0
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
Source Files ¶
- allow.go
- cmd.go
- credential_set.go
- daemon.go
- debug.go
- deny.go
- envs.go
- flags.go
- gatekeeper.go
- import.go
- invites.go
- invites_accept.go
- invites_approve.go
- invites_list.go
- invites_send.go
- keypairs.go
- link.go
- login.go
- logout.go
- ls.go
- machines.go
- middleware.go
- orgs.go
- policies.go
- prefs.go
- profile.go
- projects.go
- prompts.go
- run.go
- services.go
- set.go
- signup.go
- spawn_daemon.go
- status.go
- teams.go
- unlink.go
- unset.go
- verify.go
- version.go
- view.go
- worklog.go