pipeline

package
v0.27.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CreatePostgresTable represents a query to create the Postgres pipelines table.
	CreatePostgresTable = `` /* 546-byte string literal not displayed */

	// CreateSqliteTable represents a query to create the Sqlite pipelines table.
	CreateSqliteTable = `` /* 504-byte string literal not displayed */

)
View Source
const (
	// CreateRepoIDIndex represents a query to create an
	// index on the pipelines table for the repo_id column.
	CreateRepoIDIndex = `
CREATE INDEX
IF NOT EXISTS
pipelines_repo_id
ON pipelines (repo_id);
`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine added in v0.27.0

type Engine struct {
	// contains filtered or unexported fields
}

Engine represents the pipeline functionality that implements the PipelineInterface interface.

func New

func New(opts ...EngineOpt) (*Engine, error)

New creates and returns a Vela service for integrating with pipelines in the database.

func (*Engine) CountPipelines added in v0.27.0

func (e *Engine) CountPipelines(ctx context.Context) (int64, error)

CountPipelines gets the count of all pipelines from the database.

func (*Engine) CountPipelinesForRepo added in v0.27.0

func (e *Engine) CountPipelinesForRepo(ctx context.Context, r *api.Repo) (int64, error)

CountPipelinesForRepo gets the count of pipelines by repo ID from the database.

func (*Engine) CreatePipeline added in v0.27.0

func (e *Engine) CreatePipeline(ctx context.Context, p *api.Pipeline) (*api.Pipeline, error)

CreatePipeline creates a new pipeline in the database.

func (*Engine) CreatePipelineIndexes added in v0.27.0

func (e *Engine) CreatePipelineIndexes(ctx context.Context) error

CreatePipelineIndexes creates the indexes for the pipelines table in the database.

func (*Engine) CreatePipelineTable added in v0.27.0

func (e *Engine) CreatePipelineTable(ctx context.Context, driver string) error

CreatePipelineTable creates the pipelines table in the database.

func (*Engine) DeletePipeline added in v0.27.0

func (e *Engine) DeletePipeline(ctx context.Context, p *api.Pipeline) error

DeletePipeline deletes an existing pipeline from the database.

func (*Engine) GetPipeline added in v0.27.0

func (e *Engine) GetPipeline(ctx context.Context, id int64) (*api.Pipeline, error)

GetPipeline gets a pipeline by ID from the database.

func (*Engine) GetPipelineForRepo added in v0.27.0

func (e *Engine) GetPipelineForRepo(ctx context.Context, commit string, r *api.Repo) (*api.Pipeline, error)

GetPipelineForRepo gets a pipeline by number and repo ID from the database.

func (*Engine) ListPipelines added in v0.27.0

func (e *Engine) ListPipelines(ctx context.Context) ([]*api.Pipeline, error)

ListPipelines gets a list of all pipelines from the database.

func (*Engine) ListPipelinesForRepo added in v0.27.0

func (e *Engine) ListPipelinesForRepo(ctx context.Context, r *api.Repo, page, perPage int) ([]*api.Pipeline, error)

ListPipelinesForRepo gets a list of pipelines by repo ID from the database.

func (*Engine) UpdatePipeline added in v0.27.0

func (e *Engine) UpdatePipeline(ctx context.Context, p *api.Pipeline) (*api.Pipeline, error)

UpdatePipeline updates an existing pipeline in the database.

type EngineOpt

type EngineOpt func(*Engine) error

EngineOpt represents a configuration option to initialize the database engine for Pipelines.

func WithClient

func WithClient(client *gorm.DB) EngineOpt

WithClient sets the gorm.io/gorm client in the database engine for Pipelines.

func WithCompressionLevel

func WithCompressionLevel(level int) EngineOpt

WithCompressionLevel sets the compression level in the database engine for Pipelines.

func WithContext added in v0.21.0

func WithContext(ctx context.Context) EngineOpt

WithContext sets the context in the database engine for Pipelines.

func WithEncryptionKey added in v0.26.0

func WithEncryptionKey(key string) EngineOpt

WithEncryptionKey sets the encryption key in the database engine for Pipelines.

func WithLogger

func WithLogger(logger *logrus.Entry) EngineOpt

WithLogger sets the github.com/sirupsen/logrus logger in the database engine for Pipelines.

func WithSkipCreation

func WithSkipCreation(skipCreation bool) EngineOpt

WithSkipCreation sets the skip creation logic in the database engine for Pipelines.

type PipelineInterface added in v0.20.0

type PipelineInterface interface {

	// CreatePipelineIndexes defines a function that creates the indexes for the pipelines table.
	CreatePipelineIndexes(context.Context) error
	// CreatePipelineTable defines a function that creates the pipelines table.
	CreatePipelineTable(context.Context, string) error

	// CountPipelines defines a function that gets the count of all pipelines.
	CountPipelines(context.Context) (int64, error)
	// CountPipelinesForRepo defines a function that gets the count of pipelines by repo ID.
	CountPipelinesForRepo(context.Context, *api.Repo) (int64, error)
	// CreatePipeline defines a function that creates a new pipeline.
	CreatePipeline(context.Context, *api.Pipeline) (*api.Pipeline, error)
	// DeletePipeline defines a function that deletes an existing pipeline.
	DeletePipeline(context.Context, *api.Pipeline) error
	// GetPipeline defines a function that gets a pipeline by ID.
	GetPipeline(context.Context, int64) (*api.Pipeline, error)
	// GetPipelineForRepo defines a function that gets a pipeline by commit SHA and repo ID.
	GetPipelineForRepo(context.Context, string, *api.Repo) (*api.Pipeline, error)
	// ListPipelines defines a function that gets a list of all pipelines.
	ListPipelines(context.Context) ([]*api.Pipeline, error)
	// ListPipelinesForRepo defines a function that gets a list of pipelines by repo ID.
	ListPipelinesForRepo(context.Context, *api.Repo, int, int) ([]*api.Pipeline, error)
	// UpdatePipeline defines a function that updates an existing pipeline.
	UpdatePipeline(context.Context, *api.Pipeline) (*api.Pipeline, error)
}

Jump to

Keyboard shortcuts

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