2018-02-19 04:26:01 +00:00
|
|
|
package counters
|
|
|
|
|
|
|
|
import "sync"
|
|
|
|
|
|
|
|
// TODO: Make a neater API for this
|
|
|
|
var routeMapEnum map[string]int
|
|
|
|
var reverseRouteMapEnum map[int]string
|
|
|
|
|
|
|
|
func SetRouteMapEnum(rme map[string]int) {
|
|
|
|
routeMapEnum = rme
|
|
|
|
}
|
|
|
|
|
|
|
|
func SetReverseRouteMapEnum(rrme map[int]string) {
|
|
|
|
reverseRouteMapEnum = rrme
|
|
|
|
}
|
|
|
|
|
|
|
|
var agentMapEnum map[string]int
|
|
|
|
var reverseAgentMapEnum map[int]string
|
|
|
|
|
|
|
|
func SetAgentMapEnum(ame map[string]int) {
|
|
|
|
agentMapEnum = ame
|
|
|
|
}
|
|
|
|
|
|
|
|
func SetReverseAgentMapEnum(rame map[int]string) {
|
|
|
|
reverseAgentMapEnum = rame
|
|
|
|
}
|
|
|
|
|
|
|
|
var osMapEnum map[string]int
|
|
|
|
var reverseOSMapEnum map[int]string
|
|
|
|
|
|
|
|
func SetOSMapEnum(osme map[string]int) {
|
|
|
|
osMapEnum = osme
|
|
|
|
}
|
|
|
|
|
|
|
|
func SetReverseOSMapEnum(rosme map[int]string) {
|
|
|
|
reverseOSMapEnum = rosme
|
|
|
|
}
|
2018-07-31 04:02:09 +00:00
|
|
|
|
|
|
|
type RWMutexCounterBucket struct {
|
|
|
|
counter int
|
|
|
|
sync.RWMutex
|
|
|
|
}
|