db

package
v1.3.0-rc.0...-d217119 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CIV3BuildArtifact

type CIV3BuildArtifact struct {
	ID           int64                        `json:"id" xorm:"pk autoincr BIGINT(20)"`
	CreatedAt    time.Time                    `json:"createdAt" xorm:"created"`
	UpdatedAt    time.Time                    `json:"updatedAt" xorm:"updated"`
	Sha256       string                       `json:"sha256" xorm:"sha_256"` // 唯一标识
	IdentityText string                       `json:"identityText"`          // 便于记忆的字段,用来生成唯一标识
	Type         apistructs.BuildArtifactType `json:"type"`                  // 类型,存的是文件在 NFS 上的地址,或者直接是文件内容
	Content      string                       `json:"content"`               // 内容,根据 type 进行解析
	ClusterName  string                       `json:"clusterName"`           // 集群 name
	PipelineID   uint64                       `json:"pipelineID"`            // 关联的构建 ID
}

func (*CIV3BuildArtifact) Convert2PB

func (artifact *CIV3BuildArtifact) Convert2PB() *pb.BuildArtifact

func (*CIV3BuildArtifact) TableName

func (*CIV3BuildArtifact) TableName() string

type CIV3BuildCache

type CIV3BuildCache struct {
	ID          int64     `json:"id" xorm:"pk autoincr"`
	Name        string    `json:"name"`
	ClusterName string    `json:"clusterName"`
	LastPullAt  time.Time `json:"lastPullAt"`
	CreatedAt   time.Time `json:"createdAt" xorm:"created"`
	UpdatedAt   time.Time `json:"updatedAt" xorm:"updated"`
	DeletedAt   time.Time `xorm:"deleted"`
}

func (*CIV3BuildCache) TableName

func (*CIV3BuildCache) TableName() string

type Client

type Client struct {
	mysqlxorm.Interface
}

func (*Client) DeleteArtifact

func (client *Client) DeleteArtifact(id int64, ops ...mysqlxorm.SessionOption) error

func (*Client) DeleteArtifactsByImages

func (client *Client) DeleteArtifactsByImages(_type apistructs.BuildArtifactType, images []string, ops ...mysqlxorm.SessionOption) error

func (*Client) DeleteBuildCache

func (client *Client) DeleteBuildCache(id int64, ops ...mysqlxorm.SessionOption) (err error)

func (*Client) GetBuildArtifactBySha256

func (client *Client) GetBuildArtifactBySha256(sha256 string, ops ...mysqlxorm.SessionOption) (artifact CIV3BuildArtifact, err error)

func (*Client) GetBuildCache

func (client *Client) GetBuildCache(clusterName, imageName string, ops ...mysqlxorm.SessionOption) (cache CIV3BuildCache, err error)

func (*Client) NewArtifact

func (client *Client) NewArtifact(sha, identityText string, t apistructs.BuildArtifactType, content string, clusterName string, pipelineID uint64, ops ...mysqlxorm.SessionOption) (CIV3BuildArtifact, error)

Jump to

Keyboard shortcuts

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