Documentation ¶
Index ¶
- func CreateAll() (*database.DynamoConn, *notification.TwilioHandler, *session.Session, string)
- func CreateEmergencyMessage(emergency common.EmergencyType, user *models.User, mapsKey string, ...) (string, error)
- func CreatePollMessage(user *models.User, mapsKey string, location []float64, tier common.AlertTier) (string, error)
- func CreateTwilMLXML(user *models.User, lastLocation string) ([]byte, error)
- func ErrorResponse(status int, errs ...error) events.APIGatewayProxyResponse
- func GetAddress(latlng []float64, key string, useTier bool, tier common.AlertTier) (string, error)
- func GetCountryCode(latlng []float64, key string) (string, error)
- func GetEmergencyServices(location []float64, db *database.DynamoConn) (string, error)
- func SuccessfulResponse(bodyContent string) events.APIGatewayProxyResponse
- func UploadTwilMLXML(twilML []byte, sess *session.Session) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAll ¶
func CreateAll() (*database.DynamoConn, *notification.TwilioHandler, *session.Session, string)
CreateAll initializes the necessary API providers for Lambda handlers
func CreateEmergencyMessage ¶
func CreateEmergencyMessage(emergency common.EmergencyType, user *models.User, mapsKey string, location []float64) (string, error)
CreateEmergencyMessage generates a message given a user's information and their severity Should not used with the CHECKIN emergency type
func CreatePollMessage ¶
func CreatePollMessage(user *models.User, mapsKey string, location []float64, tier common.AlertTier) (string, error)
CreatePollMessage creates the
func CreateTwilMLXML ¶
CreateTwilMLXML creates the XML necessary for the gotwilio.NewCallbackParameters invocation in notification.SendVoiceCall
func ErrorResponse ¶
func ErrorResponse(status int, errs ...error) events.APIGatewayProxyResponse
ErrorResponse simplifies the sending of errors to the client from the API
func GetAddress ¶
GetAddress is used to ReverseGeocode a latlng combination into a precise address If `useTier` is passed as true then address information will be filtered based on the tier provided in `tier`. AlertTier.FIRST will receive all data, this is equivalent to not providing checkTier AlertTier.SECOND will not receive street information AlrtTier.THIRD will only receive state, postalcode, and country code
func GetCountryCode ¶
GetCountryCode retrives a country code associated with a latitude and longitude for the ESGetEmergencyInfo Lambda function
func GetEmergencyServices ¶
func GetEmergencyServices(location []float64, db *database.DynamoConn) (string, error)
GetEmergencyServices retrives hospitals and pharmacies within a 10 mile radius of the given location
func SuccessfulResponse ¶
func SuccessfulResponse(bodyContent string) events.APIGatewayProxyResponse
SuccessfulResponse prepares and sends a successful server response for the calling Lambda function
Types ¶
This section is empty.