cmdutil

package
v0.38.2 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TSFormatLayout = "2006-01-02 15:04:05"
)

Variables

This section is empty.

Functions

func Client

func Client(cfg *config.Config) (*client.Client, error)

Create admin client

func ConfirmPrompt

func ConfirmPrompt(msg, help string, def bool) bool

func DefaultProjectName

func DefaultProjectName() string

func FetchUserID added in v0.25.0

func FetchUserID(ctx context.Context, cfg *config.Config) (string, error)

func InputPrompt

func InputPrompt(msg, def string) (string, error)

func IsNameExistsErr

func IsNameExistsErr(err error) bool

func OrgExists

func OrgExists(ctx context.Context, c *client.Client, name string) (bool, error)

func OrgNames

func OrgNames(ctx context.Context, c *client.Client) ([]string, error)

func PrintInvites

func PrintInvites(p *printer.Printer, invites []*adminv1.UserInvite) error

func PrintMembers

func PrintMembers(p *printer.Printer, members []*adminv1.Member) error

func PrintUsers added in v0.26.0

func PrintUsers(p *printer.Printer, users []*adminv1.User) error

func ProjectExists

func ProjectExists(ctx context.Context, c *client.Client, orgName, projectName string) (bool, error)

func ProjectNamesByGithubURL

func ProjectNamesByGithubURL(ctx context.Context, c *client.Client, org, githubURL string) ([]string, error)

ProjectNames returns names of all the projects in org deployed from githubURL

func ProjectNamesByOrg

func ProjectNamesByOrg(ctx context.Context, c *client.Client, orgName string) ([]string, error)

func RepoForProjectPath added in v0.36.0

func RepoForProjectPath(path string) (drivers.RepoStore, string, error)

RepoForProjectPath creates an ad-hoc drivers.RepoStore for a local project file path

func SelectPrompt

func SelectPrompt(msg string, options []string, def string) string

func SelectPromptIfEmpty

func SelectPromptIfEmpty(input *string, msg string, options []string, def string)

func SetFlagsByInputPrompts added in v0.26.0

func SetFlagsByInputPrompts(cmd cobra.Command, flags ...string) error

func Spinner

func Spinner(prefix string) *spinner.Spinner

func StringPromptIfEmpty

func StringPromptIfEmpty(input *string, msg string)

Types

type Helper added in v0.38.0

type Helper struct {
	Config  *config.Config
	Printer *printer.Printer
}

type PreRunCheck

type PreRunCheck func(cmd *cobra.Command, args []string) error

func CheckAuth

func CheckAuth(cfg *config.Config) PreRunCheck

func CheckChain

func CheckChain(chain ...PreRunCheck) PreRunCheck

func CheckOrganization

func CheckOrganization(cfg *config.Config) PreRunCheck

Jump to

Keyboard shortcuts

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