controllers

package
v0.0.0-...-47008de Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: GPL-3.0 Imports: 13 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
	Router *gin.Engine
}

Server : the base elements that make the service

func (*Server) GetInverter

func (s *Server) GetInverter(c *gin.Context)

GetInverter : handler for getting a single inverter from the DB

func (*Server) GetInverters

func (s *Server) GetInverters(c *gin.Context)

GetInverters : handler for listing all the inverters in the DB

func (*Server) Initialize

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

Initialize : prepares the service to launch

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(servicePort string) error

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