Documentation ¶
Index ¶
- func GetAPIRequestParametersFromFlags(cmd *cobra.Command, opts ...APIRequestParametersFromFlagsOption) (connection.APIRequestParameters, error)
- func GetBoolPtrFlagIfChanged(cmd *cobra.Command, name string) *bool
- func GetContentsFromFilePathFlag(cmd *cobra.Command, fs afero.Fs, filePathFlag string) (string, error)
- func GetContentsFromLiteralOrFilePathFlag(cmd *cobra.Command, fs afero.Fs, literalFlag, filePathFlag string) (string, error)
- func GetDestinationFilePath(fs afero.Fs, source string, destination string) (string, error)
- func GetFilteringArrayFromStringArrayFlagValue(filters []string) ([]connection.APIRequestFiltering, error)
- func GetFilteringFromStringFlagValue(filter string) (connection.APIRequestFiltering, error)
- func GetFilteringInferOperator(property string, value string) connection.APIRequestFiltering
- func GetIntPtrFlagIfChanged(cmd *cobra.Command, name string) *int
- func GetSortingFromStringFlagValue(sort string) connection.APIRequestSorting
- func GetStringPtrFlagIfChanged(cmd *cobra.Command, name string) *string
- func InferTypeFromStringFlagValue(flag string) interface{}
- func JoinInt(a []int, sep string) string
- func WaitForCommand(f WaitFunc) error
- type APIRequestParametersFromFlagsOption
- type StringFilterFlagOption
- type WaitFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAPIRequestParametersFromFlags ¶
func GetAPIRequestParametersFromFlags(cmd *cobra.Command, opts ...APIRequestParametersFromFlagsOption) (connection.APIRequestParameters, error)
GetAPIRequestParametersFromFlags returns an APIRequestParameters populated from global flags
func GetDestinationFilePath ¶
GetDestinationFilePath returns the destination path, given source file 'source' and optional destination path 'destination'
func GetFilteringArrayFromStringArrayFlagValue ¶
func GetFilteringArrayFromStringArrayFlagValue(filters []string) ([]connection.APIRequestFiltering, error)
GetFilteringArrayFromStringArrayFlagValue retrieves an array of APIRequestFiltering structs for given filtering strings
func GetFilteringFromStringFlagValue ¶
func GetFilteringFromStringFlagValue(filter string) (connection.APIRequestFiltering, error)
GetFilteringFromStringFlagValue retrieves a APIRequestFiltering struct from given filtering string. This function expects a string in the following format (with optional :operator): propertyname:operator=value, Valid examples: name:eq=something name=something
func GetFilteringInferOperator ¶
func GetFilteringInferOperator(property string, value string) connection.APIRequestFiltering
GetFilteringInferOperator returns an APIRequestFiltering struct with the operater inferred from the input value. This will return an operator based on the following rules: If value contains a comma ',' - returns IN operator If value contains an asterisk '*' - returns LK operator Otherwise returns EQ operator
func GetSortingFromStringFlagValue ¶
func GetSortingFromStringFlagValue(sort string) connection.APIRequestSorting
GetSortingFromStringFlagValue return an APIRequestSorting struct from given sorting string flag
func InferTypeFromStringFlagValue ¶
func InferTypeFromStringFlagValue(flag string) interface{}
InferTypeFromStringFlagValue will return a int, bool or string, based on value of flag
func WaitForCommand ¶
Types ¶
type APIRequestParametersFromFlagsOption ¶
type APIRequestParametersFromFlagsOption interface {
Hydrate(params *connection.APIRequestParameters, cmd *cobra.Command)
}
type StringFilterFlagOption ¶
func NewStringFilterFlagOption ¶
func NewStringFilterFlagOption(flagName string, filterPropertyName string) *StringFilterFlagOption
func (*StringFilterFlagOption) Hydrate ¶
func (f *StringFilterFlagOption) Hydrate(params *connection.APIRequestParameters, cmd *cobra.Command)