Documentation
¶
Overview ¶
Package utils provides utility functions and helpers for batch-tool.
Index ¶
- Variables
- func BindBoolFlags(cmd *cobra.Command, key, yesName, noName string) error
- func BuildBoolFlags(cmd *cobra.Command, yesName, yesShort, noName, noShort, description string)
- func CheckMutuallyExclusiveFlags(cmd *cobra.Command, flags ...string) error
- func CleanFilter(ctx context.Context, input string) string
- func ExecEnv(ctx context.Context, repo string) []string
- func LookupBranch(ctx context.Context, name string) (string, error)
- func ParseRepo(ctx context.Context, repo string) (host, project, name string)
- func RepoPath(ctx context.Context, repo string) string
- func RepoURL(ctx context.Context, repo string) string
- func ValidateEnumConfig(cmd *cobra.Command, key string, validChoices []string) error
- func ValidateRequiredConfig(ctx context.Context, opts ...string) error
Constants ¶
This section is empty.
Variables ¶
var CatalogLookup = defaultCatalogLookup
CatalogLookup is a function type for looking up project from catalog
Functions ¶
func BindBoolFlags ¶ added in v0.9.6
BindBoolFlags binds a pair of mutually exclusive boolean flags to the current viper context.
func BuildBoolFlags ¶ added in v0.9.6
BuildBoolFlags adds a pair of mutually exclusive boolean flags to the given command. The "yes" flag enables the feature (default true), and the "no" flag disables it.
func CheckMutuallyExclusiveFlags ¶ added in v0.9.6
CheckMutuallyExclusiveFlags validates that at most one flag from each set of mutually exclusive flags is set. Each argument is a slice of flag names that are mutually exclusive with each other. Returns an error if more than one flag in any set is explicitly set.
func CleanFilter ¶ added in v0.9.6
CleanFilter standardizes the formatting of an imput argument by removing all configured signal tokens
func LookupBranch ¶
LookupBranch returns the target branch for the given repository
func ValidateEnumConfig ¶ added in v0.9.6
ValidateEnumConfig validates that a config value is one of the allowed choices.
Types ¶
This section is empty.