database

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DynamoConn

type DynamoConn struct {
	Client *dynamodb.DynamoDB
	Region string
}

DynamoConn encapsulates data and methods necessary for communicating with DynamoDB

func (*DynamoConn) AddContact

func (d *DynamoConn) AddContact(userID string, contact *models.Contact) error

AddContact associates an additional contact to the given user

func (*DynamoConn) Create

func (d *DynamoConn) Create(sess *session.Session) error

Create creates a new, private DynamoDB session

func (*DynamoConn) CreateUser

func (d *DynamoConn) CreateUser(user *models.User) (*dynamodb.PutItemOutput, error)

CreateUser will create a user for the application

func (*DynamoConn) GetEmergencyNumbers

func (d *DynamoConn) GetEmergencyNumbers(countryCode string) (*models.EmergencyInfo, error)

GetEmergencyNumbers retrieves police, fire, and ambulance numbers, given a country code

func (*DynamoConn) GetSettings

func (d *DynamoConn) GetSettings(uid string) (*models.Settings, error)

GetSettings retrieves a user's settings from the Settings table

func (*DynamoConn) GetUser

func (d *DynamoConn) GetUser(uid string) (*models.User, error)

GetUser will retrieve a user from the database

func (*DynamoConn) MustGetGMapsKey

func (d *DynamoConn) MustGetGMapsKey() string

MustGetGMapsKey retrives the Google Maps API

func (*DynamoConn) MustGetMapsKey

func (d *DynamoConn) MustGetMapsKey() string

MustGetMapsKey retrives the MapQuest API key from the database

func (*DynamoConn) UpdateLocation

func (d *DynamoConn) UpdateLocation(userID string, location []float64) error

UpdateLocation updates the location of a user when a location poll is invoked

func (*DynamoConn) UpdateProfile

func (d *DynamoConn) UpdateProfile(profile *models.User) error

UpdateProfile updates an existing user's profile

func (*DynamoConn) UpdateSettings

func (d *DynamoConn) UpdateSettings(settings *models.Settings) error

UpdateSettings updates an existing user's settings

func (*DynamoConn) UpdateTier

func (d *DynamoConn) UpdateTier(userID string, phoneNumber string, tier common.AlertTier) error

UpdateTier updates an existing contact's tier

Jump to

Keyboard shortcuts

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