workflowdefinition

package
v0.0.0-...-d3e8332 Latest Latest
Warning

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

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

Documentation

Overview

Package workflowdefinition implements functions for creating, updating, saving, and deleting Workflow Definitions. A database backend is used to save and manage WorkflowDefinitions without having to access Git each time (like a cache)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(reqBytes []byte, natsInfo map[string]string)

Create is used to create a new WorkflowDefinition

func Delete

func Delete(reqBytes []byte, natsInfo map[string]string)

Delete is used to delete and existing workflowdefinition

func Get

func Get(reqBytes []byte, msg *nats.Msg, natsInfo map[string]string)

Get synchronously responds with the WorkflowDefinition

func GetForUser

func GetForUser(reqBytes []byte, msg *nats.Msg, natsInfo map[string]string)

GetForUser synchronously responds with all WorkflowDefinitions owned by a user

func InitMongoDB

func InitMongoDB(name, address string) error

InitMongoDB will initialize the connection to the database

func Update

func Update(reqBytes []byte, natsInfo map[string]string)

Update allows a user to edit a WorkflowDefinition and push to git

Types

type Request

type Request struct {
	common.BasicRequest
	WorkflowDefinition
	URL           string `json:"url,omitempty"`
	Branch        string `json:"branch,omitempty"`
	CommitMessage string `json:"commit_msg,omitempty"`
}

Request is a struct containing the necessary fields for all WorkflowDefinition operations coming from the API

type WorkflowDefinition

type WorkflowDefinition struct {
	ID          string              `bson:"_id" json:"id,omitempty" yaml:"id"`
	Name        string              `bson:"name" json:"name,omitempty" yaml:"name"`
	Description string              `bson:"description" json:"description,omitempty" yaml:"description"`
	Type        string              `bson:"type" json:"type,omitempty" yaml:"type"`
	Owner       string              `bson:"owner" json:"owner,omitempty"`
	Build       []*common.BuildStep `bson:"build" json:"build,omitempty" yaml:"build"`
	Repository  *common.Repository  `bson:"repository" json:"repository,omitempty"`
	Commit      *object.Commit      `bson:"commit" json:"commit,omitempty"`
	TCPPorts    []core.ServicePort  `bson:"tcp_ports" json:"tcp_ports,omitempty" yaml:"tcp_ports"`
	HTTPPorts   []core.ServicePort  `bson:"http_ports" json:"http_ports,omitempty" yaml:"http_ports"`
	Error       string              `bson:"error_msg" json:"error_msg,omitempty"`
	// This is used to read in a 'workflow' string before parsing/converting
	// to the correct Workflow type
	RawWorkflow string              `bson:"workflow" json:"workflow,omitempty" yaml:"workflow"`
	Workflow    types.CacaoWorkflow `bson:"-" json:"-" yaml:"-"`
}

WorkflowDefinition struct is created from a YAML file in a git repository and holds information necessary to start a WorkflowDefinition

func (WorkflowDefinition) GetCollection

func (wfd WorkflowDefinition) GetCollection() string

GetCollection returns the collection in which WorkflowDefinition should be stored

func (WorkflowDefinition) GetID

func (wfd WorkflowDefinition) GetID() string

GetID returns the WorkflowDefinition ID

func (WorkflowDefinition) GetOwner

func (wfd WorkflowDefinition) GetOwner() string

GetOwner returns the Owner of this WorkflowDefinition

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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