model

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

Documentation

Index

Constants

View Source
const HEALTHY = "healthy"

HEALTHY is the constant for healthySymptom

Variables

This section is empty.

Functions

This section is empty.

Types

type Feature

type Feature struct {
	Precision int    `json:"precision"`
	Id        string `json:"id"`
}

type GeoAgg

type GeoAgg struct {
	Buckets []GeoAggBucket `json:"buckets"`
}

type GeoAggBucket

type GeoAggBucket struct {
	ID    string `json:"id"`
	Count int64  `json:"count"`
	Symptoms
}

type GeoLocation

type GeoLocation struct {
	Latitude  float64 `json:"lat"`
	Longitude float64 `json:"lon"`
}

GeoLocation ...

type Location

type Location struct {
	Name     string      `json:"name,omitempty" validate:"max=255"`
	City     string      `json:"city,omitempty" validate:"max=255"`
	Region   string      `json:"region,omitempty" validate:"max=255"`
	Country  string      `json:"country,omitempty" validate:"max=255"`
	Street   string      `json:"street,omitempty" validate:"max=255"`
	Zip      string      `json:"zip,omitempty" validate:"max=255"`
	Location GeoLocation `json:"geolocation"`
}

Location represents a location (...)

type LogSearchResults

type LogSearchResults struct {
	Count        int64           `json:"count"`
	GeoLocations []*GeoAggBucket `json:"geolocations"`
	Symptoms
}

type LogUser

type LogUser struct {
	ID        string      `json:"_id,omitempty" validate:"max=255"`
	Locations []*Location `json:"locations" validate:"dive,max=100"`
}

LogUser ...

type Logg

type Logg struct {
	ID             string      `json:"_id,omitempty"`
	User           *LogUser    `json:"user" validate:"dive"`
	Symptoms       []string    `json:"symptoms" validate:"max=100"`
	WorkSituation  string      `json:"workSituation,omitempty" validate:"max=100"`
	DailySituation string      `json:"dailySituation,omitempty" validate:"max=100"`
	Locations      []*Location `json:"locations" validate:"dive,max=1000"`
	Features       []*Feature  `json:"features"`
	CreatedAt      string      `json:"createdat"`
}

Logg ...

func (*Logg) PrepareLog

func (logg *Logg) PrepareLog() error

PrepareLog prepares the log for save

type SymptomBucket

type SymptomBucket struct {
	Symptom interface{} `json:"symptom"`
	Count   int64       `json:"count"`
}

func SetupSymptomsAggArr

func SetupSymptomsAggArr(items *elastic.AggregationBucketKeyItems) []*SymptomBucket

SetupSymptomsAggArr ...

type Symptoms

type Symptoms struct {
	Unhealthy       *SymptomsAgg `json:"unhealthy"`
	Healthy         *SymptomsAgg `json:"healthy"`
	DailySituations *SymptomsAgg `json:"dailySituation"`
}

func (*Symptoms) AnonymizeNeededSymptomsAgg

func (s *Symptoms) AnonymizeNeededSymptomsAgg()

AnonymizeNeededSymptomsAgg ...

func (*Symptoms) SetupSymptomsByAgg

func (s *Symptoms) SetupSymptomsByAgg(ag *elastic.Aggregations)

SetupSymptomsByAgg ...

type SymptomsAgg

type SymptomsAgg struct {
	Count   int64            `json:"count"`
	Buckets []*SymptomBucket `json:"buckets"`
}

func (*SymptomsAgg) SetupBucket

func (s *SymptomsAgg) SetupBucket(bucket *elastic.AggregationBucketKeyItem)

SetupBucket ...

func (*SymptomsAgg) SetupSymptomsAgg

func (s *SymptomsAgg) SetupSymptomsAgg(items *elastic.AggregationBucketKeyItems)

SetupSymptomsAgg ...

type User

type User struct {
	ID            string      `json:"_id,omitempty" validate:"max=255"`
	Email         string      `json:"email,omitempty" validate:"required,email"`
	EmailVerified bool        `json:"emailVerified"`
	Locations     []*Location `json:"locations" validate:"dive,max=100"`
}

User ...

func (*User) PrepareUserForCreation

func (user *User) PrepareUserForCreation() error

PrepareUserForCreation validates the model

func (*User) PrepareUserForGet

func (user *User) PrepareUserForGet()

PrepareUserForGet cleans up the model and prepares it for external use

Jump to

Keyboard shortcuts

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