v0.0.0-...-19ee04f Latest Latest

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

Go to latest
Published: Nov 12, 2023 License: Apache-2.0 Imports: 14 Imported by: 0



Package coordinator takes care of coordination of intaking and distribution of tasks to agents.



This section is empty.


This section is empty.


This section is empty.


type Coordinator

type Coordinator struct {
	// contains filtered or unexported fields

Coordinator takes and dispatches build requests.

func New

func New(db *sqlx.DB, configuration models.Configuration) (context.Context, *Coordinator)

New creates a new coordinator

func (*Coordinator) Enqueue

func (c *Coordinator) Enqueue(repoFullName, commitHash, commitMessage,
	sig string, body []byte) error

Enqueue puts a build into the building pipeline.

func (*Coordinator) Error

func (c *Coordinator) Error() error

Error returns the last found error.

func (*Coordinator) GetLastBuildStatus

func (c *Coordinator) GetLastBuildStatus(repoFullName string) models.Status

GetLastBuildStatus loads last known build status for a repository.

func (*Coordinator) MarkComplete

func (c *Coordinator) MarkComplete(build *models.Build) error

MarkComplete determines a build has completed and update its build information in the database.

func (*Coordinator) MarkInProgress

func (c *Coordinator) MarkInProgress(build *models.Build) error

MarkInProgress determines a build has started and update its build information in the database.

func (*Coordinator) Next

func (c *Coordinator) Next(repoFullName string) <-chan *models.Build

Next returns a job pipe.

func (*Coordinator) Wait

func (c *Coordinator) Wait() error

Wait returns when coordinator is done doing its works. Return any error found.

Jump to

Keyboard shortcuts

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