utils

package
v1.41.2-prerelease7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2024 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ArtifactorySymlink   = "symlink.dest"
	SymlinkSha1          = "symlink.destsha1"
	LatestBuildNumberKey = "LATEST"
)
View Source
const (

	// Sizes and limits constants
	MaxMultipartUploadFileSize       = SizeTiB * 5
	DefaultUploadChunkSize     int64 = SizeMiB * 20
)
View Source
const (
	SizeKib int64 = 1 << 10
	SizeMiB int64 = 1 << 20
	SizeGiB int64 = 1 << 30
	SizeTiB int64 = 1 << 40
)

Variables

This section is empty.

Functions

func AddAuthHeaders

func AddAuthHeaders(headers map[string]string, artifactoryDetails auth.ServiceDetails)

func AddChecksumHeaders

func AddChecksumHeaders(headers map[string]string, fileDetails *fileutils.FileDetails)

func AddHeader

func AddHeader(headerName, headerValue string, headers *map[string]string)

func AddSigningKeyNameHeader

func AddSigningKeyNameHeader(keyName string, headers *map[string]string)

func BuildQueryFromSpecFile

func BuildQueryFromSpecFile(specFile *CommonParams, requiredArtifactProps RequiredArtifactProps) string

Creates an aql query from a spec file.

func ConvertArtifactsDetailsToBuildInfoArtifacts

func ConvertArtifactsDetailsToBuildInfoArtifacts(artifactsDetailsReader *content.ContentReader) ([]buildinfo.Artifact, error)

func ConvertArtifactsDetailsToBuildInfoDependencies

func ConvertArtifactsDetailsToBuildInfoDependencies(artifactsDetailsReader *content.ContentReader) ([]buildinfo.Dependency, error)

func ConvertIntToStorageSizeString

func ConvertIntToStorageSizeString(num int64) string

func CreateAqlBodyForSpecWithPattern

func CreateAqlBodyForSpecWithPattern(params *CommonParams) (string, error)

Returns an AQL body string to search file in Artifactory by pattern, according the specified arguments requirements.

func CreateAqlQueryForBuildInfoJson

func CreateAqlQueryForBuildInfoJson(project, buildName, buildNumber, timestamp string) string

noinspection GoUnusedExportedFunction

func CreateAqlQueryForLatestCreated

func CreateAqlQueryForLatestCreated(repo, path string) string

func CreateAqlQueryForPypi

func CreateAqlQueryForPypi(repo, file string) string

func CreateAqlQueryForYarn

func CreateAqlQueryForYarn(npmName, npmVersion string) string

noinspection GoUnusedExportedFunction

func DisableAccelBuffering

func DisableAccelBuffering(headers *map[string]string)

func DisableTransitiveSearchIfNotAllowed

func DisableTransitiveSearchIfNotAllowed(params *CommonParams, artifactoryVersion *version.Version)

func ExecAql

func ExecAql(aqlQuery string, flags CommonConf) (io.ReadCloser, error)

func ExecAqlSaveToFile

func ExecAqlSaveToFile(aqlQuery string, flags CommonConf) (reader *content.ContentReader, err error)

func FilterBottomChainResults

func FilterBottomChainResults(readerRecord SearchBasedContentItem, reader *content.ContentReader) (resultReader *content.ContentReader, err error)

func FilterCandidateToBeDeleted

func FilterCandidateToBeDeleted(deleteCandidates *content.ContentReader, resultWriter *content.ContentWriter, candidateType string) ([]*content.ContentReader, error)

func FilterResultsByBuild

func FilterResultsByBuild(specFile *CommonParams, flags CommonConf, requiredArtifactProps RequiredArtifactProps, reader *content.ContentReader) (*content.ContentReader, error)

Filter the results by build, if no build found or items to filter, nil will be returned.

func FilterTopChainResults

func FilterTopChainResults(readerRecord SearchBasedContentItem, reader *content.ContentReader) (resultReader *content.ContentReader, err error)

Reduce the amount of items by saving only the shortest item path for each unique path e.g.: a | a/b | c | e/f -> a | c | e/f

func GetBuildInfo

func GetBuildInfo(buildName, buildNumber, projectKey string, flags CommonConf) (pbi *buildinfo.PublishedBuildInfo, found bool, err error)

func GetBuildInfoRepositoryByProject

func GetBuildInfoRepositoryByProject(projectKey string) string

func GetBuildNameAndNumberFromArtifactory

func GetBuildNameAndNumberFromArtifactory(buildName, buildNumber, projectKey string, flags CommonConf) (string, string, error)

func GetBuildNameAndNumberFromBuildIdentifier

func GetBuildNameAndNumberFromBuildIdentifier(buildIdentifier, projectKey string, flags CommonConf) (string, string, error)

This method parses buildIdentifier. buildIdentifier should be from the format "buildName/buildNumber". If no buildNumber provided LATEST will be downloaded. If buildName or buildNumber contains "/" (slash) it should be escaped by "\" (backslash). Result examples of parsing: "aaa/123" > "aaa"-"123", "aaa" > "aaa"-"LATEST", "aaa\\/aaa" > "aaa/aaa"-"LATEST", "aaa/12\\/3" > "aaa"-"12/3".

func GetLatestBuildNumberFromArtifactory

func GetLatestBuildNumberFromArtifactory(buildName, projectKey string, flags CommonConf) (buildNumber string, err error)

func GetProjectQueryParam

func GetProjectQueryParam(projectKey string) string

func GetTestResourcesPath

func GetTestResourcesPath() string

func HasPrefix

func HasPrefix(paths []string, prefix string) bool

Returns true if one or more paths has a value of 'prefix' as a prefix

func IsSubPath

func IsSubPath(paths []string, index int, separator string) bool

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 IsWildcardPattern(pattern string) bool

func LogSearchResults

func LogSearchResults(numOfArtifacts int)

func ParseNameAndVersion

func ParseNameAndVersion(identifier string, useLatestPolicy bool) (string, string, error)

For builds (useLatestPolicy = true) - Parse build name and number. The build number can be LATEST if absent. For release bundles - Parse bundle name and version. For module - Parse module name and number.

func ReduceBottomChainDirResult

func ReduceBottomChainDirResult(readerRecord SearchBasedContentItem, searchResults *content.ContentReader) (*content.ContentReader, error)

func ReduceDirResult

func ReduceDirResult(readerRecord SearchBasedContentItem, searchResults *content.ContentReader, ascendingOrder bool, resultsFilter AqlSearchResultItemFilter) (reader *content.ContentReader, err error)

Reduce Dir results by using the resultsFilter.

func ReduceTopChainDirResult

func ReduceTopChainDirResult(readerRecord SearchBasedContentItem, searchResults *content.ContentReader) (*content.ContentReader, error)

func SearchBySpecWithAql

func SearchBySpecWithAql(specFile *CommonParams, flags CommonConf, requiredArtifactProps RequiredArtifactProps) (reader *content.ContentReader, err error)

Use this function when running Aql with pattern

func SearchBySpecWithBuild

func SearchBySpecWithBuild(specFile *CommonParams, flags CommonConf) (readerContent *content.ContentReader, err error)

Use this function when searching by build without pattern or aql. Collect build artifacts and build dependencies separately, then merge the results into one reader.

func SearchBySpecWithPattern

func SearchBySpecWithPattern(specFile *CommonParams, flags CommonConf, requiredArtifactProps RequiredArtifactProps) (*content.ContentReader, error)

Perform search by pattern.

func SetContentType

func SetContentType(contentType string, headers *map[string]string)

func SumIntArray

func SumIntArray(arr []int) int

func UploadFile

func UploadFile(localPath, url, logMsgPrefix string, artifactoryDetails *auth.ServiceDetails, details *fileutils.FileDetails,
	httpClientsDetails httputils.HttpClientDetails, client *jfroghttpclient.JfrogHttpClient, includeChecksums bool,
	progress clientio.ProgressMgr) (*http.Response, []byte, error)

func UploadFileFromReader

func UploadFileFromReader(reader io.Reader, url string, artifactoryDetails *auth.ServiceDetails, details *fileutils.FileDetails,
	httpClientsDetails httputils.HttpClientDetails, client *jfroghttpclient.JfrogHttpClient) (*http.Response, []byte, error)

func WildcardToDirsPath

func WildcardToDirsPath(deletePattern, searchResult string) (string, error)

func WriteCandidateDirsToBeDeleted

func WriteCandidateDirsToBeDeleted(candidateDirsReaders []*content.ContentReader, filesNotToBeDeleteReader *content.ContentReader, resultWriter *content.ContentWriter) (err error)

Write all the dirs to be deleted into 'resultWriter'. However, skip dirs with files(s) that should not be deleted. In order to accomplish this, we check if the dirs are a prefix of any artifact, witch means the folder contains the artifact and should not be deleted. Optimization: In order not to scan for each dir the entire artifact reader and see if it is a prefix or not, we rely on the fact that the dirs and artifacts are sorted. We have two sorted readers in ascending order, we will start scanning from the beginning of the lists and compare whether the folder is a prefix of the current artifact, in case this is true the dir should not be deleted and we can move on to the next dir, otherwise we have to continue to the next dir or artifact. To know this, we will choose to move on with the lexicographic largest between the two.

candidateDirsReaders - Sorted list of dirs to be deleted. filesNotToBeDeleteReader - Sorted files that should not be deleted. resultWriter - The filtered list of dirs to be deleted.

Types

type Aql

type Aql struct {
	ItemsFind string `json:"items.find"`
}

func (*Aql) UnmarshalJSON

func (aql *Aql) UnmarshalJSON(value []byte) error

type AqlSearchResult

type AqlSearchResult struct {
	Results []ResultItem
}

type ArtifactDetails

type ArtifactDetails struct {
	// Path of the artifact in Artifactory
	ArtifactoryPath string             `json:"artifactoryPath,omitempty"`
	Checksums       buildinfo.Checksum `json:"checksums,omitempty"`
}

func (*ArtifactDetails) ToBuildInfoArtifact

func (ad *ArtifactDetails) ToBuildInfoArtifact() (buildinfo.Artifact, error)

func (*ArtifactDetails) ToBuildInfoDependency

func (ad *ArtifactDetails) ToBuildInfoDependency() buildinfo.Dependency

type BinariesSummary

type BinariesSummary struct {
	BinariesCount  string `json:"binariesCount,omitempty"`
	BinariesSize   string `json:"binariesSize,omitempty"`
	ArtifactsSize  string `json:"artifactsSize,omitempty"`
	Optimization   string `json:"optimization,omitempty"`
	ItemsCount     string `json:"itemsCount,omitempty"`
	ArtifactsCount string `json:"artifactsCount,omitempty"`
}

type Build

type Build struct {
	BuildName   string `json:"buildName"`
	BuildNumber string `json:"buildNumber"`
}

type BundleReleaseNotes

type BundleReleaseNotes struct {
	Content string `json:"content"`
	Syntax  string `json:"syntax"`
}

type CommonConf

type CommonConf interface {
	GetArtifactoryDetails() auth.ServiceDetails
	GetJfrogHttpClient() *jfroghttpclient.JfrogHttpClient
}

func NewCommonConfImpl

func NewCommonConfImpl(artDetails auth.ServiceDetails) (CommonConf, error)

type CommonConfImpl

type CommonConfImpl struct {
	// contains filtered or unexported fields
}

func (*CommonConfImpl) GetArtifactoryDetails

func (flags *CommonConfImpl) GetArtifactoryDetails() auth.ServiceDetails

func (*CommonConfImpl) GetJfrogHttpClient

func (flags *CommonConfImpl) GetJfrogHttpClient() *jfroghttpclient.JfrogHttpClient

type CommonParams

type CommonParams struct {
	Aql              Aql
	PathMapping      PathMapping
	Pattern          string
	Exclusions       []string
	Target           string
	Props            string
	TargetProps      *Properties
	ExcludeProps     string
	SortOrder        string
	SortBy           []string
	Offset           int
	Limit            int
	Build            string
	Project          string
	ExcludeArtifacts bool
	IncludeDeps      bool
	Bundle           string
	Recursive        bool
	IncludeDirs      bool
	Regexp           bool
	Ant              bool
	ArchiveEntries   string
	Transitive       bool
	Include          []string
}

func (*CommonParams) GetAql

func (params *CommonParams) GetAql() Aql

func (CommonParams) GetArchiveEntries

func (params CommonParams) GetArchiveEntries() string

func (*CommonParams) GetBuild

func (params *CommonParams) GetBuild() string

func (*CommonParams) GetBundle

func (params *CommonParams) GetBundle() string

func (*CommonParams) GetExcludeProps

func (params *CommonParams) GetExcludeProps() string

func (*CommonParams) GetExclusions

func (params *CommonParams) GetExclusions() []string

func (*CommonParams) GetLimit

func (params *CommonParams) GetLimit() int

func (*CommonParams) GetOffset

func (params *CommonParams) GetOffset() int

func (*CommonParams) GetPattern

func (params *CommonParams) GetPattern() string

func (*CommonParams) GetPatternType

func (params *CommonParams) GetPatternType() clientutils.PatternType

func (*CommonParams) GetProject

func (params *CommonParams) GetProject() string

func (*CommonParams) GetProps

func (params *CommonParams) GetProps() string

func (*CommonParams) GetSortBy

func (params *CommonParams) GetSortBy() []string

func (*CommonParams) GetSortOrder

func (params *CommonParams) GetSortOrder() string

func (CommonParams) GetSpecType

func (params CommonParams) GetSpecType() (specType SpecType)

func (*CommonParams) GetTarget

func (params *CommonParams) GetTarget() string

func (*CommonParams) GetTargetProps

func (params *CommonParams) GetTargetProps() *Properties

func (CommonParams) IsIncludeDirs

func (params CommonParams) IsIncludeDirs() bool

func (*CommonParams) IsRecursive

func (params *CommonParams) IsRecursive() bool

func (*CommonParams) SetArchiveEntries

func (params *CommonParams) SetArchiveEntries(archiveEntries string)

func (*CommonParams) SetExcludeProps

func (params *CommonParams) SetExcludeProps(excludeProps string)

func (*CommonParams) SetPattern

func (params *CommonParams) SetPattern(pattern string)

func (*CommonParams) SetProps

func (params *CommonParams) SetProps(props string)

func (*CommonParams) SetTarget

func (params *CommonParams) SetTarget(target string)

func (*CommonParams) SetTargetProps

func (params *CommonParams) SetTargetProps(targetProps *Properties)

type FileInfo

type FileInfo struct {
	Uri          string `json:"uri,omitempty"`
	DownloadUri  string `json:"downloadUri,omitempty"`
	Repo         string `json:"repo,omitempty"`
	Path         string `json:"path,omitempty"`
	RemoteUrl    string `json:"remoteUrl,omitempty"`
	Created      string `json:"created,omitempty"`
	CreatedBy    string `json:"createdBy,omitempty"`
	LastModified string `json:"lastModified,omitempty"`
	ModifiedBy   string `json:"modifiedBy,omitempty"`
	LastUpdated  string `json:"lastUpdated,omitempty"`
	Size         string `json:"size,omitempty"`
	MimeType     string `json:"mimeType,omitempty"`
	Checksums    struct {
		Sha1   string `json:"sha1,omitempty"`
		Sha256 string `json:"sha256,omitempty"`
		Md5    string `json:"md5,omitempty"`
	} `json:"checksums,omitempty"`
}

type FileListFile

type FileListFile struct {
	Uri                string             `json:"uri,omitempty"`
	Size               json.Number        `json:"size,omitempty"`
	LastModified       string             `json:"lastModified,omitempty"`
	Folder             bool               `json:"folder,omitempty"`
	Sha1               string             `json:"sha1,omitempty"`
	Sha2               string             `json:"sha2,omitempty"`
	MetadataTimestamps MetadataTimestamps `json:"mdTimestamps,omitempty"`
}

type FileListParams

type FileListParams struct {
	Deep               bool
	Depth              int
	ListFolders        bool
	MetadataTimestamps bool
	IncludeRootPath    bool
}

func NewFileListParams

func NewFileListParams() FileListParams

type FileListResponse

type FileListResponse struct {
	Uri     string         `json:"uri,omitempty"`
	Created string         `json:"created,omitempty"`
	Files   []FileListFile `json:"files,omitempty"`
}

type FileStoreSummary

type FileStoreSummary struct {
	StorageType      string `json:"storageType,omitempty"`
	StorageDirectory string `json:"storageDirectory,omitempty"`
	TotalSpace       string `json:"totalSpace,omitempty"`
	UsedSpace        string `json:"usedSpace,omitempty"`
	FreeSpace        string `json:"freeSpace,omitempty"`
}

type FolderInfo

type FolderInfo struct {
	Uri          string               `json:"uri,omitempty"`
	Repo         string               `json:"repo,omitempty"`
	Path         string               `json:"path,omitempty"`
	Created      string               `json:"created,omitempty"`
	CreatedBy    string               `json:"createdBy,omitempty"`
	LastModified string               `json:"lastModified,omitempty"`
	ModifiedBy   string               `json:"modifiedBy,omitempty"`
	LastUpdated  string               `json:"lastUpdated,omitempty"`
	Children     []FolderInfoChildren `json:"children,omitempty"`
}

type FolderInfoChildren

type FolderInfoChildren struct {
	Uri    string `json:"uri,omitempty"`
	Folder bool   `json:"folder,omitempty"`
}

type GetReplicationBody

type GetReplicationBody struct {
	ProxyRef string `json:"proxyRef"`
	// contains filtered or unexported fields
}

type ItemProperties

type ItemProperties struct {
	Properties map[string][]string `json:"properties,omitempty"`
	Uri        string              `json:"uri,omitempty"`
}

type MetadataTimestamps

type MetadataTimestamps struct {
	Properties string `json:"properties,omitempty"`
}

type MultipartUpload

type MultipartUpload struct {
	// contains filtered or unexported fields
}

func NewMultipartUpload

func NewMultipartUpload(client *jfroghttpclient.JfrogHttpClient, httpClientsDetails *httputils.HttpClientDetails, artifactoryUrl string) *MultipartUpload

func (*MultipartUpload) IsSupported

func (mu *MultipartUpload) IsSupported(serviceDetails auth.ServiceDetails) (supported bool, err error)

func (*MultipartUpload) UploadFileConcurrently

func (mu *MultipartUpload) UploadFileConcurrently(localPath, targetPath string, fileSize int64, sha1 string,
	progress ioutils.ProgressMgr, splitCount int, chunkSize int64) (err error)

type OperationSummary

type OperationSummary struct {
	// A ContentReader of FileTransferDetails structs
	TransferDetailsReader *content.ContentReader
	// A ContentReader of ArtifactDetails structs
	ArtifactsDetailsReader *content.ContentReader
	TotalSucceeded         int
	TotalFailed            int
}

func (*OperationSummary) Close

func (cs *OperationSummary) Close() error

type PathMapping

type PathMapping struct {
	Input  string `json:"input"`
	Output string `json:"output"`
}

type Properties

type Properties struct {
	// contains filtered or unexported fields
}

func MergeProperties

func MergeProperties(properties []*Properties) *Properties

Merges multiple Properties structs into one and removes duplicate values

func NewProperties

func NewProperties() *Properties

func ParseProperties

func ParseProperties(propStr string) (*Properties, error)

Parsing properties string to Properties struct.

func (*Properties) AddProperty

func (props *Properties) AddProperty(key, value string)

func (*Properties) KeysLen

func (props *Properties) KeysLen() int

func (*Properties) ParseAndAddProperties

func (props *Properties) ParseAndAddProperties(propStr string) error

func (*Properties) ToEncodedString

func (props *Properties) ToEncodedString(concatValues bool) string

Creates a string of the properties, ready to use in a URL. If concatValues is true, then the values of each property are concatenated together separated by a comma. For example: key=val1,val2,... Otherwise, each value of the property will be written with its key separately. For example: key=val1;key=val2;...

func (*Properties) ToHeadersMap

func (props *Properties) ToHeadersMap() map[string]string

func (*Properties) ToMap

func (props *Properties) ToMap() map[string][]string

Convert properties from Slice to map

type Property

type Property struct {
	Key   string
	Value string
}

type RbGpgValidator

type RbGpgValidator struct {
	// contains filtered or unexported fields
}

func NewRbGpgValidator

func NewRbGpgValidator() *RbGpgValidator

func (*RbGpgValidator) ArtifactsMap

func (r *RbGpgValidator) ArtifactsMap() map[string]string

func (*RbGpgValidator) SetAtrifactoryDetails

func (r *RbGpgValidator) SetAtrifactoryDetails(artDetails *auth.ServiceDetails) *RbGpgValidator

func (*RbGpgValidator) SetClient

func (*RbGpgValidator) SetPublicKey

func (r *RbGpgValidator) SetPublicKey(path string) *RbGpgValidator

func (*RbGpgValidator) SetRbName

func (r *RbGpgValidator) SetRbName(rbName string) *RbGpgValidator

func (*RbGpgValidator) SetRbVersion

func (r *RbGpgValidator) SetRbVersion(rbVersion string) *RbGpgValidator

func (*RbGpgValidator) Validate

func (r *RbGpgValidator) Validate() error

Validate gets a signed release bundle from Artifactory, validates the signature with the public gpg key and saves the release bundle's artifacts in a map

func (*RbGpgValidator) VerifyArtifact

func (r *RbGpgValidator) VerifyArtifact(artifactPath, sha256 string) error

type ReleaseArtifact

type ReleaseArtifact struct {
	RepoPath      string `json:"repo_path"`
	Checksum      string `json:"checksum"`
	DownloadToken string `json:"download_token"`
}

type ReleaseBundleModel

type ReleaseBundleModel struct {
	Id           string              `json:"id"`
	Name         string              `json:"name"`
	Version      string              `json:"version"`
	Created      string              `json:"created"`
	Description  string              `json:"description"`
	Artifacts    []*ReleaseArtifact  `json:"artifacts"`
	ReleaseNotes *BundleReleaseNotes `json:"release_notes"`
	Signature    string              `json:"signature"`
	Type         string              `json:"type"`
}

func (*ReleaseBundleModel) GetOrCalculateId

func (rbm *ReleaseBundleModel) GetOrCalculateId() string

func (*ReleaseBundleModel) Valid

func (rbm *ReleaseBundleModel) Valid() error

type ReplicationParams

type ReplicationParams struct {
	Username string
	Password string
	Url      string
	CronExp  string
	// Source replication repository.
	RepoKey                string
	Proxy                  string
	EnableEventReplication bool
	SocketTimeoutMillis    int
	Enabled                bool
	SyncDeletes            bool
	SyncProperties         bool
	SyncStatistics         bool
	// Deprecated
	PathPrefix               string
	IncludePathPrefixPattern string
}

func CreateReplicationParams

func CreateReplicationParams(body GetReplicationBody) *ReplicationParams

type RepoPathFile

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 RepositorySummary

type RepositorySummary struct {
	RepoKey          string      `json:"repoKey,omitempty"`
	RepoType         string      `json:"repoType,omitempty"`
	FoldersCount     json.Number `json:"foldersCount,omitempty"`
	FilesCount       json.Number `json:"filesCount,omitempty"`
	UsedSpace        string      `json:"usedSpace,omitempty"`
	UsedSpaceInBytes json.Number `json:"usedSpaceInBytes,omitempty"`
	ItemsCount       json.Number `json:"itemsCount,omitempty"`
	PackageType      string      `json:"packageType,omitempty"`
	ProjectKey       string      `json:"projectKey,omitempty"`
	Percentage       string      `json:"percentage,omitempty"`
}

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 Result

type Result struct {
	SuccessCount []int
	TotalCount   []int
}

func NewResult

func NewResult(threads int) *Result

type ResultItem

type ResultItem struct {
	Repo        string     `json:"repo,omitempty"`
	Path        string     `json:"path,omitempty"`
	Name        string     `json:"name,omitempty"`
	Created     string     `json:"created,omitempty"`
	Modified    string     `json:"modified,omitempty"`
	Updated     string     `json:"updated,omitempty"`
	CreatedBy   string     `json:"created_by,omitempty"`
	ModifiedBy  string     `json:"modified_by,omitempty"`
	Type        string     `json:"type,omitempty"`
	Actual_Md5  string     `json:"actual_md5,omitempty"`
	Actual_Sha1 string     `json:"actual_sha1,omitempty"`
	Sha256      string     `json:"sha256,omitempty"`
	Depth       int        `json:"depth,omitempty"`
	Size        int64      `json:"size,omitempty"`
	OriginalMd5 string     `json:"original_md5,omitempty"`
	Properties  []Property `json:"properties,omitempty"`
	Stats       []Stat     `json:"stats,omitempty"`
}

func (ResultItem) GetItemRelativeLocation

func (item ResultItem) GetItemRelativeLocation() string

Returns "item.Repo/item.Path/".

func (ResultItem) GetItemRelativePath

func (item ResultItem) GetItemRelativePath() string

func (ResultItem) GetName

func (item ResultItem) GetName() string

func (*ResultItem) GetProperty

func (item *ResultItem) GetProperty(key string) string

func (ResultItem) GetSortKey

func (item ResultItem) GetSortKey() string

func (ResultItem) GetType

func (item ResultItem) GetType() string

func (*ResultItem) ToArtifact

func (item *ResultItem) ToArtifact() buildinfo.Artifact

func (*ResultItem) ToDependency

func (item *ResultItem) ToDependency() buildinfo.Dependency

type SearchBasedContentItem

type SearchBasedContentItem interface {
	content.SortableContentItem
	GetItemRelativePath() string
	GetName() string
	GetType() string
}

Implement this interface to allow creating 'content.ContentReader' items which can be used with 'searchutils' functions.

type SpecType

type SpecType string
const (
	WILDCARD SpecType = "wildcard"
	AQL      SpecType = "aql"
	BUILD    SpecType = "build"
)

type Stat

type Stat struct {
	Downloaded      string      `json:"downloaded,omitempty"`
	Downloads       json.Number `json:"downloads,omitempty"`
	DownloadedBy    string      `json:"downloaded_by,omitempty"`
	RemoteDownloads json.Number `json:"remote_downloads,omitempty"`
}

type StorageInfo

type StorageInfo struct {
	BinariesSummary         `json:"binariesSummary,omitempty"`
	RepositoriesSummaryList []RepositorySummary `json:"repositoriesSummaryList,omitempty"`
	FileStoreSummary        `json:"fileStoreSummary,omitempty"`
}

func (*StorageInfo) FindRepositoryWithKey

func (si *StorageInfo) FindRepositoryWithKey(key string) (*RepositorySummary, error)

type UpdateReplicationBody

type UpdateReplicationBody struct {
	Proxy string `json:"proxy"`
	// contains filtered or unexported fields
}

func CreateUpdateReplicationBody

func CreateUpdateReplicationBody(params ReplicationParams) *UpdateReplicationBody

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL