Versions in this module Expand all Collapse all v0 v0.3.1 Nov 27, 2026 v0.3.0 Nov 27, 2026 v0.2.1 Nov 27, 2026 v0.2.0 Nov 25, 2026 Changes in this version + const DefaultListen + const DefaultLogTail + const DefaultWaitTimeout + const MCPPath + const MaxLogTail + const MaxWaitTimeout + var Actions = []string + var ErrAlreadyRunning = errors.New("the API is already running") + var Spec []byte + func CreateToken(dataDir, name, site string, readOnly bool) (secret string, err error) + func RemoveToken(dataDir, name string) (bool, error) + func Shutdown(ctx context.Context, dataDir string) error + type Action struct + Battery string + Code string + Connector *int + Curve string + EV string + For string + Info string + MaxPower string + Name string + SoC string + Step string + Tag string + TargetSoC string + VendorCode string + type Backend interface + Chargers func(ctx context.Context, site string) ([]control.ChargerState, error) + Exec func(ctx context.Context, site, charger string, action Action) ([]control.ExecResult, error) + Inspect func(ctx context.Context, site, charger string) (any, error) + Logs func(ctx context.Context, site, charger string, query LogQuery) ([]LogLine, error) + Wait func(ctx context.Context, site, charger string, wait Wait) ([]Waited, error) + type Config struct + Backend Backend + DataDir string + Listen string + Out io.Writer + TLSCert string + TLSKey string + Version string + type Entry struct + Action string + Chargers []string + Message string + Method string + Path string + Remote string + Status int + Time time.Time + Token string + func ReadLog(dataDir string) ([]Entry, error) + func (e Entry) Line() string + type Error struct + Message string + Status int + func Errorf(status int, format string, args ...any) *Error + func (e *Error) Error() string + type Info struct + Listen string + PID int + Since time.Time + TLS bool + TLSCert string + TLSKey string + Version string + func Probe(ctx context.Context, dataDir string) (Info, error) + func (i Info) URL() string + type LogLine struct + ChargePointID string + Kind string + Message json.RawMessage + Text string + Time string + type LogQuery struct + Events bool + Since string + Tail int + type Server struct + func Serve(cfg Config) (*Server, error) + func (s *Server) Close() + func (s *Server) Done() <-chan struct{} + func (s *Server) Info() Info + func (s *Server) Local() bool + func (s *Server) Stopped() <-chan struct{} + type Token struct + Created time.Time + Hash string + Name string + ReadOnly bool + Site string + func LoadTokens(dataDir string) ([]Token, error) + type Wait struct + Connector *int + State string + Timeout time.Duration + type Waited struct + ChargePointID string + Connector int + Reached bool + Site string + State string