importer

package
v0.0.0-...-a2a2cd2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2023 License: MIT, MIT Imports: 14 Imported by: 0

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.

Jump to

Keyboard shortcuts

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