@@ -1,4 +1,6 @@
package discourse
type Group struct {
+ ID int `json:"id"`
+ name string `json:"name"`
}
@@ -1,6 +1,10 @@
-import "fmt"
+import (
+ "encoding/json"
+ "fmt"
+ "net/http"
+)
type User struct {
ID string `json:"id"`
@@ -13,4 +17,11 @@ type User struct {
func GetUser(config ApiConfig, username string) {
url := fmt.Sprintf("%s/users/%s.json?api_key=%s&api_username=%s", config.Endpoint, username, config.ApiKey, config.ApiUser)
fmt.Println(url)
+
+ response, _ := http.Get(url)
+ var result User
+ json.NewDecoder(response.Body).Decode(&result)
+ fmt.Println(result)