go-mastodon/instance.go
2017-04-15 04:23:36 +09:00

22 lines
497 B
Go

package mastodon
import "net/http"
// 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(http.MethodGet, "/api/v1/instance", nil, &instance)
if err != nil {
return nil, err
}
return &instance, nil
}