Documentation
¶
Overview ¶
Package destinations provides implementations for various registry destinations.
Package destinations provides implementations of the core.Destination interface.
Index ¶
- func NewCloudsmithDestination(config CloudsmithConfig, logger *logrus.Logger) core.Destination
- type CloudsmithConfig
- type CloudsmithDestination
- func (d *CloudsmithDestination) BuildDestinationPath(artifact *core.Artifact, _ bool) (string, error)
- func (d *CloudsmithDestination) Exists(ctx context.Context, artifact *core.Artifact, raw bool) (bool, error)
- func (d *CloudsmithDestination) Put(ctx context.Context, artifact *core.Artifact, content io.Reader, raw bool) (string, error)
- func (d *CloudsmithDestination) String() string
- func (d *CloudsmithDestination) Validate() error
- type JFrogConfig
- type JFrogDestination
- func (d *JFrogDestination) BuildDestinationPath(artifact *core.Artifact, raw bool) (string, error)
- func (d *JFrogDestination) BuildTargetURL(artifact *core.Artifact, raw bool) (*url.URL, error)
- func (d *JFrogDestination) Exists(ctx context.Context, artifact *core.Artifact, raw bool) (bool, error)
- func (d *JFrogDestination) GetConfig() JFrogConfig
- func (d *JFrogDestination) Put(ctx context.Context, artifact *core.Artifact, content io.Reader, raw bool) (string, error)
- func (d *JFrogDestination) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCloudsmithDestination ¶ added in v0.5.6
func NewCloudsmithDestination(config CloudsmithConfig, logger *logrus.Logger) core.Destination
NewCloudsmithDestination creates a new Cloudsmith destination.
Types ¶
type CloudsmithConfig ¶ added in v0.5.6
type CloudsmithConfig struct {
// URL is the base URL of the Cloudsmith repository (e.g., https://api.cloudsmith.io)
URL string
// User is the username or API key for authentication
User string
// Password is the password or API secret for authentication
Password string
// DestPath is the destination path in the repository (format: owner/repo)
DestPath string
// SourcePathStrip is the path prefix to strip from source URLs
SourcePathStrip string
}
CloudsmithConfig holds the configuration for Cloudsmith destinations.
type CloudsmithDestination ¶ added in v0.5.6
type CloudsmithDestination struct {
// contains filtered or unexported fields
}
CloudsmithDestination implements the core.Destination interface for Cloudsmith repositories.
func (*CloudsmithDestination) BuildDestinationPath ¶ added in v0.5.6
func (d *CloudsmithDestination) BuildDestinationPath(artifact *core.Artifact, _ bool) (string, error)
BuildDestinationPath constructs the destination path for an artifact.
func (*CloudsmithDestination) Exists ¶ added in v0.5.6
func (d *CloudsmithDestination) Exists(ctx context.Context, artifact *core.Artifact, raw bool) (bool, error)
Exists checks if an artifact already exists in the Cloudsmith repository.
func (*CloudsmithDestination) Put ¶ added in v0.5.6
func (d *CloudsmithDestination) Put(ctx context.Context, artifact *core.Artifact, content io.Reader, raw bool) (string, error)
Put stores an artifact in the Cloudsmith repository.
func (*CloudsmithDestination) String ¶ added in v0.5.6
func (d *CloudsmithDestination) String() string
String returns a string representation of the CloudsmithDestination.
func (*CloudsmithDestination) Validate ¶ added in v0.5.6
func (d *CloudsmithDestination) Validate() error
Validate checks if the CloudsmithDestination configuration is valid.
type JFrogConfig ¶
type JFrogConfig struct {
URL string // Base URL of the Artifactory instance (e.g., https://artifactory.example.com)
User string // Username for authentication
Password string // Password for authentication
DestPath string // Path within Artifactory where artifacts will be stored
// SourcePathStrip is an optional prefix to strip from source URLs before processing.
// This is useful for JFrog-to-JFrog mirroring where you want to remove the source
// repository path. For example, setting this to "artifactory.corp.net/staging/"
// will strip that prefix from source URLs before generating the destination path.
SourcePathStrip string
}
JFrogConfig contains the configuration for connecting to JFrog Artifactory.
type JFrogDestination ¶
type JFrogDestination struct {
// contains filtered or unexported fields
}
JFrogDestination implements the core.Destination interface for JFrog Artifactory.
func NewJFrogDestination ¶
func NewJFrogDestination(config JFrogConfig, logger *logrus.Logger) *JFrogDestination
NewJFrogDestination creates a new JFrogDestination with the provided configuration.
func (*JFrogDestination) BuildDestinationPath ¶ added in v0.5.3
BuildDestinationPath calculates the destination path for an artifact without performing an upload. This is used for dry-run scenarios to predict the final location. The returned path is the path component of the full target URL.
func (*JFrogDestination) BuildTargetURL ¶
BuildTargetURL constructs the full URL for an artifact in JFrog Artifactory. It includes the base URL, destination path, and matrix parameters for metadata.
func (*JFrogDestination) Exists ¶
func (d *JFrogDestination) Exists(ctx context.Context, artifact *core.Artifact, raw bool) (bool, error)
Exists checks if an artifact already exists in JFrog Artifactory.
func (*JFrogDestination) GetConfig ¶
func (d *JFrogDestination) GetConfig() JFrogConfig
GetConfig returns the JFrog configuration (used for testing).
func (*JFrogDestination) Put ¶
func (d *JFrogDestination) Put(ctx context.Context, artifact *core.Artifact, content io.Reader, raw bool) (string, error)
Put uploads an artifact to JFrog Artifactory.
func (*JFrogDestination) Validate ¶
func (d *JFrogDestination) Validate() error
Validate checks if the JFrog configuration is valid.