handler

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: 24 Imported by: 2

Documentation

Index

Constants

View Source
const (
	MOMissEventType          = string(models.MOMissEventType)
	NewConversationEventType = "new_conversation"
	WelcomeMessageEventType  = "welcome_message"
	ReferralEventType        = "referral"
	StopEventType            = "stop_event"
	MsgEventType             = "msg_event"
	ExpirationEventType      = "expiration_event"
	TimeoutEventType         = "timeout_event"
)

Variables

This section is empty.

Functions

func AddHandleTask

func AddHandleTask(rc redis.Conn, contactID models.ContactID, task *queue.Task) error

AddHandleTask adds a single task for the passed in contact.

func HandleChannelEvent added in v0.0.74

func HandleChannelEvent(ctx context.Context, db *sqlx.DB, rp *redis.Pool, eventType models.ChannelEventType, event *models.ChannelEvent, conn *models.ChannelConnection) (*models.Session, error)

HandleChannelEvent is called for channel events

func NewExpirationTask added in v0.0.66

func NewExpirationTask(orgID models.OrgID, contactID models.ContactID, sessionID models.SessionID, runID models.FlowRunID, time time.Time) *queue.Task

NewExpirationTask creates a new event task for the passed in expiration event

func NewTimeoutTask added in v0.0.66

func NewTimeoutTask(orgID models.OrgID, contactID models.ContactID, sessionID models.SessionID, time time.Time) *queue.Task

NewTimeoutTask creates a new event task for the passed in timeout event

func StartRetryCron added in v0.0.149

func StartRetryCron(mr *mailroom.Mailroom) error

StartRetryCron starts our cron job of retrying pending incoming messages

Types

type HandleEventTask added in v0.0.69

type HandleEventTask struct {
	ContactID models.ContactID `json:"contact_id"`
}

type MsgEvent added in v0.0.69

type MsgEvent struct {
	ContactID     models.ContactID   `json:"contact_id"`
	OrgID         models.OrgID       `json:"org_id"`
	ChannelID     models.ChannelID   `json:"channel_id"`
	MsgID         flows.MsgID        `json:"msg_id"`
	MsgUUID       flows.MsgUUID      `json:"msg_uuid"`
	MsgExternalID null.String        `json:"msg_external_id"`
	URN           urns.URN           `json:"urn"`
	URNID         models.URNID       `json:"urn_id"`
	Text          string             `json:"text"`
	Attachments   []utils.Attachment `json:"attachments"`
	NewContact    bool               `json:"new_contact"`
}

type StopEvent added in v0.0.69

type StopEvent struct {
	ContactID models.ContactID `json:"contact_id"`
	OrgID     models.OrgID     `json:"org_id"`
}

type TimedEvent added in v0.0.69

type TimedEvent struct {
	ContactID models.ContactID `json:"contact_id"`
	OrgID     models.OrgID     `json:"org_id"`
	SessionID models.SessionID `json:"session_id"`
	RunID     models.FlowRunID `json:"run_id,omitempty"`
	Time      time.Time        `json:"time"`
}

Jump to

Keyboard shortcuts

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