step

package
v0.19.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

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

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

)

Variables

This section is empty.

Functions

func New

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

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

Types

type EngineOpt

type EngineOpt func(*engine) error

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

func WithClient

func WithClient(client *gorm.DB) EngineOpt

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

func WithLogger

func WithLogger(logger *logrus.Entry) EngineOpt

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

func WithSkipCreation

func WithSkipCreation(skipCreation bool) EngineOpt

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

type StepService

type StepService interface {

	// CreateStepTable defines a function that creates the steps table.
	CreateStepTable(string) error

	// CountSteps defines a function that gets the count of all steps.
	CountSteps() (int64, error)
	// CountStepsForBuild defines a function that gets the count of steps by build ID.
	CountStepsForBuild(*library.Build, map[string]interface{}) (int64, error)
	// CreateStep defines a function that creates a new step.
	CreateStep(*library.Step) error
	// DeleteStep defines a function that deletes an existing step.
	DeleteStep(*library.Step) error
	// GetStep defines a function that gets a step by ID.
	GetStep(int64) (*library.Step, error)
	// GetStepForBuild defines a function that gets a step by number and build ID.
	GetStepForBuild(*library.Build, int) (*library.Step, error)
	// ListSteps defines a function that gets a list of all steps.
	ListSteps() ([]*library.Step, error)
	// ListStepsForBuild defines a function that gets a list of steps by build ID.
	ListStepsForBuild(*library.Build, map[string]interface{}, int, int) ([]*library.Step, int64, error)
	// ListStepImageCount defines a function that gets a list of all step images and the count of their occurrence.
	ListStepImageCount() (map[string]float64, error)
	// ListStepStatusCount defines a function that gets a list of all step statuses and the count of their occurrence.
	ListStepStatusCount() (map[string]float64, error)
	// UpdateStep defines a function that updates an existing step.
	UpdateStep(*library.Step) error
}

StepService represents the Vela interface for step functions with the supported Database backends.

Jump to

Keyboard shortcuts

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