cmdutil

package
v0.36.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: Apache-2.0 Imports: 23 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(invites []*adminv1.UserInvite)

func PrintMembers

func PrintMembers(members []*adminv1.Member)

func PrintUsers added in v0.26.0

func PrintUsers(users []*adminv1.User)

func PrintlnSuccess added in v0.27.3

func PrintlnSuccess(str string)

func PrintlnWarn added in v0.27.3

func PrintlnWarn(str string)

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)

func TablePrinter

func TablePrinter(v interface{})

Types

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