coordinator

package
v0.0.0-...-8a25d1e Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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