Messaging repo ported to store and cleaned

This commit is contained in:
Denis Arh
2020-09-06 09:28:45 +02:00
parent 677469c5ca
commit 10b1dc09e9
55 changed files with 948 additions and 1816 deletions
+4 -4
View File
@@ -6,10 +6,10 @@ import (
type (
Rule struct {
RoleID uint64 `json:"roleID,string" db:"rel_role"`
Resource Resource `json:"resource" db:"resource"`
Operation Operation `json:"operation" db:"operation"`
Access Access `json:"access,string" db:"access"`
RoleID uint64 `json:"roleID,string"`
Resource Resource `json:"resource"`
Operation Operation `json:"operation"`
Access Access `json:"access,string"`
// Do we need to flush it to storage?
dirty bool
+9
View File
@@ -24,6 +24,15 @@ func ToStringBoolMap(s []string) (h map[string]bool) {
return
}
func ToUint64BoolMap(u []uint64) (h map[uint64]bool) {
h = make(map[uint64]bool)
for i := 0; i < len(u); i++ {
h[u[i]] = true
}
return
}
func HasString(ss []string, s string) bool {
for i := range ss {
if ss[i] == s {