handler

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: May 31, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnknownServiceProvider is returned when the service provider info cannot be extracted from the build file
	ErrUnknownServiceProvider = errors.New(`Cannot determine service provider e.g. "sagify", ensure the build file is valid`)
)

Errors encountered by the Service handler.

Functions

This section is empty.

Types

type Arrival

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

The Arrival Handler is the first handler called after a job is received for processing.

func NewArrival

func NewArrival(workDir string) *Arrival

NewArrival — Arrival Handler initialiser

func (*Arrival) Handle

func (h *Arrival) Handle(r *job.Request)

Handle implementation for the Arrival Handler.

1. Sets job status to running / in progress 2. Sets job work / cloning directory 3. Notifies about the new status and clone directory

func (*Arrival) SetNext

func (h *Arrival) SetNext(next job.Handler)

SetNext sets the next Handler

type Service

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

Service determines the job's service provider e.g. "sagify".

func NewService

func NewService() *Service

NewService — Service constructor

func (*Service) Handle

func (h *Service) Handle(r *job.Request)

Handle - Handler implementation

Parses build file to service info.

func (*Service) SetNext

func (h *Service) SetNext(next job.Handler)

SetNext sets the next Handler

type VCS

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

The VCS Handler clones the repo and returns the checked–out commit ID.

func NewVCS

func NewVCS(versionControl versioncontrol.Client, sec secrets.Store) *VCS

NewVCS — VCS Handler constructor

func (*VCS) Handle

func (h *VCS) Handle(r *job.Request)

Handle implementation for the VCS Handler.

1. Clones repo 2. Checks out commit ID or HEAD if no commit ID is provided 3. Notifies about the commit ID 4. Calls next handler if one is provided

func (*VCS) SetNext

func (h *VCS) SetNext(next job.Handler)

SetNext sets the next Handler

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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