Documentation ¶
Index ¶
- Variables
- func PrepareMapProducedEmail(templates *MailTemplates, to string, kmlFile []byte, ...) (*mailer.EmailJob, error)
- func PrepareSpottedInFlightEmail(templates *MailTemplates, to string, params SpottedInFlightParameters) (*mailer.EmailJob, error)
- func PrepareTakeoffComplete(templates *MailTemplates, to string, params TakeoffCompleteParams) (*mailer.EmailJob, error)
- func PrepareTakeoffFromAirport(templates *MailTemplates, to string, params TakeoffParams) (*mailer.EmailJob, error)
- func PrepareTakeoffUnknownAirport(templates *MailTemplates, to string, params TakeoffUnknownAirportParams) (*mailer.EmailJob, error)
- type Email
- type Location
- type MailTemplates
- type MapProducedParameters
- type SpottedInFlightParameters
- type TakeoffCompleteParams
- type TakeoffParams
- type TakeoffUnknownAirportParams
Constants ¶
This section is empty.
Variables ¶
var ( // TemplateNotFoundErr is returned by MailTemplates if the // requested template cannot be found TemplateNotFoundErr = errors.Errorf("email template not found") )
Functions ¶
func PrepareMapProducedEmail ¶
func PrepareMapProducedEmail(templates *MailTemplates, to string, kmlFile []byte, params MapProducedParameters) (*mailer.EmailJob, error)
PrepareMapProducedEmail creates an MapProducedEmail and returns a mailer.EmailJob for the email with the KML attachment.
func PrepareSpottedInFlightEmail ¶
func PrepareSpottedInFlightEmail(templates *MailTemplates, to string, params SpottedInFlightParameters) (*mailer.EmailJob, error)
PrepareSpottedInFlightEmail creates an SpottedInFlight and returns a mailer.EmailJob for the email
func PrepareTakeoffComplete ¶
func PrepareTakeoffComplete(templates *MailTemplates, to string, params TakeoffCompleteParams) (*mailer.EmailJob, error)
PrepareTakeoffComplete creates an TakeoffComplete and returns a mailer.EmailJob for the email
func PrepareTakeoffFromAirport ¶
func PrepareTakeoffFromAirport(templates *MailTemplates, to string, params TakeoffParams) (*mailer.EmailJob, error)
PrepareTakeoffFromAirport creates an TakeoffFromAirport and returns a mailer.EmailJob for the email
func PrepareTakeoffUnknownAirport ¶
func PrepareTakeoffUnknownAirport(templates *MailTemplates, to string, params TakeoffUnknownAirportParams) (*mailer.EmailJob, error)
PrepareTakeoffUnknownAirport creates an TakeoffUnknownAirport and returns a mailer.EmailJob for the email
Types ¶
type Email ¶
type Email string
Email - data type used to identify an email template
const ( // MapProducedEmail - the template's name MapProducedEmail Email = "map_produced.tpl" // SpottedInFlight - the template's name SpottedInFlight Email = "spotted_in_flight.tpl" // TakeoffUnknownAirport - the template's name TakeoffUnknownAirport Email = "takeoff_unknown_airport.tpl" // TakeoffFromAirport - the template's name TakeoffFromAirport Email = "takeoff_from_airport.tpl" // TakeoffComplete - the template's name TakeoffComplete Email = "takeoff_complete.tpl" )
type Location ¶
type Location struct { // Latitude - decimal latitude Latitude float64 // Longitude - decimal longitude Longitude float64 // Altitude - height in ft // todo: Units Altitude int64 }
Location - a structure containing an aircraft's location
type MailTemplates ¶
type MailTemplates struct {
// contains filtered or unexported fields
}
MailTemplates - map of Emails to parsed template
func LoadMailTemplates ¶
func LoadMailTemplates(templates ...Email) (*MailTemplates, error)
LoadMailTemplates takes a list of Emails, loads and parses the template, initializing MapTemplates, or an error if one occurred.
type MapProducedParameters ¶
type MapProducedParameters struct { Project string Icao string CallSign string StartTime time.Time EndTime time.Time DurationFmt string StartTimeFmt string StartLocation Location EndTimeFmt string EndLocation Location MapUpdated bool }
MapProducedParameters contains parameters for the MapProducedParameters template.
type SpottedInFlightParameters ¶
type SpottedInFlightParameters struct { Project string Icao string CallSign string StartTime time.Time StartTimeFmt string StartLocation Location }
SpottedInFlightParameters contains parameters for the SpottedInFlight template.
type TakeoffCompleteParams ¶
type TakeoffCompleteParams struct { Project string Icao string CallSign string AirportName string StartTimeFmt string StartLocation Location }
TakeoffCompleteParams contains parameters for the TakeoffCompleteParams template.