Improve loadpoint api (#1402)
Breaking change: chargeEstimate becomes chargeRemainingDuration
This commit is contained in:
parent
b624e5ae44
commit
c4298410d1
13 changed files with 117 additions and 60 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue