app

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Address from which emails will be sent
	Sender = "briggySmalls90@gmail.com"
	// The subject line for the email.
	Subject    = "🚨 Detectordag power update"
	DateFormat = "15:04 2/1/06"
)

Variables

This section is empty.

Functions

func HandleRequest

func HandleRequest(ctx context.Context, event StatusUpdatedEvent)

HandleRequest handles a lambda call

func SendEmail

func SendEmail(recipients []string, status PowerStatusChangedEmailConfig) error

Types

type PowerStatusChangedEmailConfig

type PowerStatusChangedEmailConfig struct {
	DeviceId  string
	Timestamp time.Time
	Status    bool
}

type StatusUpdatedEvent

type StatusUpdatedEvent struct {
	DeviceId  string  `json:""`
	Timestamp int     `json:""`
	State     state   `json:""`
	Updated   updated `json:""`
}

Jump to

Keyboard shortcuts

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