Documentation
¶
Index ¶
- Constants
- Variables
- func Execute()
- func ExtractHostFromURL(rawURL string) (string, error)
- func GetJFrogCredentials(jfrogURL string, flags *MirrorFlags, v *viper.Viper) (string, string, error)
- func NewMirrorCmd() *cobra.Command
- func NewRootCmd() *cobra.Command
- func NewVersionCmd() *cobra.Command
- func ValidateAndGetConfig(flags *MirrorFlags) (*config.Config, error)
- type MirrorFlags
Constants ¶
const (
UnsuccessExitCode = 1
)
Variables ¶
var BuildDate = "unknown"
BuildDate is the date the binary was built.
var CommitHash = "unknown"
CommitHash is the git commit hash.
var Version = "dev"
Version is the current version of the CLI.
Functions ¶
func Execute ¶
func Execute()
Execute runs the root command and exits the process with a non-zero status code if an error occurs.
func ExtractHostFromURL ¶ added in v0.2.0
ExtractHostFromURL parses the provided URL string and returns the host without scheme.
func GetJFrogCredentials ¶ added in v0.2.0
func GetJFrogCredentials(jfrogURL string, flags *MirrorFlags, v *viper.Viper) (string, string, error)
GetJFrogCredentials retrieves JFrog credentials from flags, environment variables, or .netrc.
func NewMirrorCmd ¶ added in v0.0.3
NewMirrorCmd creates a new mirror command.
func NewRootCmd ¶ added in v0.0.3
NewRootCmd creates the root command for the CLI.
func NewVersionCmd ¶ added in v0.1.1
NewVersionCmd creates the version command for the CLI.
func ValidateAndGetConfig ¶ added in v0.1.0
func ValidateAndGetConfig(flags *MirrorFlags) (*config.Config, error)
ValidateAndGetConfig is a legacy function for test compatibility. It's a wrapper around buildConfigFromFlags.
Types ¶
type MirrorFlags ¶ added in v0.0.3
type MirrorFlags struct {
ConfigFile string
Source string
Destination string
FromFile string
Raw bool
Properties []string
Unzip bool
PreserveZipName bool
DryRun bool
DryRunMode string
SourcePathStrip string
Checksum string
// Legacy JFrog-specific flags (backward compatibility, will be removed in future versions)
JFrogURL string
JFrogUser string
JFrogPassword string
JFrogPasswordFromStdin bool
// New generic registry flags (preferred for new usage)
RegistryType string
RegistryURL string
RegistryUser string
RegistryPassword string
RegistryPasswordFromStdin bool
TestMirror *mirror.DefaultMirror // Used for testing only
}
MirrorFlags holds the command-line flags for the mirror command.
func (*MirrorFlags) RunE ¶ added in v0.2.0
func (f *MirrorFlags) RunE(cmd *cobra.Command, args []string) error
RunE is a compatibility method for tests.
func (*MirrorFlags) ValidateDryRunMode ¶ added in v0.2.0
func (f *MirrorFlags) ValidateDryRunMode() error
ValidateDryRunMode checks if the dry run mode is valid. This method is added for test compatibility.