services

package
v0.0.0-...-e85117a Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadGeoJSONFile

func LoadGeoJSONFile(fileName string) (*geojson.FeatureCollection, error)

Types

type EmailService

type EmailService struct {
	// contains filtered or unexported fields
}

EmailService ...

func NewEmailService

func NewEmailService(sendgrid *sendgrid.Client, apiKey string, userPendingID, userListID string, log *logrus.Logger) *EmailService

NewEmailService ...

func (*EmailService) UserPending

func (ems *EmailService) UserPending(ctx context.Context, email, id string) error

UserPending in sendgrid

func (*EmailService) UserSubscribed

func (ems *EmailService) UserSubscribed(ctx context.Context, id, email string) error

UserSubscribed will remove the user from the pending list and add it to the subscribed list

type GeoJsonService

type GeoJsonService struct {
	// contains filtered or unexported fields
}

func NewGeoJson

func NewGeoJson(mappings map[int][]string) *GeoJsonService

func (*GeoJsonService) GetAllFeaturesFor

func (g *GeoJsonService) GetAllFeaturesFor(points ...*model.Location) []*model.Feature

func (*GeoJsonService) GetFeatureIdsFor

func (g *GeoJsonService) GetFeatureIdsFor(precision int, point *model.GeoLocation) string

func (*GeoJsonService) GetGeoJsonByPrecision

func (g *GeoJsonService) GetGeoJsonByPrecision(currentPrecision int) *geojson.FeatureCollection

type LogsService

type LogsService struct {
	// contains filtered or unexported fields
}

LogsService ...

func NewlogsService

func NewlogsService(es *persistence.Es, freshEs *persistence.Es, logger *logrus.Logger, gs *GeoJsonService) *LogsService

NewlogsService ...

func (*LogsService) CreateForUser

func (ls *LogsService) CreateForUser(ctx context.Context, uID string, logg *model.Logg) (string, error)

CreateForUser a new log

func (*LogsService) GetAggregatedSymptoms

func (ls *LogsService) GetAggregatedSymptoms(ctx context.Context, precision int, sw model.GeoLocation, ne model.GeoLocation) (*model.LogSearchResults, error)

GetAggregatedSymptoms ...

func (*LogsService) Reindex

func (ls *LogsService) Reindex(ctx context.Context) error

func (*LogsService) Update

func (ls *LogsService) Update(ctx context.Context, ID string, log *model.Logg) error

Update logg

type ResponeList

type ResponeList struct {
	ID    string `json:"id"`
	Email string `json:"email"`
}

ResponeList with resposne from email service

type UserService

type UserService struct {
	// contains filtered or unexported fields
}

UserService ...

func NewUserService

func NewUserService(es *persistence.Es, emails *EmailService) *UserService

NewUserService ...

func (*UserService) Create

func (us *UserService) Create(ctx context.Context, user *model.User) (string, error)

Create a new user

func (*UserService) Get

func (us *UserService) Get(ctx context.Context, ID string) (*model.User, error)

Get user

func (*UserService) Update

func (us *UserService) Update(ctx context.Context, ID string, m *model.User) error

Update user

func (*UserService) VerifyEmail

func (us *UserService) VerifyEmail(ctx context.Context, ID string) error

VerifyEmail moves the user to a verified user state

Jump to

Keyboard shortcuts

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