web

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: MIT Imports: 23 Imported by: 0

README

hdb-renderer-web

HomeDashboard renderer for WEB access.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDatabase

func NewDatabase(conf config.Config) (*sql.DB, error)

NewDatabase creates a new database driver from passed config. Atm sqlite3 with local file is supported, only.

func NewServer

func NewServer(conf config.Config, logger log.Logger) *webServer

func SetupDatabaseSchema

func SetupDatabaseSchema(db *sql.DB, conf config.Config) error

SetupDatabaseSChema ensures required data structures.

func TearDownDatabaseSchema

func TearDownDatabaseSchema(db *sql.DB, conf config.Config) error

TearDownDatabaseSchema deletes alls data structures.

Types

type BashbaorcRenderer

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

type ConfigRenderer

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

type DataSource

type DataSource struct {
	Id               string
	Type             DataSourceType
	Event            EventType
	Name             string
	DataSourceConfig map[string]string
}

type DataSourceRepository

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

func NewDataSourceRepository

func NewDataSourceRepository(db *sql.DB, logger log.Logger) *DataSourceRepository

func (*DataSourceRepository) Delete

func (repo *DataSourceRepository) Delete(id string) error

func (*DataSourceRepository) Get

func (repo *DataSourceRepository) Get(id string) (*DataSource, error)

func (*DataSourceRepository) List

func (repo *DataSourceRepository) List() ([]DataSource, error)

func (*DataSourceRepository) Set

func (repo *DataSourceRepository) Set(datasource DataSource) (*DataSource, error)

type DataSourceType

type DataSourceType string

DataSourceType defines rechnical source of events, e.g. database, message broker, etc.

const (
	// DATASOURCE_KAFKA. event conumed from topics in Kafka.
	DATASOURCE_KAFKA DataSourceType = "kafka"
)

type EventType

type EventType string

EventType defines events provided by a datasource, e.g. weather or indoor climate data

const (

	// EVENTTYPE_WEATHER, weather data, current weather and hourly/daily forecasts
	EVENTTYPE_WEATHER EventType = "weather"

	// EVENTTYPE_AWSBILLING, billing report form AWS for current expenses.
	EVENTTYPE_AWSBILLING EventType = "awsbilling"

	// EVENTTYPE_INDOORCLIMATE. climate data (temperature/humidity) collected in different rooms.
	EVENTTYPE_INDOORCLIMATE EventType = "indoorclimate"
)

Jump to

Keyboard shortcuts

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