open-vault/sdk/helper/keysutil/transit_syncmap.go
Lexman 9aa4662cec transit cache is an Interface implemented by wrapped versions of sync… (#6225)
* transit cache is an Interface implemented by wrapped versions of syncmap and golang-lru

* transit cache is an Interface implemented by wrapped versions of syncmap and golang-lru

* changed some import paths to point to sdk

* Apply suggestions from code review

Co-Authored-By: Lexman42 <Lexman42@users.noreply.github.com>

* updates docs with information on transit/cache-config endpoint

* updates vendored files

* fixes policy tests to actually use a cache where expected and renames the struct and storage path used for cache configurations to be more generic

* updates document links

* fixed a typo in a documentation link

* changes cache_size to just size for the cache-config endpoint
2019-06-04 15:40:56 -07:00

30 lines
504 B
Go

package keysutil
import (
"sync"
)
type TransitSyncMap struct {
syncmap sync.Map
}
func NewTransitSyncMap() *TransitSyncMap {
return &TransitSyncMap{syncmap: sync.Map{}}
}
func (c *TransitSyncMap) Delete(key interface{}) {
c.syncmap.Delete(key)
}
func (c *TransitSyncMap) Load(key interface{}) (value interface{}, ok bool) {
return c.syncmap.Load(key)
}
func (c *TransitSyncMap) Store(key, value interface{}) {
c.syncmap.Store(key, value)
}
func (c *TransitSyncMap) Size() int {
return 0
}