favourites.go
author Mikael Berthe <mikael@lilotux.net>
Sat, 15 Apr 2017 12:35:20 +0200
changeset 122 50c7733ee886
parent 120 579912e9d0ef
child 130 c450bb73f59a
permissions -rw-r--r--
Change StreamListener prototype Change StreamListener prototype in order to be able to use several StreamListener's with the same event channel. Stop a listener when the Readline call fails, since we probably cannot know if we can resume safely.

package gondole

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

// GetFavourites returns the list of the user's favourites
func (g *Client) GetFavourites() ([]Status, error) {
	var faves []Status
	err := g.apiCall("favourites", rest.Get, nil, &faves)
	if err != nil {
		return nil, err
	}
	return faves, nil
}