Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
github.com/anaelorlinski/go-discogs
go-discogs is a Go client library for the Discogs API. Check the usage section to see how to access the Discogs API.
Note : this is a fork of sblinch/go-discogs itself a fork of irlndts/go-discogs
The lib is under MIT but be sure you are familiar with Discogs API Terms of Use.
go get github.com/anaelorlinski/go-discogs
The discogs package provides a client for accessing the Discogs API. First of all import library and init client variable. According to discogs api documentation you must provide your user-agent.
import "github.com/anaelorlinski/go-discogs"
Some requests require authentication (as any user). According to Discogs, to send requests with Discogs Auth, you have two options: sending your credentials in the query string with key and secret parameters or a token parameter.
client, err := discogs.New(&discogs.Options{
UserAgent: "Some Name",
Currency: "EUR", // optional, "USD" (default), "GBP", "EUR", "CAD", "AUD", "JPY", "CHF", "MXN", "BRL", "NZD", "SEK", "ZAR" are allowed
Token: "Some Token", // optional
URL: "https://api.discogs.com", // optional
})
release, _ := client.Release(context.Background(), 9893847)
fmt.Println(release.Artists[0].Name, " - ", release.Title)
// St. Petersburg Ska-Jazz Review - Elephant Riddim
Issue a search query to discogs database. This endpoint accepts pagination parameters. Authentication (as any user) is required.
Use SearchRequest
struct to create a request.
type SearchRequest struct {
Q string // search query (optional)
Type string // one of release, master, artist, label (optional)
Title string // search by combined “Artist Name - Release Title” title field (optional)
ReleaseTitle string // search release titles (optional)
Credit string // search release credits (optional)
Artist string // search artist names (optional)
Anv string // search artist ANV (optional)
Label string // search label names (optional)
Genre string // search genres (optional)
Style string // search styles (optional)
Country string // search release country (optional)
Year string // search release year (optional)
Format string // search formats (optional)
Catno string // search catalog number (optional)
Barcode string // search barcodes (optional)
Track string // search track titles (optional)
Submitter string // search submitter username (optional)
Contributer string // search contributor usernames (optional)
Page int // optional
PerPage int // optional
}
request := discogs.SearchRequest{Artist: "reggaenauts", ReleaseTitle: "river rock", Page: 0, PerPage: 1}
search, _ := client.Search(context.Background(), request)
for _, r := range search.Results {
fmt.Println(r.Title)
}
Query a users collection.
collection, err := client.CollectionFolders(context.Background(), "my_user")
folder, err := client.Folder(context.Background(), "my_user", 0)
items, err := client.CollectionItemsByFolder(context.Background(), "my_user", 0, &Pagination{Sort: "artist", SortOrder: "desc", PerPage: 2})
items, err := client.CollectionItemsByRelease(context.Background(), "my_user", 12934893)
Query a user's marketplace
Retrieve price suggestions for the provided Release ID
suggestions, err := client.PriceSuggestions(context.Background(), 12345)
Retrieve marketplace statistics for the provided Release ID
stats, err := client.ReleaseStatistics(context.Background(), 12345)
...
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.