models

package
v0.0.0-...-e4e5e88 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Line1   string `json:"line1"`
	Line2   string `json:"line2"`
	City    string `json:"city"`
	State   string `json:"state"`
	Country string `json:"country"`
	ZipCode string `json:"zip_code"`
}

Address defines a user or contact object's place of residence

type Contact

type Contact struct {
	PhoneNumber  string           `json:"phone_number"`
	Relationship string           `json:"relationship"`
	FirstName    string           `json:"first_name"`
	LastName     string           `json:"last_name"`
	EmailAddress string           `json:"email_address"`
	Tier         common.AlertTier `json:"tier"`
}

Contact defines the information of a User's contacts

type EmergencyInfo

type EmergencyInfo struct {
	CountryCode string `json:"country_code"`
	Police      string `json:"police"`
	Ambulance   string `json:"ambulance"`
	Fire        string `json:"fire"`
}

EmergencyInfo defines the result from a lookup in the EmergencyNumbers table

type Settings

type Settings struct {
	UserID            string `json:"user_id"`          // Foreign key association of the user's who's settings are being stored
	SOSSMS            bool   `json:"sos_sms"`          // Enable/Disable SOS SMS
	SOSCalls          bool   `json:"sos_calls"`        // Enable/Disable SOS Calls
	SOSLockscreenInfo bool   `json:"sos_lockscreen"`   // Enable/Disable SOS Lockscreen Information
	Updates           bool   `json:"updates"`          // Enable/Disable location updates via poller
	UpdateFrequency   int    `json:"update_frequency"` // Number of hours the poll notification is scheduled for
}

Settings defines an active user's settings

type User

type User struct {
	UserID            string     `json:"user_id,omitempty"`
	FirstName         string     `json:"first_name,omitempty"`
	LastName          string     `json:"last_name,omitempty"`
	BloodType         string     `json:"blood_type,omitempty"`
	Age               uint32     `json:"age,omitempty"`
	Contacts          []*Contact `json:"contacts,omitempty"`
	LastKnownLocation []float64  `json:"last_known_location,omitempty"`
	PrimaryResidence  *Address   `json:"primary_residence,omitempty"`
	PhonePin          uint64     `json:"phone_pin,omitempty"`
	EmailAddress      string     `json:"email_address,omitempty"`
	PhoneNumber       string     `json:"phone_number,omitempty"`
}

User encapsulates the data necessary to represent the data of a single EmergenSeek User

func (*User) FormattedName

func (u *User) FormattedName() string

FormattedName formats a users name for SMS messages

Jump to

Keyboard shortcuts

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