Skip to content

Commit

Permalink
Remove Gin dependency (#75)
Browse files Browse the repository at this point in the history
* Remove Gin dependency

* Bump warc lib to 0.8.40 (#76)

* Remove Gin dependency

* fixing bad merge..

* Go mod tidy

* fixing bad merge..
  • Loading branch information
CorentinB authored Jul 11, 2024
1 parent e5c3f71 commit 0cbb839
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 145 deletions.
6 changes: 1 addition & 5 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,7 @@ var GlobalFlags = []cli.Flag{
Usage: "Port to listen on for the API.",
Destination: &config.App.Flags.APIPort,
},
&cli.BoolFlag{
Name: "prometheus",
Destination: &config.App.Flags.Prometheus,
Usage: "Export metrics in Prometheus format, using this setting imply --api.",
},

&cli.StringFlag{
Name: "prometheus-prefix",
Destination: &config.App.Flags.PrometheusPrefix,
Expand Down
11 changes: 2 additions & 9 deletions cmd/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,8 @@ func InitCrawlWithCMD(flags config.Flags) *crawl.Crawl {

c.API = flags.API
c.APIPort = flags.APIPort

// If Prometheus is specified, then we make sure
// c.API is true
c.Prometheus = flags.Prometheus
if c.Prometheus {
c.API = true
c.PrometheusMetrics = new(crawl.PrometheusMetrics)
c.PrometheusMetrics.Prefix = flags.PrometheusPrefix
}
c.PrometheusMetrics = new(crawl.PrometheusMetrics)
c.PrometheusMetrics.Prefix = flags.PrometheusPrefix

if flags.UserAgent != "Zeno" {
c.UserAgent = flags.UserAgent
Expand Down
1 change: 0 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ type Flags struct {

API bool
APIPort string
Prometheus bool
PrometheusPrefix string

WARCPrefix string
Expand Down
23 changes: 3 additions & 20 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ require (
github.com/clbanning/mxj/v2 v2.7.0
github.com/dustin/go-humanize v1.0.1
github.com/elastic/go-elasticsearch/v8 v8.14.0
github.com/gin-contrib/pprof v1.5.0
github.com/gin-gonic/gin v1.10.0
github.com/google/uuid v1.6.0
github.com/gosuri/uilive v0.0.4
github.com/gosuri/uitable v0.0.4
Expand All @@ -39,27 +37,17 @@ require (
github.com/andybalholm/brotli v1.1.0 // indirect
github.com/andybalholm/cascadia v1.3.2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bytedance/sonic v1.11.9 // indirect
github.com/bytedance/sonic/loader v0.1.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cloudflare/circl v1.3.9 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/elastic/elastic-transport-go/v8 v8.6.0 // indirect
github.com/fatih/color v1.17.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.4 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.22.0 // indirect
github.com/gobwas/httphead v0.1.0 // indirect
github.com/gobwas/pool v0.2.1 // indirect
github.com/gobwas/ws v1.4.0 // indirect
github.com/goccy/go-json v0.10.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/gomodule/redigo v1.9.2 // indirect
github.com/jonboulle/clockwork v0.4.0 // indirect
Expand All @@ -69,7 +57,6 @@ require (
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
github.com/klauspost/pgzip v1.2.6 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/lestrrat-go/strftime v1.0.6 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
Expand All @@ -78,27 +65,23 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/onsi/gomega v1.27.6 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/philippgille/gokv/encoding v0.7.0 // indirect
github.com/philippgille/gokv/util v0.7.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/refraction-networking/utls v1.6.6 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/quic-go/quic-go v0.41.0 // indirect
github.com/refraction-networking/utls v1.6.3 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/satori/go.uuid v1.2.0 // indirect
github.com/syndtr/goleveldb v1.0.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
go.opentelemetry.io/otel v1.28.0 // indirect
go.opentelemetry.io/otel/metric v1.28.0 // indirect
go.opentelemetry.io/otel/trace v1.28.0 // indirect
golang.org/x/arch v0.8.0 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.21.0 // indirect
Expand Down
Loading

0 comments on commit 0cbb839

Please sign in to comment.