Documentation
¶
Index ¶
- Constants
- Variables
- type DataSource
- type DiscogsClient
- func (c *DiscogsClient) GetCollection() ([]dto.ReleaseModel, error)
- func (c *DiscogsClient) GetOrders() ([]dto.ReleaseModel, error)
- func (c *DiscogsClient) GetThumbImage(url string) (image.Image, error)
- func (c *DiscogsClient) GetThumbImageWithContext(ctx context.Context, url string) (image.Image, error)
- func (c *DiscogsClient) GetWishlist() ([]dto.ReleaseModel, error)
- type DiscogsIdentity
- type TokenConfig
Constants ¶
View Source
const ( CollectionSource DataSource = iota WishlistSource OrdersSource // CollectionURL is the URL for the user's collection. CollectionURL string = "https://api.discogs.com/users/%s/collection/folders/0/releases" // WishlistURL is the URL for the user's wishlist. WishlistURL string = "https://api.discogs.com/users/%s/wants" // OrdersURL is the URL for the user's orders. OrdersURL string = "https://api.discogs.com/users/%s/orders" )
Variables ¶
View Source
var (
ErrTokenGenerationFailed = errors.New("failed to generate OAuth token")
)
Functions ¶
This section is empty.
Types ¶
type DataSource ¶
type DataSource int
type DiscogsClient ¶
type DiscogsClient struct {
*http.Client
Identity DiscogsIdentity
// contains filtered or unexported fields
}
func New ¶
func New() (*DiscogsClient, error)
New returns an authenticated http.Client for the Discogs API
func NewWithContext ¶
func NewWithContext(ctx context.Context) (*DiscogsClient, error)
NewWithContext returns an authenticated http.Client for the Discogs API with context support
func (*DiscogsClient) GetCollection ¶
func (c *DiscogsClient) GetCollection() ([]dto.ReleaseModel, error)
func (*DiscogsClient) GetOrders ¶
func (c *DiscogsClient) GetOrders() ([]dto.ReleaseModel, error)
func (*DiscogsClient) GetThumbImage ¶
func (c *DiscogsClient) GetThumbImage(url string) (image.Image, error)
GetThumbImage maintains backward compatibility
func (*DiscogsClient) GetThumbImageWithContext ¶
func (c *DiscogsClient) GetThumbImageWithContext(ctx context.Context, url string) (image.Image, error)
GetThumbImageWithContext gets thumbnail image with context support
func (*DiscogsClient) GetWishlist ¶
func (c *DiscogsClient) GetWishlist() ([]dto.ReleaseModel, error)
type DiscogsIdentity ¶
type TokenConfig ¶
Click to show internal directories.
Click to hide internal directories.