pipeline

package
v0.22.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 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 = `` /* 511-byte string literal not displayed */

	// CreateSqliteTable represents a query to create the Sqlite pipelines table.
	CreateSqliteTable = `` /* 480-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

func New

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

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

Types

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 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, *library.Repo) (int64, error)
	// CreatePipeline defines a function that creates a new pipeline.
	CreatePipeline(context.Context, *library.Pipeline) (*library.Pipeline, error)
	// DeletePipeline defines a function that deletes an existing pipeline.
	DeletePipeline(context.Context, *library.Pipeline) error
	// GetPipeline defines a function that gets a pipeline by ID.
	GetPipeline(context.Context, int64) (*library.Pipeline, error)
	// GetPipelineForRepo defines a function that gets a pipeline by commit SHA and repo ID.
	GetPipelineForRepo(context.Context, string, *library.Repo) (*library.Pipeline, error)
	// ListPipelines defines a function that gets a list of all pipelines.
	ListPipelines(context.Context) ([]*library.Pipeline, error)
	// ListPipelinesForRepo defines a function that gets a list of pipelines by repo ID.
	ListPipelinesForRepo(context.Context, *library.Repo, int, int) ([]*library.Pipeline, int64, error)
	// UpdatePipeline defines a function that updates an existing pipeline.
	UpdatePipeline(context.Context, *library.Pipeline) (*library.Pipeline, error)
}

PipelineInterface represents the Vela interface for pipeline functions with the supported Database backends.

Jump to

Keyboard shortcuts

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