@@ -0,0 +1,7 @@
+package discourse
+
+type Config struct {
+ Endpoint string
+ ApiKey string
+ ApiUser string
+}
@@ -2,6 +2,12 @@ package discourse
import "github.com/google/uuid"
+type ApiConfig struct {
type SsoConfig struct {
Endpoint string
ReturnEndpoint string
@@ -0,0 +1,4 @@
+type Group struct {
@@ -0,0 +1,16 @@
+import "fmt"
+type User struct {
+ ID string `json:"id"`
+ Username string `json:"username"`
+ Moderator bool `json:"moderator"`
+ Admin bool `json:"admin"`
+ Groups []Group `json:"group"`
+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)