mirror of
https://github.com/openp2p-cn/openp2p.git
synced 2025-12-24 12:57:52 +08:00
20 lines
252 B
Go
20 lines
252 B
Go
package main
|
|
|
|
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)
|
|
}
|