init
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user