-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresponse.go
61 lines (51 loc) · 1.41 KB
/
response.go
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
package geniusAuth
type Response[T any] struct {
Code uint `json:"code"`
Data T `json:"data"`
Msg string `json:"msg"`
}
type VerifyToken struct {
UserID uint `json:"userID"`
Name string `json:"name"`
Groups []string `json:"groups"`
AvatarUrl string `json:"avatarUrl"`
RefreshToken string `json:"refreshToken"`
AccessToken string `json:"accessToken"`
}
type RefreshToken struct {
AccessToken string `json:"access_token"`
Payload string `json:"payload,omitempty"`
}
type VerifyAccessToken struct {
UID uint `json:"uid"`
Payload string `json:"payload,omitempty"`
}
type UserInfo struct {
UserID uint `json:"userID"`
Name string `json:"name"`
Groups []string `json:"groups"`
AvatarUrl string `json:"avatarUrl"`
}
type Tokens struct {
RefreshToken string `json:"refreshToken"`
AccessToken string `json:"accessToken,omitempty"`
}
type Group struct {
ID uint `json:"id"`
Name string `json:"name"`
}
type UserPublicInfo struct {
ID uint `json:"id"`
Name string `json:"name"`
AvatarUrl string `json:"avatarUrl"`
Groups []Group `json:"groups"`
}
type ServerPublicKeys struct {
Jwt []byte `json:"jwt"`
Ca []byte `json:"ca"`
}
type RpcClientCredential struct {
Cert []byte `json:"cert"` // pem format
Key []byte `json:"key"` // pem format
ValidBefore int64 `json:"validBefore"` // second
}