pipeline

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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")
)

Module for fx.

Functions

func IsInvalidArgument

func IsInvalidArgument(err error) bool

IsInvalidArgument for pipeline.

func IsNotFound added in v0.6.0

func IsNotFound(err error) bool

IsNotFound for pipeline.

Types

type ID added in v0.7.0

type ID uint64

ID for service.

func (ID) Valid added in v0.7.0

func (i ID) Valid() error

Valid or error.

type InMemoryRepository

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

InMemoryRepository for pipeline.

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.

func (*InMemoryRepository) Get added in v0.6.0

func (r *InMemoryRepository) Get(id ID) (*Pipeline, error)

Get a pipeline.

func (*InMemoryRepository) Update added in v0.8.0

func (r *InMemoryRepository) Update(id ID, pipeline *Pipeline) (*Pipeline, error)

Update a pipeline.

type Job

type Job struct {
	Name  string
	Steps []string
}

Job of the pipeline.

func (*Job) Valid

func (j *Job) Valid() error

Valid job or error.

type Pipeline

type Pipeline struct {
	Name string
	Jobs []*Job
	ID   ID
}

Pipeline to be executed.

func (*Pipeline) Valid

func (p *Pipeline) Valid() error

Valid pipeline or error.

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.

func NewRepository

func NewRepository() Repository

NewRepository for pipeline.

type Service

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

Service coordinates all the pipeline activities.

func NewService

func NewService(repo Repository) *Service

NewService for pipeline.

func (*Service) Create

func (s *Service) Create(p *Pipeline) (*Pipeline, error)

Create a new pipeline.

func (*Service) Delete added in v0.9.0

func (s *Service) Delete(id ID) (*Pipeline, error)

Update an existing pipeline.

func (*Service) Get added in v0.6.0

func (s *Service) Get(id ID) (*Pipeline, error)

Get pipeline by id.

func (*Service) ID added in v0.6.0

func (s *Service) ID(id string) ID

ID from a string.

func (*Service) Update added in v0.8.0

func (s *Service) Update(id ID, p *Pipeline) (*Pipeline, error)

Update an existing pipeline.

Jump to

Keyboard shortcuts

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