runner

package
v0.0.38 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2018 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FireCampaignEvents added in v0.0.20

func FireCampaignEvents(
	ctx context.Context, db *sqlx.DB, rp *redis.Pool,
	orgID models.OrgID, fires []*models.EventFire, flowUUID assets.FlowUUID,
	event *triggers.CampaignEvent) ([]*models.Session, error)

FireCampaignEvents starts the flow for the passed in org, contact and flow

func ResumeFlow added in v0.0.38

func ResumeFlow(ctx context.Context, db *sqlx.DB, rp *redis.Pool, org *models.OrgAssets, sa flows.SessionAssets, session *models.Session, resume flows.Resume, hook models.SessionCommitHook) (*models.Session, error)

ResumeFlow resumes the passed in session using the passed in session

func StartFlowBatch added in v0.0.27

func StartFlowBatch(
	ctx context.Context, db *sqlx.DB, rp *redis.Pool,
	batch *models.FlowStartBatch) ([]*models.Session, error)

StartFlowBatch starts the flow for the passed in org, contacts and flow

func StartFlowForContact added in v0.0.38

func StartFlowForContact(
	ctx context.Context, db *sqlx.DB, rp *redis.Pool, org *models.OrgAssets, assets flows.SessionAssets,
	trigger flows.Trigger, hook models.SessionCommitHook) (*models.Session, error)

StartFlowForContact runs the passed in flow for the passed in contact

func StartFlowForContacts added in v0.0.38

func StartFlowForContacts(
	ctx context.Context, db *sqlx.DB, rp *redis.Pool, org *models.OrgAssets,
	flow *models.Flow, contactIDs []flows.ContactID, options *StartOptions,
	buildTrigger TriggerBuilder, hook models.SessionCommitHook) ([]*models.Session, error)

StartFlowForContacts runs the passed in flow for the passed in contact

Types

type StartOptions added in v0.0.27

type StartOptions struct {
	// RestartParticipants should be true if the flow start should restart participants already in this flow
	RestartParticipants bool

	// IncludeActive should be true if we want to interrupt people active in other flows (including this one)
	IncludeActive bool

	// Interrupt should be true if we want to interrupt the flows runs for any contact started in this flow
	// (simple campaign events do not currently interrupt)
	Interrupt bool
}

type TriggerBuilder added in v0.0.27

type TriggerBuilder func(contact *flows.Contact) flows.Trigger

TriggerBuilder defines the interface for building a trigger for the passed in contact

Jump to

Keyboard shortcuts

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