controllers

package
v0.0.0-...-f8f3de1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	DB                 *mongo.Database
	InverterCollector  *colly.Collector
	TelemetryCollector *colly.Collector
	InverterPaths      []string
	TelemetryPaths     []string
}

Server : the base elements that make the service

func (*Server) Initialize

func (s *Server) Initialize(DBHost, DBPort, DBUser, DBPassword, DBDatabase, inverters, telemetries string) error

Initialize : prepares the service to launch

func (*Server) InverterAcquisition

func (s *Server) InverterAcquisition(baseURL string, iPeriod int64, quit chan bool)

InverterAcquisition : uses the scrapper for acquire inverter data

func (*Server) InverterCollectorConfig

func (s *Server) InverterCollectorConfig() error

InverterCollectorConfig : configures the inverter data scrapper

func (*Server) RefreshInverterCollection

func (s *Server) RefreshInverterCollection(ctx context.Context) error

RefreshInverterCollection : deletes all the inverters in the DB

func (*Server) RefreshTelemetryDataCollection

func (s *Server) RefreshTelemetryDataCollection(ctx context.Context) error

RefreshTelemetryDataCollection : deletes all the telemetry data in the DB

func (*Server) Run

func (s *Server) Run(appHost, appPort, iPeriod, tPeriod string)

Run : runs the service and recovers errors

func (*Server) SetupInverterCollection

func (s *Server) SetupInverterCollection(ctx context.Context) error

SetupInverterCollection : setups the inverter collection with constraints and rules

func (*Server) SetupTelemetryDataCollection

func (s *Server) SetupTelemetryDataCollection(ctx context.Context) error

SetupTelemetryDataCollection : setups the telemetry data collection with constraints and rules

func (*Server) TelemetryDataAcquisition

func (s *Server) TelemetryDataAcquisition(baseURL string, tPeriod int64, quit chan bool)

TelemetryDataAcquisition : uses the scrapper for acquire telemetry data

func (*Server) TelemetryDataCollectorConfig

func (s *Server) TelemetryDataCollectorConfig() error

TelemetryDataCollectorConfig : configures the telemetry data scrapper

func (*Server) Terminate

func (s *Server) Terminate() error

Terminate : closes connections and ends the service

Jump to

Keyboard shortcuts

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