server

package
v0.0.0-...-0149242 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 68 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigDirty

func ConfigDirty() bool

ConfigDirty returns the dirty flag

Types

type HTTPd

type HTTPd struct {
	*http.Server
}

HTTPd wraps an http.Server and adds the root router

func NewHTTPd

func NewHTTPd(addr string, hub *SocketHub, customCssFile string) *HTTPd

NewHTTPd creates HTTP server with configured routes for loadpoint

func (*HTTPd) RegisterSiteHandlers

func (s *HTTPd) RegisterSiteHandlers(site site.API)

RegisterSiteHandlers connects the http handlers to the site

func (*HTTPd) RegisterSystemHandler

func (s *HTTPd) RegisterSystemHandler(site *core.Site, pub publisher, cache *util.ParamCache, auth auth.Auth, shutdown func(), configFile string)

RegisterSystemHandler provides system level handlers

func (*HTTPd) Router

func (s *HTTPd) Router() *mux.Router

Router returns the main router

type Influx

type Influx struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Influx is a influx publisher

func NewInfluxClient

func NewInfluxClient(url, token, org, user, password, database string, insecure bool) *Influx

NewInfluxClient creates new publisher for influx

func (*Influx) Run

func (m *Influx) Run(site site.API, in <-chan util.Param)

Run Influx publisher

type MQTT

type MQTT struct {
	Handler *mqtt.Client
	// contains filtered or unexported fields
}

MQTT is the MQTT server. It uses the MQTT client for publishing.

func NewMQTT

func NewMQTT(root string, site site.API) (*MQTT, error)

NewMQTT creates MQTT server

func (*MQTT) Listen

func (m *MQTT) Listen(site site.API) error

func (*MQTT) Run

func (m *MQTT) Run(site site.API, in <-chan util.Param)

Run starts the MQTT publisher for the MQTT API

type PlanPreviewResponse

type PlanPreviewResponse struct {
	PlanTime time.Time `json:"planTime"`
	Duration int64     `json:"duration"`
	Plan     api.Rates `json:"plan"`
	Power    float64   `json:"power"`
}

type PlanResponse

type PlanResponse struct {
	PlanId   int       `json:"planId"`
	PlanTime time.Time `json:"planTime"`
	Duration int64     `json:"duration"`
	Plan     api.Rates `json:"plan"`
	Power    float64   `json:"power"`
}

type SocketHub

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

SocketHub maintains the set of active clients and broadcasts messages to the clients.

func NewSocketHub

func NewSocketHub() *SocketHub

NewSocketHub creates a web socket hub that distributes meter status and query results for the ui or other clients

func (*SocketHub) Run

func (h *SocketHub) Run(in <-chan util.Param, cache *util.ParamCache)

Run starts data and status distribution

func (*SocketHub) ServeWebsocket

func (h *SocketHub) ServeWebsocket(w http.ResponseWriter, r *http.Request)

ServeWebsocket handles websocket requests from the peer.

Directories

Path Synopsis
db
settings
Package settings is a generated GoMock package.
Package settings is a generated GoMock package.

Jump to

Keyboard shortcuts

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