task

package
v0.2.62 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 22 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// DefaultResponseResultField is the default output property result field
	DefaultResponseResultField = "commandResponse"

	// SecureResponseResultField is the output property result field that is not shown in the UI
	SecureResponseResultField = "secureResponse"
)
View Source
const CallbackURL = "CALLBACK_URL"

CallbackURL represents the environment variable for the callback URL.

View Source
const InputCategory = "input"

InputCategory represents the category of input properties.

View Source
const InputContextSecret = "INPUT_CONTEXT_SECRET"

InputContextSecret represents the environment variable for the input context secret.

View Source
const InputContextSecretDataFetchUrlKey = "fetchUrl"

InputContextSecretDataFetchUrlKey represents the key for Fetching task content URL in the input context secret. This

View Source
const InputContextSecretDataInput = "input"

InputContextSecretDataInput represents the key for input data in the input context secret.

View Source
const InputContextSecretDataSessionKey = "session-key"

InputContextSecretDataSessionKey represents the key for session key in the input context secret.

View Source
const InputContextSecretDataUrlKey = "url"

InputContextSecretDataUrlKey represents the key for URL in the input context secret.

View Source
const InputContextSecretExecutionIdKey = "execution-id"

InputContextSecretExecutionIdKey represents the key for execution ID in the input context secret.

View Source
const InputLocation = "INPUT_LOCATION"

InputLocation represents the environment variable for input location.

View Source
const OutputCategory = "output"

OutputCategory represents the category of output properties.

View Source
const OutputLocation = "OUTPUT_LOCATION"

OutputLocation represents the environment variable for output location.

View Source
const ReleaseURL = "RELEASE_URL"

ReleaseURL represents the environment variable for the release URL.

View Source
const ResultSecretName = "RESULT_SECRET_NAME"

ResultSecretName represents the name of the result secret.

View Source
const RunnerNamespace = "RUNNER_NAMESPACE"

RunnerNamespace represents the environment variable for the runner namespace.

View Source
const SessionKey = "SESSION_KEY"

SessionKey represents the environment variable for the session key.

View Source
const SizeOf1Mb = 1024 * 1024

Variables

This section is empty.

Functions

func Comment

func Comment(comment string)

Comment logs a comment message.

func Decrypt

func Decrypt(content []byte) ([]byte, error)

Decrypt decrypts the content using the session key.

func Deserialize

func Deserialize(context *InputContext) error

Deserialize deserializes the input context from the specified source into the provided InputContext object.

func DeserializeTask

func DeserializeTask(properties []PropertyDefinition, taskInstance any) error

DeserializeTask deserializes the input properties into the provided task instance.

func Encrypt

func Encrypt(content []byte) ([]byte, error)

Encrypt encrypts the content using the session key.

func HandleAbort added in v0.2.37

func HandleAbort(result map[string]interface{})

func HandleError

func HandleError(err error, result map[string]interface{}, records []interface{})

HandleError handles task execution error by processing the result, error message and reporting records.

func HandleSuccess

func HandleSuccess(result map[string]interface{}, records interface{})

HandleSuccess handles successful task execution by processing the result and reporting records.

func Serialize

func Serialize(result map[string]interface{})

Serialize serializes the provided result into the output properties.

func SerializeError

func SerializeError(err error, result map[string]interface{})

SerializeError serializes the provided error and result into the output properties.

func Status

func Status(status string)

Status logs a status message.

func UnmarshalProperties

func UnmarshalProperties(properties []PropertyDefinition, prototype interface{}) error

UnmarshalProperties unmarshalls the input properties into the provided prototype object.

Types

type AbortError added in v0.2.37

type AbortError struct{}

func (*AbortError) Error added in v0.2.37

func (e *AbortError) Error() string

type AbortGenerator added in v0.2.37

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

The AbortGenerator - used to represent aborted execution result

func (AbortGenerator) FieldName added in v0.2.37

func (gen AbortGenerator) FieldName() string

func (AbortGenerator) GenerateValue added in v0.2.37

func (gen AbortGenerator) GenerateValue() (interface{}, error)

type AutomatedTaskAsUserContext

type AutomatedTaskAsUserContext struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

AutomatedTaskAsUserContext represents the context of an automated task as a user with credentials.

type BoolGenerator

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

BoolGenerator represents a simple boolean value with a custom field name.

func (BoolGenerator) FieldName

func (gen BoolGenerator) FieldName() string

FieldName returns the custom field name for the boolean value.

func (BoolGenerator) GenerateValue

func (gen BoolGenerator) GenerateValue() (interface{}, error)

GenerateValue generates the boolean value.

type BuildRecord added in v0.2.36

type BuildRecord struct {
	ReportingRecord
	Project   string    `json:"project,omitempty"`
	Build     string    `json:"build,omitempty"`
	Outcome   string    `json:"outcome,omitempty"`
	StartDate time.Time `json:"startDate,omitempty"`
	EndDate   time.Time `json:"endDate,omitempty"`
	Duration  string    `json:"duration,omitempty"`
	BuildUrl  string    `json:"build_url,omitempty"`
}

BuildRecord represents the record for build.

type BuildRecordBuilder added in v0.2.56

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

func (*BuildRecordBuilder) Build added in v0.2.56

func (r *BuildRecordBuilder) Build() *BuildRecord

Build builds PlanRecord.

func (*BuildRecordBuilder) BuildLabel added in v0.2.56

func (r *BuildRecordBuilder) BuildLabel(build string) *BuildRecordBuilder

BuildLabel set Build field to BuildRecord.

func (*BuildRecordBuilder) BuildUrl added in v0.2.56

func (r *BuildRecordBuilder) BuildUrl(buildUrl string) *BuildRecordBuilder

BuildUrl set Duration field to BuildRecord.

func (*BuildRecordBuilder) Duration added in v0.2.56

func (r *BuildRecordBuilder) Duration(duration string) *BuildRecordBuilder

Duration set Duration field to BuildRecord.

func (*BuildRecordBuilder) EndDate added in v0.2.56

func (r *BuildRecordBuilder) EndDate(endDate time.Time) *BuildRecordBuilder

EndDate set EndDate field to BuildRecord.

func (*BuildRecordBuilder) Outcome added in v0.2.56

func (r *BuildRecordBuilder) Outcome(outcome string) *BuildRecordBuilder

Outcome set Outcome field to BuildRecord.

func (*BuildRecordBuilder) Project added in v0.2.56

func (r *BuildRecordBuilder) Project(project string) *BuildRecordBuilder

Project set Project field to BuildRecord.

func (*BuildRecordBuilder) StartDate added in v0.2.56

func (r *BuildRecordBuilder) StartDate(startDate time.Time) *BuildRecordBuilder

StartDate set StartDate field to BuildRecord.

type CodeComplianceRecord added in v0.2.36

type CodeComplianceRecord struct {
	ReportingRecord
	Project        string    `json:"project,omitempty"`
	ProjectUrl     string    `json:"project_url,omitempty"`
	AnalysisDate   time.Time `json:"analysisDate,omitempty"`
	Outcome        string    `json:"outcome,omitempty"`
	ComplianceData string    `json:"complianceData,omitempty"`
}

CodeComplianceRecord represents the record for code compliance.

type CodeComplianceRecordBuilder added in v0.2.56

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

func (*CodeComplianceRecordBuilder) AnalysisDate added in v0.2.56

AnalysisDate set AnalysisDate field to CodeComplianceRecord.

func (*CodeComplianceRecordBuilder) Build added in v0.2.56

Build builds CodeComplianceRecord.

func (*CodeComplianceRecordBuilder) ComplianceData added in v0.2.56

ComplianceData set ComplianceData field to CodeComplianceRecord.

func (*CodeComplianceRecordBuilder) Outcome added in v0.2.56

Outcome set Outcome field to CodeComplianceRecord.

func (*CodeComplianceRecordBuilder) Project added in v0.2.56

Project set Project field to CodeComplianceRecord.

func (*CodeComplianceRecordBuilder) ProjectUrl added in v0.2.56

ProjectUrl set ProjectUrl field to CodeComplianceRecord.

type ComposedProperty

type ComposedProperty TaskContext

ComposedProperty represents a composed property of a task.

type DateGenerator

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

DateGenerator represents a simple date and time value with a custom field name.

func (DateGenerator) FieldName

func (gen DateGenerator) FieldName() string

FieldName returns the custom field name for the date and time value.

func (DateGenerator) GenerateValue

func (gen DateGenerator) GenerateValue() (interface{}, error)

GenerateValue generates the date and time value.

type DeploymentRecord added in v0.2.36

type DeploymentRecord struct {
	ReportingRecord
	DeploymentTask    string           `json:"deploymentTask,omitempty"`
	DeploymentTaskUrl string           `json:"deploymentTask_url,omitempty"`
	ApplicationName   string           `json:"applicationName,omitempty"`
	Version           string           `json:"version,omitempty"`
	EnvironmentName   string           `json:"environmentName,omitempty"`
	Status            DeploymentStatus `json:"status,omitempty"`
}

DeploymentRecord represents the record for deployment.

func CreateDeploymentRecord added in v0.2.36

func CreateDeploymentRecord(client *http.HttpClient, taskInfo *DeploymentRecordTaskInfo, status DeploymentStatus) *DeploymentRecord

CreateDeploymentRecord creates a new reporting record for deployment.

type DeploymentRecordBuilder added in v0.2.56

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

func (*DeploymentRecordBuilder) ApplicationVersion added in v0.2.56

func (r *DeploymentRecordBuilder) ApplicationVersion(deploymentVersion string) *DeploymentRecordBuilder

ApplicationVersion set Version field to DeploymentRecord.

func (*DeploymentRecordBuilder) Build added in v0.2.56

Build builds CodeComplianceRecord.

func (*DeploymentRecordBuilder) DeployedApplication added in v0.2.56

func (r *DeploymentRecordBuilder) DeployedApplication(deployedApplication string) *DeploymentRecordBuilder

DeployedApplication set DeployedApplication, DeployedApplication is used as default fallback value.

func (*DeploymentRecordBuilder) DeploymentEnvironment added in v0.2.56

func (r *DeploymentRecordBuilder) DeploymentEnvironment(deploymentEnvironment string) *DeploymentRecordBuilder

DeploymentEnvironment set DeploymentEnvironment, if deployment package is not empty it will use DeploymentEnvironment value, otherwise deployedApplication will be used to extract environment name from parent path.

func (*DeploymentRecordBuilder) DeploymentPackage added in v0.2.56

func (r *DeploymentRecordBuilder) DeploymentPackage(deploymentPackage string) *DeploymentRecordBuilder

DeploymentPackage set DeploymentPackage, if DeploymentPackage is not empty it will use extracted application name, otherwise deployedApplication is used as default fallback value.

func (*DeploymentRecordBuilder) DeploymentStatus added in v0.2.56

DeploymentStatus set Status field to DeploymentRecord.

func (*DeploymentRecordBuilder) TaskId added in v0.2.56

TaskId set DeploymentTask field to DeploymentRecord, if taskId parameter is empty string "None" is used as default value.

type DeploymentRecordTaskInfo added in v0.2.36

type DeploymentRecordTaskInfo struct {
	TaskId                string
	DeploymentPackage     string
	DeploymentEnvironment string
	DeploymentVersion     string
	DeploymentApplication string
	DeployedApplication   string
	Username              string
	ReleaseTaskId         string
}

DeploymentRecordTaskInfo represents properties of deployment needed for audit record.

type DeploymentStatus added in v0.2.36

type DeploymentStatus string

DeploymentStatus represents the status of the deployment.

const (
	Planned    DeploymentStatus = "planned"
	InProgress DeploymentStatus = "in_progress"
	Completed  DeploymentStatus = "completed"
	Skipped    DeploymentStatus = "skipped"
	Failed     DeploymentStatus = "failed"
	Aborted    DeploymentStatus = "aborted"
)

type ErrorGenerator

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

ErrorGenerator represents an error in the standardized response.

func (ErrorGenerator) FieldName

func (gen ErrorGenerator) FieldName() string

FieldName returns the field name for the error.

func (ErrorGenerator) GenerateValue

func (gen ErrorGenerator) GenerateValue() (interface{}, error)

GenerateValue generates the error value.

type Generator

type Generator interface {
	GenerateValue() (interface{}, error)
	FieldName() string
}

Generator is an interface for result value generators.

type InputContext

type InputContext struct {
	Release ReleaseContext `json:"release"`
	Task    TaskContext    `json:"task"`
}

InputContext represents the input context of a task.

type IntGenerator

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

IntGenerator represents a simple integer value with a custom field name.

func (IntGenerator) FieldName

func (gen IntGenerator) FieldName() string

FieldName returns the custom field name for the integer value.

func (IntGenerator) GenerateValue

func (gen IntGenerator) GenerateValue() (interface{}, error)

GenerateValue generates the integer value.

type ItsmReportingRecord added in v0.2.36

type ItsmReportingRecord struct {
	ReportingRecord
	Record    string `json:"record,omitempty"`
	RecordUrl string `json:"record_url,omitempty"`
	Title     string `json:"title,omitempty"`
	Status    string `json:"status,omitempty"`
	Priority  string `json:"priority,omitempty"`
	CreatedBy string `json:"createdBy,omitempty"`
}

ItsmReportingRecord represents the record for ITSM.

type ItsmReportingRecordBuilder added in v0.2.56

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

func (*ItsmReportingRecordBuilder) Build added in v0.2.56

Build builds ItsmReportingRecord.

func (*ItsmReportingRecordBuilder) CreatedBy added in v0.2.56

CreatedBy set CreatedBy field to ItsmReportingRecord.

func (*ItsmReportingRecordBuilder) Priority added in v0.2.56

Priority set Priority field to ItsmReportingRecord.

func (*ItsmReportingRecordBuilder) Record added in v0.2.56

Record set Record field to ItsmReportingRecord.

func (*ItsmReportingRecordBuilder) RecordUrl added in v0.2.56

RecordUrl set RecordUrl field to ItsmReportingRecord.

func (*ItsmReportingRecordBuilder) Status added in v0.2.56

Status set Status field to ItsmReportingRecord.

func (*ItsmReportingRecordBuilder) Title added in v0.2.56

Title set Title field to ItsmReportingRecord.

type JsonGenerator

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

JsonGenerator represents a JSON value with a custom field name.

func (JsonGenerator) FieldName

func (gen JsonGenerator) FieldName() string

FieldName returns the custom field name for the JSON value.

func (JsonGenerator) GenerateValue

func (gen JsonGenerator) GenerateValue() (interface{}, error)

GenerateValue generates the JSON value.

type JsonRawGenerator

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

JsonRawGenerator represents a raw JSON value with a custom field name.

func (JsonRawGenerator) FieldName

func (gen JsonRawGenerator) FieldName() string

FieldName returns the custom field name for the raw JSON value.

func (JsonRawGenerator) GenerateValue

func (gen JsonRawGenerator) GenerateValue() (interface{}, error)

GenerateValue generates the raw JSON value.

type JsonValueBoolGenerator

type JsonValueBoolGenerator struct {
	JsonValueGenerator
}

JsonValueBoolGenerator represents a boolean result on a JSON path given over a JQ command.

func (JsonValueBoolGenerator) GenerateValue

func (gen JsonValueBoolGenerator) GenerateValue() (interface{}, error)

GenerateValue generates the boolean value.

type JsonValueDateGenerator

type JsonValueDateGenerator struct {
	JsonValueGenerator
	// contains filtered or unexported fields
}

JsonValueDateGenerator represents a date result on a JSON path given over a JQ command.

func (JsonValueDateGenerator) GenerateValue

func (gen JsonValueDateGenerator) GenerateValue() (interface{}, error)

GenerateValue generates the date value.

type JsonValueGenerator

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

JsonValueGenerator is the base struct for all JSON value generators.

func (JsonValueGenerator) FieldName

func (gen JsonValueGenerator) FieldName() string

FieldName returns the field name for the JSON value generator.

type JsonValueNodeGenerator

type JsonValueNodeGenerator struct {
	JsonValueGenerator
}

JsonValueNodeGenerator represents a JSON result on a JSON path given over a JQ command.

func (JsonValueNodeGenerator) GenerateValue

func (gen JsonValueNodeGenerator) GenerateValue() (interface{}, error)

GenerateValue generates the JSON value.

type JsonValueStringGenerator

type JsonValueStringGenerator struct {
	JsonValueGenerator
}

JsonValueStringGenerator represents a string result on a JSON path given over a JQ command.

func (JsonValueStringGenerator) GenerateValue

func (gen JsonValueStringGenerator) GenerateValue() (interface{}, error)

GenerateValue generates the string value.

type LookupResultElement

type LookupResultElement struct {
	Label string `json:"label"`
	Value string `json:"value"`
}

LookupResultElement represents an element of a lookup result.

type LookupResultElementsGenerator

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

LookupResultElementsGenerator represents lookup result elements with a custom field name.

func (LookupResultElementsGenerator) FieldName

func (gen LookupResultElementsGenerator) FieldName() string

FieldName returns the custom field name for the lookup result elements value.

func (LookupResultElementsGenerator) GenerateValue

func (gen LookupResultElementsGenerator) GenerateValue() (interface{}, error)

GenerateValue generates the lookup result elements value.

type PlanRecord added in v0.2.36

type PlanRecord struct {
	ReportingRecord
	Ticket      string    `json:"ticket,omitempty"`
	TicketUrl   string    `json:"ticket_url,omitempty"`
	Title       string    `json:"title,omitempty"`
	TicketType  string    `json:"ticketType,omitempty"`
	Status      string    `json:"status,omitempty"`
	UpdatedDate time.Time `json:"updatedDate,omitempty"`
	UpdatedBy   string    `json:"updatedBy,omitempty"`
}

PlanRecord represents the record for plan.

type PlanRecordBuilder added in v0.2.56

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

func (*PlanRecordBuilder) Build added in v0.2.56

func (r *PlanRecordBuilder) Build() *PlanRecord

Build builds PlanRecord.

func (*PlanRecordBuilder) Status added in v0.2.56

func (r *PlanRecordBuilder) Status(status string) *PlanRecordBuilder

Status set Status field to PlanRecord.

func (*PlanRecordBuilder) Ticket added in v0.2.56

func (r *PlanRecordBuilder) Ticket(ticket string) *PlanRecordBuilder

Ticket set Ticket field to PlanRecord.

func (*PlanRecordBuilder) TicketType added in v0.2.56

func (r *PlanRecordBuilder) TicketType(ticketType string) *PlanRecordBuilder

TicketType set TicketType field to PlanRecord.

func (*PlanRecordBuilder) TicketUrl added in v0.2.56

func (r *PlanRecordBuilder) TicketUrl(ticketUrl string) *PlanRecordBuilder

TicketUrl set TicketUrl field to PlanRecord.

func (*PlanRecordBuilder) Title added in v0.2.56

func (r *PlanRecordBuilder) Title(ticket string) *PlanRecordBuilder

Title set Title field to PlanRecord.

func (*PlanRecordBuilder) UpdatedBy added in v0.2.56

func (r *PlanRecordBuilder) UpdatedBy(updatedBy string) *PlanRecordBuilder

UpdatedBy set UpdatedBy field to PlanRecord.

func (*PlanRecordBuilder) UpdatedDate added in v0.2.56

func (r *PlanRecordBuilder) UpdatedDate(updatedDate time.Time) *PlanRecordBuilder

UpdatedDate set UpdatedDate field to PlanRecord.

type PropertyDefinition

type PropertyDefinition struct {
	Name       string          `json:"name"`
	Value      json.RawMessage `json:"value"`
	Kind       string          `json:"kind"`
	Category   string          `json:"category"`
	IsPassword bool            `json:"password"`
}

PropertyDefinition represents the definition of a task property.

type ReleaseContext

type ReleaseContext struct {
	Id                  string                     `json:"id"`
	AutomatedTaskAsUser AutomatedTaskAsUserContext `json:"automatedTaskAsUser"`
	Url                 string                     `json:"url"`
}

ReleaseContext represents the context of a release.

type ReportingRecord added in v0.2.36

type ReportingRecord struct {
	Id                 string              `json:"id"`
	Type               ReportingRecordType `json:"type"`
	TargetId           string              `json:"targetId,omitempty"`
	ServerUrl          string              `json:"serverUrl,omitempty"`
	ServerUser         string              `json:"serverUser,omitempty"`
	CreationDate       time.Time           `json:"creationDate,omitempty"`
	RetryAttemptNumber int32               `json:"retryAttemptNumber,omitempty"`
	CreatedViaApi      bool                `json:"createdViaApi,omitempty"`
}

ReportingRecord represents the record produced by task.

type ReportingRecordBuilder added in v0.2.56

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

ReportingRecordBuilder builder helper type for ReportingRecord.

func NewReportingRecord added in v0.2.56

func NewReportingRecord() *ReportingRecordBuilder

NewReportingRecord create builder with empty ReportingRecord.

func (*ReportingRecordBuilder) BuildRecord added in v0.2.56

func (b *ReportingRecordBuilder) BuildRecord() *BuildRecordBuilder

BuildRecord create empty BuildRecord.

func (*ReportingRecordBuilder) CodeComplianceRecord added in v0.2.56

func (b *ReportingRecordBuilder) CodeComplianceRecord() *CodeComplianceRecordBuilder

func (*ReportingRecordBuilder) CreatedViaApi added in v0.2.56

func (b *ReportingRecordBuilder) CreatedViaApi(apiFlag bool) *ReportingRecordBuilder

CreatedViaApi mark flag if the record was created via API to ReportingRecord.

func (*ReportingRecordBuilder) CreationDate added in v0.2.56

func (b *ReportingRecordBuilder) CreationDate(date time.Time) *ReportingRecordBuilder

CreationDate set CreationDate to ReportingRecord.

func (*ReportingRecordBuilder) DeploymentRecord added in v0.2.56

func (b *ReportingRecordBuilder) DeploymentRecord() *DeploymentRecordBuilder

DeploymentRecord create empty DeploymentRecord.

func (*ReportingRecordBuilder) Id added in v0.2.56

Id set Id to ReportingRecord.

func (*ReportingRecordBuilder) ItsmReportingRecord added in v0.2.56

func (b *ReportingRecordBuilder) ItsmReportingRecord() *ItsmReportingRecordBuilder

ItsmReportingRecord return empty ItsmReportingRecord for ReportingRecord.

func (*ReportingRecordBuilder) PlanRecord added in v0.2.56

func (b *ReportingRecordBuilder) PlanRecord() *PlanRecordBuilder

PlanRecord create empty PlanRecord.

func (*ReportingRecordBuilder) RetryAttemptNumber added in v0.2.56

func (b *ReportingRecordBuilder) RetryAttemptNumber(retry int32) *ReportingRecordBuilder

RetryAttemptNumber set number of retry attempts to ReportingRecord.

func (*ReportingRecordBuilder) ServerUrl added in v0.2.56

func (b *ReportingRecordBuilder) ServerUrl(serverUrl string) *ReportingRecordBuilder

ServerUrl set ServerUrl to ReportingRecord.

func (*ReportingRecordBuilder) ServerUser added in v0.2.56

func (b *ReportingRecordBuilder) ServerUser(serverUser string) *ReportingRecordBuilder

ServerUser set ServerUser to ReportingRecord.

func (*ReportingRecordBuilder) TargetId added in v0.2.56

func (b *ReportingRecordBuilder) TargetId(targetId string) *ReportingRecordBuilder

TargetId set TargetId to ReportingRecord.

type ReportingRecordType added in v0.2.56

type ReportingRecordType string

ReportingRecordType a string value of synthetic type for ReportingRecord types

const (
	DeploymentRecordType     ReportingRecordType = "udm.DeploymentRecord"
	BuildRecordType          ReportingRecordType = "udm.BuildRecord"
	ItsmRecordType           ReportingRecordType = "udm.ItsmRecord"
	PlanRecordType           ReportingRecordType = "udm.PlanRecord"
	CodeComplianceRecordType ReportingRecordType = "udm.CodeComplianceRecord"
)

type Result

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

Result represents the result of a task execution.

func NewResult

func NewResult() *Result

NewResult creates a new Result instance.

func (*Result) Aborted added in v0.2.37

func (r *Result) Aborted(result *Result) *Result

func (*Result) Bool

func (r *Result) Bool(resultField string, result bool) *Result

Bool adds a boolean value with a custom field name to the result.

func (*Result) CustomValue

func (r *Result) CustomValue(generator Generator) *Result

CustomValue provides a custom implementation of the Generator interface, adding a custom parsed or generated value to the result.

func (*Result) Date

func (r *Result) Date(resultField string, dateTime time.Time) *Result

Date adds a date and time value with a custom field name to the result.

func (*Result) DateString

func (r *Result) DateString(resultField string, sampleFormat string, dateTime string) *Result

DateString adds a date and time value with a custom format and field name to the result.

func (*Result) Error

func (r *Result) Error(err error) *Result

Error adds an error to the result.

func (*Result) Get

func (r *Result) Get() (map[string]interface{}, error)

Get returns map with all values that were added to result

func (*Result) GetRecords added in v0.2.36

func (r *Result) GetRecords() []interface{}

GetRecords returns list of all reporting records

func (*Result) Int

func (r *Result) Int(resultField string, result int) *Result

Int adds an integer value with a custom field name to the result.

func (*Result) Json

func (r *Result) Json(resultField string, jsonPayload json.RawMessage) *Result

Json adds a JSON value with a custom field name to the result.

func (*Result) JsonBool

func (r *Result) JsonBool(resultField string, jqOp string, jsonPayload json.RawMessage) *Result

JsonBool adds a boolean result on a JSON path given over a JQ command to the result.

func (*Result) JsonDate

func (r *Result) JsonDate(resultField string, jqOp string, sampleFormat string, jsonPayload json.RawMessage) *Result

JsonDate adds a date result on a JSON path given over a JQ command to the result.

func (*Result) JsonNode

func (r *Result) JsonNode(resultField string, jqOp string, jsonPayload json.RawMessage) *Result

JsonNode adds a JSON result on a JSON path given over a JQ command to the result.

func (*Result) JsonRaw

func (r *Result) JsonRaw(resultField string, jsonPayload json.RawMessage) *Result

JsonRaw adds a raw JSON value with a custom field name to the result.

func (*Result) JsonString

func (r *Result) JsonString(resultField string, jqOp string, jsonPayload json.RawMessage) *Result

JsonString adds a string result on a JSON path given over a JQ command to the result.

func (*Result) LookupResultElements

func (r *Result) LookupResultElements(resultField string, lookupResults []LookupResultElement) *Result

LookupResultElements adds lookup result elements with a custom field name to the result.

func (*Result) ReportingRecord added in v0.2.36

func (r *Result) ReportingRecord(record interface{}) *Result

ReportingRecord adds reporting record to the result.

func (*Result) Slice

func (r *Result) Slice(resultField string, result []interface{}) *Result

Slice adds a []interface{} value with a custom field name to the result.

func (*Result) String

func (r *Result) String(resultField string, result string) *Result

String adds a string value with a custom field name to the result.

func (*Result) StringSlice

func (r *Result) StringSlice(resultField string, result []string) *Result

StringSlice adds a []string value with a custom field name to the result.

type SkipResultHandler

type SkipResultHandler struct{}

SkipResultHandler represents a result handler that should be skipped.

func (*SkipResultHandler) Error

func (m *SkipResultHandler) Error() string

Error returns the error message for the SkipResultHandler.

type SliceGenerator

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

SliceGenerator represents a []interface{} value with a custom field name.

func (SliceGenerator) FieldName

func (gen SliceGenerator) FieldName() string

FieldName returns the custom field name for the []interface{} value.

func (SliceGenerator) GenerateValue

func (gen SliceGenerator) GenerateValue() (interface{}, error)

GenerateValue generates the []interface{} value.

type StringGenerator

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

StringGenerator represents a simple string value with a custom field name.

func (StringGenerator) FieldName

func (gen StringGenerator) FieldName() string

FieldName returns the custom field name for the string value.

func (StringGenerator) GenerateValue

func (gen StringGenerator) GenerateValue() (interface{}, error)

GenerateValue generates the string value.

type StringSliceGenerator

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

StringSliceGenerator represents a []string value with a custom field name.

func (StringSliceGenerator) FieldName

func (gen StringSliceGenerator) FieldName() string

FieldName returns the custom field name for the []string value.

func (StringSliceGenerator) GenerateValue

func (gen StringSliceGenerator) GenerateValue() (interface{}, error)

GenerateValue generates the []string value.

type TaskContext

type TaskContext struct {
	Id         string               `json:"id"`
	Type       string               `json:"type"`
	Properties []PropertyDefinition `json:"properties"`
}

TaskContext represents the context of a task.

type TaskOutputContext

type TaskOutputContext struct {
	ExitCode         int64                  `json:"exitCode"`
	OutputProperties map[string]interface{} `json:"outputProperties,omitempty"`
	JobErrorMessage  string                 `json:"jobErrorMessage,omitempty"`
	ReportingRecords interface{}            `json:"reportingRecords,omitempty"`
}

TaskOutputContext represents the output context of a task.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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