-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.go
More file actions
72 lines (62 loc) · 1.8 KB
/
types.go
File metadata and controls
72 lines (62 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package main
import (
"math/big"
"time"
)
type Door struct {
Id int64 `json:"id,omitempty"`
System int64 `json:"system,omitempty"`
KeyX *big.Int `json:"keyX,omitempty"`
KeyY *big.Int `json:"keyY,omitempty"`
Challenge []byte `json:"challenge,omitempty"`
Response []byte `json:"response,omitempty"`
Name string `json:"name,omitempty"`
Method int `json:"method,omitempty"`
Totp string `json:"totp,omitempty"`
}
type Totp struct {
Expires int64 `json:"expires"`
Code string `json:"code"`
}
type Transaction struct {
DoorName string `json:"door,omitempty"`
Door int64
Time time.Time `json:"time"`
Pin string `json:"pin"`
Card string `json:"card"`
}
type Role struct {
System int64 `json:"system"`
Name string `json:"name"`
Doors []Door `json:"doors"`
}
type Permission struct {
System int64 `json:"system,omitempty"`
Door int64 `json:"door,omitempty"`
Role int64 `json:"role,omitempty"`
}
type User struct {
System int64 `json:"system,omitempty"`
Id int64 `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Email string `json:"email,omitempty"`
Pin string `json:"pin,omitempty"`
CardNo string `json:"cardno,omitempty"`
Phone string `json:"phone,omitempty"`
Roles []Role `json:"roles,omitempty"`
}
type System struct {
Id int64 `json:"id,omitempty"`
Name string `json:"name,omitempty"`
TotpKey []byte
}
type Admin struct {
Id int64 `json:"id,omitempty"`
KeyX *big.Int `json:"keyX,omitempty"`
KeyY *big.Int `json:"keyY,omitempty"`
Challenge []byte `json:"challenge,omitempty"`
Response []byte `json:"response,omitempty"`
Name string `json:"name,omitempty"`
Email string `json:"email,omitempty"`
Phone string `json:"phone,omitempty"`
}