Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseContent ¶
func ParseContent(context context.Context, reader io.Reader, parentKey *datastore.Key, startTime time.Time, readsBatchHandler func(context context.Context, userProfileKey *datastore.Key, meals []apimodel.DayOfGlucoseReads) ([]*datastore.Key, error), mealsBatchHandler func(context context.Context, userProfileKey *datastore.Key, daysOfMeals []apimodel.DayOfMeals) ([]*datastore.Key, error), injectionBatchHandler func(context context.Context, userProfileKey *datastore.Key, daysOfInjections []apimodel.DayOfInjections) ([]*datastore.Key, error), exerciseBatchHandler func(context context.Context, userProfileKey *datastore.Key, daysOfExercises []apimodel.DayOfExercises) ([]*datastore.Key, error)) (lastReadTime time.Time, err error)
ParseContent is the big function that parses the Dexcom xml file. It is given a reader to the file and it parses batches of days of GlucoseReads/Events. It streams the content but keeps some in memory until it reaches a full batch of a type. A batch is an array of DayOf[GlucoseReads,Injection,Meals,Exercises]. A batch is flushed to the datastore once it reaches the given batchSize or we reach the end of the file.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.