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 ¶
- func Create(reqBytes []byte, natsInfo map[string]string)
- func Delete(reqBytes []byte, natsInfo map[string]string)
- func Get(reqBytes []byte, msg *nats.Msg, natsInfo map[string]string)
- func GetForUser(reqBytes []byte, msg *nats.Msg, natsInfo map[string]string)
- func InitMongoDB(name, address string) error
- func Update(reqBytes []byte, natsInfo map[string]string)
- type Request
- type WorkflowDefinition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetForUser ¶
GetForUser synchronously responds with all WorkflowDefinitions owned by a user
func InitMongoDB ¶
InitMongoDB will initialize the connection to the database
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