Documentation ¶
Index ¶
Constants ¶
const ( EMAIL = "EMAIL" NOOP = "NOOP" )
valid ContentTypes
const ( ACTIVE = "ACTIVE" INACTIVE = "INACTIVE" )
valid ContentStatuses
const ( SUBSCRIBED = "SUBSCRIBED" UNSUBSCRIBED = "UNSUBSCRIBED" MINIMAL = "MINIMAL" )
valid preference states
const ( READY = "READY" QUEUED = "QUEUED" SUCCESS = "SUCCESS" FAILURE = "FAILURE" )
valid Statuses
Variables ¶
This section is empty.
Functions ¶
func SerializeValues ¶
SerializeValues returns a string representation of the given map like in JSON
Types ¶
type Content ¶
type Content struct { ID uuid.UUID `json:"id"` Type ContentType `json:"contentType" binding:"required"` Text string `json:"text" binding:"required"` Params []string `json:"parameters" ` Status ContentStatus `json:"status"` Subject string `json:"subject" binding:"required"` }
Content is the representation of content entries in bloodlines
func ContentFromSQL ¶
ContentFromSQL returns a new content slice from a group of sql rows
func NewContent ¶
func NewContent(contentType ContentType, text string, subject string, params []string) *Content
NewContent constructs and returns a new content entity with a new uuid
type ContentStatus ¶
type ContentStatus string
ContentStatus is an enum wrapper for valid ContentStatus strings
type Job ¶
type Job struct { ID uuid.UUID `json:"id"` SendTime time.Time `json:"sendTime"` SendStatus Status `json:"sendStatus"` Receipts []uuid.UUID `json:"receipts"` }
Job entity data
func JobFromSQL ¶
JobFromSQL returns a Job splice from sql rows
type Preference ¶
type Preference struct { ID uuid.UUID `json:"id"` UserID uuid.UUID `json:"userId" binding:"required"` Email PreferenceState `json:"email"` }
Preference entity data
func NewPreference ¶
func NewPreference(userID uuid.UUID) *Preference
NewPreference contstructs and returns a new preference entity with it's id
func PreferencesFromSQL ¶
func PreferencesFromSQL(rows *sql.Rows) ([]*Preference, error)
PreferencesFromSQL returns a preference splice from sql rows
type PreferenceState ¶
type PreferenceState string
PreferenceState wraps valid preference state strings
type Receipt ¶
type Receipt struct { ID uuid.UUID `json:"id"` Created time.Time `json:"ts"` Finished time.Time `json:"finished"` Values map[string]string `json:"values"` SendState Status `json:"sendState"` ContentID uuid.UUID `json:"contentId"` UserID uuid.UUID `json:"userId" binding:"required"` }
Receipt stores data for receipts
func NewReceipt ¶
NewReceipt creates and returns a new receipt with a new id
type SendRequest ¶
type SendRequest struct { ReceiptID uuid.UUID `json:"receiptId"` ContentID uuid.UUID `json:"contentId"` }
SendRequest has the info for sending a message through the sendgrid api
type Trigger ¶
type Trigger struct { ID uuid.UUID `json:"id"` ContentID uuid.UUID `json:"contentId" binding:"required"` Key string `json:"tkey" binding:"required"` Values map[string]string `json:"values"` }
Trigger stores trigger entity data
func NewTrigger ¶
NewTrigger creates and returns a new trigger entity with id