core

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTargetProperties added in v0.1.0

func CreateTargetProperties(properties []string) (*utils.Properties, error)

CreateTargetProperties converts string properties to a utils.Properties struct.

func DownloadArtifact

func DownloadArtifact(artifactURL string, progressFunc progress.ProgressFunc) (string, error)

DownloadArtifact downloads a GitHub Release artifact to a temporary directory.

func ExtractSingleFileFromZip added in v0.1.0

func ExtractSingleFileFromZip(zipFilePath string, options *ExtractOptions) (string, bool, error)

ExtractSingleFileFromZip attempts to extract a single file from a zip archive. If the zip contains exactly one file, it extracts that file to the destination path. Returns the path to the extracted file and a flag indicating if extraction occurred.

func IsZipFile added in v0.1.0

func IsZipFile(filePath string) bool

IsZipFile checks if the given file path has a .zip extension.

func ParseProperty added in v0.1.0

func ParseProperty(prop string) (key, value string, err error)

ParseProperty splits a property string into key and value components.

Types

type ExtractOptions added in v0.1.0

type ExtractOptions struct {
	// DestinationDir is the directory where files should be extracted
	// If empty, files will be extracted to the same directory as the archive
	DestinationDir string
}

ExtractOptions contains options for extracting files from archives.

type JFrogClient added in v0.0.3

type JFrogClient struct {
	artifactory.ArtifactoryServicesManager
}

JFrogClient is an embedded ArtifactoryServicesManager which adds convenience methods.

func NewJFrogClient added in v0.0.3

func NewJFrogClient(jc *JFrogConfig) (*JFrogClient, error)

NewJFrogClient creates a new JFrogClient using the provided configuration. It sets up the Artifactory connection details, builds the required service configuration, and initializes the underlying ArtifactoryServicesManager. If initialization fails at any step, an error is returned.

func (*JFrogClient) Put added in v0.2.0

func (c *JFrogClient) Put(ctx context.Context, url string, content io.Reader) error

When the reader supports seeking, it attempts to determine the total content size to enable accurate progress reporting.

func (*JFrogClient) UploadGenericArtifact added in v0.0.3

func (c *JFrogClient) UploadGenericArtifact(
	artifact *core.Artifact,
	content io.Reader,
	progressFunc progress.ProgressFunc,
) error

UploadGenericArtifact uploads a generic artifact to Artifactory.

type JFrogConfig added in v0.0.3

type JFrogConfig struct {
	Url      string
	User     string
	Password string
}

JFrogConfig contains the required properties to connect to JFrog Artifactory.

Jump to

Keyboard shortcuts

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