open-vault/sdk/helper/keysutil/transit_syncmap.go
Hamid Ghaf 27bb03bbc0
adding copyright header (#19555)
* adding copyright header

* fix fmt and a test
2023-03-15 09:00:52 -07:00

33 lines
574 B
Go

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
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
}