Documentation ¶
Overview ¶
The package pipeline contains the bounded context that is pipeline. Each requirement (create, delete, get, trigger, update) is separated into different files, you will notice this across the project. We do this so it is easy to find all the related files for a requirement.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrPipelineNotFound for pipeline. ErrPipelineNotFound = errors.New("pipeline not found") // ErrInvalidPipelineName for pipeline. ErrInvalidPipelineName = errors.New("invalid pipeline name") // ErrMissingJobs for pipeline. ErrMissingJobs = errors.New("missing jobs") // ErrInvalidJobName for pipeline. ErrInvalidJobName = errors.New("invalid job name") // ErrMissingSteps for pipeline. ErrMissingSteps = errors.New("missing steps") // ErrInvalidID for pipeline. ErrInvalidID = errors.New("invalid id") )
var Module = fx.Options( fx.Provide(NewService), fx.Provide(NewRepository), fx.Provide(NewCommand), )
Module for fx.
Functions ¶
Types ¶
type Command ¶ added in v0.11.0
type Command interface { // Exec a command and output the result or error. Exec(ctx context.Context, cmd string) (string, error) }
Command runs a specific command.
type ID ¶ added in v0.7.0
type ID string
ID for service.
A common pattern in DDD is to make sure we have defined types and allow us to extend what we mean by an id.
type InMemoryRepository ¶
type InMemoryRepository struct {
// contains filtered or unexported fields
}
InMemoryRepository for pipeline.
The mux is to make sure we don't accidentally corrupt. The cache and enc are there to make sure we don't maintain pointers in memory.
func (*InMemoryRepository) Create ¶
func (r *InMemoryRepository) Create(p *Pipeline) (*Pipeline, error)
Create a pipeline and set the identifier.
func (*InMemoryRepository) Delete ¶ added in v0.9.0
func (r *InMemoryRepository) Delete(id ID) (*Pipeline, error)
Delete a pipeline.
type Job ¶
Job of the pipeline.
Each job just has a list of commands that will run on the host. A good job definition would have some sort of workflow definition to allow different patterns. An example can be found at https://circleci.com/docs/workflows/
type Repository ¶
type Repository interface { // Get a pipeline. Get(id ID) (*Pipeline, error) // Create a pipeline. Create(p *Pipeline) (*Pipeline, error) // Update a pipeline. Update(id ID, p *Pipeline) (*Pipeline, error) // Delete a pipeline. Delete(id ID) (*Pipeline, error) }
Repository for pipeline.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service coordinates all the pipeline activities.
This is entry point and the type to be used when interacting with this package.