Documentation ¶
Overview ¶
Package smsglobal allows bulk messaging to a desired recipient list
Index ¶
- type Contact
- type SMSGlobal
- func (s *SMSGlobal) AddContact(contact Contact) error
- func (s *SMSGlobal) Connect() error
- func (s *SMSGlobal) ContactExists(contact Contact) bool
- func (s *SMSGlobal) GetContactByName(name string) (Contact, error)
- func (s *SMSGlobal) GetContactByNumber(number string) (Contact, error)
- func (s *SMSGlobal) GetEnabledContacts() int
- func (s *SMSGlobal) IsConnected() bool
- func (s *SMSGlobal) PushEvent(event base.Event) error
- func (s *SMSGlobal) RemoveContact(contact Contact) error
- func (s *SMSGlobal) SendMessage(to, message string) error
- func (s *SMSGlobal) SendMessageToAll(message string) error
- func (s *SMSGlobal) Setup(cfg *base.CommunicationsConfig)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Contact ¶
type Contact struct { Name string `json:"Name"` Number string `json:"Number"` Enabled bool `json:"Enabled"` }
Contact struct stores information related to a SMSGlobal contact
type SMSGlobal ¶
type SMSGlobal struct { base.Base Contacts []Contact Username string Password string SendFrom string }
SMSGlobal is the overarching type across this package
func (*SMSGlobal) AddContact ¶
AddContact checks to see if a contact exists and adds them if it doesn't
func (*SMSGlobal) ContactExists ¶
ContactExists checks to see if a contact exists
func (*SMSGlobal) GetContactByName ¶
GetContactByName returns a contact with supplied name
func (*SMSGlobal) GetContactByNumber ¶
GetContactByNumber returns a contact with supplied number
func (*SMSGlobal) GetEnabledContacts ¶
GetEnabledContacts returns how many SMS contacts are enabled in the contact list
func (*SMSGlobal) IsConnected ¶
IsConnected returns whether or not the connection is connected
func (*SMSGlobal) RemoveContact ¶
RemoveContact removes a contact if it exists
func (*SMSGlobal) SendMessage ¶
SendMessage sends a message to an individual contact
func (*SMSGlobal) SendMessageToAll ¶
SendMessageToAll sends a message to all enabled contacts in cfg
func (*SMSGlobal) Setup ¶
func (s *SMSGlobal) Setup(cfg *base.CommunicationsConfig)
Setup takes in a SMSGlobal configuration, sets username, password and recipient list