Documentation ¶
Index ¶
- Constants
- type Channel
- type CommitObject
- type Criteria
- type CriteriaType
- type DBCount
- type DBDelete
- type DBDeleteObj
- type DBExists
- type DBFirst
- type DBInsert
- type DBQuery
- type DBUpdate
- type DBUpdateCols
- type DatabaseOpts
- type DatabaseType
- type Engine
- type EngineOpts
- type IDField
- type PullData
- type Schema
- type Service
- type StepComplete
- type User
- type WorkflowStep
Constants ¶
const (
CACHE_DIR = "./cache"
)
const (
DATE_FORMAT = "2006-01-02 15:04:05" // MySQL format
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel struct { ChannelID string `json:"channel_id"` ChannelDescription string `json:"channel_description,omitempty"` ServiceID string `json:"service_id"` Initiators []string `json:"initiators"` // List of systems which can initiate this workflow FileName string `json:"-"` FileHash string `json:"-"` // sha1 of the struct Steps []WorkflowStep `json:"steps"` }
Channel represents a single workflow channel. This is in a separate file.
type CommitObject ¶
type CommitObject struct { Name string `json:"name"` Type string `json:"type"` Variables map[string]string `json:"variables"` }
CommitObject represents a database object which can be used in the Commit stage of a WorkflowStep.
type Criteria ¶
type Criteria struct { CriteriaName string `json:"name"` Expression string `json:"expression"` CompiledExpr *vm.Program `json:"-"` FailMessage string `json:"fail_message,omitempty"` }
Criteria represents a criteria required for a step to continue.
type CriteriaType ¶
type CriteriaType int
CriteriaType is the type of criteria in a workflow step. There are criterion which must be true before a step can be actualised, and criterion which must be true before a step is complete.
const ( ExecutionCriteria CriteriaType = iota + 1 FinalisationCriteria )
type DBCount ¶
DBCount is the type of the function which returns the count of rows which matches the query from the external database.
type DBDeleteObj ¶
type DBDeleteObj func(object interface{}) error
type DBExists ¶
DBExists is the type of the function which returns whether a row exists in the database which matches the query in the external database.
type DBFirst ¶
DBFirst is the type of the function which returns the first row which matches the query from the external database.
type DBQuery ¶
DBQuery is the type of the function which returns the all the rows which matches the query from the external database.
type DBUpdateCols ¶
type DatabaseOpts ¶
type DatabaseOpts struct { Type DatabaseType Host, User, Password string Database string SSLMode string // TLS mode for MySQL, SSLMode for PostgreSQL Path string // for SQLite only }
DatabaseOpts represents a database connection credentials.
type DatabaseType ¶
type DatabaseType int
DatabaseType represents a database driver.
const ( SQLite DatabaseType = iota MySQL PostgreSQL )
type Engine ¶
type Engine struct { Options EngineOpts EngineDB *xorm.Engine ExtDB *xorm.Engine SchemasModified bool Schemas map[string]Schema Services []Service DevMode bool }
Engine represents a workflow engine.
func NewEngine ¶
func NewEngine(opt EngineOpts) (e *Engine, err error)
NewEngine creates a new Workflow Engine based on the given options. Returns an error if it couldn't connect to any of the databases, or when there is an error loading the workflow files from disk.
func SetupTestEngine ¶
func SetupTestEngine() *Engine
func (*Engine) RegisterSchema ¶
RegisterSchema adds an GORM structure to the list of available schemas in the engine, so it could be used in the workflows. These relate to the ExtDatabase given in the EngineOpts.
func (*Engine) Run ¶
func (e *Engine) Run()
Run runs the HTTP server which hosts the JSON API and dashboard.
func (*Engine) RunWebInterface ¶
func (e *Engine) RunWebInterface()
func (*Engine) ServeHTTP ¶
func (e *Engine) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP runs the HTTP server which hosts the JSON API.
func (*Engine) ValidateWorkflows ¶
ValidateWorkflows goes through each workflow, and make sure all database-related fields, actions, etc can be reflected. This must only be run once all schemas are registered.
type EngineOpts ¶
type EngineOpts struct { EngineDatabase DatabaseOpts ExtDatabase DatabaseOpts WorkflowDirPath string Users []User APIPort int AdminPort int DashboardKey string APITokens []string }
EngineOpts represents a workflow engine options.
type Service ¶
type Service struct { ServiceID string `json:"service_id"` Description string `json:"description"` Category string `json:"category"` FileName string `json:"-"` FileHash string `json:"-"` // sha1 of the struct Channels []Channel `json:"-"` // We load these from separate files }
Service represents a category of workflows. This is in a separate file.
type StepComplete ¶
type WorkflowStep ¶
type WorkflowStep struct { StepID string `json:"step_id"` Status string `json:"status"` // Status description of this step // Page which will show to the end-user, does not affect the engine Page string `json:"page"` PostTo []string `json:"post_to"` DataIn []string `json:"data_in"` DataOut []string `json:"data_out"` PullData []PullData `json:"pull_data"` CriteriaExec []Criteria `json:"criteria_execution"` CriteriaFinal []Criteria `json:"criteria_finalisation"` CommitObjects []CommitObject `json:"commit_objects"` Commit []string `json:"commit"` EndApplication bool `json:"end_application"` }
WorkflowStep represents a step.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package public generated by go-bindata.// sources: public/bindata.go public/css/main.css public/css/normalize-8.0.1.min.css public/img/logo.png
|
Package public generated by go-bindata.// sources: public/bindata.go public/css/main.css public/css/normalize-8.0.1.min.css public/img/logo.png |
Package templates generated by go-bindata.// sources: templates/base/footer.tmpl templates/base/head.tmpl templates/bindata.go templates/channel.tmpl templates/dash.tmpl templates/edit-channel.tmpl templates/edit-service.tmpl templates/edit-step.tmpl templates/errors.tmpl templates/index.tmpl templates/login.tmpl templates/new-channel.tmpl templates/new-commit-obj.tmpl templates/new-criteria.tmpl templates/new-service.tmpl templates/new-step.tmpl templates/partials/flash.tmpl templates/service.tmpl templates/step.tmpl
|
Package templates generated by go-bindata.// sources: templates/base/footer.tmpl templates/base/head.tmpl templates/bindata.go templates/channel.tmpl templates/dash.tmpl templates/edit-channel.tmpl templates/edit-service.tmpl templates/edit-step.tmpl templates/errors.tmpl templates/index.tmpl templates/login.tmpl templates/new-channel.tmpl templates/new-commit-obj.tmpl templates/new-criteria.tmpl templates/new-service.tmpl templates/new-step.tmpl templates/partials/flash.tmpl templates/service.tmpl templates/step.tmpl |