Documentation ¶
Index ¶
- Constants
- func AddAuthHeaders(headers map[string]string, artifactoryDetails auth.ArtifactoryDetails)
- func AddChecksumHeaders(headers map[string]string, fileDetails *fileutils.FileDetails)
- func AddHeader(headerName, headerValue string, headers *map[string]string)
- func BuildArtifactoryUrl(baseUrl, path string, params map[string]string) (string, error)
- func CreateAqlQueryForNpm(npmName, npmVersion string) string
- func ExecAql(aqlQuery string, flags CommonConf) ([]byte, error)
- func GetBuildNameAndNumberFromArtifactory(buildName, buildNumber string, flags CommonConf) (string, string, error)
- func IsSubPath(paths []string, index int, separator string) bool
- func IsWildcardPattern(pattern string) bool
- func LogSearchResults(numOfArtifacts int)
- func SetContentType(contentType string, headers *map[string]string)
- func UploadFile(localPath, url, logMsgPrefix string, ...) (*http.Response, []byte, error)
- func WildcardToDirsPath(deletePattern, searchResult string) (string, error)
- type Aql
- type AqlSearchResult
- type AqlSearchResultItemFilter
- type ArtifactoryCommonParams
- func (params *ArtifactoryCommonParams) GetAql() Aql
- func (params ArtifactoryCommonParams) GetArchiveEntries() string
- func (params *ArtifactoryCommonParams) GetBuild() string
- func (params *ArtifactoryCommonParams) GetExcludePatterns() []string
- func (params *ArtifactoryCommonParams) GetExcludeProps() string
- func (params *ArtifactoryCommonParams) GetLimit() int
- func (params *ArtifactoryCommonParams) GetOffset() int
- func (params *ArtifactoryCommonParams) GetPattern() string
- func (params *ArtifactoryCommonParams) GetProps() string
- func (params *ArtifactoryCommonParams) GetSortBy() []string
- func (params *ArtifactoryCommonParams) GetSortOrder() string
- func (params ArtifactoryCommonParams) GetSpecType() (specType SpecType)
- func (params *ArtifactoryCommonParams) GetTarget() string
- func (params *ArtifactoryCommonParams) IsExplode() bool
- func (params ArtifactoryCommonParams) IsIncludeDirs() bool
- func (params *ArtifactoryCommonParams) IsRecursive() bool
- func (params *ArtifactoryCommonParams) IsRegexp() bool
- func (params *ArtifactoryCommonParams) SetArchiveEntries(archiveEntries string)
- func (params *ArtifactoryCommonParams) SetExcludeProps(excludeProps string)
- func (params *ArtifactoryCommonParams) SetPattern(pattern string)
- func (params *ArtifactoryCommonParams) SetProps(props string)
- func (params *ArtifactoryCommonParams) SetTarget(target string)
- type CommonConf
- type CommonConfImpl
- type ErrorsQueue
- type FileGetter
- type FileHashes
- type FileInfo
- type Properties
- type Property
- type PropertyParseOptions
- type RepoPathFile
- type RequiredArtifactProps
- type ResultItem
- func FilterBottomChainResults(paths map[string]ResultItem, pathsKeys []string) []ResultItem
- func FilterTopChainResults(paths map[string]ResultItem, pathsKeys []string) []ResultItem
- func ReduceDirResult(searchResults []ResultItem, resultsFilter AqlSearchResultItemFilter) []ResultItem
- func SearchBySpecWithAql(specFile *ArtifactoryCommonParams, flags CommonConf, ...) ([]ResultItem, error)
- func SearchBySpecWithPattern(specFile *ArtifactoryCommonParams, flags CommonConf, ...) ([]ResultItem, error)
- type SpecType
Constants ¶
const ( ARTIFACTORY_SYMLINK = "symlink.dest" SYMLINK_SHA1 = "symlink.destsha1" Latest = "LATEST" LastRelease = "LAST_RELEASE" )
Variables ¶
This section is empty.
Functions ¶
func AddAuthHeaders ¶
func AddAuthHeaders(headers map[string]string, artifactoryDetails auth.ArtifactoryDetails)
func AddChecksumHeaders ¶
func AddChecksumHeaders(headers map[string]string, fileDetails *fileutils.FileDetails)
func BuildArtifactoryUrl ¶
func CreateAqlQueryForNpm ¶
noinspection GoUnusedExportedFunction
func GetBuildNameAndNumberFromArtifactory ¶ added in v0.3.1
func GetBuildNameAndNumberFromArtifactory(buildName, buildNumber string, flags CommonConf) (string, string, error)
func IsSubPath ¶
@paths - sorted array @index - index of the current path which we want to check if it a prefix of any of the other previous paths @separator - file separator returns true paths[index] is a prefix of any of the paths[i] where i<index , otherwise returns false
func IsWildcardPattern ¶
func LogSearchResults ¶
func LogSearchResults(numOfArtifacts int)
func SetContentType ¶
func UploadFile ¶
func UploadFile(localPath, url, logMsgPrefix string, artifactoryDetails *auth.ArtifactoryDetails, details *fileutils.FileDetails, httpClientsDetails httputils.HttpClientDetails, client *rthttpclient.ArtifactoryHttpClient, retries int, progress io.Progress) (*http.Response, []byte, error)
func WildcardToDirsPath ¶
Types ¶
type AqlSearchResult ¶
type AqlSearchResult struct {
Results []ResultItem
}
type AqlSearchResultItemFilter ¶
type AqlSearchResultItemFilter func(map[string]ResultItem, []string) []ResultItem
type ArtifactoryCommonParams ¶
type ArtifactoryCommonParams struct { Aql Aql Pattern string ExcludePatterns []string Target string Props string ExcludeProps string SortOrder string SortBy []string Offset int Limit int Build string Recursive bool IncludeDirs bool Regexp bool ArchiveEntries string }
func (*ArtifactoryCommonParams) GetAql ¶
func (params *ArtifactoryCommonParams) GetAql() Aql
func (ArtifactoryCommonParams) GetArchiveEntries ¶
func (params ArtifactoryCommonParams) GetArchiveEntries() string
func (*ArtifactoryCommonParams) GetBuild ¶
func (params *ArtifactoryCommonParams) GetBuild() string
func (*ArtifactoryCommonParams) GetExcludePatterns ¶
func (params *ArtifactoryCommonParams) GetExcludePatterns() []string
func (*ArtifactoryCommonParams) GetExcludeProps ¶ added in v0.5.0
func (params *ArtifactoryCommonParams) GetExcludeProps() string
func (*ArtifactoryCommonParams) GetLimit ¶
func (params *ArtifactoryCommonParams) GetLimit() int
func (*ArtifactoryCommonParams) GetOffset ¶
func (params *ArtifactoryCommonParams) GetOffset() int
func (*ArtifactoryCommonParams) GetPattern ¶
func (params *ArtifactoryCommonParams) GetPattern() string
func (*ArtifactoryCommonParams) GetProps ¶
func (params *ArtifactoryCommonParams) GetProps() string
func (*ArtifactoryCommonParams) GetSortBy ¶
func (params *ArtifactoryCommonParams) GetSortBy() []string
func (*ArtifactoryCommonParams) GetSortOrder ¶
func (params *ArtifactoryCommonParams) GetSortOrder() string
func (ArtifactoryCommonParams) GetSpecType ¶
func (params ArtifactoryCommonParams) GetSpecType() (specType SpecType)
func (*ArtifactoryCommonParams) GetTarget ¶
func (params *ArtifactoryCommonParams) GetTarget() string
func (*ArtifactoryCommonParams) IsExplode ¶
func (params *ArtifactoryCommonParams) IsExplode() bool
func (ArtifactoryCommonParams) IsIncludeDirs ¶
func (params ArtifactoryCommonParams) IsIncludeDirs() bool
func (*ArtifactoryCommonParams) IsRecursive ¶
func (params *ArtifactoryCommonParams) IsRecursive() bool
func (*ArtifactoryCommonParams) IsRegexp ¶
func (params *ArtifactoryCommonParams) IsRegexp() bool
func (*ArtifactoryCommonParams) SetArchiveEntries ¶
func (params *ArtifactoryCommonParams) SetArchiveEntries(archiveEntries string)
func (*ArtifactoryCommonParams) SetExcludeProps ¶ added in v0.5.0
func (params *ArtifactoryCommonParams) SetExcludeProps(excludeProps string)
func (*ArtifactoryCommonParams) SetPattern ¶
func (params *ArtifactoryCommonParams) SetPattern(pattern string)
func (*ArtifactoryCommonParams) SetProps ¶
func (params *ArtifactoryCommonParams) SetProps(props string)
func (*ArtifactoryCommonParams) SetTarget ¶
func (params *ArtifactoryCommonParams) SetTarget(target string)
type CommonConf ¶
type CommonConf interface { GetArtifactoryDetails() auth.ArtifactoryDetails SetArtifactoryDetails(rt auth.ArtifactoryDetails) GetJfrogHttpClient() (*rthttpclient.ArtifactoryHttpClient, error) IsDryRun() bool }
type CommonConfImpl ¶
type CommonConfImpl struct { DryRun bool // contains filtered or unexported fields }
func (*CommonConfImpl) GetArtifactoryDetails ¶
func (flags *CommonConfImpl) GetArtifactoryDetails() auth.ArtifactoryDetails
func (*CommonConfImpl) GetJfrogHttpClient ¶
func (flags *CommonConfImpl) GetJfrogHttpClient() (*rthttpclient.ArtifactoryHttpClient, error)
func (*CommonConfImpl) IsDryRun ¶
func (flags *CommonConfImpl) IsDryRun() bool
func (*CommonConfImpl) SetArtifactoryDetails ¶
func (flags *CommonConfImpl) SetArtifactoryDetails(rt auth.ArtifactoryDetails)
type ErrorsQueue ¶
type ErrorsQueue struct {
// contains filtered or unexported fields
}
func NewErrorsQueue ¶
func NewErrorsQueue(size int) *ErrorsQueue
func (*ErrorsQueue) AddError ¶
func (errQueue *ErrorsQueue) AddError(err error)
func (*ErrorsQueue) GetError ¶
func (errQueue *ErrorsQueue) GetError() error
type FileGetter ¶
type FileGetter interface { GetAql() Aql GetPattern() string SetPattern(pattern string) GetExcludePatterns() []string GetTarget() string SetTarget(target string) IsExplode() bool GetProps() string GetSortOrder() string GetSortBy() []string GetOffset() int GetLimit() int GetBuild() string GetSpecType() (specType SpecType) IsRegexp() bool IsRecursive() bool IsIncludeDirs() bool GetArchiveEntries() string SetArchiveEntries(archiveEntries string) }
type FileHashes ¶
type FileInfo ¶
type FileInfo struct { *FileHashes LocalPath string `json:"localPath,omitempty"` ArtifactoryPath string `json:"artifactoryPath,omitempty"` }
func FlattenFileInfoArray ¶ added in v0.1.1
func (*FileInfo) ToBuildArtifacts ¶
type Properties ¶
type Properties struct {
Properties []Property
}
func ParseProperties ¶
func ParseProperties(propStr string, option PropertyParseOptions) (*Properties, error)
Parsing properties string to Properties struct.
func (*Properties) ToBuildPromoteMap ¶ added in v0.3.3
func (props *Properties) ToBuildPromoteMap() map[string][]string
Convert properties from Slice to map that build promotion REST API requires
func (*Properties) ToEncodedString ¶
func (props *Properties) ToEncodedString() string
func (*Properties) ToHeadersMap ¶
func (props *Properties) ToHeadersMap() map[string]string
type PropertyParseOptions ¶
type PropertyParseOptions int
const ( // Parsing properties SplitCommas PropertyParseOptions = iota JoinCommas )
type RepoPathFile ¶ added in v0.5.0
type RepoPathFile struct {
// contains filtered or unexported fields
}
We need to translate the provided download pattern to an AQL query. In Artifactory, for each artifact the name and path of the artifact are saved separately. We therefore need to build an AQL query that covers all possible repositories, paths and names the provided pattern can include. For example, the pattern repo/a/* can include the two following file: repo/a/file1.tgz and also repo/a/b/file2.tgz To achieve that, this function parses the pattern by splitting it by its * characters. The end result is a list of RepoPathFile structs. Each struct represent a possible repository, path and file name triple to be included in AQL query with an "or" relationship.
type RequiredArtifactProps ¶
type RequiredArtifactProps int
const ( ALL RequiredArtifactProps = iota SYMLINK NONE )
This enum defines which properties are required in the result of the aql. For example, when performing a copy/move command - the props are not needed, so we set RequiredArtifactProps to NONE.
type ResultItem ¶
type ResultItem struct { Repo string Path string Name string Actual_Md5 string Actual_Sha1 string Size int64 Properties []Property Type string }
func FilterBottomChainResults ¶
func FilterBottomChainResults(paths map[string]ResultItem, pathsKeys []string) []ResultItem
func FilterTopChainResults ¶
func FilterTopChainResults(paths map[string]ResultItem, pathsKeys []string) []ResultItem
func ReduceDirResult ¶
func ReduceDirResult(searchResults []ResultItem, resultsFilter AqlSearchResultItemFilter) []ResultItem
Reduce Dir results by using the resultsFilter
func SearchBySpecWithAql ¶ added in v0.2.0
func SearchBySpecWithAql(specFile *ArtifactoryCommonParams, flags CommonConf, requiredArtifactProps RequiredArtifactProps) ([]ResultItem, error)
Use this function when running Aql with pattern
func SearchBySpecWithPattern ¶ added in v0.2.0
func SearchBySpecWithPattern(specFile *ArtifactoryCommonParams, flags CommonConf, requiredArtifactProps RequiredArtifactProps) ([]ResultItem, error)
Perform search by pattern.
func (ResultItem) GetItemRelativePath ¶
func (item ResultItem) GetItemRelativePath() string
func (*ResultItem) ToArtifact ¶
func (item *ResultItem) ToArtifact() buildinfo.Artifact
func (*ResultItem) ToDependency ¶
func (item *ResultItem) ToDependency() buildinfo.Dependency