forked from ChimeraCoder/anaconda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuration.go
32 lines (28 loc) · 1008 Bytes
/
configuration.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package anaconda
import (
"net/url"
)
type Configuration struct {
CharactersReservedPerMedia int `json:"characters_reserved_per_media"`
MaxMediaPerUpload int `json:"max_media_per_upload"`
NonUsernamePaths []string `json:"non_username_paths"`
PhotoSizeLimit int `json:"photo_size_limit"`
PhotoSizes struct {
Thumb photoSize `json:"thumb"`
Small photoSize `json:"small"`
Medium photoSize `json:"medium"`
Large photoSize `json:"large"`
} `json:"photo_sizes"`
ShortUrlLength int `json:"short_url_length"`
ShortUrlLengthHttps int `json:"short_url_length_https"`
}
type photoSize struct {
H int `json:"h"`
W int `json:"w"`
Resize string `json:"resize"`
}
func (a TwitterApi) GetConfiguration(v url.Values) (conf Configuration, err error) {
response_ch := make(chan response)
a.queryQueue <- query{a.baseUrl + "/help/configuration.json", v, &conf, _GET, response_ch}
return conf, (<-response_ch).err
}