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 ¶
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 ¶
WithClient sets the gorm.io/gorm client in the database engine for Deployments.
func WithContext ¶
WithContext sets the context in the database engine for Deployments.
func WithLogger ¶
WithLogger sets the github.com/sirupsen/logrus logger in the database engine for Deployments.
func WithSkipCreation ¶
WithSkipCreation sets the skip creation logic in the database engine for Deployments.
Click to show internal directories.
Click to hide internal directories.