hooks

package
v0.0.73 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2018 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NoopHandler

func NoopHandler(ctx context.Context, tx *sqlx.Tx, rp *redis.Pool, org *models.OrgAssets, session *models.Session, event flows.Event) error

NoopHandler is our hook for events we ignore in a run

Types

type CommitAddedLabelsHook added in v0.0.58

type CommitAddedLabelsHook struct{}

CommitAddedLabelsHook is our hook for input labels being added

func (*CommitAddedLabelsHook) Apply added in v0.0.58

func (h *CommitAddedLabelsHook) Apply(ctx context.Context, tx *sqlx.Tx, rp *redis.Pool, org *models.OrgAssets, sessions map[*models.Session][]interface{}) error

Apply applies our input labels added, committing them in a single batch

type CommitFieldChangesHook added in v0.0.58

type CommitFieldChangesHook struct{}

CommitFieldChangesHook is our hook for contact field changes

func (*CommitFieldChangesHook) Apply added in v0.0.58

func (h *CommitFieldChangesHook) Apply(ctx context.Context, tx *sqlx.Tx, rp *redis.Pool, org *models.OrgAssets, sessions map[*models.Session][]interface{}) error

Apply squashes and writes all the field updates for the contacts

type CommitGroupChangesHook added in v0.0.58

type CommitGroupChangesHook struct{}

CommitGroupChangesHook is our hook for all group changes

func (*CommitGroupChangesHook) Apply added in v0.0.58

func (h *CommitGroupChangesHook) Apply(ctx context.Context, tx *sqlx.Tx, rp *redis.Pool, org *models.OrgAssets, sessions map[*models.Session][]interface{}) error

Apply squashes and adds or removes all our contact groups

type CommitLanguageChangesHook added in v0.0.58

type CommitLanguageChangesHook struct{}

CommitLanguageChangesHook is our hook for language changes

func (*CommitLanguageChangesHook) Apply added in v0.0.58

func (h *CommitLanguageChangesHook) Apply(ctx context.Context, tx *sqlx.Tx, rp *redis.Pool, org *models.OrgAssets, sessions map[*models.Session][]interface{}) error

Apply applies our contact language change before our commit

type CommitMessagesHook added in v0.0.58

type CommitMessagesHook struct{}

CommitMessagesHook is our hook for comitting session messages

func (*CommitMessagesHook) Apply added in v0.0.58

func (h *CommitMessagesHook) Apply(ctx context.Context, tx *sqlx.Tx, rp *redis.Pool, org *models.OrgAssets, sessions map[*models.Session][]interface{}) error

Apply takes care of inserting all the messages in the passed in sessions assigning topups to them as needed.

type CommitNameChangesHook added in v0.0.58

type CommitNameChangesHook struct{}

CommitNameChangesHook is our hook for name changes

func (*CommitNameChangesHook) Apply added in v0.0.58

func (h *CommitNameChangesHook) Apply(ctx context.Context, tx *sqlx.Tx, rp *redis.Pool, org *models.OrgAssets, sessions map[*models.Session][]interface{}) error

Apply commits our contact name changes as a bulk update for the passed in map of sessions

type CommitURNChangesHook added in v0.0.58

type CommitURNChangesHook struct{}

CommitURNChangesHook is our hook for when a URN is added to a contact

func (*CommitURNChangesHook) Apply added in v0.0.58

func (h *CommitURNChangesHook) Apply(ctx context.Context, tx *sqlx.Tx, rp *redis.Pool, org *models.OrgAssets, sessions map[*models.Session][]interface{}) error

Apply adds all our URNS in a batch

type ContactModifiedHook added in v0.0.48

type ContactModifiedHook struct{}

ContactModifiedHook is our hook for contact changes that require an update to modified_on

func (*ContactModifiedHook) Apply added in v0.0.48

func (h *ContactModifiedHook) Apply(ctx context.Context, tx *sqlx.Tx, rp *redis.Pool, org *models.OrgAssets, sessions map[*models.Session][]interface{}) error

Apply squashes and updates modified_on on all the contacts passed in

type FieldDelete

type FieldDelete struct {
	ContactID flows.ContactID  `db:"contact_id"`
	FieldUUID models.FieldUUID `db:"field_uuid"`
}

type FieldUpdate

type FieldUpdate struct {
	ContactID flows.ContactID `db:"contact_id"`
	Updates   string          `db:"updates"`
}

type FieldValue

type FieldValue struct {
	Text string `json:"text"`
}

type SendEmailsHook added in v0.0.58

type SendEmailsHook struct{}

SendEmailsHook is our hook for sending emails

func (*SendEmailsHook) Apply added in v0.0.58

func (h *SendEmailsHook) Apply(ctx context.Context, tx *sqlx.Tx, rp *redis.Pool, org *models.OrgAssets, sessions map[*models.Session][]interface{}) error

Apply sends all our emails

type SendMessagesHook added in v0.0.58

type SendMessagesHook struct{}

SendMessagesHook is our hook for sending session messages

func (*SendMessagesHook) Apply added in v0.0.58

func (h *SendMessagesHook) Apply(ctx context.Context, tx *sqlx.Tx, rp *redis.Pool, org *models.OrgAssets, sessions map[*models.Session][]interface{}) error

Apply sends all non-android messages to courier

type StartBroadcastsHook added in v0.0.60

type StartBroadcastsHook struct{}

StartBroadcastsHook is our hook for starting the broadcasts created in these sessions

func (*StartBroadcastsHook) Apply added in v0.0.60

func (h *StartBroadcastsHook) Apply(ctx context.Context, tx *sqlx.Tx, rp *redis.Pool, org *models.OrgAssets, sessions map[*models.Session][]interface{}) error

Apply queues up our broadcasts for sending

type StartSessionsHook added in v0.0.58

type StartSessionsHook struct{}

StartSessionsHook is our hook to fire our session starts

func (*StartSessionsHook) Apply added in v0.0.58

func (h *StartSessionsHook) Apply(ctx context.Context, tx *sqlx.Tx, rp *redis.Pool, org *models.OrgAssets, sessions map[*models.Session][]interface{}) error

Apply queues up our flow starts

type UnsubscribeResthookHook

type UnsubscribeResthookHook struct{}

UnsubscribeResthookHook is our hook for when a webhook is called

func (*UnsubscribeResthookHook) Apply

func (h *UnsubscribeResthookHook) Apply(ctx context.Context, tx *sqlx.Tx, rp *redis.Pool, org *models.OrgAssets, sessions map[*models.Session][]interface{}) error

Apply squashes and applies all our resthook unsubscriptions

type UpdateCampaignEventsHook

type UpdateCampaignEventsHook struct{}

UpdateCampaignEventsHook is our hook to update any campaign events

func (*UpdateCampaignEventsHook) Apply

func (h *UpdateCampaignEventsHook) Apply(ctx context.Context, tx *sqlx.Tx, rp *redis.Pool, org *models.OrgAssets, sessions map[*models.Session][]interface{}) error

Apply will update all the campaigns for the passed in sessions, minimizing the number of queries to do so

Jump to

Keyboard shortcuts

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