Documentation
¶
Index ¶
- Variables
- type ClientConfig
- type CreateRepoData
- type GroupID
- type IClient
- type NexusClient
- func (client NexusClient) AddRepositoryToGroup(repositoryID RepositoryID, groupID GroupID) (int, error)
- func (client NexusClient) CreateSnapshotRepository(repositoryID RepositoryID) (int, error)
- func (client NexusClient) DeleteRepository(repositoryID RepositoryID) (int, error)
- func (client NexusClient) RemoveRepositoryFromGroup(repositoryID RepositoryID, groupID GroupID) (int, error)
- func (client NexusClient) RepositoryExists(repositoryID RepositoryID) (bool, error)
- func (client NexusClient) RepositoryGroup(groupID GroupID) (RepositoryGroup, int, error)
- type Repository
- type RepositoryGroup
- type RepositoryGroupData
- type RepositoryID
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type ClientConfig ¶
type ClientConfig struct {
// The public client interface
IClient
// For Nexus clients, typically http://host:port/nexus
BaseURL string
// Admin username and password capable of updating the artifact repository
Username string
Password string
// Underlying network client
HttpClient *http.Client
}
Types expected to be common to Nexus and other repo managers
type CreateRepoData ¶
type CreateRepoData struct {
XMLName xml.Name `xml:"data"`
Id RepositoryID `xml:"id"`
Name string `xml:"name"`
ContentResourceURI string `xml:"contentResourceURI"`
Provider string `xml:"provider"`
ProviderRole string `xml:"providerRole"`
Format string `xml:"format"`
RepoType string `xml:"repoType"`
RepoPolicy string `xml:"repoPolicy"`
WritePolicy string `xml:"writePolicy"`
Exposed bool `xml:"exposed"`
Browseable bool `xml:"browseable"`
Indexable bool `xml:"indexable"`
NotFoundCacheTTL int `xml:"notFoundCacheTTL"`
}
type IClient ¶
type IClient interface {
RepositoryExists(RepositoryID) (bool, error)
CreateSnapshotRepository(RepositoryID) (int, error)
DeleteRepository(RepositoryID) (int, error)
AddRepositoryToGroup(RepositoryID, GroupID) (int, error)
RemoveRepositoryFromGroup(RepositoryID, GroupID) (int, error)
RepositoryGroup(GroupID) (RepositoryGroup, int, error)
}
ClientOps defines the service methods on a Client. This interface should be suffiently expressive to capture Nexus and Artifactory behavior. Integer return values are the underlying HTTP response codes.
type NexusClient ¶
type NexusClient struct {
ClientConfig
}
func NewNexusClient ¶
func NewNexusClient(baseURL, username, password string) NexusClient
NewClient creates a new Nexus client implementation on which subsequent service methods are called. The baseURL typically takes the form http://host:port/nexus. username and password are the credentials of an admin user capable of creating and mutating data within Nexus.
func (NexusClient) AddRepositoryToGroup ¶
func (client NexusClient) AddRepositoryToGroup(repositoryID RepositoryID, groupID GroupID) (int, error)
AddRepositoryToGroup adds the given repository specified by repositoryID to the repository group specified by groupID.
func (NexusClient) CreateSnapshotRepository ¶
func (client NexusClient) CreateSnapshotRepository(repositoryID RepositoryID) (int, error)
CreateSnapshotRepository creates a new hosted Maven2 SNAPSHOT repository with the given repositoryID. The repository name will be the same as the repositoryID. When error is nil, the integer return value is the underlying HTTP response code.
func (NexusClient) DeleteRepository ¶
func (client NexusClient) DeleteRepository(repositoryID RepositoryID) (int, error)
DeleteRepository deletes the repository with the given repositoryID.
func (NexusClient) RemoveRepositoryFromGroup ¶
func (client NexusClient) RemoveRepositoryFromGroup(repositoryID RepositoryID, groupID GroupID) (int, error)
DeleteRepositoryFromGroup removes the given repository specified by repositoryID from the repository group specified by groupID.
func (NexusClient) RepositoryExists ¶
func (client NexusClient) RepositoryExists(repositoryID RepositoryID) (bool, error)
RepositoryExists checks whether a given repository specified by repositoryID exists.
func (NexusClient) RepositoryGroup ¶
func (client NexusClient) RepositoryGroup(groupID GroupID) (RepositoryGroup, int, error)
RepositoryGroup returns a representation of the given repository group ID.
type Repository ¶
type Repository struct {
Name string
ID RepositoryID
ResourceURI string
}
Types expected to be common to Nexus and other repo managers
type RepositoryGroup ¶
type RepositoryGroup struct {
ID GroupID
Name string
ContentResourceURI string
Repositories []Repository
}
Types expected to be common to Nexus and other repo managers
type RepositoryGroupData ¶
type RepositoryGroupData struct {
ID GroupID `json:"id"`
Provider string `json:"provider"`
Name string `json:"name"`
Repositories []repository `json:"repositories"`
Format string `json:"format"`
RepoType string `json:"repoType"`
Exposed bool `json:"exposed"`
ContentResourceURI string `json:"contentResourceURI"`
}
The payload of a repository group read or mutation.
type RepositoryID ¶
type RepositoryID string
Types expected to be common to Nexus and other repo managers