A comprehensive Go SDK for interacting with the Sonatype Central Repository API. This SDK provides a clean, type-safe interface to search and retrieve artifacts from Maven Central.
- Complete API coverage for all Sonatype Central search endpoints
- Rich searching capabilities (by GroupId, ArtifactId, SHA1, Class, etc.)
- Batch operations and concurrent processing
- Flexible client configuration
- Caching and retry mechanisms
- Async API support
- Security rating and metadata retrieval
go get github.com/scagogogo/sonatype-central-sdk
package main
import (
"context"
"fmt"
"github.com/scagogogo/sonatype-central-sdk/pkg/api"
)
func main() {
// Create a new client
client := api.NewClient()
// Search for artifacts with GroupId "org.apache.commons"
artifacts, err := client.SearchByGroupId(context.Background(), "org.apache.commons", 10)
if err != nil {
panic(err)
}
// Print results
for _, artifact := range artifacts {
fmt.Printf("GroupId: %s, ArtifactId: %s, Latest Version: %s\n",
artifact.GroupId, artifact.ArtifactId, artifact.LatestVersion)
}
}
See the documentation for detailed API usage examples.
MIT License - see LICENSE for details.