Skip to content

Commit

Permalink
gokit is no longer imported directly
Browse files Browse the repository at this point in the history
  • Loading branch information
maurafortino committed Jan 23, 2024
1 parent 12cc863 commit 234c7de
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 87 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ require (
emperror.dev/emperror v0.33.0
github.com/alecthomas/kong v0.8.1
github.com/go-chi/chi/v5 v5.0.10
github.com/go-kit/kit v0.13.0
github.com/gorilla/mux v1.8.1
github.com/goschtalt/goschtalt v0.22.1
github.com/goschtalt/yaml-decoder v0.0.1
Expand Down Expand Up @@ -45,6 +44,7 @@ require (
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-kit/kit v0.13.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
Expand Down
86 changes: 0 additions & 86 deletions mocks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ package main

import (
"time"
"unicode/utf8"

"github.com/go-kit/kit/metrics"
"github.com/stretchr/testify/mock"
"github.com/xmidt-org/wrp-go/v3"
)
Expand Down Expand Up @@ -37,90 +35,6 @@ func (m *mockSenderWrapper) Shutdown(gentle bool) {
m.Called(gentle)
}

// mockCounter provides the mock implementation of the metrics.Counter object
type mockCounter struct {
mock.Mock
}

func (m *mockCounter) Add(delta float64) {
m.Called(delta)
}

func (m *mockCounter) With(labelValues ...string) metrics.Counter {
for _, v := range labelValues {
if !utf8.ValidString(v) {
panic("not UTF-8")
}
}
args := m.Called(labelValues)
return args.Get(0).(metrics.Counter)
}

// mockGauge provides the mock implementation of the metrics.Counter object
type mockGauge struct {
mock.Mock
}

func (m *mockGauge) Add(delta float64) {
m.Called(delta)
}

func (m *mockGauge) Set(value float64) {
// We're setting time values & the ROI seems pretty low with this level
// of validation...
//m.Called(value)
}

func (m *mockGauge) With(labelValues ...string) metrics.Gauge {
for _, v := range labelValues {
if !utf8.ValidString(v) {
panic("not UTF-8")
}
}
args := m.Called(labelValues)
return args.Get(0).(metrics.Gauge)
}

// mockHistogram provides the mock implementation of the metrics.Histogram object
type mockHistogram struct {
mock.Mock
}

func (m *mockHistogram) Observe(value float64) {
m.Called(value)
}

func (m *mockHistogram) With(labelValues ...string) metrics.Histogram {
for _, v := range labelValues {
if !utf8.ValidString(v) {
panic("not UTF-8")
}
}
m.Called(labelValues)
return m
}

// mockCaduceusMetricsRegistry provides the mock implementation of the
// CaduceusMetricsRegistry object
type mockCaduceusMetricsRegistry struct {
mock.Mock
}

func (m *mockCaduceusMetricsRegistry) NewCounter(name string) metrics.Counter {
args := m.Called(name)
return args.Get(0).(metrics.Counter)
}

func (m *mockCaduceusMetricsRegistry) NewGauge(name string) metrics.Gauge {
args := m.Called(name)
return args.Get(0).(metrics.Gauge)
}

func (m *mockCaduceusMetricsRegistry) NewHistogram(name string, buckets int) metrics.Histogram {
args := m.Called(name)
return args.Get(0).(metrics.Histogram)
}

// mockTime provides two mock time values
func mockTime(one, two time.Time) func() time.Time {
var called bool
Expand Down

0 comments on commit 234c7de

Please sign in to comment.