Skip to content

Commit

Permalink
[Update] dependency versions
Browse files Browse the repository at this point in the history
  • Loading branch information
JanGalek committed Jan 3, 2025
1 parent 8556892 commit 42fdb50
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type LatencyData struct {
Latency string
}

type DiagoLatencyExtension struct {
type LatencyExtension struct {
startTime time.Time
latency time.Duration
PanelGenerator diago.PanelGenerator
Expand All @@ -30,47 +30,47 @@ func NewDefaultTemplateProvider() *DefaultLatencyTemplateProvider {
return &DefaultLatencyTemplateProvider{}
}

func NewDiagoLatencyExtension() *DiagoLatencyExtension {
func NewLatencyExtension() *LatencyExtension {
generator := diago.NewDefaultPanelGenerator()
tmpProvider := NewDefaultTemplateProvider()
return &DiagoLatencyExtension{
return &LatencyExtension{
PanelGenerator: generator,
TemplateProvider: tmpProvider,
}
}

func (e *DiagoLatencyExtension) SetTemplateProvider(provider diago.TemplateProvider) {
func (e *LatencyExtension) SetTemplateProvider(provider diago.TemplateProvider) {
e.TemplateProvider = provider
}

func (e *DiagoLatencyExtension) GetTemplateProvider() diago.TemplateProvider {
func (e *LatencyExtension) GetTemplateProvider() diago.TemplateProvider {
return e.TemplateProvider
}

func (e *DiagoLatencyExtension) SetPanelGenerator(generator diago.PanelGenerator) {
func (e *LatencyExtension) SetPanelGenerator(generator diago.PanelGenerator) {
e.PanelGenerator = generator
}

func (e *DiagoLatencyExtension) GetPanelGenerator() diago.PanelGenerator {
func (e *LatencyExtension) GetPanelGenerator() diago.PanelGenerator {
return e.PanelGenerator
}

func (e *DiagoLatencyExtension) GetLatency() time.Duration {
func (e *LatencyExtension) GetLatency() time.Duration {
return e.latency
}

func (e *DiagoLatencyExtension) SetLatency(latency time.Duration) {
func (e *LatencyExtension) SetLatency(latency time.Duration) {
e.latency = latency
}

func (e *DiagoLatencyExtension) GetHtml(c *gin.Context) string {
func (e *LatencyExtension) GetHtml(c *gin.Context) string {
return ""
}
func (e *DiagoLatencyExtension) GetJSHtml(c *gin.Context) string {
func (e *LatencyExtension) GetJSHtml(c *gin.Context) string {
return ""
}

func (e *DiagoLatencyExtension) GetPanelHtml(c *gin.Context) string {
func (e *LatencyExtension) GetPanelHtml(c *gin.Context) string {

var formattedLatency string
formattedLatency = formatLatency(e.latency)
Expand All @@ -85,10 +85,10 @@ func (e *DiagoLatencyExtension) GetPanelHtml(c *gin.Context) string {
return result
}

func (e *DiagoLatencyExtension) BeforeNext(c *gin.Context) {
func (e *LatencyExtension) BeforeNext(c *gin.Context) {
e.startTime = time.Now()
}
func (e *DiagoLatencyExtension) AfterNext(c *gin.Context) {
func (e *LatencyExtension) AfterNext(c *gin.Context) {
e.latency = time.Since(e.startTime)
}

Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.23.4

require (
github.com/gin-gonic/gin v1.10.0
github.com/gouef/router v1.1.0
github.com/gouef/router v1.2.0
github.com/gouef/utils v1.9.0
github.com/stretchr/testify v1.10.0
)
Expand All @@ -16,7 +16,7 @@ require (
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/gabriel-vasile/mimetype v1.4.7 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/gin-contrib/sse v1.0.0 // 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.23.0 // indirect
Expand All @@ -39,6 +39,6 @@ require (
golang.org/x/net v0.33.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
google.golang.org/protobuf v1.36.0 // indirect
google.golang.org/protobuf v1.36.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
13 changes: 7 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/gabriel-vasile/mimetype v1.4.7 h1:SKFKl7kD0RiPdbht0s7hFtjl489WcQ1VyPW8ZzUMYCA=
github.com/gabriel-vasile/mimetype v1.4.7/go.mod h1:GDlAgAyIRT27BhFl53XNAFtfjzOkLaF35JdEG0P7LtU=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-contrib/sse v1.0.0 h1:y3bT1mUWUxDpW4JLQg/HnTqV4rozuW4tC9eFKTxYI9E=
github.com/gin-contrib/sse v1.0.0/go.mod h1:zNuFdwarAygJBht0NTKiSi3jRf6RbqeILZ9Sp6Slhe0=
github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU=
github.com/gin-gonic/gin v1.10.0/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y=
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
Expand All @@ -32,8 +32,8 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/gouef/mode v1.0.3 h1:rdTXV2qF/YO3YzTWDrqy4connt+mXFaTMvKkcw+df4c=
github.com/gouef/mode v1.0.3/go.mod h1:F6jloQRk8+CL9OxC4Nf5tgHiKvDXSCsONtt7RX4arss=
github.com/gouef/router v1.1.0 h1:LQ5PLPY4BdM+2qinAwP15q3lcUw8yO8jPE35iwrGCzg=
github.com/gouef/router v1.1.0/go.mod h1:ymO6Yo+jJkWxoesdsGa0uZJRx//6ceJOnFCXBt+3Sfs=
github.com/gouef/router v1.2.0 h1:Pa9BG2sCz9OiNWdtOguoyyxUYLPQOWccLAwMJhRGi/U=
github.com/gouef/router v1.2.0/go.mod h1:ZAfiTldFH+K++fBo2JdRtGHeCYufsknIXxgtobhKaiE=
github.com/gouef/utils v1.9.0 h1:yQBkkbZeJGMRfL3j89cJGTlFHoeY53znJN2iw3jMl0Y=
github.com/gouef/utils v1.9.0/go.mod h1:7tAjRV4M5TdC2UubCcR3asVEvPRCEfSptfw3ZgitxiY=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
Expand Down Expand Up @@ -71,6 +71,7 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
Expand All @@ -90,8 +91,8 @@ golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.36.0 h1:mjIs9gYtt56AzC4ZaffQuh88TZurBGhIJMBZGSxNerQ=
google.golang.org/protobuf v1.36.0/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk=
google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
Expand Down

0 comments on commit 42fdb50

Please sign in to comment.