Documentation
¶
Index ¶
- Constants
- type BuildExecutableInterface
- type Engine
- func (e *Engine) CleanBuildExecutables(ctx context.Context) (int64, error)
- func (e *Engine) CreateBuildExecutable(ctx context.Context, b *api.BuildExecutable) error
- func (e *Engine) CreateBuildExecutableTable(ctx context.Context, driver string) error
- func (e *Engine) PopBuildExecutable(ctx context.Context, id int64) (*api.BuildExecutable, error)
- type EngineOpt
- func WithClient(client *gorm.DB) EngineOpt
- func WithCompressionLevel(level int) EngineOpt
- func WithContext(ctx context.Context) EngineOpt
- func WithDriver(driver string) EngineOpt
- func WithEncryptionKey(key string) EngineOpt
- func WithLogger(logger *logrus.Entry) EngineOpt
- func WithSkipCreation(skipCreation bool) EngineOpt
Constants ¶
const ( // CreatePostgresTable represents a query to create the Postgres build_executables table. CreatePostgresTable = `` /* 161-byte string literal not displayed */ // CreateSqliteTable represents a query to create the Sqlite build_executables table. CreateSqliteTable = `` /* 173-byte string literal not displayed */ )
const CleanExecutablesPostgres = `
DELETE FROM build_executables
USING builds
WHERE builds.id = build_executables.build_id
AND builds.status = 'error';
`
const CleanExecutablesSqlite = `` /* 180-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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, *api.BuildExecutable) error // PopBuildExecutable defines a function that gets and deletes a build executable. PopBuildExecutable(context.Context, int64) (*api.BuildExecutable, error) }
BuildExecutableInterface represents the Vela interface for build executable functions with the supported Database backends.
type Engine ¶ added in v0.27.0
type Engine struct {
// contains filtered or unexported fields
}
Engine represents the build executable functionality that implements the BuildExecutableService interface.
func New ¶
New creates and returns a Vela service for integrating with build executables in the database.
func (*Engine) CleanBuildExecutables ¶ added in v0.27.0
CleanBuildExecutables pops executables which have a corresponding build that was cleaned.
func (*Engine) CreateBuildExecutable ¶ added in v0.27.0
CreateBuildExecutable creates a new build executable in the database.
func (*Engine) CreateBuildExecutableTable ¶ added in v0.27.0
CreateBuildExecutableTable creates the build executables table in the database.
func (*Engine) PopBuildExecutable ¶ added in v0.27.0
PopBuildExecutable pops a build executable by build_id from the database.
type EngineOpt ¶
EngineOpt represents a configuration option to initialize the database engine for build executables.
func WithClient ¶
WithClient sets the gorm.io/gorm client in the database engine for build executables.
func WithCompressionLevel ¶
WithCompressionLevel sets the compression level in the database engine for build executables.
func WithContext ¶
WithContext sets the context in the database engine for build executables.
func WithDriver ¶
WithDriver sets the driver type in the database engine for build executables.
func WithEncryptionKey ¶
WithEncryptionKey sets the encryption key in the database engine for build executables.
func WithLogger ¶
WithLogger sets the github.com/sirupsen/logrus logger in the database engine for build executables.
func WithSkipCreation ¶
WithSkipCreation sets the skip creation logic in the database engine for build executables.