Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Db ¶
type Db interface { Init(data interface{}) error One(fieldName string, value interface{}, to interface{}) error Update(data interface{}) error Save(data interface{}) error DeleteStruct(data interface{}) error Select(matchers ...q.Matcher) storm.Query Find(fieldName string, value interface{}, to interface{}, options ...func(q *index.Options)) error All(to interface{}, options ...func(*index.Options)) error Close() error }
type MessageDao ¶
type MessageDao interface { //Create creates message record and returns its id Create(text, sender string) (uint32, error) //GetOneById returns message by id GetOneById(id uint32) (model.Message, error) //GetAll returns all messages GetAll() ([]model.Message, error) //RemoveOlderThanDays removes all messages older than {days} RemoveOlderThanDays(days int) error }
func NewMessageDao ¶
func NewMessageDao(db Db) MessageDao
type RecipientDao ¶
type RecipientDao interface { //Create creates recipient record and returns its id Create(messageId uint32, phone string) (uint32, error) //UpdateSubmitStatus updates status and delivery id of recipient record with the given id UpdateSubmitStatus(id uint32, deliverId string, status string) error //UpdateDeliverStatus updates status of recipient record with the delivery id UpdateDeliverStatus(deliverId string, status string) (uint32, string, error) //GetOneByMessageIdAndPhone returns a recipient with the given message id and phone GetOneByMessageIdAndPhone(messageId uint32, phone string) (model.Recipient, error) //GetAllByMessageId returns all recipients with the given message id GetAllByMessageId(messageId uint32) ([]model.Recipient, error) //GetAll returns all recipients GetAll() ([]model.Recipient, error) //RemoveOlderThanDays removes all recipients older that {days} RemoveOlderThanDays(days int) error }
func NewRecipientDao ¶
func NewRecipientDao(db Db) RecipientDao
Click to show internal directories.
Click to hide internal directories.