-
Notifications
You must be signed in to change notification settings - Fork 11
/
setup.go
49 lines (42 loc) · 1.07 KB
/
setup.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
package morpheus
import (
_ "fmt"
)
var (
SetupPath = "/api/setup"
)
type SetupCheckResult struct {
Success bool `json:"success"`
Message string `json:"msg"`
BuildVersion string `json:"buildVersion"`
SetupNeeded bool `json:"setupNeeded"`
}
type SetupInitResult struct {
StandardResult
}
type SetupInitPayload struct {
// Request
AccountName string `json:"accountName"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Username string `json:"username"`
Password string `json:"password"`
}
func (client *Client) SetupCheck(req *Request) (*Response, error) {
return client.Execute(&Request{
Method: "GET",
Path: (SetupPath + "/check"),
QueryParams: req.QueryParams,
Result: &SetupCheckResult{},
})
}
func (client *Client) SetupInit(req *Request) (*Response, error) {
return client.Execute(&Request{
Method: "POST",
Path: (SetupPath + "/init"),
QueryParams: req.QueryParams,
Body: req.Body,
// Body: payload.(map[string]interface {}),
Result: &SetupInitResult{},
})
}