Documentation
¶
Index ¶
- Constants
- Variables
- func IsPyPIExtension(fileName string) bool
- type AqlItem
- type AqlResponse
- type Asset
- type BuildConfig
- type CatalogEntry
- type Checksum
- type CodeUpArtifact
- func (c *CodeUpArtifact) CovertToArtifact(artifactType model.ArtifactType, source *config.Source, org, registry string) []*model.Artifact
- func (c *CodeUpArtifact) ListReleaseArtifactsByPom(source *config.Source, org, repo, groupId, artifactId string, version *Version) []*model.Artifact
- func (c *CodeUpArtifact) ListSnapshotArtifactsByMetadata(source *config.Source, org, repo, groupId, artifactId string, version *Version) []*model.Artifact
- type CodeUpArtifactList
- type Composer
- type Dependencies
- type Dependency
- type DependencyGroups
- type Deprecation
- type DescribeArtifactFileDownloadUrlRequest
- type DescribeArtifactFileDownloadUrlResponse
- type DescribeArtifactVersionFileListItem
- type DescribeArtifactVersionFileListRequest
- type DescribeArtifactVersionFileListResponse
- type DescribeTeamArtifactsData
- type DescribeTeamArtifactsItem
- type DescribeTeamArtifactsRequest
- type DescribeTeamArtifactsRule
- type ErrorHandle
- type Item
- type Items
- type ItemsLeaf
- type ListArtifactsRequest
- type Maven2
- type MavenMetadataConfig
- type Npm
- type OpenApiError
- type OpenApiFileItem
- type OpenApiRepoData
- type OpenApiRepoFilesRequest
- type OpenApiRepoFilesResponse
- type OpenApiResponse
- type PackageInfoArtifact
- type Plugin
- type PyPIArtifact
- type Range
- type RawResponse
- type RegistrationIndex
- type ReleasePom
- type Response
- type ResponseErrorHandle
- type SearchResponse
- type ServiceIndex
- type Snapshot
- type SnapshotVersionConfig
- type SnapshotVersionsConfig
- type SpecifiedArtifact
- type Version
- type VersionMetaData
- type VersioningConfig
Constants ¶
const ( Whl string = ".whl" Gzip string = ".tar.gz" Egg string = ".egg" ZIP string = ".zip" )
const RegistrationsBaseUrl = "RegistrationsBaseUrl"
Variables ¶
var (
NameAndVerReg = regexp.MustCompile(
`^(?P<name>.+?)-(?P<ver>((\d+!)?\d+(\.\d+)*((a|b|rc)\d+)?(\.post\d+)?(\.dev\d+)?(\+[a-z0-9]+)?))(.+)?(.zip|.tar.[a-z0-9]+|.tgz|.egg|.whl|.exe)(.+)?$`)
)
Functions ¶
Types ¶
type AqlItem ¶
type AqlItem struct {
Repo string `json:"repo"`
Path string `json:"path"`
Name string `json:"name"`
Type string `json:"type"`
Size int64 `json:"size"`
Created string `json:"created"`
CreatedBy string `json:"created_by"`
Updated string `json:"updated"`
UpdatedBy string `json:"updated_by"`
}
AqlItem 查询结果
type AqlResponse ¶
AqlResponse 查询响应
func (*AqlResponse) CovertToArtifacts ¶
func (a *AqlResponse) CovertToArtifacts(artifactType model.ArtifactType, source *config.Source) []*model.Artifact
CovertToArtifacts Convert AqlResponse to Artifacts
type Asset ¶
type Asset struct {
ID string `json:"id"`
DownloadURL string `json:"downloadUrl"`
Path string `json:"path"`
Repository string `json:"repository"`
Format string `json:"format"`
Checksum *Checksum `json:"checksum"`
ContentType string `json:"contentType"`
LastModified string `json:"lastModified"`
LastDownloaded string `json:"lastDownloaded"`
Uploader string `json:"uploader"`
UploaderIP string `json:"uploaderIp"`
FileSize int `json:"fileSize"`
BlobCreated string `json:"blobCreated"`
Npm *Npm `json:"npm"`
Maven2 *Maven2 `json:"maven2"`
Composer *Composer `json:"composer"`
}
type CatalogEntry ¶
type CatalogEntry struct {
AtID string `json:"@id,omitempty"` // The URL to document used to produce this object
AtType string `json:"@type,omitempty"`
Authors string `json:"authors,omitempty"`
DependencyGroups []*DependencyGroups `json:"dependencyGroups,omitempty"` // The dependencies of the package, grouped by target framework
Deprecation *Deprecation `json:"deprecation,omitempty"` // The deprecation associated with the package
Description string `json:"description,omitempty"`
IconURL string `json:"iconUrl,omitempty"`
ID string `json:"id,omitempty"` // The ID of the package
LicenseURL string `json:"licenseUrl,omitempty"`
LicenseExpression string `json:"licenseExpression,omitempty"`
Listed bool `json:"listed,omitempty"` // Should be considered as listed if absent
MinClientVersion string `json:"minClientVersion,omitempty"`
ProjectURL string `json:"projectUrl,omitempty"`
PackageContent string `json:"packageContent,omitempty"`
Published time.Time `json:"published,omitempty"` // A string containing a ISO 8601 timestamp of when the package was published
RequireLicenseAcceptance bool `json:"requireLicenseAcceptance,omitempty"`
Summary string `json:"summary,omitempty"`
Tags []string `json:"tags,omitempty"`
Title string `json:"title,omitempty"`
Version string `json:"version,omitempty"` // The full version string after normalization
}
CatalogEntry ...
type Checksum ¶
type CodeUpArtifact ¶
type CodeUpArtifact struct {
DownloadCount int `json:"downloadCount"` // 下载次数
GmtDownload int64 `json:"gmtDownload"` // 最后下载时间(时间戳毫秒)
ID int64 `json:"id"` // 制品唯一ID
LatestUpdate int64 `json:"latestUpdate"` // 最后更新时间戳
Module string `json:"module"` // 模块/包名
Organization string `json:"organization"` // 组织/GroupID
RepositoryID string `json:"repositoryId"` // 所属仓库ID
Versions []*Version `json:"versions"` // 版本列表
}
func (*CodeUpArtifact) CovertToArtifact ¶
func (c *CodeUpArtifact) CovertToArtifact(artifactType model.ArtifactType, source *config.Source, org, registry string) []*model.Artifact
CovertToArtifact ...
type CodeUpArtifactList ¶
type CodeUpArtifactList []*CodeUpArtifact
type Composer ¶
type Dependencies ¶
type Dependencies struct {
AtID string `json:"@id,omitempty"`
AtType string `json:"@type,omitempty"`
ID string `json:"id,omitempty"` // The ID of the package dependency
Range string `json:"range,omitempty"` // The allowed version range of the dependency
Registration string `json:"registration,omitempty"` // The URL to the registration index for this dependency
}
Dependencies ...
type Dependency ¶
type DependencyGroups ¶
type DependencyGroups struct {
AtID string `json:"@id,omitempty"`
AtType string `json:"@type,omitempty"`
TargetFramework string `json:"targetFramework,omitempty"` // The target framework that these dependencies are applicable to
Dependencies []*Dependencies `json:"dependencies,omitempty"`
}
DependencyGroups ...
type Deprecation ¶
type Deprecation struct {
Reasons []string `json:"reasons,omitempty"` // The reasons why the package was deprecated
Message string `json:"message,omitempty"` // The additional details about this deprecation
AlternatePackage interface{} `json:"alternatePackage,omitempty"` // The package dependency that should be used instead
}
Deprecation ...
type DescribeArtifactFileDownloadUrlRequest ¶
type DescribeArtifactFileDownloadUrlRequest struct {
FileName string `json:"FileName"`
Package string `json:"Package"`
PackageVersion string `json:"PackageVersion"`
ProjectId int `json:"ProjectId"`
Repository string `json:"Repository"`
Timeout int `json:"Timeout,omitempty"`
}
https://coding.net/help/openapi#/operations/DescribeArtifactFileDownloadUrl DescribeArtifactFileDownloadUrlRequest 制品文件下载地址获取
type DescribeArtifactFileDownloadUrlResponse ¶
type DescribeArtifactFileDownloadUrlResponse RawResponse[describeArtifactFileDownloadUrlResponseData]
DescribeArtifactFileDownloadUrlResponse 制品文件下载地址获取 -- 响应数据格式
type DescribeArtifactVersionFileListItem ¶
type DescribeArtifactVersionFileListRequest ¶
type DescribeArtifactVersionFileListRequest struct {
Package string `json:"Package"`
PackageVersion string `json:"PackageVersion"`
ProjectId int `json:"ProjectId"`
Repository string `json:"Repository"`
}
https://coding.net/help/openapi#/operations/DescribeArtifactVersionFileList DescribeArtifactVersionFileList 制品版本可下载的文件列表获取
type DescribeArtifactVersionFileListResponse ¶
type DescribeArtifactVersionFileListResponse RawResponse[describeArtifactVersionFileListData]
DescribeArtifactVersionFileList 制品版本可下载的文件列表获取 -- 响应数据格式
type DescribeTeamArtifactsData ¶
type DescribeTeamArtifactsData struct {
InstanceSet []*DescribeTeamArtifactsItem `json:"InstanceSet"`
PageNumber int `json:"PageNumber"`
PageSize int `json:"PageSize"`
TotalCount int `json:"TotalCount"`
}
DescribeTeamArtifactsData 制品列表查询 -- 响应 data
type DescribeTeamArtifactsItem ¶
type DescribeTeamArtifactsItem struct {
ArtifactType int `json:"ArtifactType"`
Package string `json:"Package"` // 制品名称
PackageVersion string `json:"PackageVersion"` // 制品版本
ProjectId int `json:"ProjectId"` // 项目id
Repository string `json:"Repository"` // 制品仓库名称
}
DescribeTeamArtifactsItem 制品列表查询 -- 响应 data -- item
type DescribeTeamArtifactsRequest ¶
type DescribeTeamArtifactsRequest struct {
PageNumber int `json:"PageNumber"`
PageSize int `json:"PageSize"`
Rule *DescribeTeamArtifactsRule `json:"Rule"`
}
https://coding.net/help/openapi#/operations/DescribeTeamArtifacts DescribeTeamArtifactsRequest 制品列表查询
type DescribeTeamArtifactsRule ¶
type DescribeTeamArtifactsRule struct {
ArtifactType []int `json:"ArtifactType"`
ProjectName []string `json:"ProjectName"`
Repository []string `json:"Repository"`
}
DescribeTeamArtifactsRule 制品列表查询 -- 查询规则
type ErrorHandle ¶
type ErrorHandle struct {
Error *OpenApiError `json:"Error,omitempty"`
}
type Item ¶
type Items ¶
type Items struct {
AtID string `json:"@id,omitempty"` // The URL to the registration page
AtType string `json:"@type,omitempty"`
Count int `json:"count,omitempty"` // The number of registration leaves in the page
ItemLeafs []*ItemsLeaf `json:"items,omitempty"` // The array of registration leaves and their associate metadata
Lower string `json:"lower,omitempty"` // The lowest SemVer 2.0.0 version in the page (inclusive)
Parent string `json:"parent,omitempty"` // The URL to the registration index
Upper string `json:"upper,omitempty"` // The highest SemVer 2.0.0 version in the page (inclusive)
}
Items ...
type ItemsLeaf ¶
type ItemsLeaf struct {
AtID string `json:"@id,omitempty"` // The URL to the registration leaf
AtType string `json:"@type,omitempty"`
CatalogEntry *CatalogEntry `json:"catalogEntry,omitempty"` // The catalog entry containing the package metadata
PackageContent string `json:"packageContent,omitempty"` // The URL to the package content (.nupkg)
Registration string `json:"registration,omitempty"` // The URL to the registration index
}
ItemsLeaf ...
type ListArtifactsRequest ¶
type ListArtifactsRequest struct {
RepoType string `json:"repoType"`
Page string `json:"page"`
//每页数据量,默认值10
PerPage string `json:"perPage"`
Search string `json:"search"`
// 按指定方式排序: latestUpdate:按最近更新时间排序; gmtDownload: 按最近下载时间排序。默认值:latestUpdate。
OrderBy string `json:"orderBy"`
// asc: 从小到大; desc: 从大到小。默认值:desc
Sort string `json:"sort"`
}
ListArtifactsRequest 请求参数
type Maven2 ¶
type MavenMetadataConfig ¶
type OpenApiError ¶
OpenApiError coding open api 错误信息
type OpenApiFileItem ¶
type OpenApiFileItem struct {
DownloadUrl string `json:"DownloadUrl"` // 文件下载Url,使用标准三方协议的下载地址
Path string `json:"Path"` // 文件相对于仓库的路径
ArtifactType string `json:"ArtifactType"`
Host string `json:"Host"`
Project string `json:"Project"`
Repository string `json:"Repository"`
PackageName string `json:"PackageName,omitempty"`
VersionName string `json:"VersionName,omitempty"`
Hash string `json:"hash,omitempty"`
}
OpenApiFileItem coding open api 包列表
type OpenApiRepoData ¶
type OpenApiRepoData struct {
ContinuationToken string `json:"ContinuationToken"`
InstanceSet []*OpenApiFileItem `json:"InstanceSet"`
}
OpenApiRepoData coding open api 响应数据
func (*OpenApiRepoData) CovertToArtifact ¶
func (o *OpenApiRepoData) CovertToArtifact(artifactType model.ArtifactType) []*model.Artifact
CovertToArtifact ...
type OpenApiRepoFilesRequest ¶
type OpenApiRepoFilesRequest struct {
Action string `json:"Action"`
Project string `json:"Project"`
Repository string `json:"Repository"`
PageSize int `json:"PageSize"`
ContinuationToken string `json:"ContinuationToken"`
Artifacts []*SpecifiedArtifact `json:"Artifacts,omitempty"`
ArtifactVersionStartAt int64 `json:"ArtifactVersionStartAt,omitempty"` // 制品版本的开始推送时间,秒级
ArtifactVersionEndAt int64 `json:"ArtifactVersionEndAt,omitempty"` // 制品版本的结束推送时间,秒级
}
OpenApiRepoFilesRequest coding open api 请求参数
type OpenApiRepoFilesResponse ¶
type OpenApiRepoFilesResponse Response[OpenApiRepoData]
OpenApiRepoFilesResponse coding open api 响应参数
type OpenApiResponse ¶
type OpenApiResponse[T any] struct { RequestId string `json:"RequestId"` Data *T `json:"Data,omitempty"` Error *OpenApiError `json:"Error,omitempty"` }
OpenApiResponse coding open api 响应参数
type PackageInfoArtifact ¶
type PackageInfoArtifact struct{}
func (*PackageInfoArtifact) CovertToArtifact ¶
func (p *PackageInfoArtifact) CovertToArtifact(artifactType model.ArtifactType, source *config.Source) ([]*model.Artifact, error)
CovertToArtifact ...
type Plugin ¶
type Range ¶
type Range struct {
StartPos int `json:"start_pos"`
EndPos int `json:"end_pos"`
Total int `json:"total"`
}
Range 查询结果范围
type RegistrationIndex ¶
type RegistrationIndex struct {
AtID string `json:"@id,omitempty"` // The URL to the registration page
AtType []string `json:"@type,omitempty"`
Count int `json:"count,omitempty"` // The number of registration pages in the index
Items []*Items `json:"items,omitempty"` // The array of registration pages
}
RegistrationIndex ...
type ReleasePom ¶
type ReleasePom struct {
XMLName xml.Name `xml:"project"`
ModelVersion string `xml:"modelVersion"`
GroupID string `xml:"groupId"`
ArtifactID string `xml:"artifactId"`
Version string `xml:"version"`
Packaging string `xml:"packaging"`
Dependencies []Dependency `xml:"dependencies>dependency"`
Build BuildConfig `xml:"build"`
}
type Response ¶
type Response[T any] RawResponse[OpenApiResponse[T]]
type ResponseErrorHandle ¶
type ResponseErrorHandle RawResponse[ErrorHandle]
type SearchResponse ¶
type SearchResponse struct {
Items []Item `json:"items"`
ContinuationToken string `json:"continuationToken"`
}
func (*SearchResponse) CovertToArtifacts ¶
func (s *SearchResponse) CovertToArtifacts(artifactType model.ArtifactType, source *config.Source) []*model.Artifact
CovertToArtifacts Convert SearchResponse to Artifacts UploadSuffixPath maven org/example/gradle1/2.0.0-SNAPSHOT/gradle1-2.0.0-20250116.072611-2.jar UploadSuffixPath npm @cnb/test 统一处理为 包名/版本号
type ServiceIndex ¶
type Snapshot ¶
type SnapshotVersionConfig ¶
type SnapshotVersionsConfig ¶
type SnapshotVersionsConfig struct {
XMLName xml.Name `xml:"snapshotVersions"`
SnapshotVersion []SnapshotVersionConfig `xml:"snapshotVersion"`
}
type SpecifiedArtifact ¶
SpecifiedArtifact 指定制品
type Version ¶
type Version struct {
CreateTime int64 `json:"createTime"` // 版本创建时间戳
Creator string `json:"creator"` // 创建者标识
GmtDownload int64 `json:"gmtDownload"` // 该版本最后下载时间
ID int64 `json:"id"` // 版本唯一ID
Modifier string `json:"modifier"` // 最后修改者标识
UpdateTime int64 `json:"updateTime"` // 最后修改时间戳
Version string `json:"version"` // 版本号字符串
}
type VersionMetaData ¶
type VersionMetaData struct {
AtID string `json:"@id,omitempty"` // The URL to the registration leaf
CatalogEntry string `json:"catalogEntry,omitempty"` // The URL to the catalog entry that produced these leaf
Listed bool `json:"listed,omitempty"` // Should be considered as listed if absent
PackageContent string `json:"packageContent,omitempty"` // The URL to the package content (.nupkg)
Published *time.Time `json:"published,omitempty"` // A string containing a ISO 8601 timestamp of when the package was published
Registration string `json:"registration,omitempty"` // The URL to the registration index
}
VersionMetaData ...
Source Files
¶
- codeup.go
- coding.go
- jfrog.go
- nexus.go
- other.go
- other_nuget.go
- pypi_extension.go