Precise Attachment meta fields
authorMikael Berthe <mikael@lilotux.net>
Sun, 28 May 2017 00:12:05 +0200
changeset 190 0684ddad598c
parent 189 b0badf6ec8e8
child 191 b3f9331551b7
Precise Attachment meta fields
types.go
--- a/types.go	Sat May 27 20:33:49 2017 +0000
+++ b/types.go	Sun May 28 00:12:05 2017 +0200
@@ -55,13 +55,26 @@
 
 // Attachment represents a Mastodon attachement entity
 type Attachment struct {
-	ID         int64        `json:"id"`
-	Type       string       `json:"type"`
-	URL        string       `json:"url"`
-	RemoteURL  *string      `json:"remote_url"`
-	PreviewURL string       `json:"preview_url"`
-	TextURL    *string      `json:"text_url"`
-	Meta       *interface{} `json:"meta"`
+	ID         int64   `json:"id"`
+	Type       string  `json:"type"`
+	URL        string  `json:"url"`
+	RemoteURL  *string `json:"remote_url"`
+	PreviewURL string  `json:"preview_url"`
+	TextURL    *string `json:"text_url"`
+	Meta       *struct {
+		Original struct {
+			Size   string  `json:"size"`
+			Aspect float64 `json:"aspect"`
+			Width  int     `json:"width"`
+			Height int     `json:"height"`
+		} `json:"original"`
+		Small struct {
+			Size   string  `json:"size"`
+			Aspect float64 `json:"aspect"`
+			Width  int     `json:"width"`
+			Height int     `json:"height"`
+		} `json:"small"`
+	} `json:"meta"`
 }
 
 // Card represents a Mastodon card entity