This repository has been archived on 2023-04-13. You can view files and clone it, but cannot push or open issues or pull requests.
go-discogs/discogs.go

28 lines
587 B
Go
Raw Normal View History

2016-03-04 16:08:02 +00:00
package discogs
import (
"github.com/irlndts/go-apirequest"
"net/http"
)
const (
discogsAPI = "https://api.discogs.com/"
useragent = "TestDiscogsClient/0.0.1 +http://irlndts.moscow"
)
// Client is a Discogs client for making Discogs API requests.
type Client struct {
2016-03-04 16:48:26 +00:00
api *apirequest.API
Release *ReleaseService
2016-03-04 16:08:02 +00:00
}
// NewClient returns a new Client.
func NewClient(httpClient *http.Client) *Client {
base := apirequest.New().Client(httpClient).Base(discogsAPI).Add("User-Agent", useragent)
return &Client{
2016-03-04 16:48:26 +00:00
api: base,
Release: newReleaseService(base.New()),
2016-03-04 16:08:02 +00:00
}
}