Documentation ¶
Index ¶
- Variables
- type ChannelID
- type ContactID
- type ContactURNID
- type DBChannel
- func (c *DBChannel) Address() string
- func (c *DBChannel) ChannelType() courier.ChannelType
- func (c *DBChannel) ConfigForKey(key string, defaultValue interface{}) interface{}
- func (c *DBChannel) Country() string
- func (c *DBChannel) ID() ChannelID
- func (c *DBChannel) OrgID() OrgID
- func (c *DBChannel) UUID() courier.ChannelUUID
- type DBContact
- type DBContactURN
- type DBMsg
- type DBMsgStatus
- type MsgDirection
- type MsgPriority
- type MsgVisibility
- type OrgID
Constants ¶
This section is empty.
Variables ¶
var NilChannelID = ChannelID{sql.NullInt64{Int64: 0, Valid: false}}
NilChannelID is our nil value for ChannelIDs
var NilContactID = ContactID{sql.NullInt64{Int64: 0, Valid: false}}
NilContactID represents our nil value for ContactID
var NilContactURNID = ContactURNID{sql.NullInt64{Int64: 0, Valid: false}}
NilContactURNID is our nil value for ContactURNID
var NilOrgID = OrgID{sql.NullInt64{Int64: 0, Valid: false}}
NilOrgID is our nil value for OrgID
Functions ¶
This section is empty.
Types ¶
type ContactURNID ¶
ContactURNID represents a contact urn's id
type DBChannel ¶
type DBChannel struct { OrgID_ OrgID `db:"org_id"` ID_ ChannelID `db:"id"` ChannelType_ courier.ChannelType `db:"channel_type"` UUID_ courier.ChannelUUID `db:"uuid"` Address_ sql.NullString `db:"address"` Country_ sql.NullString `db:"country"` Config_ utils.NullMap `db:"config"` // contains filtered or unexported fields }
DBChannel is the RapidPro specific concrete type satisfying the courier.Channel interface
func (*DBChannel) ChannelType ¶
func (c *DBChannel) ChannelType() courier.ChannelType
ChannelType returns the type of this channel
func (*DBChannel) ConfigForKey ¶
ConfigForKey returns the config value for the passed in key, or defaultValue if it isn't found
func (*DBChannel) UUID ¶
func (c *DBChannel) UUID() courier.ChannelUUID
UUID returns the UUID of this channel
type DBContact ¶
type DBContact struct { OrgID OrgID `db:"org_id"` ID ContactID `db:"id"` UUID string `db:"uuid"` Name string `db:"name"` URNID ContactURNID `db:"urn_id"` CreatedOn time.Time `db:"created_on"` ModifiedOn time.Time `db:"modified_on"` CreatedBy int `db:"created_by_id"` ModifiedBy int `db:"modified_by_id"` }
DBContact is our struct for a contact in the database
type DBContactURN ¶
type DBContactURN struct { OrgID OrgID `db:"org_id"` ID ContactURNID `db:"id"` URN courier.URN `db:"urn"` Scheme string `db:"scheme"` Path string `db:"path"` Priority int `db:"priority"` ChannelID ChannelID `db:"channel_id"` ContactID ContactID `db:"contact_id"` }
DBContactURN is our struct to map to database level URNs
type DBMsg ¶
type DBMsg struct { OrgID OrgID `json:"org_id" db:"org_id"` ID courier.MsgID `json:"id" db:"id"` UUID courier.MsgUUID `json:"uuid"` Direction MsgDirection `json:"direction" db:"direction"` Status courier.MsgStatus `json:"status" db:"status"` Visibility MsgVisibility `json:"visibility" db:"visibility"` Priority MsgPriority `json:"priority" db:"priority"` URN courier.URN `json:"urn"` Text string `json:"text" db:"text"` Attachments []string `json:"attachments"` ExternalID string `json:"external_id" db:"external_id"` ChannelID ChannelID `json:"channel_id" db:"channel_id"` ContactID ContactID `json:"contact_id" db:"contact_id"` ContactURNID ContactURNID `json:"contact_urn_id" db:"contact_urn_id"` MessageCount int `json:"msg_count" db:"msg_count"` ErrorCount int `json:"error_count" db:"error_count"` ChannelUUID courier.ChannelUUID `json:"channel_uuid"` ContactName string `json:"contact_name"` NextAttempt time.Time `json:"next_attempt" db:"next_attempt"` CreatedOn time.Time `json:"created_on" db:"created_on"` ModifiedOn time.Time `json:"modified_on" db:"modified_on"` QueuedOn time.Time `json:"queued_on" db:"queued_on"` SentOn time.Time `json:"sent_on" db:"sent_on"` }
DBMsg is our base struct to represent msgs both in our JSON and db representations
type DBMsgStatus ¶
type DBMsgStatus struct { ChannelUUID courier.ChannelUUID `json:"channel_uuid" db:"channel_uuid"` ID courier.MsgID `json:"msg_id,omitempty" db:"msg_id"` ExternalID string `json:"external_id,omitempty" db:"external_id"` Status courier.MsgStatus `json:"status" db:"status"` ModifiedOn time.Time `json:"modified_on" db:"modified_on"` }
DBMsgStatus represents a status update on a message
type MsgDirection ¶
type MsgDirection string
MsgDirection is the direction of a message
const ( MsgIncoming MsgDirection = "I" MsgOutgoing MsgDirection = "O" NilMsgDirection MsgDirection = "" )
Possible values for MsgDirection
type MsgPriority ¶
type MsgPriority int
MsgPriority is the priority of our message
const ( BulkPriority MsgPriority = 100 DefaultPriority MsgPriority = 500 HighPriority MsgPriority = 1000 )
Possible values for MsgPriority
type MsgVisibility ¶
type MsgVisibility string
MsgVisibility is the visibility of a message
const ( MsgVisible MsgVisibility = "V" MsgDeleted MsgVisibility = "D" MsgArchived MsgVisibility = "A" )
Possible values for MsgVisibility