✨ Adds admin command to check server connection
This commit is contained in:
parent
a410e26174
commit
02b43592c2
@ -78,6 +78,11 @@ func main() {
|
|||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Name: "test",
|
||||||
|
Usage: "test server connection",
|
||||||
|
Action: test,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Name: "clients",
|
Name: "clients",
|
||||||
Usage: "fetch all clients",
|
Usage: "fetch all clients",
|
||||||
@ -150,6 +155,16 @@ func main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func test(context.Context, *cli.Command) error {
|
||||||
|
err := load()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
url := fmt.Sprintf("%s/", server)
|
||||||
|
return makeReq(http.MethodGet, url)
|
||||||
|
}
|
||||||
|
|
||||||
func clients(ctx context.Context, cmd *cli.Command) error {
|
func clients(ctx context.Context, cmd *cli.Command) error {
|
||||||
err := load()
|
err := load()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user