Adds admin command to check server connection

This commit is contained in:
Daniel Svitan 2025-04-13 18:42:16 +02:00
parent a410e26174
commit 02b43592c2

View File

@ -78,6 +78,11 @@ func main() {
return nil
},
},
{
Name: "test",
Usage: "test server connection",
Action: test,
},
{
Name: "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 {
err := load()
if err != nil {