healthkit

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2021 License: MIT Imports: 4 Imported by: 2

Documentation

Overview

Package healthkit contains Apple's HealthKit types and constants.

Index

Constants

View Source
const (
	BiologicalSexFemale = BiologicalSex("HKBiologicalSexFemale")
	BiologicalSexMale   = BiologicalSex("HKBiologicalSexMale")
	BiologicalSexOther  = BiologicalSex("HKBiologicalSexOther")
)

BiologicalSex constants.

View Source
const (
	BloodTypeAPositive  = BloodType("HKBloodTypeAPositive")
	BloodTypeANegative  = BloodType("HKBloodTypeANegative")
	BloodTypeBPositive  = BloodType("HKBloodTypeBPositive")
	BloodTypeBNegative  = BloodType("HKBloodTypeBNegative")
	BloodTypeABPositive = BloodType("HKBloodTypeABPositive")
	BloodTypeABNegative = BloodType("HKBloodTypeABNegative")
	BloodTypeOPositive  = BloodType("HKBloodTypeOPositive")
	BloodTypeONegative  = BloodType("HKBloodTypeONegative")
)

BloodType constants.

View Source
const (
	CategoryValueSleepAnalysisInBed  = CategoryValueSleepAnalysis("HKCategoryValueSleepAnalysisInBed")
	CategoryValueSleepAnalysisAsleep = CategoryValueSleepAnalysis("HKCategoryValueSleepAnalysisAsleep")
	CategoryValueSleepAnalysisAwake  = CategoryValueSleepAnalysis("HKCategoryValueSleepAnalysisAwake")
)

CategoryValueSleepAnalysis constants.

View Source
const (
	MetadataKeyExternalUUID   = MetadataKey("HKExternalUUID")
	MetadataKeyTimeZone       = MetadataKey("HKTimeZone")
	MetadataKeyWasUserEntered = MetadataKey("HKWasUserEntered")
)

MetadataKey constants.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivitySummary

type ActivitySummary struct {
	XMLName                xml.Name `xml:"ActivitySummary"`
	DateComponents         string   `xml:"dateComponents,attr"`
	ActiveEnergyBurned     string   `xml:"activeEnergyBurned,attr"`
	ActiveEnergyBurnedGoal string   `xml:"activeEnergyBurnedGoal,attr"`
	ActiveEnergyBurnedUnit string   `xml:"activeEnergyBurnedUnit,attr"`
	AppleMoveMinutes       string   `xml:"appleMoveMinutes,attr"`
	AppleMoveMinutesGoal   string   `xml:"appleMoveMinutesGoal,attr"`
	AppleExerciseTime      string   `xml:"appleExerciseTime,attr"`
	AppleExerciseTimeGoal  string   `xml:"appleExerciseTimeGoal,attr"`
	AppleStandHours        string   `xml:"appleStandHours,attr"`
	AppleStandHoursGoal    string   `xml:"appleStandHoursGoal,attr"`
}

ActivitySummary contains the move, exercise, and stand data for a given day. https://developer.apple.com/documentation/healthkit/hkactivitysummary

func (*ActivitySummary) String

func (as *ActivitySummary) String() string

String returns the object's string representation useful for logging and debugging.

type BiologicalSex

type BiologicalSex string

BiologicalSex indicates the user’s sex. https://developer.apple.com/documentation/healthkit/hkbiologicalsex

type BloodType

type BloodType string

BloodType indicates the user’s blood type. https://developer.apple.com/documentation/healthkit/hkbloodtype

type CategoryValueSleepAnalysis

type CategoryValueSleepAnalysis string

CategoryValueSleepAnalysis represents the result of a sleep analysis. https://developer.apple.com/documentation/healthkit/hkcategoryvaluesleepanalysis

type Correlation

type Correlation struct {
	XMLName       xml.Name         `xml:"Correlation"`
	Type          string           `xml:"type,attr"`
	SourceName    string           `xml:"sourceName,attr"`
	SourceVersion string           `xml:"sourceVersion,attr"`
	Device        string           `xml:"device,attr"`
	CreationDate  string           `xml:"creationDate,attr"`
	StartDate     string           `xml:"startDate,attr"`
	EndDate       string           `xml:"endDate,attr"`
	MetadataEntry []*MetadataEntry `xml:"MetadataEntry"`
	Record        []*Record        `xml:"Record"`
}

Correlation is a sample that groups multiple related samples into a single entry. https://developer.apple.com/documentation/healthkit/hkcorrelation

func (*Correlation) CreationDateTime

func (c *Correlation) CreationDateTime() time.Time

func (*Correlation) EndDateTime

func (c *Correlation) EndDateTime() time.Time

func (*Correlation) StartDateTime

func (c *Correlation) StartDateTime() time.Time

func (*Correlation) String

func (c *Correlation) String() string

String returns the object's string representation useful for logging and debugging.

type Data

type Data interface {
	fmt.Stringer
	// contains filtered or unexported methods
}

type ExportDate

type ExportDate struct {
	XMLName xml.Name `xml:"ExportDate"`
	Value   string   `xml:"value,attr"`
}

type HeartRateVariabilityMetadataList

type HeartRateVariabilityMetadataList struct {
	XMLName                     xml.Name                       `xml:"HeartRateVariabilityMetadataList"`
	InstantaneousBeatsPerMinute []*InstantaneousBeatsPerMinute `xml:"InstantaneousBeatsPerMinute"`
}

type InstantaneousBeatsPerMinute

type InstantaneousBeatsPerMinute struct {
	XMLName xml.Name `xml:"InstantaneousBeatsPerMinute"`
	Bpm     int      `xml:"bpm,attr"`
	Time    string   `xml:"time,attr"`
}

type Me

type Me struct {
	XMLName             xml.Name      `xml:"Me"`
	DateOfBirth         string        `xml:"HKCharacteristicTypeIdentifierDateOfBirth,attr"`
	BiologicalSex       BiologicalSex `xml:"HKCharacteristicTypeIdentifierBiologicalSex,attr"`
	BloodType           BloodType     `xml:"HKCharacteristicTypeIdentifierBloodType,attr"`
	FitzpatrickSkinType string        `xml:"HKCharacteristicTypeIdentifierFitzpatrickSkinType,attr"`
}

func (*Me) DateOfBirthTime

func (me *Me) DateOfBirthTime() time.Time

type Meta

type Meta struct {
	Locale     string
	ExportDate ExportDate
	Me         Me
}

func (*Meta) String added in v0.3.0

func (m *Meta) String() string

String returns the object's string representation useful for logging and debugging.

type MetadataEntry

type MetadataEntry struct {
	XMLName xml.Name `xml:"MetadataEntry"`
	Key     string   `xml:"key,attr"`
	Value   string   `xml:"value,attr"`
}

func (*MetadataEntry) String added in v0.2.0

func (me *MetadataEntry) String() string

String returns the object's string representation useful for logging and debugging.

type MetadataKey added in v0.2.0

type MetadataKey string

MetadataKey is used to add metadata to objects stored in HealthKit. https://developer.apple.com/documentation/healthkit/samples/metadata_keys

type Record

type Record struct {
	XMLName                          xml.Name                            `xml:"Record"`
	Type                             string                              `xml:"type,attr"`
	Unit                             string                              `xml:"unit,attr"`
	Value                            string                              `xml:"value,attr"`
	SourceName                       string                              `xml:"sourceName,attr"`
	SourceVersion                    string                              `xml:"sourceVersion,attr"`
	Device                           string                              `xml:"device,attr"`
	CreationDate                     string                              `xml:"creationDate,attr"`
	StartDate                        string                              `xml:"startDate,attr"`
	EndDate                          string                              `xml:"endDate,attr"`
	MetadataEntry                    []*MetadataEntry                    `xml:"MetadataEntry"`
	HeartRateVariabilityMetadataList []*HeartRateVariabilityMetadataList `xml:"HeartRateVariabilityMetadataList"`
}

func (*Record) CreationDateTime

func (r *Record) CreationDateTime() time.Time

func (*Record) DeviceMap

func (r *Record) DeviceMap() map[string]string

func (*Record) EndDateTime

func (r *Record) EndDateTime() time.Time

func (*Record) StartDateTime

func (r *Record) StartDateTime() time.Time

func (*Record) String

func (r *Record) String() string

String returns the object's string representation useful for logging and debugging.

type Workout

type Workout struct {
	XMLName               xml.Name         `xml:"Workout"`
	WorkoutActivityType   string           `xml:"workoutActivityType,attr"`
	Duration              string           `xml:"duration,attr"`
	DurationUnit          string           `xml:"durationUnit,attr"`
	TotalDistance         string           `xml:"totalDistance,attr"`
	TotalDistanceUnit     string           `xml:"totalDistanceUnit,attr"`
	TotalEnergyBurned     string           `xml:"totalEnergyBurned,attr"`
	TotalEnergyBurnedUnit string           `xml:"totalEnergyBurnedUnit,attr"`
	SourceName            string           `xml:"sourceName,attr"`
	SourceVersion         string           `xml:"sourceVersion,attr"`
	CreationDate          string           `xml:"creationDate,attr"`
	StartDate             string           `xml:"startDate,attr"`
	EndDate               string           `xml:"endDate,attr"`
	MetadataEntry         []*MetadataEntry `xml:"MetadataEntry"`
}

func (*Workout) CreationDateTime

func (w *Workout) CreationDateTime() time.Time

func (*Workout) EndDateTime

func (w *Workout) EndDateTime() time.Time

func (*Workout) StartDateTime

func (w *Workout) StartDateTime() time.Time

func (*Workout) String

func (w *Workout) String() string

String returns the object's string representation useful for logging and debugging.

Jump to

Keyboard shortcuts

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