Documentation ¶
Overview ¶
Package phone abstracts away sending various message types to a phone.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrFileDoesNotExist = errors.New("The given file path does not exist.")
ErrFileDoesNotExist is returned when the given input file cannot be found
var ErrFileIsDirectory = errors.New("The given file path is a directory")
ErrFileIsDirectory is returned when the given filepath is a directory
var ErrFiletypeNotSupported = errors.New("The given filetype is not supported")
ErrFiletypeNotSupported is returned when the given input file is a valid file, but its extension is not supported by the sender service.
Examples of invalid types include ".exe", ".docx", and ".pptx"
Functions ¶
This section is empty.
Types ¶
type Sender ¶
type Sender struct {
// contains filtered or unexported fields
}
Sender holds the necessary values for sending supported data to a phone.
Must be initalized with the NewSender func.
func NewSender ¶
func NewSender( config TwilioConfig, acceptedNGROKTOS bool, port int, verbose bool, ) *Sender
NewSender creates a new sender object with the specified options. Utilizes the ngrokker pkg, and in turn, ngrok, for its introspective tunneling purposes, and Twilio for its MMS sending purposes. If you'd like to override the tunneling service with something else, use NewSenderTunnel.
A valid Twilio Configuration is needed to be able to properly send a message.
Users must accept the ngrok ToS before sending anything.
Port will be used to create a local webserver and introspective tunnel, if necessary. The port must not be currently in use by another process.
Verbose prints diagnostic information to stderr.
func NewSenderTunnel ¶
func NewSenderTunnel( tunnel ngrokker.Tunneler, config TwilioConfig, port int, verbose bool, ) *Sender
NewSenderTunnel is similar to NewSender, except that it allows you to override the introspective tunneling service with your own.
type TwilioConfig ¶
TwilioConfig represents all necessary information needed to send a message via twilio. For more information, see http://twilio.com