Documentation ¶
Index ¶
- Variables
- func CheckAndExecuteTemplate(ctx context.Context, db *gorp.DbMap, store cache.Store, ...) ([]sdk.Message, *sdk.WorkflowTemplateInstance, error)
- func CreateAuditAdd(db gorp.SqlExecutor, wt sdk.WorkflowTemplate, u sdk.Identifiable) error
- func CreateAuditInstanceAdd(db gorp.SqlExecutor, wti sdk.WorkflowTemplateInstance, u sdk.Identifiable) error
- func CreateAuditInstanceUpdate(db gorp.SqlExecutor, oldI, newI sdk.WorkflowTemplateInstance, ...) error
- func CreateAuditUpdate(db gorp.SqlExecutor, oldT, newT sdk.WorkflowTemplate, changeMessage string, ...) error
- func Delete(db gorp.SqlExecutor, wt *sdk.WorkflowTemplate) error
- func DeleteInstance(db gorp.SqlExecutor, wti *sdk.WorkflowTemplateInstance) error
- func DeleteInstanceNotIDAndWorkflowID(db gorp.SqlExecutor, id, workflowID int64) error
- func Execute(wt sdk.WorkflowTemplate, instance sdk.WorkflowTemplateInstance) (exportentities.WorkflowComponents, error)
- func GetAndLockBulkByID(ctx context.Context, db gorpmapper.SqlExecutorWithTx, id int64) (*sdk.WorkflowTemplateBulk, error)
- func GetBulkByIDAndTemplateID(ctx context.Context, db gorp.SqlExecutor, id, templateID int64) (*sdk.WorkflowTemplateBulk, error)
- func GetBulksPending(ctx context.Context, db gorp.SqlExecutor) ([]sdk.WorkflowTemplateBulk, error)
- func GetInstanceAuditsByInstanceIDsAndEventTypes(db gorp.SqlExecutor, instanceIDs []int64, eventTypes []string) ([]sdk.AuditWorkflowTemplateInstance, error)
- func Insert(db gorp.SqlExecutor, wt *sdk.WorkflowTemplate) error
- func InsertAudit(db gorp.SqlExecutor, awt *sdk.AuditWorkflowTemplate) error
- func InsertBulk(db gorp.SqlExecutor, wtb *sdk.WorkflowTemplateBulk) error
- func InsertInstance(db gorp.SqlExecutor, wti *sdk.WorkflowTemplateInstance) error
- func InsertInstanceAudit(db gorp.SqlExecutor, awti *sdk.AuditWorkflowTemplateInstance) error
- func LoadAll(ctx context.Context, db gorp.SqlExecutor, opts ...LoadOptionFunc) ([]sdk.WorkflowTemplate, error)
- func LoadAllByGroupIDs(ctx context.Context, db gorp.SqlExecutor, groupIDs []int64, ...) ([]sdk.WorkflowTemplate, error)
- func LoadAllByIDs(ctx context.Context, db gorp.SqlExecutor, ids []int64, opts ...LoadOptionFunc) ([]sdk.WorkflowTemplate, error)
- func LoadAuditByTemplateIDAndVersion(ctx context.Context, db gorp.SqlExecutor, templateID, version int64) (*sdk.AuditWorkflowTemplate, error)
- func LoadAuditLatestByTemplateID(ctx context.Context, db gorp.SqlExecutor, templateID int64) (*sdk.AuditWorkflowTemplate, error)
- func LoadAuditOldestByTemplateID(ctx context.Context, db gorp.SqlExecutor, templateID int64) (*sdk.AuditWorkflowTemplate, error)
- func LoadAuditsByTemplateIDAndVersionGTE(db gorp.SqlExecutor, templateID, version int64) ([]sdk.AuditWorkflowTemplate, error)
- func LoadByID(ctx context.Context, db gorp.SqlExecutor, id int64, opts ...LoadOptionFunc) (*sdk.WorkflowTemplate, error)
- func LoadBySlugAndGroupID(ctx context.Context, db gorp.SqlExecutor, slug string, groupID int64, ...) (*sdk.WorkflowTemplate, error)
- func LoadInstanceByIDForTemplateIDAndProjectIDs(ctx context.Context, db gorp.SqlExecutor, id, templateID int64, ...) (*sdk.WorkflowTemplateInstance, error)
- func LoadInstanceByTemplateIDAndProjectIDAndRequestWorkflowName(ctx context.Context, db gorp.SqlExecutor, templateID, projectID int64, ...) (*sdk.WorkflowTemplateInstance, error)
- func LoadInstanceByWorkflowID(ctx context.Context, db gorp.SqlExecutor, workflowID int64, ...) (*sdk.WorkflowTemplateInstance, error)
- func LoadInstanceByWorkflowIDs(ctx context.Context, db gorp.SqlExecutor, workflowID []int64, ...) ([]sdk.WorkflowTemplateInstance, error)
- func LoadInstancesByTemplateIDAndProjectIDs(ctx context.Context, db gorp.SqlExecutor, templateID int64, projectIDs []int64, ...) ([]sdk.WorkflowTemplateInstance, error)
- func LoadInstancesByWorkflowIDs(ctx context.Context, db gorp.SqlExecutor, workflowIDs []int64, ...) ([]sdk.WorkflowTemplateInstance, error)
- func Parse(wt sdk.WorkflowTemplate) (sdk.WorkflowTemplateParsed, error)
- func Pull(ctx context.Context, wt *sdk.WorkflowTemplate, f exportentities.Format, ...) error
- func Push(ctx context.Context, db gorp.SqlExecutor, wt *sdk.WorkflowTemplate, ...) ([]sdk.Message, error)
- func Update(db gorp.SqlExecutor, wt *sdk.WorkflowTemplate) error
- func UpdateBulk(db gorp.SqlExecutor, wtb *sdk.WorkflowTemplateBulk) error
- func UpdateInstance(db gorp.SqlExecutor, wti *sdk.WorkflowTemplateInstance) error
- func UpdateTemplateInstanceWithWorkflow(ctx context.Context, db gorp.SqlExecutor, w sdk.Workflow, u sdk.Identifiable, ...) error
- type LoadInstanceOptionFunc
- type LoadOptionFunc
- type TemplateRequestModifierFunc
Constants ¶
This section is empty.
Variables ¶
var LoadInstanceOptions = struct { WithTemplate LoadInstanceOptionFunc WithAudits LoadInstanceOptionFunc }{ WithTemplate: loadInstanceTemplate, WithAudits: loadInstanceAudits, }
LoadInstanceOptions provides all options on workflow template instance loads functions
var LoadOptions = struct { Default LoadOptionFunc WithAudits LoadOptionFunc WithGroup LoadOptionFunc }{ Default: loadDefault, WithAudits: loadAudits, WithGroup: loadGroup, }
LoadOptions provides all options to load workflow template.
var TemplateRequestModifiers = struct { Detached TemplateRequestModifierFunc DefaultKeys func(proj sdk.Project) TemplateRequestModifierFunc DefaultNameAndRepositories func(proj sdk.Project, repoURL string) TemplateRequestModifierFunc }{ Detached: requestModifyDetached, DefaultKeys: requestModifyDefaultKeysfunc, DefaultNameAndRepositories: requestModifyDefaultNameAndRepositories, }
Functions ¶
func CheckAndExecuteTemplate ¶
func CheckAndExecuteTemplate(ctx context.Context, db *gorp.DbMap, store cache.Store, consumer sdk.AuthUserConsumer, p sdk.Project, data *exportentities.WorkflowComponents, mods ...TemplateRequestModifierFunc) ([]sdk.Message, *sdk.WorkflowTemplateInstance, error)
CheckAndExecuteTemplate will execute the workflow template if given workflow components contains a template instance. When detached is set this will not create/update any template instance in database (this is useful for workflow ascode branches).
func CreateAuditAdd ¶
func CreateAuditAdd(db gorp.SqlExecutor, wt sdk.WorkflowTemplate, u sdk.Identifiable) error
CreateAuditAdd create an audit for template add.
func CreateAuditInstanceAdd ¶
func CreateAuditInstanceAdd(db gorp.SqlExecutor, wti sdk.WorkflowTemplateInstance, u sdk.Identifiable) error
CreateAuditInstanceAdd create an audit for template instance add.
func CreateAuditInstanceUpdate ¶
func CreateAuditInstanceUpdate(db gorp.SqlExecutor, oldI, newI sdk.WorkflowTemplateInstance, u sdk.Identifiable) error
CreateAuditInstanceUpdate create an audit for template instance update.
func CreateAuditUpdate ¶
func CreateAuditUpdate(db gorp.SqlExecutor, oldT, newT sdk.WorkflowTemplate, changeMessage string, u sdk.Identifiable) error
CreateAuditUpdate create an audit for template update.
func Delete ¶
func Delete(db gorp.SqlExecutor, wt *sdk.WorkflowTemplate) error
Delete template in database.
func DeleteInstance ¶
func DeleteInstance(db gorp.SqlExecutor, wti *sdk.WorkflowTemplateInstance) error
DeleteInstance for workflow template in database.
func DeleteInstanceNotIDAndWorkflowID ¶
func DeleteInstanceNotIDAndWorkflowID(db gorp.SqlExecutor, id, workflowID int64) error
DeleteInstanceNotIDAndWorkflowID removes all instances of a template where not id and workflow id equal in database.
func Execute ¶
func Execute(wt sdk.WorkflowTemplate, instance sdk.WorkflowTemplateInstance) (exportentities.WorkflowComponents, error)
Execute returns yaml file from template.
func GetAndLockBulkByID ¶ added in v0.53.0
func GetAndLockBulkByID(ctx context.Context, db gorpmapper.SqlExecutorWithTx, id int64) (*sdk.WorkflowTemplateBulk, error)
GetAndLockBulkByID returns an bulk from database for given id.
func GetBulkByIDAndTemplateID ¶
func GetBulkByIDAndTemplateID(ctx context.Context, db gorp.SqlExecutor, id, templateID int64) (*sdk.WorkflowTemplateBulk, error)
GetBulkByIDAndTemplateID returns the workflow template bulk for given id and template id.
func GetBulksPending ¶ added in v0.53.0
func GetBulksPending(ctx context.Context, db gorp.SqlExecutor) ([]sdk.WorkflowTemplateBulk, error)
GetBulksPending returns the workflow template bulks with pending status.
func GetInstanceAuditsByInstanceIDsAndEventTypes ¶
func GetInstanceAuditsByInstanceIDsAndEventTypes(db gorp.SqlExecutor, instanceIDs []int64, eventTypes []string) ([]sdk.AuditWorkflowTemplateInstance, error)
GetInstanceAuditsByInstanceIDsAndEventTypes returns all workflow template instance audits by instance ids and event types.
func Insert ¶
func Insert(db gorp.SqlExecutor, wt *sdk.WorkflowTemplate) error
Insert template in database.
func InsertAudit ¶
func InsertAudit(db gorp.SqlExecutor, awt *sdk.AuditWorkflowTemplate) error
InsertAudit for workflow template in database.
func InsertBulk ¶
func InsertBulk(db gorp.SqlExecutor, wtb *sdk.WorkflowTemplateBulk) error
InsertBulk task for workflow template in database.
func InsertInstance ¶
func InsertInstance(db gorp.SqlExecutor, wti *sdk.WorkflowTemplateInstance) error
InsertInstance for workflow template in database.
func InsertInstanceAudit ¶
func InsertInstanceAudit(db gorp.SqlExecutor, awti *sdk.AuditWorkflowTemplateInstance) error
InsertInstanceAudit for workflow template instance in database.
func LoadAll ¶
func LoadAll(ctx context.Context, db gorp.SqlExecutor, opts ...LoadOptionFunc) ([]sdk.WorkflowTemplate, error)
LoadAll workflow templates from database.
func LoadAllByGroupIDs ¶
func LoadAllByGroupIDs(ctx context.Context, db gorp.SqlExecutor, groupIDs []int64, opts ...LoadOptionFunc) ([]sdk.WorkflowTemplate, error)
LoadAllByGroupIDs returns all workflow templates by group ids.
func LoadAllByIDs ¶
func LoadAllByIDs(ctx context.Context, db gorp.SqlExecutor, ids []int64, opts ...LoadOptionFunc) ([]sdk.WorkflowTemplate, error)
LoadAllByIDs returns all workflow templates by ids.
func LoadAuditByTemplateIDAndVersion ¶
func LoadAuditByTemplateIDAndVersion(ctx context.Context, db gorp.SqlExecutor, templateID, version int64) (*sdk.AuditWorkflowTemplate, error)
LoadAuditByTemplateIDAndVersion returns workflow template audit by template id and version.
func LoadAuditLatestByTemplateID ¶
func LoadAuditLatestByTemplateID(ctx context.Context, db gorp.SqlExecutor, templateID int64) (*sdk.AuditWorkflowTemplate, error)
LoadAuditLatestByTemplateID returns workflow template latest audit by template id.
func LoadAuditOldestByTemplateID ¶
func LoadAuditOldestByTemplateID(ctx context.Context, db gorp.SqlExecutor, templateID int64) (*sdk.AuditWorkflowTemplate, error)
LoadAuditOldestByTemplateID returns workflow template oldtest audit by template id.
func LoadAuditsByTemplateIDAndVersionGTE ¶
func LoadAuditsByTemplateIDAndVersionGTE(db gorp.SqlExecutor, templateID, version int64) ([]sdk.AuditWorkflowTemplate, error)
LoadAuditsByTemplateIDAndVersionGTE returns all workflow template audits by template id and version greater or equal.
func LoadByID ¶
func LoadByID(ctx context.Context, db gorp.SqlExecutor, id int64, opts ...LoadOptionFunc) (*sdk.WorkflowTemplate, error)
LoadByID retrieves in database the workflow template with given id.
func LoadBySlugAndGroupID ¶
func LoadBySlugAndGroupID(ctx context.Context, db gorp.SqlExecutor, slug string, groupID int64, opts ...LoadOptionFunc) (*sdk.WorkflowTemplate, error)
LoadBySlugAndGroupID returns the workflow template for given slug and group id.
func LoadInstanceByIDForTemplateIDAndProjectIDs ¶
func LoadInstanceByIDForTemplateIDAndProjectIDs(ctx context.Context, db gorp.SqlExecutor, id, templateID int64, projectIDs []int64, opts ...LoadInstanceOptionFunc) (*sdk.WorkflowTemplateInstance, error)
LoadInstanceByIDForTemplateIDAndProjectIDs returns a workflow template instance by id, template id in project ids.
func LoadInstanceByTemplateIDAndProjectIDAndRequestWorkflowName ¶
func LoadInstanceByTemplateIDAndProjectIDAndRequestWorkflowName(ctx context.Context, db gorp.SqlExecutor, templateID, projectID int64, workflowName string, opts ...LoadInstanceOptionFunc) (*sdk.WorkflowTemplateInstance, error)
LoadInstanceByTemplateIDAndProjectIDAndRequestWorkflowName return a workflow template instance by template id, project id and request workflow name.
func LoadInstanceByWorkflowID ¶
func LoadInstanceByWorkflowID(ctx context.Context, db gorp.SqlExecutor, workflowID int64, opts ...LoadInstanceOptionFunc) (*sdk.WorkflowTemplateInstance, error)
LoadInstanceByWorkflowID returns a workflow template instance by workflow id.
func LoadInstanceByWorkflowIDs ¶
func LoadInstanceByWorkflowIDs(ctx context.Context, db gorp.SqlExecutor, workflowID []int64, opts ...LoadInstanceOptionFunc) ([]sdk.WorkflowTemplateInstance, error)
LoadInstanceByWorkflowIDs returns a workflow template instance by workflow ids.
func LoadInstancesByTemplateIDAndProjectIDs ¶
func LoadInstancesByTemplateIDAndProjectIDs(ctx context.Context, db gorp.SqlExecutor, templateID int64, projectIDs []int64, opts ...LoadInstanceOptionFunc) ([]sdk.WorkflowTemplateInstance, error)
LoadInstancesByTemplateIDAndProjectIDs returns all workflow template instances by template id and project ids.
func LoadInstancesByWorkflowIDs ¶
func LoadInstancesByWorkflowIDs(ctx context.Context, db gorp.SqlExecutor, workflowIDs []int64, opts ...LoadInstanceOptionFunc) ([]sdk.WorkflowTemplateInstance, error)
LoadInstancesByWorkflowIDs returns all workflow template instances by workflow ids.
func Parse ¶
func Parse(wt sdk.WorkflowTemplate) (sdk.WorkflowTemplateParsed, error)
Parse return a template with parsed content.
func Pull ¶
func Pull(ctx context.Context, wt *sdk.WorkflowTemplate, f exportentities.Format, w io.Writer) error
Pull writes the content of a template inside the given writer.
func Push ¶
func Push(ctx context.Context, db gorp.SqlExecutor, wt *sdk.WorkflowTemplate, u sdk.Identifiable) ([]sdk.Message, error)
Push creates or updates a workflow template from a tar.
func Update ¶
func Update(db gorp.SqlExecutor, wt *sdk.WorkflowTemplate) error
Update template in database.
func UpdateBulk ¶
func UpdateBulk(db gorp.SqlExecutor, wtb *sdk.WorkflowTemplateBulk) error
UpdateBulk task for workflow template in database.
func UpdateInstance ¶
func UpdateInstance(db gorp.SqlExecutor, wti *sdk.WorkflowTemplateInstance) error
UpdateInstance for workflow template in database.
func UpdateTemplateInstanceWithWorkflow ¶
func UpdateTemplateInstanceWithWorkflow(ctx context.Context, db gorp.SqlExecutor, w sdk.Workflow, u sdk.Identifiable, wti *sdk.WorkflowTemplateInstance) error
UpdateTemplateInstanceWithWorkflow will perform some action after a successful workflow push, if it was generated from a template we want to set the workflow id on generated template instance.
Types ¶
type LoadInstanceOptionFunc ¶
type LoadInstanceOptionFunc func(context.Context, gorp.SqlExecutor, ...*sdk.WorkflowTemplateInstance) error
LoadInstanceOptionFunc for workflow template instance.
type LoadOptionFunc ¶
type LoadOptionFunc func(context.Context, gorp.SqlExecutor, ...*sdk.WorkflowTemplate) error
LoadOptionFunc for workflow template.
type TemplateRequestModifierFunc ¶
type TemplateRequestModifierFunc func(ctx context.Context, db gorpmapper.SqlExecutorWithTx, store cache.Store, wt sdk.WorkflowTemplate, req *sdk.WorkflowTemplateRequest) error