Movatterモバイル変換


[0]ホーム

URL:


Alert GO-2024-3228: Coder vulnerable to post-auth URL redirection to untrusted site ('Open Redirect') in github.com/coder/coder
Notice  The highest tagged major version isv2.

runner

package
v0.27.3Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License:AGPL-3.0Imports:27Imported by:0

Details

Repository

github.com/coder/coder

Links

Documentation

Index

Constants

View Source
const (MissingParameterErrorCode = "MISSING_TEMPLATE_PARAMETER"RequiredTemplateVariablesErrorCode = "REQUIRED_TEMPLATE_VARIABLES")
View Source
const ReadmeFile = "README.md"

ReadmeFile is the location we look for to extract documentation from templateversions.

Variables

This section is empty.

Functions

This section is empty.

Types

typeJobUpdater

type JobUpdater interface {UpdateJob(ctxcontext.Context, in *proto.UpdateJobRequest) (*proto.UpdateJobResponse,error)FailJob(ctxcontext.Context, in *proto.FailedJob)errorCompleteJob(ctxcontext.Context, in *proto.CompletedJob)error}

typeMetricsadded inv0.12.3

type Metrics struct {ConcurrentJobs *prometheus.GaugeVecNumDaemonsprometheus.Gauge// JobTimings also counts the total amount of jobs.JobTimings *prometheus.HistogramVec// WorkspaceBuilds counts workspace build successes and failures.WorkspaceBuilds *prometheus.CounterVec}

typeOptionsadded inv0.12.7

type Options struct {UpdaterJobUpdaterQuotaCommitterQuotaCommitterLoggerslog.LoggerFilesystemafero.FsWorkDirectorystringProvisionersdkproto.DRPCProvisionerClientUpdateIntervaltime.DurationForceCancelIntervaltime.DurationLogDebounceIntervaltime.DurationTracertrace.TracerMetricsMetrics}

typeQuotaCommitteradded inv0.12.7

type QuotaCommitter interface {CommitQuota(ctxcontext.Context, in *proto.CommitQuotaRequest) (*proto.CommitQuotaResponse,error)}

typeRunner

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

funcNewadded inv0.12.5

func New(ctxcontext.Context,job *proto.AcquiredJob,optsOptions,) *Runner

func (*Runner)Cancel

func (r *Runner) Cancel()

Cancel initiates a Cancel on the job, but allows it to keep running to do so gracefully. Read from Done() tobe notified when the job completes.

func (*Runner)Done

func (r *Runner) Done() <-chan struct{}

func (*Runner)Fail

func (r *Runner) Fail(ctxcontext.Context, f *proto.FailedJob)error

Fail immediately halts updates and, if the job is not complete sends FailJob to the coder server. Running goroutinesare canceled but complete asynchronously (although they are prevented from further updating the job to the coderserver). The provided context sets how long to keep trying to send the FailJob.

func (*Runner)ForceStop

func (r *Runner) ForceStop()

ForceStop signals all goroutines to stop and prevents any further API calls back to coder server for this job

func (*Runner)Run

func (r *Runner) Run()

Run executes the job.

the idea here is to run two goroutines to work on the job: doCleanFinish and heartbeat, then usethe `r.cond` to wait until the job is either complete or failed. This function then sends thecomplete or failed message --- the exception to this is if something calls Fail() on the Runner;either something external, like the server getting closed, or the heartbeat goroutine timing outafter attempting to gracefully cancel. If something calls Fail(), then the failure is sent onthat goroutine on the context passed into Fail(), and it marks okToSend false to signal us herethat this function should not also send a terminal message.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp