deployment

package
v0.27.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2025 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 = `` /* 440-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

This section is empty.

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, *api.Repo) (int64, error)
	// CreateDeployment defines a function that creates a new deployment.
	CreateDeployment(context.Context, *api.Deployment) (*api.Deployment, error)
	// DeleteDeployment defines a function that deletes an existing deployment.
	DeleteDeployment(context.Context, *api.Deployment) error
	// GetDeployment defines a function that gets a deployment by ID.
	GetDeployment(context.Context, int64) (*api.Deployment, error)
	// GetDeploymentForRepo defines a function that gets a deployment by repo ID and number.
	GetDeploymentForRepo(context.Context, *api.Repo, int64) (*api.Deployment, error)
	// ListDeployments defines a function that gets a list of all deployments.
	ListDeployments(context.Context) ([]*api.Deployment, error)
	// ListDeploymentsForRepo defines a function that gets a list of deployments by repo ID.
	ListDeploymentsForRepo(context.Context, *api.Repo, int, int) ([]*api.Deployment, error)
	// UpdateDeployment defines a function that updates an existing deployment.
	UpdateDeployment(context.Context, *api.Deployment) (*api.Deployment, error)
}

type Engine added in v0.27.0

type Engine struct {
	// contains filtered or unexported fields
}

Engine represents the deployment functionality that implements the DeploymentInterface interface.

func New

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

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

func (*Engine) CountDeployments added in v0.27.0

func (e *Engine) CountDeployments(ctx context.Context) (int64, error)

CountDeployments gets the count of all deployments from the database.

func (*Engine) CountDeploymentsForRepo added in v0.27.0

func (e *Engine) CountDeploymentsForRepo(ctx context.Context, r *api.Repo) (int64, error)

CountDeploymentsForRepo gets the count of deployments by repo ID from the database.

func (*Engine) CreateDeployment added in v0.27.0

func (e *Engine) CreateDeployment(ctx context.Context, d *api.Deployment) (*api.Deployment, error)

CreateDeployment creates a new deployment in the database.

func (*Engine) CreateDeploymentIndexes added in v0.27.0

func (e *Engine) CreateDeploymentIndexes(ctx context.Context) error

CreateDeploymetsIndexes creates the indexes for the deployments table in the database.

func (*Engine) CreateDeploymentTable added in v0.27.0

func (e *Engine) CreateDeploymentTable(ctx context.Context, driver string) error

CreateDeploymentTable creates the deployments table in the database.

func (*Engine) DeleteDeployment added in v0.27.0

func (e *Engine) DeleteDeployment(ctx context.Context, d *api.Deployment) error

DeleteDeployment deletes an existing deployment from the database.

func (*Engine) GetDeployment added in v0.27.0

func (e *Engine) GetDeployment(ctx context.Context, id int64) (*api.Deployment, error)

GetDeployment gets a deployment by ID from the database.

func (*Engine) GetDeploymentForRepo added in v0.27.0

func (e *Engine) GetDeploymentForRepo(ctx context.Context, r *api.Repo, number int64) (*api.Deployment, error)

GetDeploymentForRepo gets a deployment by repo ID and number from the database.

func (*Engine) ListDeployments added in v0.27.0

func (e *Engine) ListDeployments(ctx context.Context) ([]*api.Deployment, error)

ListDeployments gets a list of all deployments from the database.

func (*Engine) ListDeploymentsForRepo added in v0.27.0

func (e *Engine) ListDeploymentsForRepo(ctx context.Context, r *api.Repo, page, perPage int) ([]*api.Deployment, error)

ListDeploymentsForRepo gets a list of deployments by repo ID from the database.

func (*Engine) UpdateDeployment added in v0.27.0

func (e *Engine) UpdateDeployment(ctx context.Context, d *api.Deployment) (*api.Deployment, error)

UpdateDeployment updates an existing deployment in the database.

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 WithEncryptionKey added in v0.26.0

func WithEncryptionKey(key string) EngineOpt

WithEncryptionKey sets the encryption key 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