You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
451 B
Go
29 lines
451 B
Go
package starmap
|
|
|
|
import "sync"
|
|
|
|
var globalMap StarMapKV
|
|
|
|
type StarMapKV struct {
|
|
kvMap map[string]interface{}
|
|
kvmu sync.RWMutex
|
|
kvMapPro map[string]StarMap
|
|
kvmuPro sync.RWMutex
|
|
}
|
|
|
|
type StarStack struct {
|
|
kvPushmu sync.RWMutex
|
|
kvStack []interface{}
|
|
}
|
|
|
|
func init() {
|
|
globalMap = NewStarMap()
|
|
}
|
|
|
|
func NewStarMap() StarMapKV {
|
|
var mp StarMapKV
|
|
mp.kvMap = make(map[string]interface{})
|
|
mp.kvMapPro = make(map[string]StarMap)
|
|
return mp
|
|
}
|