add instance

pull/8/head
Yasuhiro Matsumoto 2017-04-14 23:59:43 +09:00
parent 0206b94abc
commit aa81cb8318
1 changed files with 19 additions and 0 deletions

19
instance.go 100644
View File

@ -0,0 +1,19 @@
package mastodon
// Instance hold information for mastodon instance.
type Instance struct {
URI string `json:"uri"`
Title string `json:"title"`
Description string `json:"description"`
EMail string `json:"email"`
}
// GetInstance return Instance.
func (c *Client) GetInstance() (*Instance, error) {
var instance Instance
err := c.doAPI("GET", "/api/v1/instance", nil, &instance)
if err != nil {
return nil, err
}
return &instance, nil
}