Documentation ¶
Index ¶
- Variables
- type ArtifactDescription
- type Upload
- func (nexusUpload *Upload) AddArtifact(artifact ArtifactDescription) error
- func (nexusUpload *Upload) Clear()
- func (nexusUpload *Upload) GetArtifacts() []ArtifactDescription
- func (nexusUpload *Upload) GetArtifactsID() string
- func (nexusUpload *Upload) GetArtifactsVersion() string
- func (nexusUpload *Upload) GetGroupID() string
- func (nexusUpload *Upload) GetMavenRepoURL() string
- func (nexusUpload *Upload) GetNpmRepoURL() string
- func (nexusUpload *Upload) SetInfo(groupID, artifactID, version string) error
- func (nexusUpload *Upload) SetRepoURL(nexusURL, nexusVersion, mavenRepository, npmRepository string) error
- type Uploader
Constants ¶
This section is empty.
Variables ¶
var ErrEmptyArtifactID = errors.New("artifactID must not be empty")
ErrEmptyArtifactID is returned from SetInfo, if artifactID is empty.
var ErrEmptyGroupID = errors.New("groupID must not be empty")
ErrEmptyGroupID is returned from SetInfo, if groupID is empty.
var ErrEmptyVersion = errors.New("version must not be empty")
ErrEmptyVersion is returned from SetInfo, if version is empty.
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
GetArtifactsID returns the common artifactId for all artifacts.
func (*Upload) GetArtifactsVersion ¶ added in v1.18.0
GetArtifactsVersion returns the common version for all artifacts.
func (*Upload) GetGroupID ¶ added in v1.18.0
GetGroupID returns the common groupId for all artifacts.
func (*Upload) GetMavenRepoURL ¶ added in v1.22.0
GetMavenRepoURL returns the base URL for the nexus-maven repository.
func (*Upload) GetNpmRepoURL ¶ added in v1.22.0
GetNpmRepoURL returns the base URL for the nexus-npm repository.
func (*Upload) SetInfo ¶ added in v1.18.0
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 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.