deployment

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 deployments table.
	CreatePostgresTable = `` /* 427-byte string literal not displayed */

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

)
View Source
const (
	// CreateRepoIDIndex represents a query to create an
	// index on the deployments table for the repo_id column.
	CreateRepoIDIndex = `
CREATE INDEX
IF NOT EXISTS
deployments_repo_id
ON deployments (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 deployments in the database.

Types

type DeploymentInterface

type DeploymentInterface interface {

	// CreateDeploymentIndexes defines a function that creates the indexes for the deployment table.
	CreateDeploymentIndexes(context.Context) error
	// CreateDeploymentTable defines a function that creates the deployment table.
	CreateDeploymentTable(context.Context, string) error

	// CountDeployments defines a function that gets the count of all deployments.
	CountDeployments(context.Context) (int64, error)
	// CountDeploymentsForRepo defines a function that gets the count of deployments by repo ID.
	CountDeploymentsForRepo(context.Context, *library.Repo) (int64, error)
	// CreateDeployment defines a function that creates a new deployment.
	CreateDeployment(context.Context, *library.Deployment) (*library.Deployment, error)
	// DeleteDeployment defines a function that deletes an existing deployment.
	DeleteDeployment(context.Context, *library.Deployment) error
	// GetDeployment defines a function that gets a deployment by ID.
	GetDeployment(context.Context, int64) (*library.Deployment, error)
	// GetDeploymentForRepo defines a function that gets a deployment by repo ID and number.
	GetDeploymentForRepo(context.Context, *library.Repo, int64) (*library.Deployment, error)
	// ListDeployments defines a function that gets a list of all deployments.
	ListDeployments(context.Context) ([]*library.Deployment, error)
	// ListDeploymentsForRepo defines a function that gets a list of deployments by repo ID.
	ListDeploymentsForRepo(context.Context, *library.Repo, int, int) ([]*library.Deployment, error)
	// UpdateDeployment defines a function that updates an existing deployment.
	UpdateDeployment(context.Context, *library.Deployment) (*library.Deployment, error)
}

DeploymentInterface represents the Vela interface for deployment functions with the supported Database backends.

type EngineOpt

type EngineOpt func(*engine) error

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

func WithClient

func WithClient(client *gorm.DB) EngineOpt

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

func WithContext

func WithContext(ctx context.Context) EngineOpt

WithContext sets the context in the database engine for Deployments.

func WithLogger

func WithLogger(logger *logrus.Entry) EngineOpt

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

func WithSkipCreation

func WithSkipCreation(skipCreation bool) EngineOpt

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

Jump to

Keyboard shortcuts

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