17 lines
194 B
Go
17 lines
194 B
Go
package cache
|
|
|
|
import (
|
|
"sync"
|
|
"sync/atomic"
|
|
)
|
|
|
|
type Cache struct {
|
|
mu sync.Mutex
|
|
state atomic.Pointer[mappings]
|
|
}
|
|
|
|
type mappings struct {
|
|
s2c map[string]string
|
|
c2s map[string]string
|
|
}
|