dump

package
v0.1.0-alpha9 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package dump provides types that write a days worth of sensor data into a blob storage service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Date     time.Time
	Readings Repository
	Blobs    Sink
	Logger   *log.Logger
}

The Config type contains fields used to configure the Dumper.

type Dumper

type Dumper struct {
	// contains filtered or unexported fields
}

The Dumper type is used to perform a daily dump of sensor data into a blob storage provider.

func New

func New(config Config) *Dumper

New returns a new instance of the Dumper type for the provided configuration values. For safety, it will automatically set Config.Date to be the earliest possible time for that day.

func (*Dumper) Dump

func (d *Dumper) Dump(ctx context.Context) error

Dump JSON-encoded readings for the configured date into the blob storage provider. Dumps will be JSON streams similar to how they are originally presented to the ingestor.

type Repository

type Repository interface {
	ForEachOnDate(ctx context.Context, date time.Time, fn reading.ForEachFunc) error
}

The Repository interface describes types that can iterate over reading data in a database.

type Sink

type Sink interface {
	NewWriter(ctx context.Context, name string) (io.WriteCloser, error)
}

The Sink interface describes types that provide keyed blobs where sensor data can be written.

Jump to

Keyboard shortcuts

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