streaming

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: 4 Imported by: 1

Documentation

Index

Constants

View Source
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

Close flushes the buffer and the inner writer to effectively ensure nothing is left unwritten

func (*CalibrationReadStreamer) Flush

Flush writes any buffered data to the underlying glukitio.Writer as a batch.

func (*CalibrationReadStreamer) WriteCalibration

WriteCalibration writes a single CalibrationRead into the buffer.

func (*CalibrationReadStreamer) WriteCalibrations

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

Close flushes the buffer and the inner writer to effectively ensure nothing is left unwritten

func (*GlucoseReadStreamer) Flush

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).

Jump to

Keyboard shortcuts

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