executable

package
v0.23.4 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

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

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

)
View Source
const CleanExecutablesPostgres = `
	DELETE FROM build_executables 
	USING builds 
	WHERE builds.id = build_executables.build_id 
	AND builds.status = 'error';
`
View Source
const CleanExecutablesSqlite = `` /* 180-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 build executables in the database.

Types

type BuildExecutableInterface

type BuildExecutableInterface interface {
	// BuildExecutable Data Definition Language Functions
	//
	// https://en.wikipedia.org/wiki/Data_definition_language
	CreateBuildExecutableTable(context.Context, string) error

	// CleanBuildExecutables defines a function that deletes errored builds' corresponding executables.
	CleanBuildExecutables(context.Context) (int64, error)
	// CreateBuildExecutable defines a function that creates a build executable.
	CreateBuildExecutable(context.Context, *library.BuildExecutable) error
	// PopBuildExecutable defines a function that gets and deletes a build executable.
	PopBuildExecutable(context.Context, int64) (*library.BuildExecutable, error)
}

BuildExecutableInterface represents the Vela interface for build executable functions with the supported Database backends.

type EngineOpt

type EngineOpt func(*engine) error

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

func WithClient

func WithClient(client *gorm.DB) EngineOpt

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

func WithCompressionLevel

func WithCompressionLevel(level int) EngineOpt

WithCompressionLevel sets the compression level in the database engine for build executables.

func WithContext

func WithContext(ctx context.Context) EngineOpt

WithContext sets the context in the database engine for build executables.

func WithDriver

func WithDriver(driver string) EngineOpt

WithDriver sets the driver type in the database engine for build executables.

func WithEncryptionKey

func WithEncryptionKey(key string) EngineOpt

WithEncryptionKey sets the encryption key in the database engine for build executables.

func WithLogger

func WithLogger(logger *logrus.Entry) EngineOpt

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

func WithSkipCreation

func WithSkipCreation(skipCreation bool) EngineOpt

WithSkipCreation sets the skip creation logic in the database engine for build executables.

Jump to

Keyboard shortcuts

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