minor comment fix

This commit is contained in:
irlndts 2017-05-09 18:52:58 +03:00
parent 86244f6665
commit 0f41f45197
3 changed files with 10 additions and 3 deletions

View File

@ -1,14 +1,17 @@
package discogs package discogs
import ( import (
"github.com/irlndts/go-apirequest"
"net/http" "net/http"
"github.com/irlndts/go-apirequest"
) )
// ArtistService ...
type ArtistService struct { type ArtistService struct {
api *apirequest.API api *apirequest.API
} }
// ArtistParams ...
type ArtistParams struct { type ArtistParams struct {
Artist_id string Artist_id string
Sort string // year, title, format Sort string // year, title, format
@ -17,6 +20,7 @@ type ArtistParams struct {
Per_page int Per_page int
} }
// Artist ...
type Artist struct { type Artist struct {
Namevariations []string `json:"namevariations"` Namevariations []string `json:"namevariations"`
Profile string `json:"profile"` Profile string `json:"profile"`
@ -30,6 +34,7 @@ type Artist struct {
Members []Member `json:"members"` Members []Member `json:"members"`
} }
// ArtistReleases ...
type ArtistReleases struct { type ArtistReleases struct {
Paginastion Page `json:"pagination"` Paginastion Page `json:"pagination"`
Releases []ReleaseSource `json:"releases"` Releases []ReleaseSource `json:"releases"`
@ -41,6 +46,7 @@ func newArtistService(api *apirequest.API) *ArtistService {
} }
} }
// Artist ...
func (self *ArtistService) Artist(params *ArtistParams) (*Artist, *http.Response, error) { func (self *ArtistService) Artist(params *ArtistParams) (*Artist, *http.Response, error) {
artist := new(Artist) artist := new(Artist)
apiError := new(APIError) apiError := new(APIError)
@ -49,6 +55,7 @@ func (self *ArtistService) Artist(params *ArtistParams) (*Artist, *http.Response
return artist, resp, relevantError(err, *apiError) return artist, resp, relevantError(err, *apiError)
} }
// Releases ...
func (self *ArtistService) Releases(params *ArtistParams) (*ArtistReleases, *http.Response, error) { func (self *ArtistService) Releases(params *ArtistParams) (*ArtistReleases, *http.Response, error) {
releases := new(ArtistReleases) releases := new(ArtistReleases)
apiError := new(APIError) apiError := new(APIError)

View File

@ -7,7 +7,7 @@ import (
) )
func main() { func main() {
d := discogs.NewClient().UserAgent("TestDiscogsClient/0.0.1 +http://irlndts.moscow").Token() d := discogs.NewClient().UserAgent("TestDiscogsClient/0.0.1 +http://irlndts.moscow").Token("oQTQKAprakIQfWOkAxTdYyDpgUqahHtdbHTuYkIy")
if err := d.Currency("EUR"); err != nil { if err := d.Currency("EUR"); err != nil {
fmt.Println(err) fmt.Println(err)

View File

@ -28,7 +28,7 @@ type Release struct {
MasterID int `json:"master_id"` MasterID int `json:"master_id"`
MasterURL string `json:"master_url"` MasterURL string `json:"master_url"`
Notes string `json:"notes,omitempty"` Notes string `json:"notes,omitempty"`
NumForSale int `json:"numfor_sale,omitempty"` NumForSale int `json:"num_for_sale,omitempty"`
Released string `json:"released"` Released string `json:"released"`
ReleasedFormatted string `json:"released_formatted"` ReleasedFormatted string `json:"released_formatted"`
ResourceURL string `json:"resource_url"` ResourceURL string `json:"resource_url"`