24 lines
537 B
Go
24 lines
537 B
Go
package clientcmd
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/go-resty/resty/v2"
|
|
)
|
|
|
|
// GetServerInfo queries the supplied server name for information about the current repo from the server
|
|
func GetServerInfo() error {
|
|
serverURL := "http://localhost:80/info/"
|
|
client := resty.New()
|
|
resp, err := client.R().
|
|
SetPathParams(map[string]string{
|
|
"repoName": "testRepo",
|
|
}).
|
|
Get(serverURL + "{repoName}")
|
|
if err != nil {
|
|
return fmt.Errorf("error connecting to server at: %s: error was: %s", serverURL, err)
|
|
}
|
|
fmt.Println(resp)
|
|
return nil
|
|
}
|