-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.go
More file actions
40 lines (34 loc) · 922 Bytes
/
config.go
File metadata and controls
40 lines (34 loc) · 922 Bytes
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
package auth
import "gorm.io/gorm"
type Type string
const ( //for permission check
Postgres Type = "postgres"
Mysql Type = "mysql"
)
type Config struct {
UserId int //(optional) if you use login function this userid no need
ExpiryTime int //It should be an hour not a mintues, UTC time only
ExpiryFlg bool //if you want to check token expiry time enable expiryflg true otherwise expirytime not check
SecretKey string //jwt secretkey
DB *gorm.DB //database connection
DataBaseType Type
RoleId int
RoleName string
OTPAttempt int //how many times otp attempt
}
type Authentication struct {
Token string
SecretKey string
}
type Auth struct {
UserId int
ExpiryTime int
ExpiryFlg bool
SecretKey string
DB *gorm.DB
AuthFlg bool
PermissionFlg bool
RoleId int
RoleName string
DataAccess int
}