Skip to content

Commit

Permalink
updated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
phin1x committed Apr 30, 2023
1 parent 1372cb4 commit d501d5a
Show file tree
Hide file tree
Showing 468 changed files with 89 additions and 116,736 deletions.
26 changes: 20 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
module github.com/phin1x/cups-exporter

go 1.13
go 1.20

require (
github.com/go-logr/logr v0.1.0
github.com/go-logr/zapr v0.1.1
github.com/phin1x/go-ipp v1.2.1-0.20191226192803-6c9dee854ace
github.com/prometheus/client_golang v1.3.0
go.uber.org/zap v1.13.0
github.com/go-logr/logr v1.2.4
github.com/go-logr/zapr v1.2.3
github.com/phin1x/go-ipp v1.6.0
github.com/prometheus/client_golang v1.15.0
go.uber.org/zap v1.24.0
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/sys v0.7.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
)
160 changes: 56 additions & 104 deletions go.sum

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pkg/exporter.go → internal/exporter.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package pkg
package internal

import (
"github.com/go-logr/logr"
Expand Down Expand Up @@ -95,7 +95,7 @@ func (e *Exporter) Describe(ch chan<- *prometheus.Desc) {
ch <- e.jobsTotal
ch <- e.jobsActiveTotal
ch <- e.printersTotal
ch <-e.printerStateTotal
ch <- e.printerStateTotal
}

func (e *Exporter) Collect(ch chan<- prometheus.Metric) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/jobs.go → internal/jobs.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package pkg
package internal

import (
"github.com/phin1x/go-ipp"
Expand Down Expand Up @@ -32,7 +32,7 @@ func (e *Exporter) jobsMetrics(ch chan<- prometheus.Metric) error {
}

/*
returns the last job id, the last completed job id and the current active jobs
returns the last job id, the last completed job id and the current active jobs
*/
func getLastJobId(m map[int]ipp.Attributes) int {
lastJobId := 0
Expand Down
13 changes: 7 additions & 6 deletions pkg/printers.go → internal/printers.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package pkg
package internal

import (
"github.com/phin1x/go-ipp"
Expand All @@ -12,13 +12,14 @@ func (e *Exporter) printerMetrics(ch chan<- prometheus.Metric) error {
return err
}

states := make(map[ipp.PrinterState]int)
states[ipp.PrinterStateIdle] = 0
states[ipp.PrinterStateProcessing] = 0
states[ipp.PrinterStateStopped] = 0
states := map[int8]int{
ipp.PrinterStateIdle: 0,
ipp.PrinterStateProcessing: 0,
ipp.PrinterStateStopped: 0,
}

for _, attr := range printers {
states[ipp.PrinterState(attr["printer-state"][0].Value.(int))]++
states[attr["printer-state"][0].Value.(int8)]++
}

ch <- prometheus.MustNewConstMetric(e.printersTotal, prometheus.GaugeValue, float64(len(printers)))
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"flag"
"github.com/go-logr/logr"
"github.com/go-logr/zapr"
"github.com/phin1x/cups-exporter/pkg"
"github.com/phin1x/cups-exporter/internal"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"go.uber.org/zap"
Expand All @@ -29,7 +29,7 @@ func main() {
flag.Parse()

log.Info("starting cups exporter")
exporter, err := pkg.NewExporter(opts.CupsUri, log)
exporter, err := internal.NewExporter(opts.CupsUri, log)
if err != nil {
log.Error(err, "failed to create the exporter")
os.Exit(1)
Expand Down
5 changes: 0 additions & 5 deletions vendor/github.com/BurntSushi/toml/.gitignore

This file was deleted.

15 changes: 0 additions & 15 deletions vendor/github.com/BurntSushi/toml/.travis.yml

This file was deleted.

3 changes: 0 additions & 3 deletions vendor/github.com/BurntSushi/toml/COMPATIBLE

This file was deleted.

21 changes: 0 additions & 21 deletions vendor/github.com/BurntSushi/toml/COPYING

This file was deleted.

19 changes: 0 additions & 19 deletions vendor/github.com/BurntSushi/toml/Makefile

This file was deleted.

218 changes: 0 additions & 218 deletions vendor/github.com/BurntSushi/toml/README.md

This file was deleted.

Loading

0 comments on commit d501d5a

Please sign in to comment.