manager

package
v0.0.0-...-6cdb919 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckManager

type CheckManager interface {
	// Create create a check
	Create(ctx context.Context, check *models.Check) (*models.Check, error)
	// Update check run
	UpdateByID(ctx context.Context, checkRunID uint, newCheckRun *models.CheckRun) error
	// GetByResource get checks by resource
	GetByResource(ctx context.Context, resources ...common.Resource) ([]*models.Check, error)
	GetCheckRunByID(ctx context.Context, checkRunID uint) (*models.CheckRun, error)
	ListCheckRuns(ctx context.Context, pipelinerunID uint) ([]*models.CheckRun, error)
	CreateCheckRun(ctx context.Context, checkRun *models.CheckRun) (*models.CheckRun, error)
}

nolint

func NewCheckManager

func NewCheckManager(db *gorm.DB) CheckManager

type PRManager

type PRManager struct {
	PipelineRun PipelineRunManager
	Message     PRMessageManager
	Check       CheckManager
}

func NewPRManager

func NewPRManager(db *gorm.DB) *PRManager

type PRMessageManager

type PRMessageManager interface {
	// Create creates a pipelinerun message
	Create(ctx context.Context, prMessage *models.PRMessage) (*models.PRMessage, error)
	// List lists messages order by created_at asc
	List(ctx context.Context, pipelineRunID uint, query *q.Query) (int, []*models.PRMessage, error)
}

func NewPRMessageManager

func NewPRMessageManager(db *gorm.DB) PRMessageManager

type PipelineRunManager

type PipelineRunManager interface {
	Create(ctx context.Context, pipelinerun *models.Pipelinerun) (*models.Pipelinerun, error)
	GetByID(ctx context.Context, pipelinerunID uint) (*models.Pipelinerun, error)
	GetByCIEventID(ctx context.Context, ciEventID string) (*models.Pipelinerun, error)
	GetByClusterID(ctx context.Context, clusterID uint, canRollback bool,
		query q.Query) (int, []*models.Pipelinerun, error)
	GetFirstCanRollbackPipelinerun(ctx context.Context, clusterID uint) (*models.Pipelinerun, error)
	DeleteByID(ctx context.Context, pipelinerunID uint) error
	DeleteByClusterID(ctx context.Context, clusterID uint) error
	UpdateConfigCommitByID(ctx context.Context, pipelinerunID uint, commit string) error
	GetLatestByClusterIDAndActions(ctx context.Context, clusterID uint, actions ...string) (*models.Pipelinerun, error)
	GetLatestByClusterIDAndActionAndStatus(ctx context.Context, clusterID uint, action,
		status string) (*models.Pipelinerun, error)
	GetLatestSuccessByClusterID(ctx context.Context, clusterID uint) (*models.Pipelinerun, error)
	UpdateStatusByID(ctx context.Context, pipelinerunID uint, result models.PipelineStatus) error
	UpdateCIEventIDByID(ctx context.Context, pipelinerunID uint, ciEventID string) error
	// UpdateResultByID  update the pipelinerun restore result
	UpdateResultByID(ctx context.Context, pipelinerunID uint, result *models.Result) error
	UpdateColumns(ctx context.Context, pipelinerunID uint, columns map[string]interface{}) error
}

nolint -package=mock_manager

func NewPipelineRunManager

func NewPipelineRunManager(db *gorm.DB) PipelineRunManager

Jump to

Keyboard shortcuts

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