Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# registries

Go library for fetching package metadata from registry APIs. Supports 25 ecosystems with a unified interface. Also provides sub-packages for HTTP client usage (`client/`) and streaming artifact downloads (`fetch/`).
Go library for fetching package metadata from registry APIs. Supports 26 ecosystems with a unified interface. Also provides sub-packages for HTTP client usage (`client/`) and streaming artifact downloads (`fetch/`).

## Installation

Expand Down Expand Up @@ -182,6 +182,7 @@ import _ "github.com/git-pkgs/registries/all"
| LuaRocks | `luarocks` | https://luarocks.org |
| Nimble | `nimble` | https://nimble.directory |
| Haxelib | `haxelib` | https://lib.haxe.org |
| Helm | `helm` | URL required |
| Homebrew | `brew` | https://formulae.brew.sh |
| Deno | `deno` | https://apiland.deno.dev |
| Terraform | `terraform` | https://registry.terraform.io |
Expand Down
3 changes: 2 additions & 1 deletion all/all.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// // Now all ecosystems are available
// ecosystems := registries.SupportedEcosystems()
// // ["brew", "cargo", "clojars", "cocoapods", "composer", "conda", "cpan", "cran", "deno", "dub", "elm", "gem", "golang", "hackage", "haxelib", "hex", "julia", "luarocks", "maven", "nimble", "npm", "nuget", "pub", "pypi", "terraform"]
// // ["brew", "cargo", "clojars", "cocoapods", "composer", "conda", "cpan", "cran", "deno", "dub", "elm", "gem", "golang", "hackage", "haxelib", "helm", "hex", "julia", "luarocks", "maven", "nimble", "npm", "nuget", "pub", "pypi", "terraform"]
package all

import (
Expand All @@ -25,6 +25,7 @@ import (
_ "github.com/git-pkgs/registries/internal/golang"
_ "github.com/git-pkgs/registries/internal/hackage"
_ "github.com/git-pkgs/registries/internal/haxelib"
_ "github.com/git-pkgs/registries/internal/helm"
_ "github.com/git-pkgs/registries/internal/hex"
_ "github.com/git-pkgs/registries/internal/homebrew"
_ "github.com/git-pkgs/registries/internal/julia"
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ require (
github.com/git-pkgs/pom v0.1.5
github.com/git-pkgs/purl v0.1.15
github.com/git-pkgs/spdx v0.3.0
github.com/git-pkgs/vers v0.3.0
github.com/rs/dnscache v0.0.0-20230804202142-fc85eb664529
github.com/rubyist/circuitbreaker v2.2.1+incompatible
go.yaml.in/yaml/v3 v3.0.5
)

require (
github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a // indirect
github.com/git-pkgs/vers v0.3.0 // indirect
github.com/github/go-spdx/v2 v2.7.0 // indirect
github.com/package-url/packageurl-go v0.1.6 // indirect
github.com/peterbourgon/g2s v0.0.0-20170223122336-d4e7ad98afea // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ github.com/rubyist/circuitbreaker v2.2.1+incompatible h1:KUKd/pV8Geg77+8LNDwdow6
github.com/rubyist/circuitbreaker v2.2.1+incompatible/go.mod h1:Ycs3JgJADPuzJDwffe12k6BZT8hxVi6lFK+gWYJLN4A=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw=
go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
Expand Down
3 changes: 3 additions & 0 deletions internal/core/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ func New(ecosystem string, baseURL string, client *Client) (Registry, error) { /
if baseURL == "" {
baseURL = defaultURL
}
if baseURL == "" {
return nil, fmt.Errorf("no registry URL configured for ecosystem: %s", ecosystem)
}

if client == nil {
client = DefaultClient()
Expand Down
Loading