instance.go
author Mikael Berthe <mikael@lilotux.net>
Mon, 17 Apr 2017 12:07:44 +0200
changeset 131 68ef6504637e
parent 130 c450bb73f59a
child 138 23d3a518d0ad
permissions -rw-r--r--
Introduce RestoreApp(), bump library version RestoreApp() lets the client provide an existing application ID/Secret pair. The library no longer falls back to mastodon.social, an instance name is required. The version is bumped to 0.1 (we have something that works!).

/*
Copyright 2017 Mikael Berthe

Licensed under the MIT license.  Please see the LICENSE file is this directory.
*/

package gondole

import (
	"github.com/sendgrid/rest"
)

// GetCurrentInstance returns current instance information
func (g *Client) GetCurrentInstance() (*Instance, error) {
	var i Instance
	if err := g.apiCall("instance", rest.Get, nil, &i); err != nil {
		return nil, err
	}
	return &i, nil
}