Documentation ¶
Index ¶
- Constants
- func InsertContact(db *sqlx.DB, contact *Contact) error
- func InsertContactURN(db *sqlx.DB, urn *ContactURN) error
- func InsertMsg(db *sqlx.DB, msg *Msg) error
- func UpdateContactURN(db *sqlx.DB, urn *ContactURN) error
- type Channel
- type ChannelID
- type Contact
- type ContactID
- type ContactURN
- type ContactURNID
- type MessageID
- type Msg
- type OrgID
- type URN
Constants ¶
View Source
const ( SchemeTel = "tel" SchemeTwitter = "twitter" SchemeEmail = "email" )
Variables ¶
This section is empty.
Functions ¶
func InsertContact ¶
InsertContact inserts the passed in contact, the id field will be populated with the result on success
func InsertContactURN ¶
func InsertContactURN(db *sqlx.DB, urn *ContactURN) error
InsertContactURN inserts the passed in urn, the id field will be populated with the result on success
func InsertMsg ¶
InsertMsg inserts the passed in msg, the id field will be populated with the result on success
func UpdateContactURN ¶
func UpdateContactURN(db *sqlx.DB, urn *ContactURN) error
UpdateContactURN updates the Channel and Contact on an existing URN
Types ¶
type Channel ¶
type Contact ¶
type ContactURN ¶
type ContactURN struct { Org OrgID `db:"org_id"` ID ContactURNID `db:"id"` URN URN `db:"urn"` Scheme string `db:"scheme"` Path string `db:"path"` Priority int `db:"priority"` Channel ChannelID `db:"channel_id"` Contact ContactID `db:"contact_id"` }
func ContactURNForURN ¶
func ContactURNForURN(db *sqlx.DB, org OrgID, channel ChannelID, contact ContactID, urn URN) (*ContactURN, error)
ContactURNForURN returns the ContactURN for the passed in org and URN, creating and associating
it with the passed in contact if necessary
func NewContactURN ¶
func NewContactURN(org OrgID, channel ChannelID, contact ContactID, urn URN) *ContactURN
NewContactURN returns a new ContactURN object for the passed in org, contact and string urn, this is not saved to the DB yet
type ContactURNID ¶
type Msg ¶
type Msg struct { Org OrgID `db:"org_id"` ID MessageID `db:"id"` Direction string `db:"direction"` Text string `db:"text"` Priority int `db:"priority"` Status string `db:"status"` Visibility string `db:"visibility"` ExternalID string `db:"external_id"` MessageCount int `db:"msg_count"` ErrorCount int `db:"error_count"` Channel ChannelID `db:"channel_id"` Contact ContactID `db:"contact_id"` ContactURN ContactURNID `db:"contact_urn_id"` NextAttempt time.Time `db:"next_attempt"` CreatedOn time.Time `db:"created_on"` ModifiedOn time.Time `db:"modified_on"` QueuedOn time.Time `db:"queued_on"` SentOn time.Time `db:"sent_on"` }
Click to show internal directories.
Click to hide internal directories.