File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ Supported package repositories:
1515- [ Arch Linux] ( https://archlinux.org/packages/ )
1616- [ AUR] ( https://aur.archlinux.org/ )
1717- [ Chocolatey] ( https://chocolatey.org/ )
18+ - [ Clojars] ( https://clojars.org/ )
1819- [ CRAN] ( https://cran.r-project.org/ )
1920- [ crates.io] ( https://crates.io/ )
2021- [ Debian] ( https://www.debian.org/distrib/packages )
Original file line number Diff line number Diff line change 1+ package clojars
2+
3+ import (
4+ "fmt"
5+ "net/http"
6+
7+ "github.com/skewb1k/pkgrep/internal/httputil"
8+ )
9+
10+ type Client struct {
11+ HTTPClient * http.Client
12+ }
13+
14+ func (c Client ) Name () string {
15+ return "Clojars"
16+ }
17+
18+ func (c Client ) Query (query string ) (bool , error ) {
19+ url := fmt .Sprintf ("https://clojars.org/%s" , query )
20+ return httputil .GetCheckOK (c .HTTPClient , url )
21+ }
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import (
1717 "github.com/skewb1k/pkgrep/internal/archlinux"
1818 "github.com/skewb1k/pkgrep/internal/aur"
1919 "github.com/skewb1k/pkgrep/internal/chocolatey"
20+ "github.com/skewb1k/pkgrep/internal/clojars"
2021 "github.com/skewb1k/pkgrep/internal/cran"
2122 "github.com/skewb1k/pkgrep/internal/cratesio"
2223 "github.com/skewb1k/pkgrep/internal/debian"
@@ -111,6 +112,7 @@ func main() {
111112 archlinux.Client {httpClient },
112113 aur.Client {httpClient },
113114 chocolatey.Client {httpClient },
115+ clojars.Client {httpClient },
114116 cran.Client {httpClient },
115117 cratesio.Client {httpClient },
116118 debian.Client {httpClient },
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import (
1212 "github.com/skewb1k/pkgrep/internal/archlinux"
1313 "github.com/skewb1k/pkgrep/internal/aur"
1414 "github.com/skewb1k/pkgrep/internal/chocolatey"
15+ "github.com/skewb1k/pkgrep/internal/clojars"
1516 "github.com/skewb1k/pkgrep/internal/cran"
1617 "github.com/skewb1k/pkgrep/internal/cratesio"
1718 "github.com/skewb1k/pkgrep/internal/debian"
@@ -63,6 +64,7 @@ var tests = []testcase{
6364 {archlinux.Client {testHTTPClient }, "linux" },
6465 {aur.Client {testHTTPClient }, "google-chrome" },
6566 {chocolatey.Client {testHTTPClient }, "go" },
67+ {clojars.Client {testHTTPClient }, "core.typed" },
6668 {cran.Client {testHTTPClient }, "ggplot2" },
6769 {cratesio.Client {testHTTPClient }, "chroma-ls" },
6870 {debian.Client {testHTTPClient }, "linux-base" },
You can’t perform that action at this time.
0 commit comments