Documentation ¶
Overview ¶
Package coordinator takes care of coordination of intaking and distribution of tasks to agents.
Index ¶
- type Coordinator
- func (c *Coordinator) Enqueue(repoFullName, commitHash, commitMessage, sig string, body []byte) error
- func (c *Coordinator) Error() error
- func (c *Coordinator) GetLastBuildStatus(repoFullName string) models.Status
- func (c *Coordinator) MarkComplete(build *models.Build) error
- func (c *Coordinator) MarkInProgress(build *models.Build) error
- func (c *Coordinator) Next(repoFullName string) <-chan *models.Build
- func (c *Coordinator) Wait() error
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) 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.
Click to show internal directories.
Click to hide internal directories.