exporter

package module
v0.0.0-...-ef58b52 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2019 License: MIT Imports: 7 Imported by: 0

README

exporter

Go Report Card Build Status Coverage Status GoDoc GitHub release GitHub license

A pet project for exporting csv data from IQControls Mass controller logs to timescale DB.

##Enviroments

  • BASE_URI Host for importing the data - usually mass server ip like http://10.0.0.150
  • START_OFFSET How far from now to start getting readings, if no readings in database time.Duration, eg.: 1h
  • IMPORT_PERIOD The import period - shouldn't be less than 1 min
  • IMPORT_ONLY_ONCE Import the data only once and die - mostly for testing

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

func NewApplication

func NewApplication(importer Importer, exporter Exporter, db *gorm.DB) *App

NewApplication creates App

func (App) Export

func (a App) Export(ctx context.Context, imp []*sink.Reading) error

Export exports data

func (App) Import

func (a App) Import(ctx context.Context) ([]*sink.Reading, error)

Import imports data

func (App) IsHealthy

func (a App) IsHealthy() error

type Application

type Application interface {
	Importer
	Exporter
}

Application is the App

type Exporter

type Exporter interface {
	Export(ctx context.Context, imp []*sink.Reading) error
}

Exporter is a data exporter

type Importer

type Importer interface {
	Import(ctx context.Context) ([]*sink.Reading, error)
}

Importer is a data importer

type Migrator

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

func NewMigrator

func NewMigrator(db *sql.DB) *Migrator

func (*Migrator) IsHealthy

func (m *Migrator) IsHealthy() error

func (*Migrator) MigrateDown

func (m *Migrator) MigrateDown() error

func (*Migrator) MigrateUp

func (m *Migrator) MigrateUp() error

type Schema

type Schema struct{}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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