-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuser.go
48 lines (36 loc) · 801 Bytes
/
user.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
package maestropanel
import (
"encoding/json"
)
type UserExecutionResult struct {
Result
Details UserInfo
}
type UserInfo struct {
Id string
UserName string
Type string
Status int32
Email string
FirstName string
LastName string
}
type User struct {
mp MaestroPanel
}
func (m *User) Whoami() (result UserExecutionResult, err error) {
result = UserExecutionResult{}
response, err := m.mp.writeData(whoamiUserAction.Method, m.mp.getURL(whoamiUserAction), nil)
if err == nil {
json.Unmarshal(response, &result)
}
return
}
func (m *User) LogOff() (result Result, err error) {
result = Result{}
response, err := m.mp.writeData(logOffUserAction.Method, m.mp.getURL(logOffUserAction), nil)
if err == nil {
json.Unmarshal(response, &result)
}
return
}