jobs

package
v0.19.5-pre.20220616 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AsyncProjectCommandOutputHandler

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

AsyncProjectCommandOutputHandler is a handler to transport terraform client outputs to the front end.

func (*AsyncProjectCommandOutputHandler) CleanUp

func (p *AsyncProjectCommandOutputHandler) CleanUp(pullInfo PullInfo)

func (*AsyncProjectCommandOutputHandler) Deregister

func (p *AsyncProjectCommandOutputHandler) Deregister(jobID string, ch chan string)

Remove channel, so client no longer receives Terraform output

func (*AsyncProjectCommandOutputHandler) GetJobIDMapForPull

func (p *AsyncProjectCommandOutputHandler) GetJobIDMapForPull(pullInfo PullInfo) map[string]bool

func (*AsyncProjectCommandOutputHandler) GetProjectOutputBuffer

func (p *AsyncProjectCommandOutputHandler) GetProjectOutputBuffer(jobID string) OutputBuffer

func (*AsyncProjectCommandOutputHandler) GetReceiverBufferForPull

func (p *AsyncProjectCommandOutputHandler) GetReceiverBufferForPull(jobID string) map[chan string]bool

func (*AsyncProjectCommandOutputHandler) Handle

func (*AsyncProjectCommandOutputHandler) IsKeyExists

func (p *AsyncProjectCommandOutputHandler) IsKeyExists(key string) bool

func (*AsyncProjectCommandOutputHandler) Register

func (p *AsyncProjectCommandOutputHandler) Register(jobID string, receiver chan string)

func (*AsyncProjectCommandOutputHandler) Send

func (p *AsyncProjectCommandOutputHandler) Send(ctx command.ProjectContext, msg string, operationComplete bool)

type JobInfo

type JobInfo struct {
	PullInfo
	HeadCommit string
}

type JobURLSetter

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

func NewJobURLSetter

func NewJobURLSetter(projectJobURLGenerator ProjectJobURLGenerator, projectStatusUpdater ProjectStatusUpdater) *JobURLSetter

func (*JobURLSetter) SetJobURLWithStatus

func (j *JobURLSetter) SetJobURLWithStatus(ctx command.ProjectContext, cmdName command.Name, status models.CommitStatus) error

type NoopProjectOutputHandler

type NoopProjectOutputHandler struct{}

NoopProjectOutputHandler is a mock that doesn't do anything

func (*NoopProjectOutputHandler) CleanUp

func (p *NoopProjectOutputHandler) CleanUp(pullInfo PullInfo)

func (*NoopProjectOutputHandler) Deregister

func (p *NoopProjectOutputHandler) Deregister(jobID string, receiver chan string)

func (*NoopProjectOutputHandler) Handle

func (p *NoopProjectOutputHandler) Handle()

func (*NoopProjectOutputHandler) IsKeyExists

func (p *NoopProjectOutputHandler) IsKeyExists(key string) bool

func (*NoopProjectOutputHandler) Register

func (p *NoopProjectOutputHandler) Register(jobID string, receiver chan string)

func (*NoopProjectOutputHandler) Send

func (p *NoopProjectOutputHandler) Send(ctx command.ProjectContext, msg string, isOperationComplete bool)

type OutputBuffer

type OutputBuffer struct {
	OperationComplete bool
	Buffer            []string
}

type ProjectCmdOutputLine

type ProjectCmdOutputLine struct {
	JobID             string
	JobInfo           JobInfo
	Line              string
	OperationComplete bool
}

type ProjectCommandOutputHandler

type ProjectCommandOutputHandler interface {
	// Send will enqueue the msg and wait for Handle() to receive the message.
	Send(ctx command.ProjectContext, msg string, operationComplete bool)

	// Register registers a channel and blocks until it is caught up. Callers should call this asynchronously when attempting
	// to read the channel in the same goroutine
	Register(jobID string, receiver chan string)

	// Deregister removes a channel from successive updates and closes it.
	Deregister(jobID string, receiver chan string)

	IsKeyExists(key string) bool

	// Listens for msg from channel
	Handle()

	// Cleans up resources for a pull
	CleanUp(pullInfo PullInfo)
}

func NewAsyncProjectCommandOutputHandler

func NewAsyncProjectCommandOutputHandler(
	projectCmdOutput chan *ProjectCmdOutputLine,
	logger logging.SimpleLogging,
) ProjectCommandOutputHandler

type ProjectJobURLGenerator

type ProjectJobURLGenerator interface {
	GenerateProjectJobURL(p command.ProjectContext) (string, error)
}

ProjectJobURLGenerator generates urls to view project's progress.

type ProjectStatusUpdater

type ProjectStatusUpdater interface {
	// UpdateProject sets the commit status for the project represented by
	// ctx.
	UpdateProject(ctx command.ProjectContext, cmdName command.Name, status models.CommitStatus, url string) error
}

type PullInfo

type PullInfo struct {
	PullNum     int
	Repo        string
	ProjectName string
	Workspace   string
}

Directories

Path Synopsis
matchers
Code generated by pegomock.
Code generated by pegomock.

Jump to

Keyboard shortcuts

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