common

package
v0.0.0-...-44afeb0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupResult

func CleanupResult(result *commandUtils.Result, err *error)

func CreateArtifactoryDetailsByFlags

func CreateArtifactoryDetailsByFlags(c *components.Context) (*coreConfig.ServerDetails, error)

func CreateBuildConfiguration

func CreateBuildConfiguration(c *components.Context) *build.BuildConfiguration

Returns build configuration struct using the args (build name/number) and options (project) provided by the user. Any empty configuration could be later overridden by environment variables if set.

func CreateBuildConfigurationWithModule

func CreateBuildConfigurationWithModule(c *components.Context) (buildConfigConfiguration *buildUtils.BuildConfiguration, err error)

Returns build configuration struct using the options provided by the user. Any empty configuration could be later overridden by environment variables if set.

func CreateServerDetailsFromFlags

func CreateServerDetailsFromFlags(c *components.Context) (details *config.ServerDetails, err error)

func CreateServerDetailsWithConfigOffer

func CreateServerDetailsWithConfigOffer(c *components.Context, excludeRefreshableTokens bool, domain cliUtils.CommandDomain) (*config.ServerDetails, error)

Exclude refreshable tokens parameter should be true when working with external tools (build tools, curl, etc) or when sending requests not via ArtifactoryHttpClient.

func CreateSummaryReportString

func CreateSummaryReportString(success, failed int, failNoOp bool, err error) (string, error)

func ExtractArguments

func ExtractArguments(context *components.Context) []string

func ExtractCommand

func ExtractCommand(c *components.Context) []string

func FixWinPathsForFileSystemSourcedCmds

func FixWinPathsForFileSystemSourcedCmds(uploadSpec *spec.SpecFiles, c *components.Context)

func GetBuildName

func GetBuildName(buildName string) string

func GetBuildUrl

func GetBuildUrl(buildUrl string) string

func GetCliError

func GetCliError(err error, success, failed int, failNoOp bool) error

func GetCommandFlags

func GetCommandFlags(cmdKey string, commandToFlags map[string][]string, flagsMap map[string]components.Flag) []components.Flag

Return a sorted list of a command's flags by a given command key.

func GetDetailedSummary

func GetDetailedSummary(c *components.Context) bool

func GetDocumentationMessage

func GetDocumentationMessage() string

func GetEnvExclude

func GetEnvExclude(envExclude string) string

func GetFileSystemSpec

func GetFileSystemSpec(c *components.Context) (fsSpec *spec.SpecFiles, err error)

func GetPrintCurrentCmdHelp

func GetPrintCurrentCmdHelp(c *components.Context) func() error

func GetProject

func GetProject(c *components.Context) string

Get project key from flag or environment variable

func GetQuietValue

func GetQuietValue(c *components.Context) bool

This function indicates whether the command should be executed without confirmation warning or not. If the --quiet option was sent, it is used to determine whether to prompt the confirmation or not. If not, the command will prompt the confirmation, unless the CI environment variable was set to true.

func GetServerDetails

func GetServerDetails(c *components.Context) (*config.ServerDetails, error)

Return the Artifactory Details of the provided 'server-id', or the default one.

func GetServerIdFlag

func GetServerIdFlag() components.StringFlag

Get the common 'server-id' flag

func GetStringsArrFlagValue

func GetStringsArrFlagValue(c *components.Context, flagName string) (resultArray []string)

func GetThreadsCount

func GetThreadsCount(c *components.Context) (threads int, err error)

func HandleSecretInput

func HandleSecretInput(c *components.Context, stringFlag, stdinFlag string) (secret string, err error)

Get a secret value from a flag or from stdin.

func IsFailNoOp

func IsFailNoOp(context *components.Context) bool

func OverrideArrayIfSet

func OverrideArrayIfSet(field *[]string, c *components.Context, fieldName string)

If `fieldName` exist in the cli args, read it to `field` as an array split by `;`.

func OverrideIntIfSet

func OverrideIntIfSet(field *int, c *components.Context, fieldName string)

If `fieldName` exist in the cli args, read it to `field` as a int.

func OverrideSpecFieldsIfSet

func OverrideSpecFieldsIfSet(spec *spec.File, c *components.Context)

func OverrideStringIfSet

func OverrideStringIfSet(field *string, c *components.Context, fieldName string)

If `fieldName` exist in the cli args, read it to `field` as a string.

func PrintBriefSummaryReport

func PrintBriefSummaryReport(success, failed int, failNoOp bool, originalErr error) error

func PrintCommandSummary

func PrintCommandSummary(result *commandUtils.Result, detailedSummary, printDeploymentView, failNoOp bool, originalErr error) (err error)

func PrintDeploymentView

func PrintDeploymentView(reader *content.ContentReader) error

Print a file tree based on the items' path in the reader's list.

func PrintDetailedSummaryReport

func PrintDetailedSummaryReport(basicSummary string, reader *content.ContentReader, uploaded bool, originalErr error) error

Prints a summary report. If a resultReader is provided, we will iterate over the result and print a detailed summary including the affected files.

func PrintHelpAndReturnError

func PrintHelpAndReturnError(msg string, context *components.Context) error

func RunCmdWithDeprecationWarning

func RunCmdWithDeprecationWarning(cmdName, oldSubcommand string, c *components.Context,
	cmd func(c *components.Context) error) error

func ShowCmdHelpIfNeeded

func ShowCmdHelpIfNeeded(c *components.Context, args []string) (bool, error)

This function checks whether the command received --help as a single option. If it did, the command's help is shown and true is returned. This function should be used iff the SkipFlagParsing option is used.

func WrongNumberOfArgumentsHandler

func WrongNumberOfArgumentsHandler(context *components.Context) error

Types

type DetailedSummaryRecord

type DetailedSummaryRecord struct {
	Source string `json:"source,omitempty"`
	Target string `json:"target"`
}

type ExtendedDetailedSummaryRecord

type ExtendedDetailedSummaryRecord struct {
	DetailedSummaryRecord
	Sha256 string `json:"sha256"`
}

Jump to

Keyboard shortcuts

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