Documentation
¶
Index ¶
- Constants
- Variables
- func Delete(c *Client, path string) (int, string, error)
- func GenerateRandomPassword() string
- func Get(c *Client, path string, options map[string]string) ([]byte, int, string, error)
- func Put(c *Client, path string, data []byte, options map[string]string) ([]byte, int, string, error)
- type Client
- func (c *Client) CleanupRepository(reqName string, repoType string, namespace string) error
- func (c *Client) CreatePermission(reqName string, repoType string, namespace string, users []string, ...) error
- func (c *Client) CreateRepositories(repoName string, repoType string, namespace string, statusCode int) (int, string, error)
- func (c *Client) CreateRepositoryUser(reqName string) (string, int, string, error)
- type ClientConfig
- type ErrorJSON
- type ErrorsJSON
- type GenericRepoConfig
- type LocalRepoConfig
- type PermissionTarget
- type PermissionTargetDetails
- type Principals
- type RTFactory
- func (R RTFactory) CreatePermissionTarget(c *Client, key string, p PermissionTargetDetails, q map[string]string) (int, string, error)
- func (R RTFactory) CreateRepo(c *Client, key string, r RepositoryConfig, q map[string]string) (int, string, error)
- func (R RTFactory) CreateUser(c *Client, key string, u UserDetails, q map[string]string) (int, string, error)
- func (R RTFactory) DeletePermissionTarget(c *Client, key string) (int, string, error)
- func (R RTFactory) DeleteRepo(c *Client, key string) (int, string, error)
- func (R RTFactory) DeleteUser(c *Client, key string) (int, string, error)
- func (R RTFactory) GetLocalRepo(c *Client, key string, q map[string]string) (RepositoryConfig, int, string, error)
- func (R RTFactory) GetPermissionTargetDetails(c *Client, key string, q map[string]string) (PermissionTargetDetails, int, string, error)
- func (R RTFactory) GetRemoteRepos(c *Client, packageType string) ([]RemoteRepo, int, string, error)
- func (R RTFactory) GetUser(c *Client, key string, q map[string]string) (RepositoryUser, int, string, error)
- func (R RTFactory) GetVirtualRepo(c *Client, key string, q map[string]string) (RepositoryConfig, int, string, error)
- type RemoteRepo
- type RemoteRepoConfig
- type Repo
- type RepositoryConfig
- type RepositoryUser
- type Request
- type User
- type UserAPIKey
- type UserDetails
- type VirtualRepoConfig
Constants ¶
const LocalRepoMimeType string = "application/vnd.org.jfrog.artifactory.repositories.LocalRepositoryConfiguration+json"
LocalRepoMimeType is the mimetype for a local repo
const RemoteRepoMimeType string = "application/vnd.org.jfrog.artifactory.repositories.RemoteRepositoryConfiguration+json"
RemoteRepoMimeType is the mimetype for a remote repo
const VERSION = "6.12.2"
VERSION : Artifactory version
const VirtualRepoMimeType string = "application/vnd.org.jfrog.artifactory.repositories.VirtualRepositoryConfiguration+json"
VirtualRepoMimeType is the mimetype for a virtual repo
Variables ¶
var Code int
var Status string
Functions ¶
func GenerateRandomPassword ¶
func GenerateRandomPassword() string
GenerateRandomPassword : Generates a Random password for internal user
Types ¶
type Client ¶
type Client struct { Client *http.Client Config *ClientConfig Transport *http.Transport // contains filtered or unexported fields }
Client is a client for interacting with REPOSITORY
func NewClient ¶
func NewClient(config *ClientConfig) Client
NewClient returns a new REPOSITORY Client with the provided ClientConfig
func NewRepositoryClient ¶
func NewRepositoryClient() *Client
NewRepositoryClient : Create new repository client from environment variable
func (*Client) CleanupRepository ¶
CleanupRepository : It clean-up everything related to repositories
func (*Client) CreatePermission ¶
func (c *Client) CreatePermission(reqName string, repoType string, namespace string, users []string, repositories []string) error
CreatePermission : Create permission object
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 REPOSITORY Client
type ErrorsJSON ¶
type ErrorsJSON struct { Errors []ErrorJSON `json:"errors,omitempty"` Error string `json:"error,omitempty"` }
ErrorsJSON : Struct
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"` LayoutRef string `json:"repoLayoutRef,omitempty"` HandleReleases *bool `json:"handleReleases,omitempty"` HandleSnapshots *bool `json:"handleSnapshots,omitempty"` MaxUniqueSnapshots int `json:"maxUniqueSnapshots,omitempty"` SuppressPomConsistencyChecks bool `json:"suppressPomConsistencyChecks,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 LocalRepoConfig ¶
type LocalRepoConfig struct { GenericRepoConfig DebianTrivialLayout bool `json:"debianTrivialLayout,omitempty"` ChecksumPolicyType string `json:"checksumPolicyType,omitempty"` MaxUniqueTags int `json:"maxUniqueTags,omitempty"` SnapshotVersionBehavior string `json:"snapshotVersionBehavior,omitempty"` ArchiveBrowsingEnabled bool `json:"archiveBrowsingEnabled,omitempty"` CalculateYumMetadata bool `json:"calculateYumMetadata,omitempty"` YumRootDepth int `json:"yumRootDepth,omitempty"` DockerAPIVersion string `json:"dockerApiVersion,omitempty"` EnableFileListsIndexing bool `json:"enableFileListsIndexing,omitempty"` XrayIndex bool `json:"xrayIndex,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 RTFactory ¶
type RTFactory struct {
// contains filtered or unexported fields
}
func (RTFactory) CreatePermissionTarget ¶
func (R RTFactory) CreatePermissionTarget(c *Client, key string, p PermissionTargetDetails, q map[string]string) (int, string, error)
CreatePermissionTarget creates the named permission target
func (RTFactory) CreateRepo ¶
func (R RTFactory) CreateRepo(c *Client, key string, r RepositoryConfig, q map[string]string) (int, string, error)
CreateRepo creates the named repo
func (RTFactory) CreateUser ¶
func (R RTFactory) CreateUser(c *Client, key string, u UserDetails, q map[string]string) (int, string, error)
CreateUser creates a user with the specified details
func (RTFactory) DeletePermissionTarget ¶
DeletePermissionTarget : Delete permission target
func (RTFactory) DeleteRepo ¶
DeleteRepo creates the named repo
func (RTFactory) DeleteUser ¶
DeleteUser deletes a user
func (RTFactory) GetLocalRepo ¶
func (R RTFactory) GetLocalRepo(c *Client, key string, q map[string]string) (RepositoryConfig, int, string, error)
GetLocalRepo returns the named local repo
func (RTFactory) GetPermissionTargetDetails ¶
func (R RTFactory) GetPermissionTargetDetails(c *Client, key string, q map[string]string) (PermissionTargetDetails, int, string, error)
GetPermissionTargetDetails : get details about the permission target
func (RTFactory) GetRemoteRepos ¶
GetRemoteRepos returns all repos of the provided type
type RemoteRepo ¶
type RemoteRepo struct { Key string `json:"key"` Rtype string `json:"type"` URL string `json:"url,omitempty"` PackageType string `json:"packagetype,omitempty"` }
RemoteRepo : Repo represents the json response from Artifactory describing a repository
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"` FetchSourcesEagerly bool `json:"fetchSourcesEagerly,omitempty"` SynchronizeProperties bool `json:"synchronizeProperties,omitempty"` BlockMismatchingMimeTypes bool `json:"blockMismatchingMimeTypes,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"` ClientTLSCertificate string `json:"clientTlsCertificate,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 RepositoryConfig ¶
type RepositoryConfig interface {
MimeType() string
}
RepositoryConfig represents a repo config
type RepositoryUser ¶
type RepositoryUser struct { Name string `json:"name"` Email string `json:"email"` Admin bool `json:"admin"` ProfileUpdatable bool `json:"profileUpdatable"` InternalPasswordDisabled bool `json:"internalPasswordDisabled"` Groups []string `json:"groups"` LastLoggedIn time.Time `json:"lastLoggedIn"` LastLoggedInMillis int `json:"lastLoggedInMillis"` Realm string `json:"realm"` OfflineMode bool `json:"offlineMode"` DisableUIAccess bool `json:"disableUIAccess"` }
RepositoryUser struct
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"` DisableUIAccess bool `json:"disableUIAccess,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"` PomRepositoryReferencesCleanupPolicy string `json:"pomRepositoryReferencesCleanupPolicy,omitempty"` DefaultDeploymentRepo string `json:"defaultDeploymentRepo,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