Version: v0.0.0-...-1b11a6a Latest Latest

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

Go to latest
Published: Jun 5, 2023 License: MIT Imports: 41 Imported by: 0




View Source
const DevVersion = "0.0.0"
View Source
const SocketPath = "/tmp/evcc"

SocketPath is the unix domain socket path


View Source
var (
	// Version of executable
	Version = DevVersion

	// Commit of executable
	Commit = ""


func FormattedVersion

func FormattedVersion() string

func HealthListener

func HealthListener(site site.API)

HealthListener attaches listener to unix domain socket and runs listener


type HTTPd

type HTTPd struct {

HTTPd wraps an http.Server and adds the root router

func NewHTTPd

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

NewHTTPd creates HTTP server with configured routes for loadpoint

func (*HTTPd) RegisterShutdownHandler

func (s *HTTPd) RegisterShutdownHandler(callback func())

RegisterShutdownHandler connects the http handlers to the site

func (*HTTPd) RegisterSiteHandlers

func (s *HTTPd) RegisterSiteHandlers(site site.API, cache *util.Cache)

RegisterSiteHandlers connects the http handlers to the site

func (*HTTPd) Router

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

Router returns the main router

type Influx

type Influx struct {
	// contains filtered or unexported fields

Influx is a influx publisher

func NewInfluxClient

func NewInfluxClient(url, token, org, user, password, database string) *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 InfluxConfig

type InfluxConfig struct {
	URL      string
	Database string
	Token    string
	Org      string
	User     string
	Password string
	Interval time.Duration

InfluxConfig is the influx db configuration

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

NewMQTT creates MQTT server

func (*MQTT) Run

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

Run starts the MQTT publisher for the MQTT API

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

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.


Path Synopsis

Jump to

Keyboard shortcuts

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