pipelinerun

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: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildDeployRequestGit

type BuildDeployRequestGit struct {
	Branch string `json:"branch"`
	Tag    string `json:"tag"`
	Commit string `json:"commit"`
}

type CodeInfo

type CodeInfo struct {
	// deploy branch info
	Branch string `json:"branch,omitempty"`
	// deploy tag info
	Tag string `json:"tag,omitempty"`
	// branch commit
	CommitID string `json:"commitID"`
	// commit message
	CommitMsg string `json:"commitMsg"`
	// code history link
	Link string `json:"link"`
}

type ConfigDiff

type ConfigDiff struct {
	From string `json:"from"`
	To   string `json:"to"`
	Diff string `json:"diff"`
}

type Controller

type Controller interface {
	GetPipelinerunLog(ctx context.Context, pipelinerunID uint) (*collector.Log, error)
	GetClusterLatestLog(ctx context.Context, clusterID uint) (*collector.Log, error)
	GetDiff(ctx context.Context, pipelinerunID uint) (*GetDiffResponse, error)
	GetPipelinerun(ctx context.Context, pipelinerunID uint) (*prmodels.PipelineBasic, error)
	ListPipelineruns(ctx context.Context, clusterID uint, canRollback bool,
		query q.Query) (int, []*prmodels.PipelineBasic, error)
	StopPipelinerun(ctx context.Context, pipelinerunID uint) error
	StopPipelinerunForCluster(ctx context.Context, clusterID uint) error

	CreateCheck(ctx context.Context, check *prmodels.Check) (*prmodels.Check, error)
	GetCheckRunByID(ctx context.Context, checkRunID uint) (*prmodels.CheckRun, error)
	UpdateCheckRunByID(ctx context.Context, checkRunID uint, request *CreateOrUpdateCheckRunRequest) error

	// Execute runs a pipelineRun only if its state is ready.
	Execute(ctx context.Context, pipelinerunID uint) error
	// Ready marks a pipelineRun as ready if its state is pending.
	Ready(ctx context.Context, pipelinerunID uint) error
	// Cancel withdraws a pipelineRun only if its state is pending.
	Cancel(ctx context.Context, pipelinerunID uint) error

	ListCheckRuns(ctx context.Context, pipelinerunID uint) ([]*prmodels.CheckRun, error)
	CreateCheckRun(ctx context.Context, pipelineRunID uint,
		request *CreateOrUpdateCheckRunRequest) (*prmodels.CheckRun, error)
	ListPRMessages(ctx context.Context, pipelineRunID uint, q *q.Query) (int, []*PRMessage, error)
	CreatePRMessage(ctx context.Context, pipelineRunID uint, request *CreatePRMessageRequest) (*PRMessage, error)
}

func NewController

func NewController(config *config.Config, param *param.Param) Controller

type CreateOrUpdateCheckRunRequest

type CreateOrUpdateCheckRunRequest struct {
	Name       string `json:"name"`
	CheckID    uint   `json:"checkId"`
	Status     string `json:"status"`
	Message    string `json:"message"`
	ExternalID string `json:"externalId"`
	DetailURL  string `json:"detailUrl"`
}

type CreatePRMessageRequest

type CreatePRMessageRequest struct {
	Content string `json:"content"`
}

type GetDiffResponse

type GetDiffResponse struct {
	CodeInfo   *CodeInfo   `json:"codeInfo"`
	ConfigDiff *ConfigDiff `json:"configDiff"`
}

type PRMessage

type PRMessage struct {
	Content   string    `json:"content"`
	System    bool      `json:"system"`
	CreatedBy User      `json:"createdBy"`
	UpdatedBy User      `json:"updatedBy"`
	CreatedAt time.Time `json:"createdAt"`
}

type User

type User struct {
	ID       uint   `json:"id"`
	Name     string `json:"name"`
	UserType string `json:"userType,omitempty"`
}

Jump to

Keyboard shortcuts

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