Documentation ¶
Index ¶
- Constants
- func ListToArrayOfCalibrationReads(head *container.ImmutableList, size int) []apimodel.CalibrationRead
- func ListToArrayOfExerciseReads(head *container.ImmutableList, size int) []apimodel.Exercise
- func ListToArrayOfGlucoseReads(head *container.ImmutableList, size int) []apimodel.GlucoseRead
- func ListToArrayOfInjectionReads(head *container.ImmutableList, size int) []apimodel.Injection
- func ListToArrayOfMealReads(head *container.ImmutableList, size int) []apimodel.Meal
- type CalibrationReadStreamer
- func (b *CalibrationReadStreamer) Close() (s *CalibrationReadStreamer, err error)
- func (b *CalibrationReadStreamer) Flush() (s *CalibrationReadStreamer, err error)
- func (b *CalibrationReadStreamer) WriteCalibration(c apimodel.CalibrationRead) (s *CalibrationReadStreamer, err error)
- func (b *CalibrationReadStreamer) WriteCalibrations(p []apimodel.CalibrationRead) (s *CalibrationReadStreamer, err error)
- type ExerciseStreamer
- func (b *ExerciseStreamer) Close() (s *ExerciseStreamer, err error)
- func (b *ExerciseStreamer) Flush() (s *ExerciseStreamer, err error)
- func (b *ExerciseStreamer) WriteExercise(c apimodel.Exercise) (s *ExerciseStreamer, err error)
- func (b *ExerciseStreamer) WriteExercises(p []apimodel.Exercise) (s *ExerciseStreamer, err error)
- type GlucoseReadStreamer
- func (b *GlucoseReadStreamer) Close() (*GlucoseReadStreamer, error)
- func (b *GlucoseReadStreamer) Flush() (*GlucoseReadStreamer, error)
- func (b *GlucoseReadStreamer) WriteGlucoseRead(c apimodel.GlucoseRead) (g *GlucoseReadStreamer, err error)
- func (b *GlucoseReadStreamer) WriteGlucoseReads(p []apimodel.GlucoseRead) (g *GlucoseReadStreamer, err error)
- type InjectionStreamer
- func (b *InjectionStreamer) Close() (s *InjectionStreamer, err error)
- func (b *InjectionStreamer) Flush() (s *InjectionStreamer, err error)
- func (b *InjectionStreamer) WriteInjection(c apimodel.Injection) (s *InjectionStreamer, err error)
- func (b *InjectionStreamer) WriteInjections(p []apimodel.Injection) (s *InjectionStreamer, err error)
- type MealStreamer
Constants ¶
const (
BUFFER_SIZE = 86400
)
Variables ¶
This section is empty.
Functions ¶
func ListToArrayOfCalibrationReads ¶
func ListToArrayOfCalibrationReads(head *container.ImmutableList, size int) []apimodel.CalibrationRead
func ListToArrayOfExerciseReads ¶
func ListToArrayOfExerciseReads(head *container.ImmutableList, size int) []apimodel.Exercise
func ListToArrayOfGlucoseReads ¶
func ListToArrayOfGlucoseReads(head *container.ImmutableList, size int) []apimodel.GlucoseRead
func ListToArrayOfInjectionReads ¶
func ListToArrayOfInjectionReads(head *container.ImmutableList, size int) []apimodel.Injection
func ListToArrayOfMealReads ¶
func ListToArrayOfMealReads(head *container.ImmutableList, size int) []apimodel.Meal
Types ¶
type CalibrationReadStreamer ¶
type CalibrationReadStreamer struct {
// contains filtered or unexported fields
}
func NewCalibrationReadStreamerDuration ¶
func NewCalibrationReadStreamerDuration(wr glukitio.CalibrationBatchWriter, bufferDuration time.Duration) *CalibrationReadStreamer
NewCalibrationReadStreamerDuration returns a new CalibrationReadStreamer whose buffer has the specified size.
func (*CalibrationReadStreamer) Close ¶
func (b *CalibrationReadStreamer) Close() (s *CalibrationReadStreamer, err error)
Close flushes the buffer and the inner writer to effectively ensure nothing is left unwritten
func (*CalibrationReadStreamer) Flush ¶
func (b *CalibrationReadStreamer) Flush() (s *CalibrationReadStreamer, err error)
Flush writes any buffered data to the underlying glukitio.Writer as a batch.
func (*CalibrationReadStreamer) WriteCalibration ¶
func (b *CalibrationReadStreamer) WriteCalibration(c apimodel.CalibrationRead) (s *CalibrationReadStreamer, err error)
WriteCalibration writes a single CalibrationRead into the buffer.
func (*CalibrationReadStreamer) WriteCalibrations ¶
func (b *CalibrationReadStreamer) WriteCalibrations(p []apimodel.CalibrationRead) (s *CalibrationReadStreamer, err error)
WriteCalibrations writes the contents of p into the buffer. It returns the number of bytes written. If nn < len(p), it also returns an error explaining why the write is short. p must be sorted by time (oldest to most recent).
type ExerciseStreamer ¶
type ExerciseStreamer struct {
// contains filtered or unexported fields
}
func NewExerciseStreamerDuration ¶
func NewExerciseStreamerDuration(wr glukitio.ExerciseBatchWriter, bufferDuration time.Duration) *ExerciseStreamer
NewExerciseStreamerDuration returns a new ExerciseStreamer whose buffer has the specified size.
func (*ExerciseStreamer) Close ¶
func (b *ExerciseStreamer) Close() (s *ExerciseStreamer, err error)
Close flushes the buffer and the inner writer to effectively ensure nothing is left unwritten
func (*ExerciseStreamer) Flush ¶
func (b *ExerciseStreamer) Flush() (s *ExerciseStreamer, err error)
Flush writes any buffered data to the underlying glukitio.Writer as a batch.
func (*ExerciseStreamer) WriteExercise ¶
func (b *ExerciseStreamer) WriteExercise(c apimodel.Exercise) (s *ExerciseStreamer, err error)
WriteExercise writes a single Exercise into the buffer.
func (*ExerciseStreamer) WriteExercises ¶
func (b *ExerciseStreamer) WriteExercises(p []apimodel.Exercise) (s *ExerciseStreamer, err error)
WriteExercises writes the contents of p into the buffer. It returns the number of bytes written. If nn < len(p), it also returns an error explaining why the write is short. p must be sorted by time (oldest to most recent).
type GlucoseReadStreamer ¶
type GlucoseReadStreamer struct {
// contains filtered or unexported fields
}
func NewGlucoseStreamerDuration ¶
func NewGlucoseStreamerDuration(wr glukitio.GlucoseReadBatchWriter, bufferDuration time.Duration) *GlucoseReadStreamer
NewGlucoseStreamerDuration returns a new GlucoseReadStreamer whose buffer has the specified size.
func (*GlucoseReadStreamer) Close ¶
func (b *GlucoseReadStreamer) Close() (*GlucoseReadStreamer, error)
Close flushes the buffer and the inner writer to effectively ensure nothing is left unwritten
func (*GlucoseReadStreamer) Flush ¶
func (b *GlucoseReadStreamer) Flush() (*GlucoseReadStreamer, error)
Flush writes any buffered data to the underlying glukitio.Writer as a batch.
func (*GlucoseReadStreamer) WriteGlucoseRead ¶
func (b *GlucoseReadStreamer) WriteGlucoseRead(c apimodel.GlucoseRead) (g *GlucoseReadStreamer, err error)
WriteGlucoseRead writes a single GlucoseRead into the buffer.
func (*GlucoseReadStreamer) WriteGlucoseReads ¶
func (b *GlucoseReadStreamer) WriteGlucoseReads(p []apimodel.GlucoseRead) (g *GlucoseReadStreamer, err error)
WriteGlucoseReads writes the contents of p into the buffer. It returns the number of bytes written. If nn < len(p), it also returns an error explaining why the write is short. p must be sorted by time (oldest to most recent).
type InjectionStreamer ¶
type InjectionStreamer struct {
// contains filtered or unexported fields
}
func NewInjectionStreamerDuration ¶
func NewInjectionStreamerDuration(wr glukitio.InjectionBatchWriter, bufferDuration time.Duration) *InjectionStreamer
NewInjectionStreamerDuration returns a new InjectionStreamer whose buffer has the specified size.
func (*InjectionStreamer) Close ¶
func (b *InjectionStreamer) Close() (s *InjectionStreamer, err error)
Close flushes the buffer and the inner writer to effectively ensure nothing is left unwritten
func (*InjectionStreamer) Flush ¶
func (b *InjectionStreamer) Flush() (s *InjectionStreamer, err error)
Flush writes any buffered data to the underlying glukitio.Writer as a batch.
func (*InjectionStreamer) WriteInjection ¶
func (b *InjectionStreamer) WriteInjection(c apimodel.Injection) (s *InjectionStreamer, err error)
WriteInjection writes a single Injection into the buffer.
func (*InjectionStreamer) WriteInjections ¶
func (b *InjectionStreamer) WriteInjections(p []apimodel.Injection) (s *InjectionStreamer, err error)
WriteInjections writes the contents of p into the buffer. It returns the number of bytes written. If nn < len(p), it also returns an error explaining why the write is short. p must be sorted by time (oldest to most recent).
type MealStreamer ¶
type MealStreamer struct {
// contains filtered or unexported fields
}
func NewMealStreamerDuration ¶
func NewMealStreamerDuration(wr glukitio.MealBatchWriter, bufferDuration time.Duration) *MealStreamer
NewMealStreamerDuration returns a new MealStreamer whose buffer has the specified size.
func (*MealStreamer) Close ¶
func (b *MealStreamer) Close() (s *MealStreamer, err error)
Close flushes the buffer and the inner writer to effectively ensure nothing is left unwritten
func (*MealStreamer) Flush ¶
func (b *MealStreamer) Flush() (s *MealStreamer, err error)
Flush writes any buffered data to the underlying glukitio.Writer as a batch.
func (*MealStreamer) WriteMeal ¶
func (b *MealStreamer) WriteMeal(c apimodel.Meal) (s *MealStreamer, err error)
WriteMeal writes a single Meal into the buffer.
func (*MealStreamer) WriteMeals ¶
func (b *MealStreamer) WriteMeals(p []apimodel.Meal) (s *MealStreamer, err error)
WriteMeals writes the contents of p into the buffer. It returns the number of bytes written. If nn < len(p), it also returns an error explaining why the write is short. p must be sorted by time (oldest to most recent).