hooks

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2019 License: AGPL-3.0 Imports: 21 Imported by: 1

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 CommitIVRHook added in v0.0.74

type CommitIVRHook struct{}

CommitIVRHook is our hook for comitting session messages / say commands

func (*CommitIVRHook) Apply added in v0.0.74

func (h *CommitIVRHook) 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 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 models.ContactID `db:"contact_id"`
	FieldUUID models.FieldUUID `db:"field_uuid"`
}

type FieldUpdate

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

type FieldValue

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

type InsertStartHook added in v0.0.126

type InsertStartHook struct{}

InsertStartHook is our hook to fire insert our starts

func (*InsertStartHook) Apply added in v0.0.126

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

Apply inserts our starts

type InsertWebhookEventHook added in v0.0.84

type InsertWebhookEventHook struct{}

InsertWebhookEventHook is our hook for when a resthook needs to be inserted

func (*InsertWebhookEventHook) Apply added in v0.0.84

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

Apply inserts all the webook events that were created

type InsertWebhookResultHook added in v0.0.76

type InsertWebhookResultHook struct{}

InsertWebhookResultHook is our hook for inserting webhook results

func (*InsertWebhookResultHook) Apply added in v0.0.76

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

Apply inserts all the webook results that were created

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 StartStartHook added in v0.0.126

type StartStartHook struct{}

StartStartHook is our hook to fire our session starts

func (*StartStartHook) Apply added in v0.0.126

func (h *StartStartHook) 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