command

package
v1.3.18 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HarnessConfigDir = ".harness"
	MavenConfigFile  = "maven-config.json"
	PipConfigFile    = "pip-config.json"
	NugetConfigFile  = "nuget-config.json"
)

Variables

This section is empty.

Functions

func BackupFile added in v1.3.18

func BackupFile(filePath, prefix string) (string, error)

BackupFile backs up a file to ~/.harness/<prefix>-backup-<timestamp>. Returns empty string if the file doesn't exist or is empty.

func NewConfigureCmd added in v1.3.4

func NewConfigureCmd(f *cmdutils.Factory) *cobra.Command

func NewConfigureMavenCmd added in v1.3.18

func NewConfigureMavenCmd(f *cmdutils.Factory) *cobra.Command

func NewConfigureNpmCmd added in v1.3.4

func NewConfigureNpmCmd(f *cmdutils.Factory) *cobra.Command

func NewConfigureNugetCmd added in v1.3.18

func NewConfigureNugetCmd(f *cmdutils.Factory) *cobra.Command

func NewConfigurePipCmd added in v1.3.18

func NewConfigurePipCmd(f *cmdutils.Factory) *cobra.Command

func NewCreateRegistryCmd

func NewCreateRegistryCmd(c *cmdutils.Factory) *cobra.Command

NewCreateRegistryCmd wires up:

hc registry create

func NewDeleteRegistryCmd

func NewDeleteRegistryCmd(c *cmdutils.Factory) *cobra.Command

func NewFirewallAuditCmd added in v1.3.4

func NewFirewallAuditCmd(f *cmdutils.Factory) *cobra.Command

func NewFirewallCmd added in v1.3.4

func NewFirewallCmd(f *cmdutils.Factory) *cobra.Command

func NewFirewallExplainCmd added in v1.3.4

func NewFirewallExplainCmd(f *cmdutils.Factory) *cobra.Command

func NewGetRegistryCmd

func NewGetRegistryCmd(f *cmdutils.Factory) *cobra.Command

NewGetRegistryCmd wires up:

hc registry get <args>

func NewListRegistryCmd

func NewListRegistryCmd(f *cmdutils.Factory) *cobra.Command

NewListRegistryCmd wires up:

hc registry list

func NewMetadataCmd added in v1.3.0

func NewMetadataCmd(f *cmdutils.Factory) *cobra.Command

func NewMetadataDeleteCmd added in v1.3.0

func NewMetadataDeleteCmd(f *cmdutils.Factory) *cobra.Command

func NewMetadataGetCmd added in v1.3.0

func NewMetadataGetCmd(f *cmdutils.Factory) *cobra.Command

func NewMetadataSetCmd added in v1.3.0

func NewMetadataSetCmd(f *cmdutils.Factory) *cobra.Command

func RestoreFromBackup added in v1.3.18

func RestoreFromBackup(backupPath, targetPath string) error

RestoreFromBackup copies backup file contents back to the target path.

func RestoreMavenSettings added in v1.3.18

func RestoreMavenSettings() error

RestoreMavenSettings restores the backed-up settings.xml file if a backup exists.

func RestoreNpmrc added in v1.3.18

func RestoreNpmrc() error

RestoreNpmrc restores the backed-up .npmrc file if a backup exists.

func RestoreNugetConfig added in v1.3.18

func RestoreNugetConfig() error

RestoreNugetConfig restores the backed-up NuGet.Config file if a backup exists.

func RestorePipConf added in v1.3.18

func RestorePipConf() error

RestorePipConf restores the backed-up pip.conf file if a backup exists.

func SaveMavenRegistryConfig added in v1.3.18

func SaveMavenRegistryConfig(cfg MavenRegistryConfig) error

func SaveNugetRegistryConfig added in v1.3.18

func SaveNugetRegistryConfig(cfg NugetRegistryConfig) error

func SavePipRegistryConfig added in v1.3.18

func SavePipRegistryConfig(cfg PipRegistryConfig) error

Types

type Dependency added in v1.3.4

type Dependency struct {
	Name    string `json:"name"`
	Version string `json:"version"`
	Source  string `json:"source"`
	Parent  string `json:"parent,omitempty"`
}

func ParseLockFile added in v1.3.18

func ParseLockFile(filePath string) ([]Dependency, error)

type MavenRegistryConfig added in v1.3.18

type MavenRegistryConfig struct {
	RegistryIdentifier string `json:"registryIdentifier"`
	RegistryURL        string `json:"registryUrl"`
	OrgID              string `json:"orgId,omitempty"`
	ProjectID          string `json:"projectId,omitempty"`
	SettingsBackupPath string `json:"settingsBackupPath,omitempty"`
	SettingsPath       string `json:"settingsPath"`
}

MavenRegistryConfig stores maven registry configuration in ~/.harness/maven-config.json.

func LoadMavenRegistryConfig added in v1.3.18

func LoadMavenRegistryConfig() (*MavenRegistryConfig, error)

type NpmRegistryConfig added in v1.3.18

type NpmRegistryConfig struct {
	RegistryIdentifier string `json:"registryIdentifier"`
	RegistryURL        string `json:"registryUrl"`
	Scope              string `json:"scope,omitempty"`
	OrgID              string `json:"orgId,omitempty"`
	ProjectID          string `json:"projectId,omitempty"`
	NpmrcBackupPath    string `json:"npmrcBackupPath,omitempty"`
	NpmrcPath          string `json:"npmrcPath"`
}

NpmRegistryConfig stores npm registry configuration in ~/.harness/npm-config.json. Used by the install wrapper to detect the HAR registry without re-parsing .npmrc.

func LoadNpmRegistryConfig added in v1.3.18

func LoadNpmRegistryConfig() (*NpmRegistryConfig, error)

LoadNpmRegistryConfig loads the saved npm registry config from ~/.harness/npm-config.json.

type NugetRegistryConfig added in v1.3.18

type NugetRegistryConfig struct {
	RegistryIdentifier    string `json:"registryIdentifier"`
	RegistryURL           string `json:"registryUrl"`
	OrgID                 string `json:"orgId,omitempty"`
	ProjectID             string `json:"projectId,omitempty"`
	NugetConfigBackupPath string `json:"nugetConfigBackupPath,omitempty"`
	NugetConfigPath       string `json:"nugetConfigPath"`
}

func LoadNugetRegistryConfig added in v1.3.18

func LoadNugetRegistryConfig() (*NugetRegistryConfig, error)

type PipRegistryConfig added in v1.3.18

type PipRegistryConfig struct {
	RegistryIdentifier string `json:"registryIdentifier"`
	RegistryURL        string `json:"registryUrl"`
	OrgID              string `json:"orgId,omitempty"`
	ProjectID          string `json:"projectId,omitempty"`
	PipConfBackupPath  string `json:"pipConfBackupPath,omitempty"`
	PipConfPath        string `json:"pipConfPath"`
}

func LoadPipRegistryConfig added in v1.3.18

func LoadPipRegistryConfig() (*PipRegistryConfig, error)

type ScanResult added in v1.3.4

type ScanResult struct {
	PackageName string `json:"packageName"`
	Version     string `json:"version"`
	ScanID      string `json:"scanId"`
	ScanStatus  string `json:"scanStatus"`
}

Jump to

Keyboard shortcuts

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