Documentation
¶
Index ¶
- Constants
- type Engine
- func (e *Engine) CountPipelines(ctx context.Context) (int64, error)
- func (e *Engine) CountPipelinesForRepo(ctx context.Context, r *api.Repo) (int64, error)
- func (e *Engine) CreatePipeline(ctx context.Context, p *api.Pipeline) (*api.Pipeline, error)
- func (e *Engine) CreatePipelineIndexes(ctx context.Context) error
- func (e *Engine) CreatePipelineTable(ctx context.Context, driver string) error
- func (e *Engine) DeletePipeline(ctx context.Context, p *api.Pipeline) error
- func (e *Engine) GetPipeline(ctx context.Context, id int64) (*api.Pipeline, error)
- func (e *Engine) GetPipelineForRepo(ctx context.Context, commit string, r *api.Repo) (*api.Pipeline, error)
- func (e *Engine) ListPipelines(ctx context.Context) ([]*api.Pipeline, error)
- func (e *Engine) ListPipelinesForRepo(ctx context.Context, r *api.Repo, page, perPage int) ([]*api.Pipeline, error)
- func (e *Engine) UpdatePipeline(ctx context.Context, p *api.Pipeline) (*api.Pipeline, error)
- type EngineOpt
- type PipelineInterface
Constants ¶
const ( // CreatePostgresTable represents a query to create the Postgres pipelines table. CreatePostgresTable = `` /* 546-byte string literal not displayed */ // CreateSqliteTable represents a query to create the Sqlite pipelines table. CreateSqliteTable = `` /* 504-byte string literal not displayed */ )
const ( // CreateRepoIDIndex represents a query to create an // index on the pipelines table for the repo_id column. CreateRepoIDIndex = ` CREATE INDEX IF NOT EXISTS pipelines_repo_id ON pipelines (repo_id); ` )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶ added in v0.27.0
type Engine struct {
// contains filtered or unexported fields
}
Engine represents the pipeline functionality that implements the PipelineInterface interface.
func (*Engine) CountPipelines ¶ added in v0.27.0
CountPipelines gets the count of all pipelines from the database.
func (*Engine) CountPipelinesForRepo ¶ added in v0.27.0
CountPipelinesForRepo gets the count of pipelines by repo ID from the database.
func (*Engine) CreatePipeline ¶ added in v0.27.0
CreatePipeline creates a new pipeline in the database.
func (*Engine) CreatePipelineIndexes ¶ added in v0.27.0
CreatePipelineIndexes creates the indexes for the pipelines table in the database.
func (*Engine) CreatePipelineTable ¶ added in v0.27.0
CreatePipelineTable creates the pipelines table in the database.
func (*Engine) DeletePipeline ¶ added in v0.27.0
DeletePipeline deletes an existing pipeline from the database.
func (*Engine) GetPipeline ¶ added in v0.27.0
GetPipeline gets a pipeline by ID from the database.
func (*Engine) GetPipelineForRepo ¶ added in v0.27.0
func (e *Engine) GetPipelineForRepo(ctx context.Context, commit string, r *api.Repo) (*api.Pipeline, error)
GetPipelineForRepo gets a pipeline by number and repo ID from the database.
func (*Engine) ListPipelines ¶ added in v0.27.0
ListPipelines gets a list of all pipelines from the database.
type EngineOpt ¶
EngineOpt represents a configuration option to initialize the database engine for Pipelines.
func WithClient ¶
WithClient sets the gorm.io/gorm client in the database engine for Pipelines.
func WithCompressionLevel ¶
WithCompressionLevel sets the compression level in the database engine for Pipelines.
func WithContext ¶ added in v0.21.0
WithContext sets the context in the database engine for Pipelines.
func WithEncryptionKey ¶ added in v0.26.0
WithEncryptionKey sets the encryption key in the database engine for Pipelines.
func WithLogger ¶
WithLogger sets the github.com/sirupsen/logrus logger in the database engine for Pipelines.
func WithSkipCreation ¶
WithSkipCreation sets the skip creation logic in the database engine for Pipelines.
type PipelineInterface ¶ added in v0.20.0
type PipelineInterface interface {
// CreatePipelineIndexes defines a function that creates the indexes for the pipelines table.
CreatePipelineIndexes(context.Context) error
// CreatePipelineTable defines a function that creates the pipelines table.
CreatePipelineTable(context.Context, string) error
// CountPipelines defines a function that gets the count of all pipelines.
CountPipelines(context.Context) (int64, error)
// CountPipelinesForRepo defines a function that gets the count of pipelines by repo ID.
CountPipelinesForRepo(context.Context, *api.Repo) (int64, error)
// CreatePipeline defines a function that creates a new pipeline.
CreatePipeline(context.Context, *api.Pipeline) (*api.Pipeline, error)
// DeletePipeline defines a function that deletes an existing pipeline.
DeletePipeline(context.Context, *api.Pipeline) error
// GetPipeline defines a function that gets a pipeline by ID.
GetPipeline(context.Context, int64) (*api.Pipeline, error)
// GetPipelineForRepo defines a function that gets a pipeline by commit SHA and repo ID.
GetPipelineForRepo(context.Context, string, *api.Repo) (*api.Pipeline, error)
// ListPipelines defines a function that gets a list of all pipelines.
ListPipelines(context.Context) ([]*api.Pipeline, error)
// ListPipelinesForRepo defines a function that gets a list of pipelines by repo ID.
ListPipelinesForRepo(context.Context, *api.Repo, int, int) ([]*api.Pipeline, error)
// UpdatePipeline defines a function that updates an existing pipeline.
UpdatePipeline(context.Context, *api.Pipeline) (*api.Pipeline, error)
}