health

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(db *gorm.DB) provider.Provider

Types

type ActivitySummary

type ActivitySummary struct {
	gorm.Model
	Date                   types.DateTime `xml:"dateComponents,attr" gorm:"unique"`
	ActiveEnergyBurned     float64        `xml:"activeEnergyBurned,attr"`
	ActiveEnergyBurnedGoal int            `xml:"activeEnergyBurnedGoal,attr"`
	ActiveEnergyBurnedUnit string         `xml:"activeEnergyBurnedUnit,attr"`
	AppleMoveTime          int            `xml:"appleMoveTime,attr"`
	AppleMoveTimeGoal      int            `xml:"appleMoveTimeGoal,attr"`
	AppleExerciseTime      int            `xml:"appleExerciseTime,attr"`
	AppleExerciseTimeGoal  int            `xml:"appleExerciseTimeGoal,attr"`
	AppleStandHours        int            `xml:"appleStandHours,attr"`
	AppleStandHoursGoal    int            `xml:"appleStandHoursGoal,attr"`
}

func (ActivitySummary) Conditions

func (as ActivitySummary) Conditions() map[string]interface{}

func (ActivitySummary) TableName

func (ActivitySummary) TableName() string

type BeatsPerMinute

type BeatsPerMinute struct {
	gorm.Model
	EntryID uint   `gorm:"uniqueIndex:health_beats_per_minutes_key"`
	BPM     int    `xml:"bpm,attr"`
	Time    string `xml:"time,attr" gorm:"uniqueIndex:health_beats_per_minutes_key"`
}

func (BeatsPerMinute) Conditions

func (bpm BeatsPerMinute) Conditions() map[string]interface{}

func (BeatsPerMinute) TableName

func (BeatsPerMinute) TableName() string

type DataExport

type DataExport struct {
	gorm.Model
	Locale     string
	ExportDate types.DateTime `gorm:"unique"`
	Me         MeRecord       `xml:"Me"`
	Workouts   []*Workout     `gorm:"-"`
}

func (DataExport) Conditions

func (d DataExport) Conditions() map[string]interface{}

func (DataExport) TableName

func (DataExport) TableName() string

type Device

type Device struct {
	gorm.Model
	Name         string
	Manufacturer string
	DeviceModel  string `gorm:"column:model"`
	Hardware     string
	Software     string
}

func (Device) Conditions

func (d Device) Conditions() map[string]interface{}

func (Device) TableName

func (Device) TableName() string

func (*Device) UnmarshalText

func (d *Device) UnmarshalText(b []byte) error

type Entry

type Entry struct {
	gorm.Model
	Type            string         `xml:"type,attr" gorm:"uniqueIndex:health_entries_key"`
	SourceName      string         `xml:"sourceName,attr"`
	SourceVersion   string         `xml:"sourceVersion,attr"`
	Unit            string         `xml:"unit,attr"`
	CreationDate    types.DateTime `xml:"creationDate,attr" gorm:"uniqueIndex:health_entries_key"`
	StartDate       types.DateTime `xml:"startDate,attr"`
	EndDate         types.DateTime `xml:"endDate,attr"`
	Value           string         `xml:"value,attr"`
	DeviceID        *int
	Device          *Device             `xml:"device,attr"`
	MetadataEntries []EntryMetadataItem `xml:"MetadataEntry"`
	BeatsPerMinutes []BeatsPerMinute    `xml:"HeartRateVariabilityMetadataList"`
}

func (Entry) Conditions

func (e Entry) Conditions() map[string]interface{}

func (Entry) TableName

func (Entry) TableName() string

func (*Entry) UnmarshalXML

func (e *Entry) UnmarshalXML(decoder *xml.Decoder, start xml.StartElement) error

type EntryMetadataItem

type EntryMetadataItem struct {
	gorm.Model
	EntryID uint   `gorm:"uniqueIndex:health_entry_metadata_key"`
	Key     string `xml:"key,attr" gorm:"uniqueIndex:health_entry_metadata_key"`
	Value   string `xml:"value,attr"`
}

func (EntryMetadataItem) Conditions

func (m EntryMetadataItem) Conditions() map[string]interface{}

func (EntryMetadataItem) TableName

func (EntryMetadataItem) TableName() string

type MeRecord

type MeRecord struct {
	gorm.Model
	DataExportID                uint           `gorm:"unique"`
	DateOfBirth                 types.DateTime `xml:"HKCharacteristicTypeIdentifierDateOfBirth,attr"`
	BiologicalSex               string         `xml:"HKCharacteristicTypeIdentifierBiologicalSex,attr"`
	BloodType                   string         `xml:"HKCharacteristicTypeIdentifierBloodType,attr"`
	FitzpatrickSkinType         string         `xml:"HKCharacteristicTypeIdentifierFitzpatrickSkinType,attr"`
	CardioFitnessMedicationsUse string         `xml:"HKCharacteristicTypeIdentifierCardioFitnessMedicationsUse,attr"`
}

func (MeRecord) Conditions

func (m MeRecord) Conditions() map[string]interface{}

func (MeRecord) TableName

func (MeRecord) TableName() string

type Workout

type Workout struct {
	gorm.Model
	ActivityType          string         `xml:"workoutActivityType,attr"`
	Duration              float64        `xml:"duration,attr"`
	DurationUnit          string         `xml:"durationUnit,attr"`
	TotalDistance         float64        `xml:"totalDistance,attr"`
	TotalDistanceUnit     string         `xml:"totalDistanceUnit,attr"`
	TotalEnergyBurned     float64        `xml:"totalEnergyBurned,attr"`
	TotalEnergyBurnedUnit string         `xml:"totalEnergyBurnedUnit,attr"`
	SourceName            string         `xml:"sourceName,attr"`
	SourceVersion         string         `xml:"sourceVersion,attr"`
	CreationDate          types.DateTime `xml:"creationDate,attr" gorm:"unique"`
	StartDate             types.DateTime `xml:"startDate,attr"`
	EndDate               types.DateTime `xml:"endDate,attr"`
	DeviceID              *int
	Device                *Device               `xml:"device,attr"`
	MetadataEntries       []WorkoutMetadataItem `xml:"MetadataEntry"`
	Events                []WorkoutEvent        `xml:"WorkoutEvent"`
	Route                 *WorkoutRoute         `xml:"WorkoutRoute"`
}

func (Workout) Conditions

func (w Workout) Conditions() map[string]interface{}

func (Workout) TableName

func (Workout) TableName() string

type WorkoutEvent

type WorkoutEvent struct {
	gorm.Model
	WorkoutID    uint           `gorm:"uniqueIndex:health_workout_events_key"`
	Type         string         `xml:"type,attr" gorm:"uniqueIndex:health_workout_events_key"`
	Date         types.DateTime `xml:"date,attr" gorm:"uniqueIndex:health_workout_events_key"`
	Duration     float64        `xml:"duration,attr"`
	DurationUnit string         `xml:"durationUnit,attr"`
}

func (WorkoutEvent) Conditions

func (e WorkoutEvent) Conditions() map[string]interface{}

func (WorkoutEvent) TableName

func (WorkoutEvent) TableName() string

type WorkoutMetadataItem

type WorkoutMetadataItem struct {
	gorm.Model
	WorkoutID uint   `gorm:"uniqueIndex:health_workout_metadata_key"`
	Key       string `xml:"key,attr" gorm:"uniqueIndex:health_workout_metadata_key"`
	Value     string `xml:"value,attr"`
}

func (WorkoutMetadataItem) Conditions

func (m WorkoutMetadataItem) Conditions() map[string]interface{}

func (WorkoutMetadataItem) TableName

func (WorkoutMetadataItem) TableName() string

type WorkoutRoute

type WorkoutRoute struct {
	gorm.Model
	WorkoutID       uint                       `gorm:"uniqueIndex:health_workout_routes_key"`
	SourceName      string                     `xml:"sourceName,attr"`
	SourceVersion   string                     `xml:"sourceVersion,attr"`
	CreationDate    types.DateTime             `xml:"creationDate,attr" gorm:"uniqueIndex:health_workout_routes_key"`
	StartDate       types.DateTime             `xml:"startDate,attr"`
	EndDate         types.DateTime             `xml:"endDate,attr"`
	MetadataEntries []WorkoutRouteMetadataItem `xml:"MetadataEntry"`
	FilePath        string
	Time            types.DateTime
	TrackName       string
	TrackPoints     []WorkoutRouteTrackPoint
}

func (WorkoutRoute) Conditions

func (wr WorkoutRoute) Conditions() map[string]interface{}

func (WorkoutRoute) TableName

func (WorkoutRoute) TableName() string

func (*WorkoutRoute) UnmarshalXML

func (wr *WorkoutRoute) UnmarshalXML(decoder *xml.Decoder, start xml.StartElement) error

type WorkoutRouteGPX

type WorkoutRouteGPX WorkoutRoute

func (*WorkoutRouteGPX) UnmarshalXML

func (wr *WorkoutRouteGPX) UnmarshalXML(decoder *xml.Decoder, start xml.StartElement) error

type WorkoutRouteMetadataItem

type WorkoutRouteMetadataItem struct {
	gorm.Model
	WorkoutRouteID uint   `gorm:"uniqueIndex:health_workout_route_metadata_key"`
	Key            string `xml:"key,attr" gorm:"uniqueIndex:health_workout_route_metadata_key"`
	Value          string `xml:"value,attr"`
}

func (WorkoutRouteMetadataItem) Conditions

func (m WorkoutRouteMetadataItem) Conditions() map[string]interface{}

func (WorkoutRouteMetadataItem) TableName

func (WorkoutRouteMetadataItem) TableName() string

type WorkoutRouteTrackPoint

type WorkoutRouteTrackPoint struct {
	gorm.Model
	WorkoutRouteID uint           `gorm:"uniqueIndex:health_track_points_key"`
	Lon            float64        `xml:"lon,attr"`
	Lat            float64        `xml:"lat,attr"`
	Ele            float64        `xml:"ele"`
	Time           types.DateTime `xml:"time" gorm:"uniqueIndex:health_track_points_key"`
	WorkoutRouteTrackPointExtensions
}

func (WorkoutRouteTrackPoint) Conditions

func (tp WorkoutRouteTrackPoint) Conditions() map[string]interface{}

func (WorkoutRouteTrackPoint) TableName

func (WorkoutRouteTrackPoint) TableName() string

type WorkoutRouteTrackPointExtensions

type WorkoutRouteTrackPointExtensions struct {
	Speed  float64 `xml:"speed"`
	Course float64 `xml:"course"`
	HAcc   float64 `xml:"hAcc"`
	VAcc   float64 `xml:"vAcc"`
}

Jump to

Keyboard shortcuts

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