Documentation ¶
Index ¶
- Constants
- Variables
- func GetRunByIdTx(tx *sqlx.Tx, options api.Options, id uuid.UUID) (*api.RunRecord, error)
- func InitLogrus(out io.Writer, level log.Level)
- type BL
- func (b *BL) DeleteRuns(query *api.DeleteQuery) error
- func (b *BL) DoStepByLabel(params *api.DoStepByLabelParams, synchronous bool) (api.DoStepByLabelResult, error)
- func (b *BL) DoStepByUUID(params *api.DoStepByUUIDParams, synchronous bool) (api.DoStepByUUIDResult, error)
- func (b *BL) Enqueue(do *doWork) error
- func (b *BL) GetRun(options api.Options, id uuid.UUID) (*api.RunRecord, error)
- func (b *BL) GetRuns(query *api.GetRunsQuery) ([]api.RunRecord, error)
- func (b *BL) GetSteps(query *api.GetStepsQuery) ([]api.StepRecord, error)
- func (b *BL) IsPostgreSQL() bool
- func (b *BL) IsSqlite() bool
- func (b *BL) ListRuns(query *api.ListQuery) ([]api.RunRecord, *api.RangeResult, error)
- func (b *BL) ListSteps(query *api.ListQuery) ([]api.StepRecord, *api.RangeResult, error)
- func (b *BL) MigrateDB(autoMigrate bool) error
- func (b *BL) QueuesIdle() bool
- func (b *BL) UpdateRunStatus(options api.Options, runId uuid.UUID, newStatus api.RunStatusType) error
- func (b *BL) UpdateStepByLabel(query *api.UpdateQueryByLabel) error
- func (b *BL) UpdateStepByUUID(query *api.UpdateQueryByUUID) error
- type DO
- type Decision
- type DoType
- type DoubleCurlyToken
- type Event
- type Expiration
- type JOBQueueType
- type On
- type RabbitMQ
- type RecoveryMessage
- type Rego
- type Rule
- type RulesDecision
- type Step
- type StepDo
- type StepDoEvaluate
- type StepDoEvaluateOptions
- type StepDoREST
- type StepDoRESTOptions
- type StepStateRest
- type Template
- func (t *Template) CreateRun(BL *BL, options api.Options, key string) (*api.RunRecord, error)
- func (t *Template) EvaluateCurlyPercent(BL *BL, step *Step, str string, currentContext api.Context, ...) (string, error)
- func (t *Template) LoadAndCreateRun(BL *BL, options api.Options, key string, fileName string, fileType string) (uuid.UUID, error)
- func (t *Template) LoadFromBytes(BL *BL, runId uuid.UUID, isYaml bool, yamlDocument []byte) error
- func (t *Template) RefreshInput(BL *BL, options api.Options, runId uuid.UUID)
- func (t *Template) ResolveContext(BL *BL, step *Step, jsonStr string, currentContext api.Context, ...) (api.Context, error)
- func (t *Template) ResolveInput(BL *BL, step *Step, jsonStr string, currentContext api.Context, ...) (api.Input, error)
- func (t *Template) StartDo(BL *BL, options api.Options, runId uuid.UUID, label string, stepUUID uuid.UUID, ...) (*api.StepRecord, error)
- func (t *Template) TransitionStateAndStatus(BL *BL, options api.Options, runId uuid.UUID, label string, stepUUID uuid.UUID, ...) (*api.StepRecord, error)
- type Then
- type ThenDo
- type ThenError
- type WorkType
Constants ¶
View Source
const ( DefaultDoRestTimeout = 60 DefaultMaxResponseHeaderBytes = 64 * 1024 DefaultMaxResponseBodyBytes = 256 * 1024 )
View Source
const ( OnPhasePreTransaction = iota OnPhaseInTransaction OnPhasePostTransaction )
View Source
const CodeDatabaseVersion = 1
View Source
const (
ExpirationStepIndex = -1
)
View Source
const RecoveryChannelName = "recovery"
Variables ¶
View Source
var DefaultAllowedBuiltins = []*ast.Builtin{}/* 141 elements not displayed */
View Source
var LabelFormat = regexp.MustCompile(`^[a-zA-Z][a-zA-Z_0-9]*`)
View Source
var TESTSLock sync.Mutex
Functions ¶
func GetRunByIdTx ¶
Types ¶
type BL ¶
type BL struct { TLSEnable bool TLSEnableClientCertificateCheck bool TLSCertFile string TLSKeyFile string TLSCAFile string InterruptServe chan os.Signal ServerReady bool ValveCtx context.Context ShutdownValve *valve.Valve CancelValveCtx context.CancelFunc JobQueueType JOBQueueType PendingRecursionDepthLimit int InstanceId string DAO *dao.DAO Client *client.CLI // contains filtered or unexported fields }
func (*BL) DeleteRuns ¶
func (b *BL) DeleteRuns(query *api.DeleteQuery) error
func (*BL) DoStepByLabel ¶
func (b *BL) DoStepByLabel(params *api.DoStepByLabelParams, synchronous bool) (api.DoStepByLabelResult, error)
func (*BL) DoStepByUUID ¶
func (b *BL) DoStepByUUID(params *api.DoStepByUUIDParams, synchronous bool) (api.DoStepByUUIDResult, error)
func (*BL) GetSteps ¶
func (b *BL) GetSteps(query *api.GetStepsQuery) ([]api.StepRecord, error)
func (*BL) IsPostgreSQL ¶
func (*BL) ListSteps ¶
func (b *BL) ListSteps(query *api.ListQuery) ([]api.StepRecord, *api.RangeResult, error)
func (*BL) QueuesIdle ¶
try not to use this, this is primarily for testing
func (*BL) UpdateRunStatus ¶
func (*BL) UpdateStepByLabel ¶
func (b *BL) UpdateStepByLabel(query *api.UpdateQueryByLabel) error
func (*BL) UpdateStepByUUID ¶
func (b *BL) UpdateStepByUUID(query *api.UpdateQueryByUUID) error
type DoubleCurlyToken ¶
func TokenizeCurlyPercent ¶
func TokenizeCurlyPercent(originalString string) (result []DoubleCurlyToken, sanitizedString string)
type Event ¶
type Event struct { Decisions []RulesDecision `json:"decisions,omitempty"` Rules []Rule `json:"rules,omitempty"` }
type Expiration ¶
type Expiration struct { CompleteBy int64 `json:"complete-by,omitempty" mapstructure:"complete-by" yaml:"complete-by,omitempty"` Decisions []RulesDecision `json:"decisions,omitempty"` Rules []Rule `json:"rules,omitempty"` }
type JOBQueueType ¶
type JOBQueueType int
const ( JobQueueTypeMemoryQueue JOBQueueType = 0 JobQueueTypeRabbitMQ JOBQueueType = 10 )
func TranslateToJOBQueueType ¶
func TranslateToJOBQueueType(status string) (JOBQueueType, error)
type On ¶
type On struct { InProgress Event `json:"in-progress,omitempty" mapstructure:"in-progress" yaml:"in-progress,omitempty"` Pending Event `json:"pending,omitempty" mapstructure:"pending" yaml:"pending,omitempty"` Done Event `json:"done,omitempty" mapstructure:"done" yaml:"done,omitempty"` Failed Event `json:"failed,omitempty" mapstructure:"failed" yaml:"failed,omitempty"` }
type RecoveryMessage ¶
type RulesDecision ¶
type Step ¶
type Step struct { Name string `json:"name,omitempty"` Tags pq.StringArray `json:"tags,omitempty"` Label string `json:"label,omitempty"` Description string `json:"description,omitempty"` Parameters api.Parameters `json:"parameters,omitempty"` Do interface{} `json:"do,omitempty"` On On `json:"on,omitempty"` Retries int `json:"retries,omitempty"` // contains filtered or unexported fields }
func (*Step) GetCompleteBy ¶
func (*Step) GetHeartBeatTimeout ¶
type StepDo ¶
type StepDo struct { Type DoType `json:"type,omitempty" mapstructure:"type" yaml:"type,omitempty"` HeartBeatTimeout int64 `json:"heartbeat-timeout,omitempty" mapstructure:"heartbeat-timeout" yaml:"heartbeat-timeout,omitempty"` Retries int64 `json:"retries,omitempty" mapstructure:"retries" yaml:"retries,omitempty"` CompleteBy int64 `json:"complete-by,omitempty" mapstructure:"complete-by" yaml:"complete-by,omitempty"` }
type StepDoEvaluate ¶
type StepDoEvaluate struct { StepDo `yaml:",inline" mapstructure:",squash"` Options StepDoEvaluateOptions `json:"options,omitempty"` }
type StepDoEvaluateOptions ¶
type StepDoEvaluateOptions struct {
Result string `json:"result,omitempty"`
}
type StepDoREST ¶
type StepDoREST struct { StepDo `yaml:",inline" mapstructure:",squash"` Options StepDoRESTOptions `json:"options,omitempty"` }
func (StepDoREST) Describe ¶
func (do StepDoREST) Describe() string
type StepDoRESTOptions ¶
type StepDoRESTOptions struct { Timeout int64 `json:"timeout,omitempty"` Method string `json:"method,omitempty"` Url string `json:"url,omitempty"` Headers http.Header `json:"headers,omitempty"` MaxResponseBodyBytes int64 `json:"max-response-body-bytes,omitempty" mapstructure:"max-response-body-bytes" yaml:"max-response-body-bytes,omitempty"` Body string `json:"body,omitempty"` }
type StepStateRest ¶
type StepStateRest struct { Body interface{} `json:"body,omitempty" mapstructure:"body" yaml:"body,omitempty"` ContentType string `json:"content-type,omitempty" mapstructure:"content-type" yaml:"content-type,omitempty"` StatusCode int `json:"status-code,omitempty" mapstructure:"status-code" yaml:"status-code,omitempty"` StatusPhrase string `json:"status-phrase,omitempty" mapstructure:"status-phrase" yaml:"status-phrase,omitempty"` Header map[string][]string `json:"header,omitempty" mapstructure:"header" yaml:"header,omitempty"` }
type Template ¶
type Template struct { Title string `json:"title,omitempty"` Version int `json:"version,omitempty"` Expiration Expiration `json:"expiration,omitempty"` Steps []Step `json:"steps,omitempty"` Tags pq.StringArray `json:"tags,omitempty"` Decisions []Decision `json:"decisions,omitempty"` Parameters api.Parameters `json:"parameters,omitempty"` // contains filtered or unexported fields }
func (*Template) EvaluateCurlyPercent ¶
func (*Template) LoadAndCreateRun ¶
func (*Template) LoadFromBytes ¶
func (*Template) RefreshInput ¶
func (*Template) ResolveContext ¶
func (*Template) ResolveInput ¶
func (*Template) TransitionStateAndStatus ¶
type Then ¶
type Then struct { SetRunStatus *api.RunStatusType `json:"set-run-status,omitempty" mapstructure:"set-run-status,omitempty" yaml:"set-run-status,omitempty"` Error *ThenError `json:"error,omitempty"` Do []ThenDo `json:"do,omitempty"` }
Click to show internal directories.
Click to hide internal directories.