27bb03bbc0
* adding copyright header * fix fmt and a test
33 lines
574 B
Go
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
|
|
}
|