server

package
v0.0.0-...-9d8e2b1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 46 Imported by: 0

Documentation

Index

Constants

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

SocketPath is the unix domain socket path

Variables

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

	// Commit of executable
	Commit = ""
)

Functions

func ConfigDirty

func ConfigDirty() bool

ConfigDirty returns the dirty flag

func FormattedVersion

func FormattedVersion() string

func HealthListener

func HealthListener(site site.API)

HealthListener attaches listener to unix domain socket and runs listener

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

NewHTTPd creates HTTP server with configured routes for loadpoint

func (*HTTPd) RegisterAuthHandlers

func (s *HTTPd) RegisterAuthHandlers(auth auth.Auth)

RegisterAuthHandlers provides authentication handlers

func (*HTTPd) RegisterSiteHandlers

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

RegisterSiteHandlers connects the http handlers to the site

func (*HTTPd) RegisterSystemHandler

func (s *HTTPd) RegisterSystemHandler(auth auth.Auth, shutdown func())

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) *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, 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 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.

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