Documentation ¶
Index ¶
- Constants
- type AQLFileInfo
- type AQLProperties
- type AQLResults
- type Artifact
- type ArtifactChecksums
- type ArtifactProperties
- type Client
- func (c *Client) CreateGroup(gname string, g GroupDetails) error
- func (c *Client) CreatePermissionTarget(u string, p PermissionTargetDetails, q map[string]string) error
- func (client *Client) CreateRepo(key string, r RepoConfig, q map[string]string) error
- func (c *Client) CreateUser(uname string, u UserDetails) error
- func (c *Client) CreateUserAPIKey() (string, error)
- func (c *Client) Delete(path string) error
- func (c *Client) DeleteArtifact(repo, path string) ([]byte, error)
- func (c *Client) DeleteUser(uname string) error
- func (c *Client) DeployArtifact(repoKey string, filename string, path string, properties map[string]string) (CreatedStorageItem, error)
- func (c *Client) DockerSearch(name string) (files []FileInfo, e error)
- func (c *Client) GAVCSearch(coords *GAVC) (files []FileInfo, e error)
- func (c *Client) Get(path string, options map[string]string) ([]byte, error)
- func (c *Client) GetFileInfo(path string) (a Artifact, err error)
- func (c *Client) GetGeneralConfiguration() (s string, e error)
- func (c *Client) GetGroupDetails(u string) (GroupDetails, error)
- func (c *Client) GetGroups() ([]Group, error)
- func (c *Client) GetLicenseInformation() (LicenseInformation, error)
- func (c *Client) GetPermissionTargetDetails(u string) (PermissionTargetDetails, error)
- func (c *Client) GetPermissionTargets() ([]PermissionTarget, error)
- func (client *Client) GetRepo(key string) (RepoConfig, error)
- func (client *Client) GetRepos(rtype string) ([]Repo, error)
- func (c *Client) GetSystemSecurityConfiguration() (s string, e error)
- func (c *Client) GetUserAPIKey() (string, error)
- func (c *Client) GetUserDetails(u string) (UserDetails, error)
- func (c *Client) GetUserEncryptedPassword() (string, error)
- func (c *Client) GetUsers() ([]User, error)
- func (c *Client) HTTPRequest(ar Request) ([]byte, error)
- func (c *Client) HTTPRequestWithResponse(ar Request) (*http.Response, error)
- func (c *Client) ListFiles(repo string) (fileList FileList, err error)
- func (c *Client) Post(path string, data string, options map[string]string) ([]byte, error)
- func (c *Client) Put(path string, data string, options map[string]string) ([]byte, error)
- func (c *Client) RetrieveArtifact(repo string, path string) ([]byte, error)
- func (client *Client) UpdateRepo(key string, r RepoConfig, q map[string]string) error
- func (c *Client) VagrantSearch(name string) (files []AQLFileInfo, e error)
- type ClientConfig
- type CreatedStorageItem
- type ErrorJSON
- type ErrorsJSON
- type FileInfo
- type FileList
- type FileListItem
- type GAVC
- type GavcSearchResults
- type GenericRepoConfig
- type Group
- type GroupDetails
- type LicenseInformation
- type LocalRepoConfig
- type PermissionTarget
- type PermissionTargetDetails
- type Principals
- type RemoteRepoConfig
- type Repo
- type RepoConfig
- type Request
- type URI
- type User
- type UserAPIKey
- type UserDetails
- type VirtualRepoConfig
Constants ¶
const ExportSettingsMimeType string = "application/vnd.org.jfrog.artifactory.system.ExportSettings+json"
ExportSettingsMimeType is the mimetype for export settings
const GroupMimeType string = "application/vnd.org.jfrog.artifactory.security.Group+json"
GroupMimeType is the mimetype for a group
const ImportSettingsMimeType string = "application/vnd.org.jfrog.artifactory.system.ImportSettings+json"
ImportSettingsMimeType is the mimetype for import settings
const LocalRepoMimeType string = "application/vnd.org.jfrog.artifactory.repositories.LocalRepositoryConfiguration+json"
LocalRepoMimeType is the mimetype for a local repo
const PermissionTargetMimeType string = "application/vnd.org.jfrog.artifactory.security.PermissionTarget+json"
PermissionTargetMimeType is the mimetype for a permission target
const RemoteRepoMimeType string = "application/vnd.org.jfrog.artifactory.repositories.RemoteRepositoryConfiguration+json"
RemoteRepoMimeType is the mimetype for a remote repo
const SystemVersionMimeType string = "application/vnd.org.jfrog.artifactory.system.Version+json"
SystemVersionMimeType is the mimetype for system version
const UserMimeType string = "application/vnd.org.jfrog.artifactory.security.User+json"
UserMimeType is the mimetype for a user
const VERSION = "5.1"
VERSION represents the minimum version of the Artifactory API this library supports
const VirtualRepoMimeType string = "application/vnd.org.jfrog.artifactory.repositories.VirtualRepositoryConfiguration+json"
VirtualRepoMimeType is the mimetype for a virtual repo
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AQLFileInfo ¶
type AQLFileInfo struct { Repo string `json:"repo,omitempty"` Path string `json:"path,omitempty"` Name string `json:"name,omitempty"` Type string `json:"type,omitempty"` Created string `json:"created,omitempty"` CreatedBy string `json:"created_by,omitempty"` Modified string `json:"modified,omitempty"` ModifiedBy string `json:"modified_by,omitempty"` Depth int `json:"depth,omitempty"` Size int64 `json:"size,omitempty"` Properties []AQLProperties `json:"properties,omitempty"` ActualMD5 string `json:"actual_md5,omitempty"` ActualSHA1 string `json:"actual_sha1,omitempty"` OriginalSHA1 string `json:"original_sha1,omitempty"` }
AQLFileInfo represents the json returned from artifactory for an individual file result in an AQL query
type AQLProperties ¶
AQLProperties represents the json used to compose an AQL query
type AQLResults ¶
type AQLResults struct { Results []AQLFileInfo `json:"results"` Range struct { StartPos int `json:"start_pos"` EndPos int `json:"end_pos"` Total int `json:"total"` Limit int `json:"limit"` } `json:"range"` }
AQLResults represents the json returned from artifactory for an AQL query
type ArtifactChecksums ¶
ArtifactChecksums represents the checksums for an artifact
type ArtifactProperties ¶
ArtifactProperties represents a set of properties for an Artifact
type Client ¶
type Client struct { Client *http.Client Config *ClientConfig Transport *http.Transport }
Client is a client for interacting with Artifactory
func NewClient ¶
func NewClient(config *ClientConfig) (c Client)
NewClient returns a new ArtifactoryClient with the provided ClientConfig
func NewClientFromEnv ¶
func NewClientFromEnv() (c Client)
NewClientFromEnv returns a new ArtifactoryClient the is automatically configured from environment variables
func (*Client) CreateGroup ¶
func (c *Client) CreateGroup(gname string, g GroupDetails) error
CreateGroup creates a group in artifactory
func (*Client) CreatePermissionTarget ¶
func (c *Client) CreatePermissionTarget(u string, p PermissionTargetDetails, q map[string]string) error
CreatePermissionTarget creates the named permission target
func (*Client) CreateRepo ¶
CreateRepo creates the named repo
func (*Client) CreateUser ¶
func (c *Client) CreateUser(uname string, u UserDetails) error
CreateUser creates a user with the specified details
func (*Client) CreateUserAPIKey ¶
CreateUserAPIKey creates an apikey for the current user
func (*Client) DeleteArtifact ¶
DeleteArtifact deletes the named artifact from the provided repo
func (*Client) DeleteUser ¶
DeleteUser deletes a user
func (*Client) DeployArtifact ¶
func (c *Client) DeployArtifact(repoKey string, filename string, path string, properties map[string]string) (CreatedStorageItem, error)
DeployArtifact deploys the named artifact to the provided repo
func (*Client) DockerSearch ¶
DockerSearch searches for docker images
func (*Client) GAVCSearch ¶
GAVCSearch performs a search based on GAVC coordinates
func (*Client) GetFileInfo ¶
GetFileInfo returns the details about an artifact
func (*Client) GetGeneralConfiguration ¶
GetGeneralConfiguration returns the general artifactory configuration
func (*Client) GetGroupDetails ¶
func (c *Client) GetGroupDetails(u string) (GroupDetails, error)
GetGroupDetails returns details for a Group
func (*Client) GetLicenseInformation ¶
func (c *Client) GetLicenseInformation() (LicenseInformation, error)
GetLicenseInformation returns license information from Artifactory
func (*Client) GetPermissionTargetDetails ¶
func (c *Client) GetPermissionTargetDetails(u string) (PermissionTargetDetails, error)
GetPermissionTargetDetails returns the details of the provided permission target
func (*Client) GetPermissionTargets ¶
func (c *Client) GetPermissionTargets() ([]PermissionTarget, error)
GetPermissionTargets returns all permission targets
func (*Client) GetRepo ¶
func (client *Client) GetRepo(key string) (RepoConfig, error)
GetRepo returns the named repo
func (*Client) GetSystemSecurityConfiguration ¶
GetSystemSecurityConfiguration returns the security configuration for the artifactory server
func (*Client) GetUserAPIKey ¶
GetUserAPIKey returns the current user's api key
func (*Client) GetUserDetails ¶
func (c *Client) GetUserDetails(u string) (UserDetails, error)
GetUserDetails returns details for the named user
func (*Client) GetUserEncryptedPassword ¶
GetUserEncryptedPassword returns the current user's encrypted password
func (*Client) HTTPRequest ¶
HTTPRequest performs an HTTP request to artifactory
func (*Client) HTTPRequestWithResponse ¶
HTTPRequestWithResponse performs an HTTP request to artifactory and returns the http response
func (*Client) RetrieveArtifact ¶
RetrieveArtifact downloads the named artifact from the provided repo
func (*Client) UpdateRepo ¶
UpdateRepo updates the named repo
func (*Client) VagrantSearch ¶
func (c *Client) VagrantSearch(name string) (files []AQLFileInfo, e error)
VagrantSearch searches for vagrant images
type ClientConfig ¶
type ClientConfig struct { BaseURL string Username string Password string Token string AuthMethod string VerifySSL bool Client *http.Client Transport *http.Transport }
ClientConfig is the configuration for an ArtifactoryClient
type CreatedStorageItem ¶
type CreatedStorageItem struct { URI string `json:"uri"` DownloadURI string `json:"downloadUri"` Repo string `json:"repo"` Created string `json:"created"` CreatedBy string `json:"createdBy"` Size string `json:"size"` MimeType string `json:"mimeType"` Checksums ArtifactChecksums `json:"checksums"` OriginalChecksums ArtifactChecksums `json:"originalChecksums"` }
CreatedStorageItem represents a created storage item in artifactory
type ErrorsJSON ¶
type ErrorsJSON struct { Errors []ErrorJSON `json:"errors,omitempty"` Error string `json:"error,omitempty"` }
ErrorsJSON represents a group of error messages returned by the artifactory api
type FileInfo ¶
type FileInfo struct { URI string `json:"uri"` DownloadURI string `json:"downloadUri"` Repo string `json:"repo"` Path string `json:"path"` RemoteURL string `json:"remoteUrl,omitempty"` Created string `json:"created"` CreatedBy string `json:"createdBy"` LastModified string `json:"lastModified"` ModifiedBy string `json:"modifiedBy"` MimeType string `json:"mimeType"` Size string `json:"size"` Properties ArtifactProperties `json:"properties"` Checksums struct { SHA1 string `json:"sha1"` MD5 string `json:"md5"` } `json:"checksums"` OriginalChecksums struct { SHA1 string `json:"sha1"` MD5 string `json:"md5"` } `json:"originalChecksums,omitempty"` }
FileInfo represents the json returned by the artifactory API for a file
type FileList ¶
type FileList struct { URI string `json:"uri"` Created string `json:"created"` Files []FileListItem `json:"files"` }
FileList represents a list of files
type FileListItem ¶
type FileListItem struct { URI string `json:"uri"` Size int `json:"size"` LastModified string `json:"lastModified"` Folder bool `json:"folder"` SHA1 string `json:"sha1"` }
FileListItem is an item in a list of files
type GAVC ¶
type GAVC struct { GroupID string ArtifactID string Version string Classifier string Repos []string }
GAVC represents a GAVC search
type GavcSearchResults ¶
type GavcSearchResults struct {
Results []FileInfo `json:"results"`
}
GavcSearchResults represents gavc search results
type GenericRepoConfig ¶
type GenericRepoConfig struct { Key string `json:"key,omitempty"` RClass string `json:"rclass"` PackageType string `json:"packageType,omitempty"` Description string `json:"description,omitempty"` Notes string `json:"notes,omitempty"` IncludesPattern string `json:"includesPattern,omitempty"` ExcludesPattern string `json:"excludesPattern,omitempty"` HandleReleases bool `json:"handleReleases,omitempty"` HandleSnapshots bool `json:"handleSnapshots,omitempty"` MaxUniqueSnapshots int `json:"maxUniqueSnapshots,omitempty"` SuppressPomConsistencyChecks bool `json:"supressPomConsistencyChecks,omitempty"` BlackedOut bool `json:"blackedOut,omitempty"` PropertySets []string `json:"propertySets,omitempty"` }
GenericRepoConfig represents the common json of a repo response from artifactory
func (GenericRepoConfig) MimeType ¶
func (r GenericRepoConfig) MimeType() string
MimeType returns the MimeType of a GenericRepoConfig
type GroupDetails ¶
type GroupDetails struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` AutoJoin bool `json:"autoJoin,omitempty"` Realm string `json:"realm,omitempty"` RealmAttributes string `json:"realmAttributes,omitempty"` }
GroupDetails represents the json response for a group's details in artifactory
type LicenseInformation ¶
type LicenseInformation struct { LicenseType string `json:"type"` ValidThrough string `json:"validThrough"` LicensedTo string `json:"licensedTo"` }
LicenseInformation represents the json response from artifactory for license information
type LocalRepoConfig ¶
type LocalRepoConfig struct { GenericRepoConfig LayoutRef string `json:"repoLayoutRef,omitempty"` DebianTrivialLayout bool `json:"debianTrivialLayout,omitempty"` ChecksumPolicyType string `json:"checksumPolicyType,omitempty"` SnapshotVersionBehavior string `json:"snapshotVersionBehavior,omitempty"` ArchiveBrowsingEnabled bool `json:"archiveBrowsingEnabled,omitempty"` CalculateYumMetadata bool `json:"calculateYumMetadata,omitempty"` YumRootDepth int `json:"yumRootDepth,omitempty"` }
LocalRepoConfig represents a local repo type in artifactory
func (LocalRepoConfig) MimeType ¶
func (r LocalRepoConfig) MimeType() string
MimeType returns the MimeType for a local repo in artifactory
type PermissionTarget ¶
PermissionTarget represents the json returned by Artifactory for a permission target
type PermissionTargetDetails ¶
type PermissionTargetDetails struct { Name string `json:"name,omitempty"` IncludesPattern string `json:"includesPattern,omitempty"` ExcludesPattern string `json:"excludesPattern,omitempty"` Repositories []string `json:"repositories,omitempty"` Principals Principals `json:"principals,omitempty"` }
PermissionTargetDetails represents the json returned by Artifactory for permission target details
type Principals ¶
type Principals struct { Users map[string][]string `json:"users"` Groups map[string][]string `json:"groups"` }
Principals represents the json response for principals in Artifactory
type RemoteRepoConfig ¶
type RemoteRepoConfig struct { GenericRepoConfig URL string `json:"url"` Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` Proxy string `json:"proxy,omitempty"` RemoteRepoChecksumPolicyType string `json:"remoteRepoChecksumPolicyType,omitempty"` HardFail bool `json:"hardFail,omitempty"` Offline bool `json:"offline,omitempty"` StoreArtifactsLocally bool `json:"storeArtifactsLocally,omitempty"` SocketTimeoutMillis int `json:"socketTimeoutMillis,omitempty"` LocalAddress string `json:"localAddress,omitempty"` RetrivialCachePeriodSecs int `json:"retrievalCachePeriodSecs,omitempty"` FailedRetrievalCachePeriodSecs int `json:"failedRetrievalCachePeriodSecs,omitempty"` MissedRetrievalCachePeriodSecs int `json:"missedRetrievalCachePeriodSecs,omitempty"` UnusedArtifactsCleanupEnabled bool `json:"unusedArtifactCleanupEnabled,omitempty"` UnusedArtifactsCleanupPeriodHours int `json:"unusedArtifactCleanupPeriodHours,omitempty"` FetchJarsEagerly bool `json:"fetchJarsEagerly,omitempty"` SynchronizeProperties bool `json:"synchronizeProperties,omitempty"` AllowAnyHostAuth bool `json:"allowAnyHostAuth,omitempty"` EnableCookieManagement bool `json:"enableCookieManagement,omitempty"` BowerRegistryURL string `json:"bowerRegistryUrl,omitempty"` VcsType string `json:"vcsType,omitempty"` VcsGitProvider string `json:"vcsGitProvider,omitempty"` VcsGitDownloader string `json:"vcsGitDownloader,omitempty"` }
RemoteRepoConfig represents a remote repo in artifactory
func (RemoteRepoConfig) MimeType ¶
func (r RemoteRepoConfig) MimeType() string
MimeType returns the mimetype of a remote repo
type Repo ¶
type Repo struct { Key string `json:"key"` Rtype string `json:"type"` Description string `json:"description,omitempty"` URL string `json:"url,omitempty"` }
Repo represents the json response from Artifactory describing a repository
type RepoConfig ¶
type RepoConfig interface {
MimeType() string
}
RepoConfig represents a repo config
type Request ¶
type Request struct { Verb string Path string ContentType string Accept string QueryParams map[string]string Body io.Reader }
Request represents an artifactory http request
type UserAPIKey ¶
type UserAPIKey struct {
APIKey string `json:"apiKey"`
}
UserAPIKey represents the JSON returned for a user's API Key in Artifactory
type UserDetails ¶
type UserDetails struct { Name string `json:"name,omitempty"` Email string `json:"email"` Password string `json:"password"` Admin bool `json:"admin,omitempty"` ProfileUpdatable bool `json:"profileUpdatable,omitempty"` InternalPasswordDisabled bool `json:"internalPasswordDisabled,omitempty"` LastLoggedIn string `json:"lastLoggedIn,omitempty"` Realm string `json:"realm,omitempty"` Groups []string `json:"groups,omitempty"` }
UserDetails represents the details of a user in artifactory
type VirtualRepoConfig ¶
type VirtualRepoConfig struct { GenericRepoConfig Repositories []string `json:"repositories"` DebianTrivialLayout bool `json:"debianTrivialLayout,omitempty"` ArtifactoryRequestsCanRetrieveRemoteArtifacts bool `json:"artifactoryRequestsCanRetrieveRemoteArtifacts,omitempty"` KeyPair string `json:"keyPair,omitempty"` PomRepositoryReferenceCleanupPolicy string `json:"pomRepositoryReferenceCleanupPolicy,omitempty"` }
VirtualRepoConfig represents a virtual repo in artifactory
func (VirtualRepoConfig) MimeType ¶
func (r VirtualRepoConfig) MimeType() string
MimeType returns the mimetype for a virtual repo in artifactory