v1

package
v0.54.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	True  = true
	False = false
)

Booleans

Functions

func CheckWorkflowNotificationsValidity

func CheckWorkflowNotificationsValidity(w Workflow) error

func ProcessNotificationValues

func ProcessNotificationValues(notif NotificationEntry) (sdk.WorkflowNotification, error)

Types

type ConditionEntry

type ConditionEntry struct {
	PlainConditions []PlainConditionEntry `json:"plain,omitempty" yaml:"check,omitempty"`
	LuaScript       string                `json:"script,omitempty" yaml:"script,omitempty"`
}

type HookEntry

type HookEntry struct {
	Model      string                      `` /* 143-byte string literal not displayed */
	Config     map[string]string           `json:"config,omitempty" yaml:"config,omitempty"`
	Conditions *sdk.WorkflowNodeConditions `` /* 175-byte string literal not displayed */
}

HookEntry represents a hook as code

type NodeEntry

type NodeEntry struct {
	ID                     int64                  `json:"-" yaml:"-"`
	DependsOn              []string               ``                                                                                                                      /* 141-byte string literal not displayed */
	Conditions             *ConditionEntry        ``                                                                                                                      /* 175-byte string literal not displayed */
	When                   []string               `json:"when,omitempty" yaml:"when,omitempty" jsonschema_description:"Set manual and status condition (ex: 'success')."` //This is used only for manual and success condition
	PipelineName           string                 `json:"pipeline,omitempty" yaml:"pipeline,omitempty" jsonschema_description:"The name of a pipeline used for pipeline node."`
	ApplicationName        string                 `` /* 200-byte string literal not displayed */
	EnvironmentName        string                 `` /* 200-byte string literal not displayed */
	ProjectIntegrationName string                 `` /* 200-byte string literal not displayed */
	OneAtATime             *bool                  `` /* 164-byte string literal not displayed */
	Payload                map[string]interface{} `json:"payload,omitempty" yaml:"payload,omitempty"`
	Parameters             map[string]string      `json:"parameters,omitempty" yaml:"parameters,omitempty" jsonschema_description:"List of parameters for the workflow."`
	OutgoingHookModelName  string                 `json:"trigger,omitempty" yaml:"trigger,omitempty"`
	OutgoingHookConfig     map[string]string      `json:"config,omitempty" yaml:"config,omitempty"`
	Permissions            map[string]int         `` /* 182-byte string literal not displayed */
}

NodeEntry represents a node as code

type NotificationEntry

type NotificationEntry struct {
	Type     string                        `json:"type" yaml:"type"`
	Settings *sdk.UserNotificationSettings `json:"settings,omitempty" yaml:"settings,omitempty"`
}

NotificationEntry represents a notification set on a nodeEntry

type PlainConditionEntry

type PlainConditionEntry struct {
	Variable string `json:"variable" yaml:"variable"`
	Operator string `json:"operator" yaml:"operator"`
	Value    string `json:"value" yaml:"value"`
}

WorkflowNodeCondition represents a condition to trigger ot not a pipeline in a workflow. Operator can be =, !=, regex

type Workflow

type Workflow struct {
	Name        string `json:"name" yaml:"name" jsonschema_description:"The name of the workflow."`
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	Version     string `json:"version,omitempty" yaml:"version,omitempty" jsonschema_description:"Version for the yaml syntax, latest is v1.0."`
	// this will be filled for complex workflows
	Workflow map[string]NodeEntry   `json:"workflow,omitempty" yaml:"workflow,omitempty" jsonschema_description:"Workflow nodes list."`
	Hooks    map[string][]HookEntry `json:"hooks,omitempty" yaml:"hooks,omitempty" jsonschema_description:"Workflow hooks list."`
	// this will be filled for simple workflows
	OneAtATime             *bool                  ``                                                                                                                      /* 164-byte string literal not displayed */
	Conditions             *ConditionEntry        ``                                                                                                                      /* 175-byte string literal not displayed */
	When                   []string               `json:"when,omitempty" yaml:"when,omitempty" jsonschema_description:"Set manual and status condition (ex: 'success')."` //This is used only for manual and success condition
	PipelineName           string                 `json:"pipeline,omitempty" yaml:"pipeline,omitempty" jsonschema_description:"The name of a pipeline used for pipeline node."`
	Payload                map[string]interface{} `json:"payload,omitempty" yaml:"payload,omitempty"`
	Parameters             map[string]string      `json:"parameters,omitempty" yaml:"parameters,omitempty" jsonschema_description:"List of parameters for the workflow."`
	ApplicationName        string                 `` /* 200-byte string literal not displayed */
	EnvironmentName        string                 `` /* 200-byte string literal not displayed */
	ProjectIntegrationName string                 `` /* 200-byte string literal not displayed */
	PipelineHooks          []HookEntry            `json:"pipeline_hooks,omitempty" yaml:"pipeline_hooks,omitempty"`
	// extra workflow data
	Permissions      map[string]int                 `` /* 186-byte string literal not displayed */
	Metadata         map[string]string              `json:"metadata,omitempty" yaml:"metadata,omitempty"`
	PurgeTags        []string                       `json:"purge_tags,omitempty" yaml:"purge_tags,omitempty"`
	Notifications    []NotificationEntry            `json:"notify,omitempty" yaml:"notify,omitempty"` // This is used when the workflow have only one pipeline
	HistoryLength    *int64                         `json:"history_length,omitempty" yaml:"history_length,omitempty"`
	MapNotifications map[string][]NotificationEntry `json:"notifications,omitempty" yaml:"notifications,omitempty"` // This is used when the workflow have more than one pipeline
}

Workflow is the "as code" representation of a sdk.Workflow

func (Workflow) CheckDependencies

func (w Workflow) CheckDependencies() error

func (Workflow) CheckValidity

func (w Workflow) CheckValidity() error

func (Workflow) Entries

func (w Workflow) Entries() map[string]NodeEntry

Entries returns the map of all workflow entries

func (Workflow) GetName

func (w Workflow) GetName() string

func (Workflow) GetVersion

func (w Workflow) GetVersion() string

func (Workflow) GetWorkflow

func (w Workflow) GetWorkflow() (*sdk.Workflow, error)

GetWorkflow returns a fresh sdk.Workflow

Jump to

Keyboard shortcuts

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