Documentation ¶
Overview ¶
Copyright 2018 F5 Networks
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2018 F5 Networks ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func ContextLogger(ctx context.Context, name string, fields ...zap.Field) (context.Context, *zap.Logger)
- func DecodeResults(result []byte) (actions.ActionResult, error)
- func DecodeStepResults(ctx variables.Context) (results []actions.ActionResult, err error)
- func ExecuteStep(ctx context.Context, executor Executor, step *workflow.Step, job *pwe.Job, ...) actions.ActionResult
- func FileOrURLReader(ctx context.Context, taskFilename string) (reader io.Reader, err error)
- func NewStepResult(result actions.ActionStatus, message string) actions.ActionResult
- func NextStep(step *workflow.Step, code actions.ActionStatus) string
- func ParseContext(data []byte) (ctx variables.Context, err error)
- func ParseJob(data []byte) (job *pwe.Job, err error)
- type Executor
- type Job
- type JobResult
- type NotifyHook
- type NotifyHooks
Constants ¶
const LoggerContextKey ctxKey = iota
Variables ¶
This section is empty.
Functions ¶
func ContextLogger ¶ added in v2.0.2
func DecodeResults ¶
func DecodeResults(result []byte) (actions.ActionResult, error)
func DecodeStepResults ¶
func DecodeStepResults(ctx variables.Context) (results []actions.ActionResult, err error)
func ExecuteStep ¶
func FileOrURLReader ¶
func NewStepResult ¶
func NewStepResult(result actions.ActionStatus, message string) actions.ActionResult
Types ¶
type Executor ¶
type Executor interface { Prepare(ctx context.Context, job *pwe.Job) error CreateJob(ctx context.Context, inputData, correlationId, jobName, stepName, runId string, action *actions.Action, labels map[string]string, volumes []string) error GetJob() Job AttachIO(ctx context.Context) error SendInput(inputData string) error ProcessOutput(ctx context.Context, resultText *string) Wait(ctx context.Context, timeout time.Duration) (int, error) Cleanup(ctx context.Context) error }
type Job ¶
type Job interface { ID() string Input(input io.WriteCloser) io.WriteCloser Output(output io.ReadCloser) io.ReadCloser }
type JobResult ¶
type JobResult struct { ID string `json:"correlation_id" yaml:"correlation_id"` Name string `json:"task_name" yaml:"task_name"` Status pwe.JobStatus `json:"status" yaml:"status"` Message string `json:"message" yaml:"message"` NotifyStatus string `json:"notify_status" yaml:"notify_status"` NotifyMessage string `json:"notify_message" yaml:"notify_message"` }
type NotifyHook ¶
func NewConsoleHook ¶
func NewConsoleHook() NotifyHook
func NewHTTPNotifyHook ¶
func NewHTTPNotifyHook(ctx context.Context, baseURL string) NotifyHook
type NotifyHooks ¶
type NotifyHooks []NotifyHook
func (*NotifyHooks) AddNotification ¶
func (h *NotifyHooks) AddNotification(hook NotifyHook)
func (NotifyHooks) FireNotification ¶
func (h NotifyHooks) FireNotification(job *pwe.Job) error