lib

package
v0.0.0-...-d521ba1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDB

func InitDB(dbname string) (*sql.DB, error)

func InitWorker

func InitWorker()

InitWorker starts the worker

func InsertMessage

func InsertMessage(sms *SMS) error

func UpdateMessageStatus

func UpdateMessageStatus(sms SMS) error

TODO: locks for driver.Stmt (stmt) and driver.Conn (db)

Types

type SMS

type SMS struct {
	UUID    string `json:"uuid"`
	Mobile  string `json:"mobile"`
	Body    string `json:"body"`
	Status  string `json:"status"`
	Retries int    `json:"retries"`
}

SMS encaps a SMS message

func GetAllMessages

func GetAllMessages() ([]SMS, error)

GetAllMessages returns all messages with specified status

func GetMessageByUuid

func GetMessageByUuid(uuid string) (SMS, error)

func GetPendingMessages

func GetPendingMessages() ([]SMS, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL