Documentation ¶
Index ¶
- Constants
- func EnqueueMessage(message *SMS, insertToDB bool)
- func GetConfig(configFilePath string) (ini.File, error)
- func GetLast7DaysMessageCount() (map[string]int, error)
- func GetStatusSummary() ([]int, error)
- func InitDB(driver, dbname string) (*sql.DB, error)
- func InitWorker(modems []*modem.GSMModem, ...)
- func UpdateUser(user *User) error
- type SMS
- type User
Constants ¶
View Source
const ( SMSPending = iota // 0 SMSProcessed // 1 SMSError // 2 )
View Source
const SMSRetryLimit = 3
TODO: should be configurable
Variables ¶
This section is empty.
Functions ¶
func EnqueueMessage ¶
func GetStatusSummary ¶
func InitWorker ¶
func UpdateUser ¶
Types ¶
type SMS ¶
type SMS struct { UUID string `json:"uuid"` Body string `json:"body"` Status int `json:"status"` Retries int `json:"retries"` Device string `json:"device"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` User *User `json:"user"` }
func GetMessages ¶
type User ¶
type User struct { ID int64 `json:"id"` PhoneNumber string `json:"phone_number"` ChatIdTelegram string `json:"chat_id_telegram"` }
User структура пользователя с данными для отправки сообщений
func GetUserByChatIdTg ¶
GetUserByChatIdTg получение пользователя по номеру чата в телеграм
func GetUserByPhoneNumber ¶
GetUserByPhoneNumber получение одного из пользователей с номером
func GetUsersByPhoneNumber ¶
GetUsersByPhoneNumber получение всех пользователей на определенный номер
func InsertUser ¶
Click to show internal directories.
Click to hide internal directories.