Add basic OCPP support (#395)
This commit is contained in:
parent
9bd8754b85
commit
29ea3c6549
20 changed files with 618 additions and 130 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package util
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"sync"
|
||||
)
|
||||
|
||||
|
|
@ -91,3 +92,15 @@ 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