Documentation ¶
Index ¶
- Constants
- func LogMiddleware(h http.HandlerFunc) http.HandlerFunc
- func LoopPath(w *CurrentWorker, reqs []sdk.Requirement) []string
- func StartWorker(ctx context.Context, w *CurrentWorker, bookedJobID int64) (mainError error)
- func V2StartWorker(ctx context.Context, w *CurrentWorker, runJobID string, region string) (mainError error)
- type BuiltInAction
- type CurrentJobV2
- type CurrentWorker
- func (wk *CurrentWorker) AddStepOutput(ctx context.Context, outputName string, outputValue string)
- func (wk *CurrentWorker) BaseDir() afero.Fs
- func (w *CurrentWorker) Blur(i interface{}) error
- func (wk *CurrentWorker) CDNHttpURL() string
- func (wk *CurrentWorker) Client() cdsclient.WorkerInterface
- func (wk *CurrentWorker) ClientV2() cdsclient.V2WorkerInterface
- func (wk *CurrentWorker) Environ() []string
- func (wk *CurrentWorker) FeatureEnabled(name sdk.FeatureName) bool
- func (wk *CurrentWorker) GetActionPlugin(pluginName string) *sdk.GRPCPlugin
- func (wk *CurrentWorker) GetContext() context.Context
- func (w *CurrentWorker) GetEnvVariable(ctx context.Context, contexts sdk.WorkflowRunJobsContext) (map[string]string, error)
- func (wk *CurrentWorker) GetIntegrationPlugin(pluginType string) *sdk.GRPCPlugin
- func (wk *CurrentWorker) GetJobIdentifiers() (int64, int64, int64)
- func (w *CurrentWorker) HTTPPort() int32
- func (wk *CurrentWorker) Init(cfg *workerruntime.WorkerConfig, workspace afero.Fs) error
- func (wk *CurrentWorker) InstallKey(key sdk.Variable) (*workerruntime.KeyResponse, error)
- func (wk *CurrentWorker) InstallKeyTo(key sdk.Variable, destinationPath string) (*workerruntime.KeyResponse, error)
- func (wk *CurrentWorker) Name() string
- func (wk *CurrentWorker) Parameters() []sdk.Parameter
- func (wk *CurrentWorker) PluginGet(pluginName string) (*sdk.GRPCPlugin, error)
- func (wk *CurrentWorker) PluginGetBinary(name, os, arch string, w io.Writer) error
- func (w *CurrentWorker) ProcessJob(jobInfo sdk.WorkflowNodeJobRunData) (res sdk.Result)
- func (w *CurrentWorker) Register(ctx context.Context) error
- func (w *CurrentWorker) ResultAdd(ctx context.Context, req ResultAddRequest) error
- func (wk *CurrentWorker) RunResultSignature(artifactName string, perm uint32, t sdk.WorkflowRunResultType) (string, error)
- func (wk *CurrentWorker) SendLog(ctx context.Context, level workerruntime.Level, logLine string)
- func (wk *CurrentWorker) SendTerminatedStepLog(ctx context.Context, level workerruntime.Level, logLine string)
- func (w *CurrentWorker) Serve(c context.Context) error
- func (wk *CurrentWorker) SetActionPlugin(p *sdk.GRPCPlugin)
- func (wk *CurrentWorker) SetContextForTestJobV2(t *testing.T, c context.Context)
- func (wk *CurrentWorker) SetGelfLogger(h *loghook.Hook, l *logrus.Logger)
- func (wk *CurrentWorker) SetSecrets(secrets []sdk.Variable) error
- func (w *CurrentWorker) Take(ctx context.Context, job sdk.WorkflowNodeJobRun) error
- func (w *CurrentWorker) Unregister(ctx context.Context) error
- func (wk *CurrentWorker) V2AddRunResult(ctx context.Context, req workerruntime.V2RunResultRequest) (*workerruntime.V2AddResultResponse, error)
- func (wk *CurrentWorker) V2GetIntegrationByName(ctx context.Context, name string) (*sdk.ProjectIntegration, error)
- func (wk *CurrentWorker) V2GetJobContext(ctx context.Context) *sdk.WorkflowRunJobsContext
- func (wk *CurrentWorker) V2GetJobRun(ctx context.Context) *sdk.V2WorkflowRunJob
- func (wk *CurrentWorker) V2GetRunResult(ctx context.Context, filter workerruntime.V2FilterRunResult) (*workerruntime.V2GetResultResponse, error)
- func (w *CurrentWorker) V2ProcessJob() (res sdk.V2WorkflowRunJobResult)
- func (w *CurrentWorker) V2Register(ctx context.Context, runJobID, region string) error
- func (w *CurrentWorker) V2Take(ctx context.Context, region, jobRunID string) error
- func (w *CurrentWorker) V2Unregister(ctx context.Context, region, runJobID string) error
- func (wk *CurrentWorker) V2UpdateRunResult(ctx context.Context, req workerruntime.V2RunResultRequest) (*workerruntime.V2UpdateResultResponse, error)
- func (wk *CurrentWorker) WorkerCacheSignature(tag string) (string, error)
- type ResultAddRequest
Constants ¶
View Source
const ( // WorkerServerPort is name of environment variable set to local worker HTTP server port WorkerServerPort = "CDS_EXPORT_PORT" // CDS API URL CDSApiUrl = "CDS_API_URL" CDSCDNUrl = "CDS_CDN_URL" )
Variables ¶
This section is empty.
Functions ¶
func LogMiddleware ¶
func LogMiddleware(h http.HandlerFunc) http.HandlerFunc
func LoopPath ¶
func LoopPath(w *CurrentWorker, reqs []sdk.Requirement) []string
LoopPath returns the list of available binaries in path
func StartWorker ¶
func StartWorker(ctx context.Context, w *CurrentWorker, bookedJobID int64) (mainError error)
func V2StartWorker ¶ added in v0.53.0
Types ¶
type BuiltInAction ¶
type BuiltInAction func(context.Context, workerruntime.Runtime, sdk.Action, []sdk.Variable) (sdk.Result, error)
BuiltInAction defines builtin action signature
type CurrentJobV2 ¶ added in v0.53.1
type CurrentJobV2 struct {
// contains filtered or unexported fields
}
type CurrentWorker ¶
type CurrentWorker struct {
// contains filtered or unexported fields
}
func (*CurrentWorker) AddStepOutput ¶ added in v0.53.1
func (wk *CurrentWorker) AddStepOutput(ctx context.Context, outputName string, outputValue string)
func (*CurrentWorker) BaseDir ¶
func (wk *CurrentWorker) BaseDir() afero.Fs
func (*CurrentWorker) Blur ¶
func (w *CurrentWorker) Blur(i interface{}) error
func (*CurrentWorker) CDNHttpURL ¶
func (wk *CurrentWorker) CDNHttpURL() string
func (*CurrentWorker) Client ¶
func (wk *CurrentWorker) Client() cdsclient.WorkerInterface
func (*CurrentWorker) ClientV2 ¶ added in v0.53.0
func (wk *CurrentWorker) ClientV2() cdsclient.V2WorkerInterface
func (*CurrentWorker) Environ ¶
func (wk *CurrentWorker) Environ() []string
func (*CurrentWorker) FeatureEnabled ¶
func (wk *CurrentWorker) FeatureEnabled(name sdk.FeatureName) bool
func (*CurrentWorker) GetActionPlugin ¶ added in v0.53.0
func (wk *CurrentWorker) GetActionPlugin(pluginName string) *sdk.GRPCPlugin
func (*CurrentWorker) GetContext ¶
func (wk *CurrentWorker) GetContext() context.Context
func (*CurrentWorker) GetEnvVariable ¶ added in v0.53.1
func (w *CurrentWorker) GetEnvVariable(ctx context.Context, contexts sdk.WorkflowRunJobsContext) (map[string]string, error)
func (*CurrentWorker) GetIntegrationPlugin ¶ added in v0.53.0
func (wk *CurrentWorker) GetIntegrationPlugin(pluginType string) *sdk.GRPCPlugin
func (*CurrentWorker) GetJobIdentifiers ¶
func (wk *CurrentWorker) GetJobIdentifiers() (int64, int64, int64)
func (*CurrentWorker) HTTPPort ¶
func (w *CurrentWorker) HTTPPort() int32
func (*CurrentWorker) Init ¶
func (wk *CurrentWorker) Init(cfg *workerruntime.WorkerConfig, workspace afero.Fs) error
func (*CurrentWorker) InstallKey ¶
func (wk *CurrentWorker) InstallKey(key sdk.Variable) (*workerruntime.KeyResponse, error)
func (*CurrentWorker) InstallKeyTo ¶
func (wk *CurrentWorker) InstallKeyTo(key sdk.Variable, destinationPath string) (*workerruntime.KeyResponse, error)
func (*CurrentWorker) Name ¶
func (wk *CurrentWorker) Name() string
func (*CurrentWorker) Parameters ¶
func (wk *CurrentWorker) Parameters() []sdk.Parameter
func (*CurrentWorker) PluginGet ¶ added in v0.53.0
func (wk *CurrentWorker) PluginGet(pluginName string) (*sdk.GRPCPlugin, error)
func (*CurrentWorker) PluginGetBinary ¶ added in v0.53.0
func (wk *CurrentWorker) PluginGetBinary(name, os, arch string, w io.Writer) error
func (*CurrentWorker) ProcessJob ¶
func (w *CurrentWorker) ProcessJob(jobInfo sdk.WorkflowNodeJobRunData) (res sdk.Result)
func (*CurrentWorker) Register ¶
func (w *CurrentWorker) Register(ctx context.Context) error
Workers need to register to main api so they can run actions
func (*CurrentWorker) ResultAdd ¶ added in v0.53.1
func (w *CurrentWorker) ResultAdd(ctx context.Context, req ResultAddRequest) error
func (*CurrentWorker) RunResultSignature ¶
func (wk *CurrentWorker) RunResultSignature(artifactName string, perm uint32, t sdk.WorkflowRunResultType) (string, error)
func (*CurrentWorker) SendLog ¶
func (wk *CurrentWorker) SendLog(ctx context.Context, level workerruntime.Level, logLine string)
func (*CurrentWorker) SendTerminatedStepLog ¶
func (wk *CurrentWorker) SendTerminatedStepLog(ctx context.Context, level workerruntime.Level, logLine string)
func (*CurrentWorker) SetActionPlugin ¶ added in v0.53.0
func (wk *CurrentWorker) SetActionPlugin(p *sdk.GRPCPlugin)
func (*CurrentWorker) SetContextForTestJobV2 ¶ added in v0.53.1
func (wk *CurrentWorker) SetContextForTestJobV2(t *testing.T, c context.Context)
used into unit tests only
func (*CurrentWorker) SetGelfLogger ¶
func (wk *CurrentWorker) SetGelfLogger(h *loghook.Hook, l *logrus.Logger)
func (*CurrentWorker) SetSecrets ¶ added in v0.52.0
func (wk *CurrentWorker) SetSecrets(secrets []sdk.Variable) error
func (*CurrentWorker) Take ¶
func (w *CurrentWorker) Take(ctx context.Context, job sdk.WorkflowNodeJobRun) error
func (*CurrentWorker) Unregister ¶
func (w *CurrentWorker) Unregister(ctx context.Context) error
func (*CurrentWorker) V2AddRunResult ¶ added in v0.53.1
func (wk *CurrentWorker) V2AddRunResult(ctx context.Context, req workerruntime.V2RunResultRequest) (*workerruntime.V2AddResultResponse, error)
func (*CurrentWorker) V2GetIntegrationByName ¶ added in v0.53.1
func (wk *CurrentWorker) V2GetIntegrationByName(ctx context.Context, name string) (*sdk.ProjectIntegration, error)
func (*CurrentWorker) V2GetJobContext ¶ added in v0.53.1
func (wk *CurrentWorker) V2GetJobContext(ctx context.Context) *sdk.WorkflowRunJobsContext
func (*CurrentWorker) V2GetJobRun ¶ added in v0.53.1
func (wk *CurrentWorker) V2GetJobRun(ctx context.Context) *sdk.V2WorkflowRunJob
func (*CurrentWorker) V2GetRunResult ¶ added in v0.53.1
func (wk *CurrentWorker) V2GetRunResult(ctx context.Context, filter workerruntime.V2FilterRunResult) (*workerruntime.V2GetResultResponse, error)
func (*CurrentWorker) V2ProcessJob ¶ added in v0.53.0
func (w *CurrentWorker) V2ProcessJob() (res sdk.V2WorkflowRunJobResult)
func (*CurrentWorker) V2Register ¶ added in v0.53.0
func (w *CurrentWorker) V2Register(ctx context.Context, runJobID, region string) error
V2Register Workers need to register to main api so they can run actions
func (*CurrentWorker) V2Take ¶ added in v0.53.0
func (w *CurrentWorker) V2Take(ctx context.Context, region, jobRunID string) error
func (*CurrentWorker) V2Unregister ¶ added in v0.53.0
func (w *CurrentWorker) V2Unregister(ctx context.Context, region, runJobID string) error
func (*CurrentWorker) V2UpdateRunResult ¶ added in v0.53.1
func (wk *CurrentWorker) V2UpdateRunResult(ctx context.Context, req workerruntime.V2RunResultRequest) (*workerruntime.V2UpdateResultResponse, error)
func (*CurrentWorker) WorkerCacheSignature ¶
func (wk *CurrentWorker) WorkerCacheSignature(tag string) (string, error)
type ResultAddRequest ¶ added in v0.53.1
Source Files ¶
- builtin.go
- handler_artifacts.go
- handler_cache.go
- handler_cds_version_set.go
- handler_check_secret.go
- handler_directories.go
- handler_download.go
- handler_exit.go
- handler_export.go
- handler_key.go
- handler_run_result.go
- handler_tag.go
- handler_tmpl.go
- handler_upload.go
- http_server.go
- keys.go
- register.go
- register_v2.go
- requirement.go
- resultV2.go
- run.go
- runV2.go
- run_directory.go
- runtime_v2.go
- start.go
- startV2.go
- take.go
- takeV2.go
- types.go
Click to show internal directories.
Click to hide internal directories.