nexus

package
v1.414.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyArtifactID = errors.New("artifactID must not be empty")

ErrEmptyArtifactID is returned from SetInfo, if artifactID is empty.

View Source
var ErrEmptyGroupID = errors.New("groupID must not be empty")

ErrEmptyGroupID is returned from SetInfo, if groupID is empty.

View Source
var ErrEmptyVersion = errors.New("version must not be empty")

ErrEmptyVersion is returned from SetInfo, if version is empty.

View Source
var ErrInvalidArtifactID = errors.New("artifactID may not include slashes")

ErrInvalidArtifactID is returned from SetInfo, if artifactID contains slashes.

Functions

This section is empty.

Types

type ArtifactDescription

type ArtifactDescription struct {
	Classifier string `json:"classifier"`
	Type       string `json:"type"`
	File       string `json:"file"`
}

ArtifactDescription describes a single artifact that can be uploaded to a Nexus repository manager. The File string must point to an existing file. The Classifier can be empty.

type Upload

type Upload struct {
	// contains filtered or unexported fields
}

Upload combines information about an artifact and its sub-artifacts which are supposed to be uploaded together. Call SetRepoURL(), SetArtifactsVersion(), SetArtifactID(), and add at least one artifact via AddArtifact().

func (*Upload) AddArtifact

func (nexusUpload *Upload) AddArtifact(artifact ArtifactDescription) error

AddArtifact adds a single artifact to be uploaded later via UploadArtifacts(). If an identical artifact description is already contained in the Upload, the function does nothing and returns no error.

func (*Upload) Clear added in v1.18.0

func (nexusUpload *Upload) Clear()

Clear removes any contained artifact descriptions.

func (*Upload) GetArtifacts

func (nexusUpload *Upload) GetArtifacts() []ArtifactDescription

GetArtifacts returns a copy of the artifact descriptions array stored in the Upload.

func (*Upload) GetArtifactsID added in v1.18.0

func (nexusUpload *Upload) GetArtifactsID() string

GetArtifactsID returns the common artifactId for all artifacts.

func (*Upload) GetArtifactsVersion added in v1.18.0

func (nexusUpload *Upload) GetArtifactsVersion() string

GetArtifactsVersion returns the common version for all artifacts.

func (*Upload) GetGroupID added in v1.18.0

func (nexusUpload *Upload) GetGroupID() string

GetGroupID returns the common groupId for all artifacts.

func (*Upload) GetMavenRepoURL added in v1.22.0

func (nexusUpload *Upload) GetMavenRepoURL() string

GetMavenRepoURL returns the base URL for the nexus-maven repository.

func (*Upload) GetNexusURLProtocol added in v1.130.0

func (nexusUpload *Upload) GetNexusURLProtocol() string

GetNexusURLProtocol returns the protocol specified in the nexusUrl which was set thru setNexusUrl

func (*Upload) GetNpmRepoURL added in v1.22.0

func (nexusUpload *Upload) GetNpmRepoURL() string

GetNpmRepoURL returns the base URL for the nexus-npm repository.

func (*Upload) SetInfo added in v1.18.0

func (nexusUpload *Upload) SetInfo(groupID, artifactID, version string) error

SetInfo sets the common info for all uploaded artifacts. This info is external to the artifact descriptions so that it is consistent for all of them.

func (*Upload) SetRepoURL added in v1.18.0

func (nexusUpload *Upload) SetRepoURL(nexusURL, nexusVersion, mavenRepository, npmRepository string) error

SetRepoURL constructs the base URL to the Nexus repository. mavenRepository or npmRepository may be empty.

type Uploader

type Uploader interface {
	SetRepoURL(nexusURL, nexusVersion, mavenRepository, npmRepository string) error
	GetNexusURLProtocol() string
	GetMavenRepoURL() string
	GetNpmRepoURL() string
	SetInfo(groupID, artifactsID, version string) error
	GetGroupID() string
	GetArtifactsID() string
	GetArtifactsVersion() string
	AddArtifact(artifact ArtifactDescription) error
	GetArtifacts() []ArtifactDescription
	Clear()
}

Uploader provides an interface for configuring the target Nexus Repository and adding artifacts.

Jump to

Keyboard shortcuts

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