models

package module
v0.0.0-...-afae923 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2017 License: MIT Imports: 7 Imported by: 0

README

models

Documentation

Index

Constants

View Source
const (
	SourceMeter = "meter"
	SourceCGM   = "cgm"
)

Variables

This section is empty.

Functions

func DB

func DB() *gorm.DB

func ILike

func ILike(db *gorm.DB, field, like string) *gorm.DB

func OverrideDBURL

func OverrideDBURL(url string)

Types

type AuditItem

type AuditItem struct {
	gorm.Model
	Occurred
	NewDeviceTime                        time.Time
	BGReading                            int
	LinkedBGMeterID                      string `gorm:"size:256"`
	TempBasalAmount                      float64
	TempBasalType                        string `gorm:"size:128"`
	TempBasalDuration                    int
	BolusType                            string `gorm:"size:128"`
	BolusVolumeSelected                  float64
	BolusVolumeDelivered                 float64
	BolusDuration                        int
	PrimeType                            string `gorm:"size:128"`
	PrimeVolumeDelivered                 float64
	Suspend                              string `gorm:"size:128"`
	Rewind                               string `gorm:"size:128"`
	BolusWizardInsulinEstimate           float64
	BolusWizardTargetHighBG              int
	BolusWizardTargetLowBG               int
	BolusWizardCurrentCarbRatio          int
	BolusWizardCurrentInsulinSensitivity int
	BolusWizardCarbInput                 int
	BolusWizardBGInput                   int
	BolusWizardCorrectionEstimate        float64
	BolusWizardFoodEstimate              float64
	BolusWizardActiveInsulin             float64
	Alarm                                string `gorm:"size:256"`
	SensorCalibrationBG                  int
	SensorGluclose                       int
	ISIGValue                            float64
	DailyInsulinTotal                    float64
	RawType                              string `gorm:"size:512"`
	RawValues                            string `gorm:"size:5096"`
	RawDeviceType                        string `gorm:"size:1024"`
	RawSequenceNumber                    int
	RawID                                int64 `gorm:"unique_index"`
}

func (*AuditItem) SetRaw

func (item *AuditItem) SetRaw(key, value string)

type Food

type Food struct {
	gorm.Model
	Occurred
	Name      string `gorm:"size:2048"`
	FoodStems []FoodStem
	Carbs     int
	Insulin   float64
}

Food represents a food eaten

type FoodStem

type FoodStem struct {
	gorm.Model
	Stem   string `gorm:"size:2048"`
	FoodID uint
}

FoodStem represents the stem of a food name

type Message

type Message struct {
	gorm.Model
	Message string `gorm:"size:4096"`
}

Message stores messages for later study

type Occurred

type Occurred struct {
	OccurredAt time.Time
}

Occured represents the time when an event happend.

type Place

type Place struct {
	gorm.Model
	Name       string `gorm:"size:4096"`
	SearchName string `gorm:"size:1024"`
}

Place represents a place a meal was eaten

type PlaceVisit

type PlaceVisit struct {
	gorm.Model
	Occurred
	PlaceID uint
}

PlaceVisit represents an visit to a place

type Sugar

type Sugar struct {
	gorm.Model
	Occurred
	Value  int
	Source SugarSource `gorm:"size:64"`
}

Sugar represents a measured blood sugar

type SugarSource

type SugarSource string

type User

type User struct {
	gorm.Model
	Name                string `gorm:"size:1024"`
	FoursquareID        string `gorm:"size:1024"`
	FacebookMessengerID string `gorm:"size:1024"`
	AlexaID             string `gorm:"size:2048"`
	GoogleID            string `gorm:"size:2048"`
}

User represents a user

Jump to

Keyboard shortcuts

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