dto

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Whl  string = ".whl"
	Gzip string = ".tar.gz"
	Egg  string = ".egg"
	ZIP  string = ".zip"
)
View Source
const RegistrationsBaseUrl = "RegistrationsBaseUrl"

Variables

View Source
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

func IsPyPIExtension

func IsPyPIExtension(fileName string) bool

IsPyPIExtension 目前支持迁移的类型

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 查询结果

func (*AqlItem) CovertToArtifact

func (a *AqlItem) CovertToArtifact(artifactType model.ArtifactType, source *config.Source) *model.Artifact

CovertToArtifact Convert AqlItem to Artifacts mavenPath org/snapshot/gradle/2.0.0-SNAPSHOT npmPath @cnb/test 统一处理为 包名/版本号

type AqlResponse

type AqlResponse struct {
	Items []*AqlItem `json:"results"`
	Range *Range     `json:"range"`
}

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 BuildConfig

type BuildConfig struct {
	Plugins []Plugin `xml:"plugins>plugin"`
}

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 Checksum struct {
	Sha1   string `json:"sha1"`
	Sha512 string `json:"sha512"`
	Sha256 string `json:"sha256"`
	Md5    string `json:"md5"`
}

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 ...

func (*CodeUpArtifact) ListReleaseArtifactsByPom

func (c *CodeUpArtifact) ListReleaseArtifactsByPom(source *config.Source, org, repo, groupId, artifactId string, version *Version) []*model.Artifact

ListReleaseArtifactsByPom 生成制品列表

func (*CodeUpArtifact) ListSnapshotArtifactsByMetadata

func (c *CodeUpArtifact) ListSnapshotArtifactsByMetadata(source *config.Source, org, repo, groupId, artifactId string, version *Version) []*model.Artifact

ListSnapshotArtifactsByMetadata 根据Maven包元数据获取制品

type CodeUpArtifactList

type CodeUpArtifactList []*CodeUpArtifact

type Composer

type Composer struct {
	Package string `json:"package"`
	Version string `json:"version"`
	Vendor  string `json:"vendor"`
}

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 Dependency struct {
	GroupID    string `xml:"groupId"`
	ArtifactID string `xml:"artifactId"`
	Version    string `xml:"version"`
	Scope      string `xml:"scope"`
}

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 DescribeArtifactVersionFileListItem struct {
	Name string  `json:"Name"`
	Size float64 `json:"Size"`
}

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 Item struct {
	ID         string   `json:"id"`
	Repository string   `json:"repository"`
	Format     string   `json:"format"`
	Group      string   `json:"group"`
	Name       string   `json:"name"`
	Version    string   `json:"version"`
	Assets     []*Asset `json:"assets"`
}

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 Maven2 struct {
	Extension  string `json:"extension"`
	GroupId    string `json:"groupId"`
	ArtifactId string `json:"artifactId"`
	Version    string `json:"version"`
}

type MavenMetadataConfig

type MavenMetadataConfig struct {
	XMLName    xml.Name         `xml:"metadata"`
	GroupId    string           `xml:"groupId"`
	ArtifactId string           `xml:"artifactId"`
	Version    string           `xml:"version"`
	Versioning VersioningConfig `xml:"versioning"`
}

type Npm

type Npm struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

type OpenApiError

type OpenApiError struct {
	Message string `json:"Message"`
	Code    string `json:"Code"`
}

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 Plugin struct {
	GroupID    string `xml:"groupId"`
	ArtifactID string `xml:"artifactId"`
	Version    string `xml:"version"`
}

type PyPIArtifact

type PyPIArtifact struct {
	FileName string
	Path     string
}

type Range

type Range struct {
	StartPos int `json:"start_pos"`
	EndPos   int `json:"end_pos"`
	Total    int `json:"total"`
}

Range 查询结果范围

type RawResponse

type RawResponse[T any] struct {
	Response *T `json:"Response"`
}

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 ServiceIndex struct {
	Resources []struct {
		Type    string `json:"@type"`
		ID      string `json:"@id"`
		Comment string `json:"comment"`
	} `json:"resources"`
}

type Snapshot

type Snapshot struct {
	XMLName     xml.Name `xml:"snapshot"`
	Timestamp   string   `xml:"timestamp"`
	BuildNumber string   `xml:"buildNumber"`
}

type SnapshotVersionConfig

type SnapshotVersionConfig struct {
	XMLName    xml.Name `xml:"snapshotVersion"`
	Extension  string   `xml:"extension"`
	Classifier string   `xml:"classifier"`
	Value      string   `xml:"value"`
	Updated    string   `xml:"updated"`
}

type SnapshotVersionsConfig

type SnapshotVersionsConfig struct {
	XMLName         xml.Name                `xml:"snapshotVersions"`
	SnapshotVersion []SnapshotVersionConfig `xml:"snapshotVersion"`
}

type SpecifiedArtifact

type SpecifiedArtifact struct {
	PackageName string
	VersionName string
}

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 ...

type VersioningConfig

type VersioningConfig struct {
	XMLName          xml.Name                 `xml:"versioning"`
	Snapshot         Snapshot                 `xml:"snapshot"`
	LastUpdated      string                   `xml:"lastUpdated"`
	SnapshotVersions []SnapshotVersionsConfig `xml:"snapshotVersions"`
}

Source Files

  • codeup.go
  • coding.go
  • jfrog.go
  • nexus.go
  • other.go
  • other_nuget.go
  • pypi_extension.go

Jump to

Keyboard shortcuts

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