mirror of
https://github.com/openp2p-cn/openp2p.git
synced 2026-02-12 14:45:08 +08:00
20 lines
255 B
Go
20 lines
255 B
Go
package openp2p
|
|
|
|
import (
|
|
"sync"
|
|
)
|
|
|
|
var p2pAppKeys sync.Map
|
|
|
|
func GetKey(appID uint64) uint64 {
|
|
i, ok := p2pAppKeys.Load(appID)
|
|
if !ok {
|
|
return 0
|
|
}
|
|
return i.(uint64)
|
|
}
|
|
|
|
func SaveKey(appID uint64, appKey uint64) {
|
|
p2pAppKeys.Store(appID, appKey)
|
|
}
|