server

package
v0.0.0-...-722e3e0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2021 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const SocketPath = "/tmp/evcc"

SocketPath is the unix domain socket path

Variables

View Source
var (
	// Repository name
	Repository = "evcc"

	// Owner of repository
	Owner = "andig"

	// Version of executable
	Version = "0.0.1-alpha"

	// Commit of executable
	Commit = "HEAD"
)
View Source
var Assets fs.FS

Assets is the embedded assets file system

Functions

func ChargeModeHandler

func ChargeModeHandler(loadpoint core.LoadPointAPI) http.HandlerFunc

ChargeModeHandler updates charge mode

func CurrentChargeModeHandler

func CurrentChargeModeHandler(loadpoint core.LoadPointAPI) http.HandlerFunc

CurrentChargeModeHandler returns current charge mode

func CurrentMinSoCHandler

func CurrentMinSoCHandler(loadpoint core.LoadPointAPI) http.HandlerFunc

CurrentMinSoCHandler returns current minimum soc

func CurrentPhasesHandler

func CurrentPhasesHandler(loadpoint core.LoadPointAPI) http.HandlerFunc

CurrentPhasesHandler returns current minimum soc

func CurrentTargetSoCHandler

func CurrentTargetSoCHandler(loadpoint core.LoadPointAPI) http.HandlerFunc

CurrentTargetSoCHandler returns current target soc

func HealthHandler

func HealthHandler(site core.SiteAPI) http.HandlerFunc

HealthHandler returns current charge mode

func HealthListener

func HealthListener(site core.SiteAPI)

HealthListener attaches listener to unix domain socket and runs listener

func MinSoCHandler

func MinSoCHandler(loadpoint core.LoadPointAPI) http.HandlerFunc

MinSoCHandler updates minimum soc

func PhasesHandler

func PhasesHandler(loadpoint core.LoadPointAPI) http.HandlerFunc

PhasesHandler updates minimum soc

func RemoteDemandHandler

func RemoteDemandHandler(loadpoint core.LoadPointAPI) http.HandlerFunc

RemoteDemandHandler updates minimum soc

func ServeWebsocket

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

ServeWebsocket handles websocket requests from the peer.

func SocketHandler

func SocketHandler(hub *SocketHub) http.HandlerFunc

SocketHandler attaches websocket handler to uri

func StateHandler

func StateHandler(cache *util.Cache) http.HandlerFunc

StateHandler returns current charge mode

func TargetChargeHandler

func TargetChargeHandler(loadpoint core.LoadPointAPI) http.HandlerFunc

TargetChargeHandler updates target soc

func TargetSoCHandler

func TargetSoCHandler(loadpoint core.LoadPointAPI) http.HandlerFunc

TargetSoCHandler updates target soc

func TemplatesHandler

func TemplatesHandler() http.HandlerFunc

TemplatesHandler returns current charge mode

Types

type EEBus

type EEBus struct {
	// contains filtered or unexported fields
}
var EEBusInstance *EEBus

func NewEEBus

func NewEEBus(other map[string]interface{}) (*EEBus, error)

func (*EEBus) DeviceInfo

func (c *EEBus) DeviceInfo() communication.ManufacturerDetails

func (*EEBus) Register

func (c *EEBus) Register(ski string, shipConnectHandler func(string, ship.Conn) error, shipDisconnectHandler func(string))

func (*EEBus) Run

func (c *EEBus) Run()

type EEBusClientCBs

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

type HTTPd

type HTTPd struct {
	*http.Server
}

HTTPd wraps an http.Server and adds the root router

func NewHTTPd

func NewHTTPd(url string, site core.SiteAPI, hub *SocketHub, cache *util.Cache) *HTTPd

NewHTTPd creates HTTP server with configured routes for loadpoint

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(loadPoints []core.LoadPointAPI, 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 core.SiteAPI, in <-chan util.Param)

Run starts the MQTT publisher for the MQTT API

type SocketClient

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

SocketClient is a middleman between the websocket connection and the hub.

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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