go-mastodon/instance.go

22 lines
497 B
Go
Raw Normal View History

2017-04-14 16:59:43 +02:00
package mastodon
2017-04-14 21:23:36 +02:00
import "net/http"
2017-04-14 16:59:43 +02:00
// 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
2017-04-14 21:23:36 +02:00
err := c.doAPI(http.MethodGet, "/api/v1/instance", nil, &instance)
2017-04-14 16:59:43 +02:00
if err != nil {
return nil, err
}
return &instance, nil
}