smsglobal

package
v0.0.0-...-b8e8dbd Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package smsglobal allows bulk messaging to a desired recipient list

Index

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

func (s *SMSGlobal) AddContact(contact Contact) error

AddContact checks to see if a contact exists and adds them if it doesn't

func (*SMSGlobal) Connect

func (s *SMSGlobal) Connect() error

Connect connects to the service

func (*SMSGlobal) ContactExists

func (s *SMSGlobal) ContactExists(contact Contact) bool

ContactExists checks to see if a contact exists

func (*SMSGlobal) GetContactByName

func (s *SMSGlobal) GetContactByName(name string) (Contact, error)

GetContactByName returns a contact with supplied name

func (*SMSGlobal) GetContactByNumber

func (s *SMSGlobal) GetContactByNumber(number string) (Contact, error)

GetContactByNumber returns a contact with supplied number

func (*SMSGlobal) GetEnabledContacts

func (s *SMSGlobal) GetEnabledContacts() int

GetEnabledContacts returns how many SMS contacts are enabled in the contact list

func (*SMSGlobal) PushEvent

func (s *SMSGlobal) PushEvent(base.Event) error

PushEvent pushes an event to a contact list via SMS

func (*SMSGlobal) RemoveContact

func (s *SMSGlobal) RemoveContact(contact Contact) error

RemoveContact removes a contact if it exists

func (*SMSGlobal) SendMessage

func (s *SMSGlobal) SendMessage(to, message string) error

SendMessage sends a message to an individual contact

func (*SMSGlobal) SendMessageToAll

func (s *SMSGlobal) SendMessageToAll(message string) error

SendMessageToAll sends a message to all enabled contacts in cfg

func (*SMSGlobal) Setup

func (s *SMSGlobal) Setup(config config.CommunicationsConfig)

Setup takes in a SMSGlobal configuration, sets username, password and and recipient list

Jump to

Keyboard shortcuts

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