This commit is contained in:
2024-04-02 15:13:13 +03:00
parent 1a1ce70a5c
commit 6e62411979
48 changed files with 191 additions and 96 deletions
+3 -6
View File
@@ -1,9 +1,6 @@
# gin contrib
gin contrib is middleware utilities for [Gin](https://gitverse.ru/andoma/gin)
[![GoDoc](https://godoc.org/gitverse.ru/andoma/gin-contrib?status.svg)](https://godoc.org/gitverse.ru/andoma/gin-contrib)
[![Go Report Card](https://goreportcard.com/badge/gitverse.ru/andoma/gin-contrib)](https://goreportcard.com/report/gitverse.ru/andoma/gin-contrib)
gin contrib is middleware utilities for [Gin](https://git.company.lan/gopkg/gin)
## Usage
@@ -12,13 +9,13 @@ gin contrib is middleware utilities for [Gin](https://gitverse.ru/andoma/gin)
Use go get.
```bash
go get gitverse.ru/andoma/gin-contrib
go get git.company.lan/gopkg/gin-contrib
```
Then import the package into your own code.
```go
import "gitverse.ru/andoma/gin-contrib"
import "git.company.lan/gopkg/gin-contrib"
```
## License
+6 -5
View File
@@ -1,17 +1,18 @@
module gitverse.ru/andoma/gin-contrib/examples
module git.company.lan/gopkg/gin-contrib/examples
go 1.21.5
replace gitverse.ru/andoma/gin-contrib => ../
replace git.company.lan/gopkg/gin-contrib => ../
require (
gitverse.ru/andoma/gin-contrib v0.0.0-00010101000000-000000000000
git.company.lan/gopkg/gin v0.0.0-20240402114754-9aa1216a15eb
git.company.lan/gopkg/gin-contrib v0.0.0-00010101000000-000000000000
)
require (
github.com/bytedance/sonic v1.10.2 // indirect
github.com/bytedance/sonic v1.11.0 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
github.com/chenzhuoyu/iasm v0.9.0 // indirect
github.com/chenzhuoyu/iasm v0.9.1 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
+93
View File
@@ -0,0 +1,93 @@
git.company.lan/gopkg/gin v0.0.0-20240402114754-9aa1216a15eb h1:8o26v/7r8gdA8f+yCCk0skz7+/QcbhHpilC8DumruHw=
git.company.lan/gopkg/gin v0.0.0-20240402114754-9aa1216a15eb/go.mod h1:tqgu5hp8FSUVCdgSAlneNMFEE+cYSihiiEVvypv1UNo=
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM=
github.com/bytedance/sonic v1.11.0 h1:FwNNv6Vu4z2Onf1++LNzxB/QhitD8wuTdpZzMTGITWo=
github.com/bytedance/sonic v1.11.0/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4=
github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY=
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk=
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0=
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d/go.mod h1:8EPpVsBuRksnlj1mLy4AWzRNQYxauNi62uWcE3to6eA=
github.com/chenzhuoyu/iasm v0.9.0/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog=
github.com/chenzhuoyu/iasm v0.9.1 h1:tUHQJXo3NhBqw6s33wkGn9SP3bvrWLdlVIJ3hQBL7P0=
github.com/chenzhuoyu/iasm v0.9.1/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
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.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk=
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/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
github.com/go-playground/validator/v10 v10.18.0 h1:BvolUXjp4zuvkZ5YN5t7ebzbhlUtPsPm2S9NAZ5nl9U=
github.com/go-playground/validator/v10 v10.18.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc=
github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M=
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI=
github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
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.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE=
github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
golang.org/x/arch v0.7.0 h1:pskyeJh/3AmoQ8CPE95vxHLqp1G1GfGNXTmcl9NEKTc=
golang.org/x/arch v0.7.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo=
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
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.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50=
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
+2 -2
View File
@@ -6,8 +6,8 @@ import (
"net/http"
"time"
"gitverse.ru/andoma/gin"
"gitverse.ru/andoma/gin-contrib/gzip"
"git.company.lan/gopkg/gin"
"git.company.lan/gopkg/gin-contrib/gzip"
)
func main() {
+2 -2
View File
@@ -1,8 +1,8 @@
package main
import (
"gitverse.ru/andoma/gin"
"gitverse.ru/andoma/gin-contrib/nocache"
"git.company.lan/gopkg/gin"
"git.company.lan/gopkg/gin-contrib/nocache"
)
func main() {
+2 -2
View File
@@ -3,8 +3,8 @@ package main
import (
"net/http"
"gitverse.ru/andoma/gin"
"gitverse.ru/andoma/gin-contrib/pprof"
"git.company.lan/gopkg/gin"
"git.company.lan/gopkg/gin-contrib/pprof"
)
func main() {
+2 -2
View File
@@ -1,8 +1,8 @@
package main
import (
"gitverse.ru/andoma/gin"
"gitverse.ru/andoma/gin-contrib/pprof"
"git.company.lan/gopkg/gin"
"git.company.lan/gopkg/gin-contrib/pprof"
)
func main() {
+2 -2
View File
@@ -6,8 +6,8 @@ import (
"net/http"
"time"
"gitverse.ru/andoma/gin"
"gitverse.ru/andoma/gin-contrib/requestid"
"git.company.lan/gopkg/gin"
"git.company.lan/gopkg/gin-contrib/requestid"
)
func main() {
+2 -2
View File
@@ -6,8 +6,8 @@ import (
"net/http"
"time"
"gitverse.ru/andoma/gin"
"gitverse.ru/andoma/gin-contrib/requestid"
"git.company.lan/gopkg/gin"
"git.company.lan/gopkg/gin-contrib/requestid"
)
func main() {
+2 -2
View File
@@ -4,8 +4,8 @@ import (
"fmt"
"time"
"gitverse.ru/andoma/gin"
"gitverse.ru/andoma/gin-contrib/secure"
"git.company.lan/gopkg/gin"
"git.company.lan/gopkg/gin-contrib/secure"
)
func main() {
+2 -2
View File
@@ -3,8 +3,8 @@ package main
import (
"log"
"gitverse.ru/andoma/gin"
"gitverse.ru/andoma/gin-contrib/static"
"git.company.lan/gopkg/gin"
"git.company.lan/gopkg/gin-contrib/static"
)
func main() {
+2 -2
View File
@@ -5,8 +5,8 @@ import (
"net/http"
"time"
"gitverse.ru/andoma/gin"
"gitverse.ru/andoma/gin-contrib/timeout"
"git.company.lan/gopkg/gin"
"git.company.lan/gopkg/gin-contrib/timeout"
)
func emptySuccessResponse(c *gin.Context) {
+2 -2
View File
@@ -5,8 +5,8 @@ import (
"net/http"
"time"
"gitverse.ru/andoma/gin"
"gitverse.ru/andoma/gin-contrib/timeout"
"git.company.lan/gopkg/gin"
"git.company.lan/gopkg/gin-contrib/timeout"
)
func testResponse(c *gin.Context) {
+6 -6
View File
@@ -1,15 +1,17 @@
module gitverse.ru/andoma/gin-contrib
module git.company.lan/gopkg/gin-contrib
go 1.21.5
replace git.company.lan/gopkg/gin-contrib/static => ./static
require (
git.company.lan/gopkg/gin v0.0.0-20240402114754-9aa1216a15eb
github.com/google/uuid v1.6.0
github.com/stretchr/testify v1.9.0
gitverse.ru/andoma/gin v0.0.0-20240329081234-0c04899a8413
)
require (
github.com/bytedance/sonic v1.11.0 // indirect
github.com/bytedance/sonic v1.11.3 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
github.com/chenzhuoyu/iasm v0.9.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
@@ -17,7 +19,7 @@ require (
github.com/gin-contrib/sse v0.1.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.18.0 // indirect
github.com/go-playground/validator/v10 v10.19.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
@@ -37,5 +39,3 @@ require (
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
replace gitverse.ru/andoma/gin-contrib/static => ./static
+6 -2
View File
@@ -1,7 +1,11 @@
git.company.lan/gopkg/gin v0.0.0-20240402114754-9aa1216a15eb h1:8o26v/7r8gdA8f+yCCk0skz7+/QcbhHpilC8DumruHw=
git.company.lan/gopkg/gin v0.0.0-20240402114754-9aa1216a15eb/go.mod h1:tqgu5hp8FSUVCdgSAlneNMFEE+cYSihiiEVvypv1UNo=
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM=
github.com/bytedance/sonic v1.11.0 h1:FwNNv6Vu4z2Onf1++LNzxB/QhitD8wuTdpZzMTGITWo=
github.com/bytedance/sonic v1.11.0/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4=
github.com/bytedance/sonic v1.11.3 h1:jRN+yEjakWh8aK5FzrciUHG8OFXK+4/KrAX/ysEtHAA=
github.com/bytedance/sonic v1.11.3/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4=
github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY=
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk=
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0=
@@ -24,6 +28,8 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
github.com/go-playground/validator/v10 v10.18.0 h1:BvolUXjp4zuvkZ5YN5t7ebzbhlUtPsPm2S9NAZ5nl9U=
github.com/go-playground/validator/v10 v10.18.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
github.com/go-playground/validator/v10 v10.19.0 h1:ol+5Fu+cSq9JD7SoSqe04GMI92cbn0+wvQ3bZ8b/AU4=
github.com/go-playground/validator/v10 v10.19.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
@@ -65,8 +71,6 @@ github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE=
github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
gitverse.ru/andoma/gin v0.0.0-20240329081234-0c04899a8413 h1:enDogauF7weHy3UV3sIw7kaSWqH7p2Jg+oqlc1XKLO4=
gitverse.ru/andoma/gin v0.0.0-20240329081234-0c04899a8413/go.mod h1:QJKH9K4t9bNSV2Y4vbqgmHm8lqK8Bm3coDzeM0Qjwgk=
golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
golang.org/x/arch v0.7.0 h1:pskyeJh/3AmoQ8CPE95vxHLqp1G1GfGNXTmcl9NEKTc=
golang.org/x/arch v0.7.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
+8 -8
View File
@@ -16,8 +16,8 @@ import (
"net/http"
"time"
"gitverse.ru/andoma/gin-contrib/gzip"
"gitverse.ru/andoma/gin"
"git.company.lan/gopkg/gin-contrib/gzip"
"git.company.lan/gopkg/gin"
)
func main() {
@@ -44,8 +44,8 @@ import (
"net/http"
"time"
"gitverse.ru/andoma/gin-contrib/gzip"
"gitverse.ru/andoma/gin"
"git.company.lan/gopkg/gin-contrib/gzip"
"git.company.lan/gopkg/gin"
)
func main() {
@@ -72,8 +72,8 @@ import (
"net/http"
"time"
"gitverse.ru/andoma/gin-contrib/gzip"
"gitverse.ru/andoma/gin"
"git.company.lan/gopkg/gin-contrib/gzip"
"git.company.lan/gopkg/gin"
)
func main() {
@@ -100,8 +100,8 @@ import (
"net/http"
"time"
"gitverse.ru/andoma/gin-contrib/gzip"
"gitverse.ru/andoma/gin"
"git.company.lan/gopkg/gin-contrib/gzip"
"git.company.lan/gopkg/gin"
)
func main() {
+1 -1
View File
@@ -3,7 +3,7 @@ package gzip
import (
"compress/gzip"
"gitverse.ru/andoma/gin"
"git.company.lan/gopkg/gin"
)
const (
+1 -1
View File
@@ -13,8 +13,8 @@ import (
"strconv"
"testing"
"git.company.lan/gopkg/gin"
"github.com/stretchr/testify/assert"
"gitverse.ru/andoma/gin"
)
const (
+1 -1
View File
@@ -9,7 +9,7 @@ import (
"strings"
"sync"
"gitverse.ru/andoma/gin"
"git.company.lan/gopkg/gin"
)
type gzipHandler struct {
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"regexp"
"strings"
"gitverse.ru/andoma/gin"
"git.company.lan/gopkg/gin"
)
var (
+2 -2
View File
@@ -9,8 +9,8 @@ Based on [bu/gin-access-limit](https://github.com/bu/gin-access-limit)
package main
import (
gin "gitverse.ru/andoma/gin"
"gitverse.ru/andoma/gin-contrib/limit"
gin "git.company.lan/gopkg/gin"
"git.company.lan/gopkg/gin-contrib/limit"
)
func main() {
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"net"
"strings"
"gitverse.ru/andoma/gin"
"git.company.lan/gopkg/gin"
)
// CIDR is a middleware that check given CIDR rules and return 403 Forbidden when user is not coming from allowed source.
+1 -1
View File
@@ -5,8 +5,8 @@ import (
"net/http/httptest"
"testing"
"git.company.lan/gopkg/gin"
"github.com/stretchr/testify/assert"
"gitverse.ru/andoma/gin"
)
func setupRouter(CIDRs string) *gin.Engine {
+1 -1
View File
@@ -1,6 +1,6 @@
package limit
import "gitverse.ru/andoma/gin"
import "git.company.lan/gopkg/gin"
type Handler func(c *gin.Context, remoteAddr, CIDRs string) bool
+1 -1
View File
@@ -7,7 +7,7 @@ import (
"net/http"
"time"
"gitverse.ru/andoma/gin"
"git.company.lan/gopkg/gin"
)
// Unix epoch time
+1 -1
View File
@@ -7,7 +7,7 @@ import (
"testing"
"time"
"gitverse.ru/andoma/gin"
"git.company.lan/gopkg/gin"
)
func Test_NoCacheHeaders(t *testing.T) {
+5 -5
View File
@@ -13,7 +13,7 @@ Copied from [gin-contrib/pprof](https://github.com/gin-contrib/pprof)
Import it in your code:
```go
import "gitverse.ru/andoma/gin-contrib/pprof"
import "git.company.lan/gopkg/gin-contrib/pprof"
```
### Example
@@ -22,8 +22,8 @@ import "gitverse.ru/andoma/gin-contrib/pprof"
package main
import (
"gitverse.ru/andoma/gin-contrib/pprof"
"gitverse.ru/andoma/gin"
"git.company.lan/gopkg/gin-contrib/pprof"
"git.company.lan/gopkg/gin"
)
func main() {
@@ -52,8 +52,8 @@ package main
import (
"net/http"
"gitverse.ru/andoma/gin-contrib/pprof"
"gitverse.ru/andoma/gin"
"git.company.lan/gopkg/gin-contrib/pprof"
"git.company.lan/gopkg/gin"
)
func main() {
+1 -1
View File
@@ -3,7 +3,7 @@ package pprof
import (
"net/http/pprof"
"gitverse.ru/andoma/gin"
"git.company.lan/gopkg/gin"
)
const (
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"net/http/httptest"
"testing"
"gitverse.ru/andoma/gin"
"git.company.lan/gopkg/gin"
)
func Test_getPrefix(t *testing.T) {
+2 -2
View File
@@ -42,8 +42,8 @@ import (
"net/http"
"time"
"gitverse.ru/andoma/gin-contrib/requestid"
"gitverse.ru/andoma/gin"
"git.company.lan/gopkg/gin-contrib/requestid"
"git.company.lan/gopkg/gin"
)
func main() {
+1 -1
View File
@@ -1,7 +1,7 @@
package requestid
import (
"gitverse.ru/andoma/gin"
"git.company.lan/gopkg/gin"
)
// Option for queue system
+1 -1
View File
@@ -1,8 +1,8 @@
package requestid
import (
"git.company.lan/gopkg/gin"
"github.com/google/uuid"
"gitverse.ru/andoma/gin"
)
const defaultHeaderKey = "X-Request-ID"
+1 -1
View File
@@ -6,8 +6,8 @@ import (
"net/http/httptest"
"testing"
"git.company.lan/gopkg/gin"
"github.com/stretchr/testify/assert"
"gitverse.ru/andoma/gin"
)
const testXRequestID = "test-request-id"
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"net/http"
"strings"
"gitverse.ru/andoma/gin"
"git.company.lan/gopkg/gin"
)
const (
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"reflect"
"testing"
"gitverse.ru/andoma/gin"
"git.company.lan/gopkg/gin"
)
const (
+6 -6
View File
@@ -11,13 +11,13 @@ Copied from [gin-contrib/static](https://github.com/gin-contrib/static) and [sou
Download and install it:
```bash
go get gitverse.ru/andoma/gin-contrib/static
go get git.company.lan/gopkg/gin-contrib/static
```
Import it in your code:
```go
import "gitverse.ru/andoma/gin-contrib/static"
import "git.company.lan/gopkg/gin-contrib/static"
```
## Example
@@ -32,8 +32,8 @@ package main
import (
"log"
"gitverse.ru/andoma/gin-contrib/static"
"gitverse.ru/andoma/gin"
"git.company.lan/gopkg/gin-contrib/static"
"git.company.lan/gopkg/gin"
)
func main() {
@@ -67,8 +67,8 @@ import (
"fmt"
"net/http"
"gitverse.ru/andoma/gin-contrib/static"
"gitverse.ru/andoma/gin"
"git.company.lan/gopkg/gin-contrib/static"
"git.company.lan/gopkg/gin"
)
//go:embed public
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"net/http"
"strings"
"gitverse.ru/andoma/gin"
"git.company.lan/gopkg/gin"
)
type embedFileSystem struct {
+2 -2
View File
@@ -7,9 +7,9 @@ import (
"net/http"
"testing"
"git.company.lan/gopkg/gin"
"git.company.lan/gopkg/gin-contrib/static"
"github.com/stretchr/testify/assert"
"gitverse.ru/andoma/gin"
"gitverse.ru/andoma/gin-contrib/static"
)
//go:embed test/data/server
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"path"
"strings"
"gitverse.ru/andoma/gin"
"git.company.lan/gopkg/gin"
)
type localFileSystem struct {
+2 -2
View File
@@ -6,9 +6,9 @@ import (
"path/filepath"
"testing"
"git.company.lan/gopkg/gin"
"git.company.lan/gopkg/gin-contrib/static"
"github.com/stretchr/testify/assert"
"gitverse.ru/andoma/gin"
"gitverse.ru/andoma/gin-contrib/static"
)
func TestLocalFile(t *testing.T) {
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"fmt"
"net/http"
"gitverse.ru/andoma/gin"
"git.company.lan/gopkg/gin"
)
type Override func(*gin.Context) bool
+2 -2
View File
@@ -9,9 +9,9 @@ import (
"path/filepath"
"testing"
"git.company.lan/gopkg/gin"
"git.company.lan/gopkg/gin-contrib/static"
"github.com/stretchr/testify/assert"
"gitverse.ru/andoma/gin"
"gitverse.ru/andoma/gin-contrib/static"
)
// nolint:unparam
+4 -4
View File
@@ -14,8 +14,8 @@ import (
"net/http"
"time"
"gitverse.ru/andoma/gin-contrib/timeout"
"gitverse.ru/andoma/gin"
"git.company.lan/gopkg/gin-contrib/timeout"
"git.company.lan/gopkg/gin"
)
func emptySuccessResponse(c *gin.Context) {
@@ -69,8 +69,8 @@ import (
"net/http"
"time"
"gitverse.ru/andoma/gin-contrib/timeout"
"gitverse.ru/andoma/gin"
"git.company.lan/gopkg/gin-contrib/timeout"
"git.company.lan/gopkg/gin"
)
func testResponse(c *gin.Context) {
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"net/http"
"time"
"gitverse.ru/andoma/gin"
"git.company.lan/gopkg/gin"
)
// Option for timeout
+1 -1
View File
@@ -3,7 +3,7 @@ package timeout
import (
"time"
"gitverse.ru/andoma/gin"
"git.company.lan/gopkg/gin"
)
var bufPool *BufferPool
+1 -1
View File
@@ -8,8 +8,8 @@ import (
"testing"
"time"
"git.company.lan/gopkg/gin"
"github.com/stretchr/testify/assert"
"gitverse.ru/andoma/gin"
)
// nolint:unparam
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"net/http"
"sync"
"gitverse.ru/andoma/gin"
"git.company.lan/gopkg/gin"
)
// Writer is a writer with memory buffer
+1 -1
View File
@@ -9,8 +9,8 @@ import (
"testing"
"time"
"git.company.lan/gopkg/gin"
"github.com/stretchr/testify/assert"
"gitverse.ru/andoma/gin"
)
func TestWriteHeader(t *testing.T) {