hooks

package
v0.0.50 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2018 License: AGPL-3.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyEmailCreatedEvent added in v0.0.44

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

ApplyEmailCreatedEvent event queues an email to be sent later on

func ApplyMsgCreatedEvent

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

ApplyMsgCreatedEvent creates the db msg for the passed in event

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 CommitContactLanguageChanges

type CommitContactLanguageChanges struct{}

our hook for language changes

func (*CommitContactLanguageChanges) Apply

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

type CommitContactNameChanges struct{}

our hook for name changes

func (*CommitContactNameChanges) Apply

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

type CommitSessionMessages struct{}

CommitSessionMessages is our hook for comitting session messages

func (*CommitSessionMessages) Apply

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

type ContactFieldChangedHook struct{}

ContactFieldChangedHook is our hook for contact field changes

func (*ContactFieldChangedHook) Apply

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

type ContactGroupsChangedHook struct{}

ContactGroupsChangedHook is our hook for all group changes

func (*ContactGroupsChangedHook) Apply

func (h *ContactGroupsChangedHook) 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 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 ContactURNsChangedHook added in v0.0.48

type ContactURNsChangedHook struct{}

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

func (*ContactURNsChangedHook) Apply added in v0.0.48

func (h *ContactURNsChangedHook) 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 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 SendEmails added in v0.0.44

type SendEmails struct{}

SendEmails is our hook for sending emails

func (*SendEmails) Apply added in v0.0.44

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

type SendSessionMessages struct{}

SendSessionMessages is our hook for sending session messages

func (*SendSessionMessages) Apply

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