Documentation
¶
Index ¶
Constants ¶
View Source
const ( ARCH_X86 = "x86" ARCH_AMD64 = "amd64" ARCH_ARM64 = "arm64" )
View Source
const (
APP_NAME = "artifact"
)
View Source
const (
RESOURCE_PREFIX = "art"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Artifact ¶
type Artifact struct {
// 制品Id, Hash(服务Id+分支+Commit)
Id string `json:"id" bson:"_id" gorm:"column:id;primaryKey"`
// 创建时间
CreateAt time.Time `json:"create_at" bson:"create_at" gorm:"column:create_at"`
// 制品信息
ArtifactSpec
// 资产清单 (镜像, Jar包, Helm Chat, Static Web Zip)
Assets []Asset `json:"assets" bson:"-" gorm:"-"`
}
制品
func NewArtifact ¶
func NewArtifact(req ArtifactSpec) *Artifact
func (*Artifact) GetFirstByLabel ¶
type ArtifactSpec ¶
type ArtifactSpec struct {
// 服务Id, 关联得有仓库
ServiceId string `json:"service_id" bson:"service_id" gorm:"column:service_id"`
// 分支
Branch string `json:"branch" bson:"branch" gorm:"column:branch"`
// Commit号
Commit string `json:"commit" bson:"commit" gorm:"column:commit"`
// 制品版本(Tag)
Version string `json:"version" bson:"version" gorm:"column:version"`
}
type Asset ¶
type Asset struct {
// 管理制品信息
RefArtifactId string `json:"ref_artifact_id" bson:"ref_artifact_id" gorm:"column:ref_artifact_id;type:varchar(60)"`
// 制品资产具体信息
AssetSpec
}
制品资产
type AssetSpec ¶
type AssetSpec struct {
// 制品Id
Id string `json:"id" bson:"_id" gorm:"column:id;primaryKey"`
// 制品上传时间
UploadAt time.Time `json:"upload_at" bson:"upload_at" gorm:"column:upload_at"`
// 上传人
UploadBy string `json:"upload_by" bson:"upload_by" gorm:"column:upload_by;type:varchar(60)"`
// 制品格式
Format FORMAT `json:"format" bson:"format" gorm:"column:format;type:varchar(60)"`
// 资源URL
URL string `json:"url" bson:"url" gorm:"column:url;type:varchar(120)"`
// 架构, 能用于那些场景
Arch ARCH `json:"arch" bson:"arch" gorm:"column:arch;type:varchar(60)"`
// 资产标签, env=prod
Lables map[string]string `json:"lables" bson:"lables" gorm:"column:lables;serializer:json;"`
// 资产的其他属性
Extras map[string]string `json:"extras" bson:"extras" gorm:"column:extras;serializer:json;"`
}
type DescribeArtifactRequest ¶
type DescribeArtifactRequest struct {
// 制品Id, Hash(应用Id+分支+Commit)
Id string `json:"id" bson:"_id"`
}
func NewDescribeArtifactRequest ¶
func NewDescribeArtifactRequest(artifactId string) *DescribeArtifactRequest
type QueryArtifactRequest ¶
type QueryArtifactRequest struct {
// 分页参数
request.PageRequest
// 标签过滤
Label map[string]string `json:"label"`
// 应用Id
ServiceId string `json:"service_id" bson:"service_id"`
// 分支
Branch string `json:"branch" bson:"branch"`
// Commit号
Commit string `json:"commit" bson:"commit"`
//
WithAssets bool `json:"with_assets" bson:"with_assets"`
}
func NewQueryArtifactRequest ¶
func NewQueryArtifactRequest() *QueryArtifactRequest
type ReportArtifactRequest ¶
type ReportArtifactRequest struct {
// 制品信息
ArtifactSpec
// 制品资产
AssetSpec
}
func NewReportArtifactRequest ¶
func NewReportArtifactRequest() *ReportArtifactRequest
type Service ¶
type Service interface {
// 上报制品信息
ReportArtifact(context.Context, *ReportArtifactRequest) (*Artifact, error)
// 查询制品信息
QueryArtifact(context.Context, *QueryArtifactRequest) (*types.Set[*Artifact], error)
// 查询制品详情
DescribeArtifact(context.Context, *DescribeArtifactRequest) (*Artifact, error)
}
func GetService ¶
func GetService() Service
Click to show internal directories.
Click to hide internal directories.