Improve loadpoint api (#1402)

Breaking change: chargeEstimate becomes chargeRemainingDuration
This commit is contained in:
andig 2021-09-05 11:28:28 +02:00 • committed by GitHub
parent b624e5ae44
commit c4298410d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 117 additions and 60 deletions

View file

@ -1,7 +1,6 @@
package util
import (
"errors"
"sync"
)
@ -92,15 +91,3 @@ func (c *Cache) Get(key string) Param {
return Param{}
}
// GetChecked returns checked value from cache
func (c *Cache) GetChecked(id int, key string) (res Param, err error) {
pid := Param{LoadPoint: &id, Key: key}
res = c.Get(pid.UniqueID())
if res.Key == "" {
err = errors.New("not found")
}
return res, err
}