Documentation ¶
Index ¶
- Constants
- type Base
- func (s *Base) AddContact(contact Contact)
- func (s *Base) ContactExists(contact Contact) bool
- func (s *Base) GetContactByName(name string) (Contact, error)
- func (s *Base) GetContactByNumber(number string) (Contact, error)
- func (s *Base) GetEnabledContacts() int
- func (s *Base) RemoveContact(contact Contact)
- func (s *Base) SendMessage(to, message string) error
- func (s *Base) SendMessageToAll(message string)
- type Contact
Constants ¶
View Source
const (
// ErrSMSContactNotFound is a general error code for "SMS Contact not found."
ErrSMSContactNotFound = "SMS Contact not found."
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct { Contacts []Contact `json:"contacts"` Username string `json:"username"` Password string `json:"password"` SendFrom string `json:"send_from"` }
Base struct stores information related to the SMSGlobal package
var (
SMSGlobal *Base
)
vars for the SMS global package
func (*Base) AddContact ¶
AddContact checks to see if a contact exists and adds them if it doesn't
func (*Base) ContactExists ¶
ContactExists checks to see if a contact exists
func (*Base) GetContactByName ¶
GetContactByName returns a contact with supplied name
func (*Base) GetContactByNumber ¶
GetContactByNumber returns a contact with supplied number
func (*Base) GetEnabledContacts ¶
GetEnabledContacts returns how many SMS contacts are enabled in the contact list
func (*Base) RemoveContact ¶
RemoveContact removes a contact if it exists
func (*Base) SendMessage ¶
SendMessage sends a message to an individual contact
func (*Base) SendMessageToAll ¶
SendMessageToAll sends a message to all enabled contacts in cfg
Click to show internal directories.
Click to hide internal directories.