This commit is contained in:
unknown
2026-02-04 20:27:13 +08:00
commit 3b042d1dad
9410 changed files with 1488147 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package models
type NSKeys struct {
m map[int64]*NSKey // keyId => *NSKey
}
func NewNSKeys() *NSKeys {
return &NSKeys{m: map[int64]*NSKey{}}
}
func (this *NSKeys) Add(key *NSKey) {
this.m[key.Id] = key
}
func (this *NSKeys) Remove(keyId int64) {
delete(this.m, keyId)
}
func (this *NSKeys) All() []*NSKey {
var result = []*NSKey{}
for _, k := range this.m {
result = append(result, k)
}
return result
}