diff --git a/go.mod b/go.mod index 4b961eb..862dfa9 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/webtor-io/web-ui-v2 -go 1.22.0 +go 1.23 require ( github.com/dgrijalva/jwt-go v3.2.0+incompatible @@ -56,7 +56,7 @@ require ( github.com/go-openapi/spec v0.21.0 // indirect github.com/go-openapi/swag v0.23.0 // indirect github.com/go-pg/migrations/v8 v8.1.0 // indirect - github.com/go-pg/pg/v10 v10.13.0 // indirect + github.com/go-pg/pg/v10 v10.13.0 github.com/go-pg/zerochecker v0.2.0 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect @@ -69,7 +69,6 @@ require ( github.com/gomodule/redigo v2.0.0+incompatible // indirect github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/pprof v0.0.0-20240528025155-186aa0362fba // indirect github.com/gorilla/context v1.1.2 // indirect github.com/gorilla/securecookie v1.1.2 // indirect github.com/gorilla/sessions v1.2.2 // indirect @@ -127,7 +126,6 @@ require ( golang.org/x/term v0.20.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.21.0 // indirect - google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect google.golang.org/protobuf v1.34.1 // indirect gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect diff --git a/go.sum b/go.sum index 115b909..81ba695 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,6 @@ bazil.org/fuse v0.0.0-20180421153158-65cc252bf669/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -code.cloudfoundry.org/bytefmt v0.0.0-20231017140541-3b893ed0421b h1:/2OEIBwZAaJ8n8iTXrM4v/+bdyLDTLwcW6RZtkO4+r0= -code.cloudfoundry.org/bytefmt v0.0.0-20231017140541-3b893ed0421b/go.mod h1:CKNYSQxmKcMCNIKoRG5rRR4AIgJMIoK65ya+Z5xHnk4= code.cloudfoundry.org/bytefmt v0.0.0-20240528171252-bec775193611 h1:sMcODssiQANJ1kSneXdr3jf0QX+zXIsj0lOUeyRbjP8= code.cloudfoundry.org/bytefmt v0.0.0-20240528171252-bec775193611/go.mod h1:TfaetLE8EkRzT3UelLiedeKDAFOys9U9HBBPK8t2m5A= crawshaw.io/iox v0.0.0-20181124134642-c51c3df30797/go.mod h1:sXBiorCo8c46JlQV3oXPKINnZ8mcqnye1EkVkqsectk= @@ -95,15 +93,11 @@ github.com/anacrolix/torrent v1.9.0/go.mod h1:jJJ6lsd2LD1eLHkUwFOhy7I0FcLYH0tHKw github.com/anacrolix/torrent v1.11.0/go.mod h1:FwBai7SyOFlflvfEOaM88ag/jjcBWxTOqD6dVU/lKKA= github.com/anacrolix/torrent v1.15.0/go.mod h1:MFc6KcbpAyfwGqOyRkdarUK9QnKA/FkVg0usFk1OQxU= github.com/anacrolix/torrent v1.15.2/go.mod h1:sJtcAZtlGaZLo7wCXT/EZV+hATsq0Bg6pVhhzACY0E0= -github.com/anacrolix/torrent v1.55.0 h1:s9yh/YGdPmbN9dTa+0Inh2dLdrLQRvEAj1jdFW/Hdd8= -github.com/anacrolix/torrent v1.55.0/go.mod h1:sBdZHBSZNj4de0m+EbYg7vvs/G/STubxu/GzzNbojsE= github.com/anacrolix/torrent v1.56.0 h1:g/sM0K/BaWUv4Htu2bblLBhIxGdFZ1MUCoD7lcvemlo= github.com/anacrolix/torrent v1.56.0/go.mod h1:5DMHbeIM1TuC5wTQ99XieKKLiYZYz6iB2lyZpKZEr6w= github.com/anacrolix/upnp v0.1.1/go.mod h1:LXsbsp5h+WGN7YR+0A7iVXm5BL1LYryDev1zuJMWYQo= github.com/anacrolix/utp v0.0.0-20180219060659-9e0e1d1d0572/go.mod h1:MDwc+vsGEq7RMw6lr2GKOEqjWny5hO5OZXRVNaBJ2Dk= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/aws/aws-sdk-go v1.51.21 h1:UrT6JC9R9PkYYXDZBV0qDKTualMr+bfK2eboTknMgbs= -github.com/aws/aws-sdk-go v1.51.21/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/aws/aws-sdk-go v1.53.15 h1:FtZmkg7xM8RfP2oY6p7xdKBYrRgkITk9yve2QV7N938= github.com/aws/aws-sdk-go v1.53.15/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A= @@ -121,14 +115,15 @@ github.com/bradfitz/iter v0.0.0-20190303215204-33e6a9893b0c/go.mod h1:PyRFw1Lt2w github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8 h1:GKTyiRCL6zVf5wWaqKnf+7Qs6GbEPfd4iMOitWzXJx8= github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8/go.mod h1:spo1JLcs67NmW1aVLEgtA8Yy1elc+X8y5SRW1sFW4Og= github.com/bradleypeabody/gorilla-sessions-memcache v0.0.0-20181103040241-659414f458e1/go.mod h1:dkChI7Tbtx7H1Tj7TqGSZMOeGpMP5gLHtjroHd4agiI= -github.com/bytedance/sonic v1.11.6 h1:oUp34TzMlL+OY1OUWxHqsdkgC/Zfc85zGqw9siXjrc0= -github.com/bytedance/sonic v1.11.6/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4= +github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= +github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= +github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= +github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= github.com/bytedance/sonic v1.11.8 h1:Zw/j1KfiS+OYTi9lyB3bb0CFxPJVkM17k1wyDG32LRA= github.com/bytedance/sonic v1.11.8/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4= github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM= github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -137,7 +132,6 @@ github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/ github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -165,8 +159,6 @@ github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/elliotchance/orderedmap v1.2.0/go.mod h1:8hdSl6jmveQw8ScByd3AaNHNk51RhbTazdqtTty+NFw= github.com/elliotchance/orderedmap v1.3.0/go.mod h1:8hdSl6jmveQw8ScByd3AaNHNk51RhbTazdqtTty+NFw= -github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= -github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU= github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -179,19 +171,13 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -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/gabriel-vasile/mimetype v1.4.4 h1:QjV6pZ7/XZ7ryI2KuyeEDE8wnh7fHP9YnQy+R0LnH8I= github.com/gabriel-vasile/mimetype v1.4.4/go.mod h1:JwLei5XPtWdGiMFB5Pjle1oEeoSeEuJfJE+TtfvdB/s= github.com/garyburd/redigo v1.6.0/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= -github.com/gin-contrib/cors v1.5.0 h1:DgGKV7DDoOn36DFkNtbHrjoRiT5ExCe+PC9/xp7aKvk= -github.com/gin-contrib/cors v1.5.0/go.mod h1:TvU7MAZ3EwrPLI2ztzTt3tqgvBCq+wn8WpZmfADjupI= github.com/gin-contrib/cors v1.7.2 h1:oLDHxdg8W/XDoN/8zamqk/Drgt4oVZDvaV0YmvVICQw= github.com/gin-contrib/cors v1.7.2/go.mod h1:SUJVARKgQ40dmrzgXEVxj2m7Ig1v1qIboQkPDTQ9t2E= github.com/gin-contrib/gzip v0.0.6 h1:NjcunTcGAj5CO1gn4N8jHOSIeRFHIbn51z6K+xaN4d4= github.com/gin-contrib/gzip v0.0.6/go.mod h1:QOJlmV2xmayAjkNS2Y8NQsMneuRShOU/kjovCXNuzzk= -github.com/gin-contrib/multitemplate v0.0.0-20230212012517-45920c92c271 h1:s+boMV47gwTyff2PL+k6V33edJpp+K5y3QPzZlRhno8= -github.com/gin-contrib/multitemplate v0.0.0-20230212012517-45920c92c271/go.mod h1:XLLtIXoP9+9zGcEDc7gAGV3AksGPO+vzv4kXHMJSdU0= github.com/gin-contrib/multitemplate v1.0.1 h1:Asi8boB7NctSoQzbWDosLObon0cYMP5OM+ihQMjlW5M= github.com/gin-contrib/multitemplate v1.0.1/go.mod h1:uU+PnuKoiEHWqB9Zvco+Kqv9KNrsHi6IZOUUgTctMPA= github.com/gin-contrib/sessions v0.0.0-20190101140330-dc5246754963/go.mod h1:4lkInX8nHSR62NSmhXM3xtPeMSyfiR58NaEz+om1lHM= @@ -201,7 +187,6 @@ github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7/go.mod h1:VJ0WA2NB 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-gonic/gin v1.3.0/go.mod h1:7cKuhb5qV2ggCFctp2fJQ+ErvciLZrIeoOSOm6mUr7Y= -github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= 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/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= @@ -215,75 +200,43 @@ github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= -github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= -github.com/go-openapi/jsonpointer v0.20.0 h1:ESKJdU9ASRfaPNOPRx12IUyA1vn3R9GiE3KYD14BXdQ= -github.com/go-openapi/jsonpointer v0.20.0/go.mod h1:6PGzBjjIIumbLYysB73Klnms1mwnU4G3YHOECG3CedA= github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= -github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= -github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= -github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= -github.com/go-openapi/spec v0.20.11 h1:J/TzFDLTt4Rcl/l1PmyErvkqlJDncGvPTMnCI39I4gY= -github.com/go-openapi/spec v0.20.11/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY= github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= -github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/go-pg/migrations/v8 v8.1.0 h1:bc1wQwFoWRKvLdluXCRFRkeaw9xDU4qJ63uCAagh66w= github.com/go-pg/migrations/v8 v8.1.0/go.mod h1:o+CN1u572XHphEHZyK6tqyg2GDkRvL2bIoLNyGIewus= github.com/go-pg/pg/v10 v10.4.0/go.mod h1:BfgPoQnD2wXNd986RYEHzikqv9iE875PrFaZ9vXvtNM= -github.com/go-pg/pg/v10 v10.12.0 h1:rBmfDDHTN7FQW0OemYmcn5UuBy6wkYWgh/Oqt1OBEB8= -github.com/go-pg/pg/v10 v10.12.0/go.mod h1:USA08CdIasAn0F6wC1nBf5nQhMHewVQodWoH89RPXaI= github.com/go-pg/pg/v10 v10.13.0 h1:xMagDE57VP8Y2KvIf9PvrsOAIjX62XqaKmfEzB0c5eU= github.com/go-pg/pg/v10 v10.13.0/go.mod h1:IXp9Ok9JNNW9yWedbQxxvKUv84XhoH5+tGd+68y+zDs= github.com/go-pg/zerochecker v0.2.0 h1:pp7f72c3DobMWOb2ErtZsnrPaSvHd2W4o9//8HtF4mU= github.com/go-pg/zerochecker v0.2.0/go.mod h1:NJZ4wKL0NmTtz0GKCoJ8kym6Xn/EQzXRl2OnAe7MmDo= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= 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.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= 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.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= 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.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= -github.com/go-playground/validator/v10 v10.20.0 h1:K9ISHbSaI0lyB2eWMPJo+kOS/FBExVwjEviJTixqxL8= -github.com/go-playground/validator/v10 v10.20.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= github.com/go-playground/validator/v10 v10.21.0 h1:4fZA11ovvtkdgaeev9RGWPgc1uj3H8W+rNYyH/ySBb0= github.com/go-playground/validator/v10 v10.21.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= -github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGKFlFgcHWWmHQjg= -github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= -github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -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/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw= -github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -304,14 +257,10 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v1.9.2 h1:HrutZBLhSIU8abiSfW8pj8mPhOyMYjZT/wcA4/L9L9s= -github.com/gomodule/redigo v1.9.2/go.mod h1:KsU3hiK/Ay8U42qpaJk+kuNa3C+spxapWpM+ywhcgtw= github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0= github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180124185431-e89373fe6b4a/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -324,15 +273,13 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ= -github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= +github.com/google/pprof v0.0.0-20240528025155-186aa0362fba h1:ql1qNgCyOB7iAEk8JTNM+zJrgIbnyCKX/wdlyPufP5g= github.com/google/pprof v0.0.0-20240528025155-186aa0362fba/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= 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= @@ -401,29 +348,22 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= 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/localtunnel/go-localtunnel v0.0.0-20170326223115-8a804488f275 h1:IZycmTpoUtQK3PD60UYBwjaCUHUP7cML494ao9/O8+Q= github.com/localtunnel/go-localtunnel v0.0.0-20170326223115-8a804488f275/go.mod h1:zt6UU74K6Z6oMOYJbJzYpYucqdcQwSMPBEdSvGiaUMw= github.com/lukechampine/stm v0.0.0-20191022212748-05486c32d236/go.mod h1:wTLsd5FC9rts7GkMpsPGk64CIuea+03yaLAp19Jmlg8= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= 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/mattn/go-sqlite3 v1.7.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= @@ -460,8 +400,6 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/nyaruka/phonenumbers v1.2.2 h1:OwVjf7Y4uHoK9VJUrA8ebR0ha2yc6sEYbfrwkq0asCY= -github.com/nyaruka/phonenumbers v1.2.2/go.mod h1:wzk2qq7qwsaBKrfbkWKdgHYOOH+QFTesSpIq53ELw8M= github.com/nyaruka/phonenumbers v1.3.6 h1:33owXWp4d1U+Tyaj9fpci6PbvaQZcXBUO2FybeKeLwQ= github.com/nyaruka/phonenumbers v1.3.6/go.mod h1:Ut+eFwikULbmCenH6InMKL9csUNLyxHuBLyfkpum11s= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -470,21 +408,19 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.9.4 h1:xR7vG4IXt5RWx6FfIjyAtsoMAtnc3C/rFXBBd2AjZwE= -github.com/onsi/ginkgo/v2 v2.9.4/go.mod h1:gCQYp2Q+kSoIj7ykSVb9nskRSsR6PUj4AiLywzIhbKM= +github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA= +github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= -github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE= -github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg= +github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= +github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= -github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -495,8 +431,6 @@ github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXP github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.5.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= -github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= -github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -509,8 +443,6 @@ github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQy github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.52.3 h1:5f8uj6ZwHSscOGNdIQg6OiZv/ybiK2CO2q2drVZAQSA= -github.com/prometheus/common v0.52.3/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U= github.com/prometheus/common v0.54.0 h1:ZlZy0BgJhTwVZUn7dLOkwCZHUkrAqd3WYtcFCWnM1D8= github.com/prometheus/common v0.54.0/go.mod h1:/TQgMJP5CuVYveyT7n/0Ix8yLNNXy9yRSkhnLTHPDIQ= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -518,18 +450,14 @@ github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= -github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/quasoft/memstore v0.0.0-20180925164028-84a050167438/go.mod h1:wTPjTepVu7uJBYgZ0SdWHQlIas582j6cn2jgk4DDdlg= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/redis/go-redis/v9 v9.5.2 h1:L0L3fcSNReTRGyZ6AqAEN0K56wYeYAwapBIhkvh0f3E= github.com/redis/go-redis/v9 v9.5.2/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46/go.mod h1:uAQ5PCi+MFsC7HjREoAz1BU+Mq60+05gifQSsHSDG/8= @@ -567,16 +495,12 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o 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/supertokens/supertokens-golang v0.17.4 h1:G5FngSJpGjlLG/t+xQtVnq0XkMjhAkZivmmEwgZ2gD4= -github.com/supertokens/supertokens-golang v0.17.4/go.mod h1:/n6zQ9461RscnnWB4Y4bWwzhPivnj8w79j/doqkLOs8= github.com/supertokens/supertokens-golang v0.20.0 h1:mQHfF38UF5AWqkRPXyt1CcDUHDt/LvMwY+FCbYez2eo= github.com/supertokens/supertokens-golang v0.20.0/go.mod h1:/n6zQ9461RscnnWB4Y4bWwzhPivnj8w79j/doqkLOs8= github.com/swaggo/files v1.0.1 h1:J1bVJ4XHZNq0I46UU90611i9/YzdrF7x92oX1ig5IdE= github.com/swaggo/files v1.0.1/go.mod h1:0qXmMNH6sXNf+73t65aKeB+ApmgxdnkQzVTAj2uaMUg= github.com/swaggo/gin-swagger v1.6.0 h1:y8sxvQ3E20/RCyrXeFfg60r6H0Z+SwpTjMYsMm+zy8M= github.com/swaggo/gin-swagger v1.6.0/go.mod h1:BG00cCEy294xtVpyIAHG6+e2Qzj/xKlRdOqDkvq0uzo= -github.com/swaggo/swag v1.16.2 h1:28Pp+8DkQoV+HLzLx8RGJZXNGKbFqnuvSbAAtoxiY04= -github.com/swaggo/swag v1.16.2/go.mod h1:6YzXnDcpr0767iOejs318CwYkCQqyGer6BizOg03f+E= github.com/swaggo/swag v1.16.3 h1:PnCYjPCah8FK4I26l2F/KQ4yz3sILcVUN3cTlBFA9Pg= github.com/swaggo/swag v1.16.3/go.mod h1:DImHIuOFXKpMFAQjcC7FG4m3Dg4+QuUgUzJmKjI/gRk= github.com/syncthing/syncthing v0.14.48-rc.4/go.mod h1:nw3siZwHPA6M8iSfjDCWQ402eqvEIasMQOE8nFOxy7M= @@ -586,20 +510,14 @@ github.com/tinylib/msgp v1.1.1/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDW github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc h1:9lRDQMhESg+zvGYmW5DyG0UqvY96Bu5QYsTLvCHdrgo= github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GHm1iF1pBvUfxfsH0Wmnc2VbpgvbI9ZWuIRs= -github.com/twilio/twilio-go v1.15.3 h1:zjXEEwIrm72qLO5IvquqK0G4htEtq5HO+ax6rCIlink= -github.com/twilio/twilio-go v1.15.3/go.mod h1:tdnfQ5TjbewoAu4lf9bMsGvfuJ/QU9gYuv9yx3TSIXU= github.com/twilio/twilio-go v1.21.0 h1:ZO8mGb10HxPo+sigPDwgqVokIhh61tXok9h61n67ESA= github.com/twilio/twilio-go v1.21.0/go.mod h1:tdnfQ5TjbewoAu4lf9bMsGvfuJ/QU9gYuv9yx3TSIXU= 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 v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v0.0.0-20181209151446-772ced7fd4c2/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk= -github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA= github.com/urfave/cli v1.22.15 h1:nuqt+pdC/KqswQKhETJjo7pvn/k4xMUxgW6liI7XpnM= github.com/urfave/cli v1.22.15/go.mod h1:wSan1hmo5zeyLGBjRJbzRTNk8gwoYa2B9n4q9dmRIc0= github.com/utrack/gin-csrf v0.0.0-20190424104817-40fb8d2c8fca h1:lpvAjPK+PcxnbcB8H7axIb4fMNwjX9bE4DzwPjGg8aE= @@ -617,16 +535,12 @@ github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAh github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/webtor-io/claims-provider v0.0.0-20240414120741-d7e398fc01d8 h1:q+EzbmxlV6NxZ5Kx+o67zM3rK0T0gHzyA4IBnkxhiDo= github.com/webtor-io/claims-provider v0.0.0-20240414120741-d7e398fc01d8/go.mod h1:OC4d4aPowF8kSta8BiQH/QBdYNbGuOpfa73oUVeR5RY= -github.com/webtor-io/common-services v0.0.0-20240203141409-87c1e715ac36 h1:aXW+saHvTNYOhZIJx7URamwY7fogzR6e7LzIa6TW4Tc= -github.com/webtor-io/common-services v0.0.0-20240203141409-87c1e715ac36/go.mod h1:Hu3wCy1YM0UD1z6aIVmaVURyV8WI6lC1SGt9sIOYWbg= github.com/webtor-io/common-services v0.0.0-20240603220900-f55e2770e301 h1:86MQoktAeuZH/Os3KlcruGLXBiof5COFkNHvamY0h3U= github.com/webtor-io/common-services v0.0.0-20240603220900-f55e2770e301/go.mod h1:Kktb8YoxXn4uqROK3nY/SlDdV/lNp9DuKUN7JPuPMR4= github.com/webtor-io/lazymap v0.0.0-20221030185154-1799721becef h1:tSAcIGxgmsxFJnLRyTkhzFhjGAtaOZ5g2osBHG3JYBs= github.com/webtor-io/lazymap v0.0.0-20221030185154-1799721becef/go.mod h1:za/bioTGK3VjG3+mK7/kpx0TV8++ytZkdOQ1MJ2HTjM= github.com/webtor-io/magnet2torrent v0.0.0-20220312143110-bc1a7e4bcbba h1:OyPsU+YnNo0h22PfqfQHtkBTO9vKllKgy94RzF/Ga3c= github.com/webtor-io/magnet2torrent v0.0.0-20220312143110-bc1a7e4bcbba/go.mod h1:2cBSuVh1bLCrVUUy5TxEZj+Msuzz127kEt5XfeX/F3s= -github.com/webtor-io/rest-api v0.0.0-20221217132559-7039a3dfcf56 h1:HH96VbgQvuJj3/fQb9iBuesFU++JIQQv7tioQvMSu5s= -github.com/webtor-io/rest-api v0.0.0-20221217132559-7039a3dfcf56/go.mod h1:m5hMHawVpwj6FOYiCgwBoABPi6VwE+WXj4F3AMocq9s= github.com/webtor-io/rest-api v0.0.0-20231229193338-6669290c58f0 h1:n1fBc3kMLAMFKoP98ZNefE6EDTtmUiNWsqnlqSAQCA0= github.com/webtor-io/rest-api v0.0.0-20231229193338-6669290c58f0/go.mod h1:fiN8+mwSsrVvoN7JFIGNuHXhUaVnr+nON1mDddqaGJw= github.com/webtor-io/torrent-store v0.0.0-20230129225621-aec101523586 h1:SpJWnQsQJvyJTWgBfdCdT1I5OqXU4BJ8S3un069/tjg= @@ -660,7 +574,6 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= @@ -675,8 +588,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180524181706-dfa909b99c79/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -710,10 +623,6 @@ golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI= -golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= -golang.org/x/oauth2 v0.19.0 h1:9+E/EZBCbTLNrbN35fHv/a/d/mOBatymz1zbtQrXpIg= -golang.org/x/oauth2 v0.19.0/go.mod h1:vYi7skDa1x015PmRRYZ7+s1cWyPgrPiSYRe4rnsexc8= golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -725,6 +634,8 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -759,8 +670,6 @@ golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -776,9 +685,7 @@ golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= @@ -801,8 +708,6 @@ golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.16.0 h1:GO788SKMRunPIBCXiQyo2AaexLstOrVhuAL5YwsckQM= -golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw= golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -814,15 +719,11 @@ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9Ywl google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= -google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240412170617-26222e5d3d56 h1:zviK8GX4VlMstrK3JkexM5UHjH1VOkRebH9y3jhSBGk= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240412170617-26222e5d3d56/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= @@ -830,8 +731,6 @@ google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZi google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= -google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -843,9 +742,6 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= @@ -857,7 +753,6 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/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= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= @@ -880,35 +775,21 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/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= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -k8s.io/api v0.28.4 h1:8ZBrLjwosLl/NYgv1P7EQLqoO8MGQApnbgH8tu3BMzY= -k8s.io/api v0.28.4/go.mod h1:axWTGrY88s/5YE+JSt4uUi6NMM+gur1en2REMR7IRj0= k8s.io/api v0.30.1 h1:kCm/6mADMdbAxmIh0LBjS54nQBE+U4KmbCfIkF5CpJY= k8s.io/api v0.30.1/go.mod h1:ddbN2C0+0DIiPntan/bye3SW3PdwLa11/0yqwvuRrJM= -k8s.io/apimachinery v0.28.4 h1:zOSJe1mc+GxuMnFzD4Z/U1wst50X28ZNsn5bhgIIao8= -k8s.io/apimachinery v0.28.4/go.mod h1:wI37ncBvfAoswfq626yPTe6Bz1c22L7uaJ8dho83mgg= k8s.io/apimachinery v0.30.1 h1:ZQStsEfo4n65yAdlGTfP/uSHMQSoYzU/oeEbkmF7P2U= k8s.io/apimachinery v0.30.1/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= -k8s.io/client-go v0.28.4 h1:Np5ocjlZcTrkyRJ3+T3PkXDpe4UpatQxj85+xjaD2wY= -k8s.io/client-go v0.28.4/go.mod h1:0VDZFpgoZfelyP5Wqu0/r/TRYcLYuJ2U1KEeoaPa1N4= k8s.io/client-go v0.30.1 h1:uC/Ir6A3R46wdkgCV3vbLyNOYyCJ8oZnjtJGKfytl/Q= k8s.io/client-go v0.30.1/go.mod h1:wrAqLNs2trwiCH/wxxmT/x3hKVH9PuV0GGW0oDoHVqc= -k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= -k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kube-openapi v0.0.0-20231206194836-bf4651e18aa8 h1:vzKzxN5uyJZLY8HL1/OovW7BJefnsBIWt8T7Gjh2boQ= -k8s.io/kube-openapi v0.0.0-20231206194836-bf4651e18aa8/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= k8s.io/kube-openapi v0.0.0-20240521193020-835d969ad83a h1:zD1uj3Jf+mD4zmA7W+goE5TxDkI7OGJjBNBzq5fJtLA= k8s.io/kube-openapi v0.0.0-20240521193020-835d969ad83a/go.mod h1:UxDHUPsUwTOOxSU+oXURfFBcAS6JwiRXTYqYwfuGowc= -k8s.io/utils v0.0.0-20231127182322-b307cd553661 h1:FepOBzJ0GXm8t0su67ln2wAZjbQ6RxQGZDnzuLcrUTI= -k8s.io/utils v0.0.0-20231127182322-b307cd553661/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 h1:jgGTlFYnhF1PM1Ax/lAlxUPE+KfCIXHaathvJg1C3ak= k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= lukechampine.com/blake3 v1.3.0 h1:sJ3XhFINmHSrYCgl958hscfIa3bw8x4DqMP3u1YvoYE= diff --git a/qodana.yaml b/qodana.yaml new file mode 100644 index 0000000..215d808 --- /dev/null +++ b/qodana.yaml @@ -0,0 +1,29 @@ +#-------------------------------------------------------------------------------# +# Qodana analysis is configured by qodana.yaml file # +# https://www.jetbrains.com/help/qodana/qodana-yaml.html # +#-------------------------------------------------------------------------------# +version: "1.0" + +#Specify inspection profile for code analysis +profile: + name: qodana.starter + +#Enable inspections +#include: +# - name: + +#Disable inspections +#exclude: +# - name: +# paths: +# - + +#Execute shell command before Qodana execution (Applied in CI/CD pipeline) +#bootstrap: sh ./prepare-qodana.sh + +#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline) +#plugins: +# - id: #(plugin id can be found at https://plugins.jetbrains.com) + +#Specify Qodana linter for analysis (Applied in CI/CD pipeline) +linter: jetbrains/qodana-go:latest diff --git a/serve.go b/serve.go index 91bebf6..ae497f0 100644 --- a/serve.go +++ b/serve.go @@ -72,7 +72,7 @@ func serve(c *cli.Context) error { // redis := cs.NewRedisClient(c) // defer redis.Close() - servers := []cs.Servable{} + var servers []cs.Servable // Setting Probe probe := cs.NewProbe(c) servers = append(servers, probe) @@ -110,7 +110,7 @@ func serve(c *cli.Context) error { cl := http.DefaultClient // Setting Api - api := api.New(c, cl) + sapi := api.New(c, cl) // Setting Helper helper := w.NewHelper(c) @@ -125,7 +125,7 @@ func serve(c *cli.Context) error { queues := job.NewQueues(job.NewStorage(redis, gin.Mode())) // Setting JobHandler - jobs := wj.New(queues, tm, api) + jobs := wj.New(queues, tm, sapi) jobs.RegisterHandler(r) @@ -138,7 +138,7 @@ func serve(c *cli.Context) error { return err } a.RegisterHandler(r) - wau.RegisterHandler(c, r, tm) + wau.RegisterHandler(r, tm) } // Setting Claims Client @@ -149,32 +149,32 @@ func serve(c *cli.Context) error { uc := claims.New(c, cpCl) if uc != nil { // Setting UserClaimsHandler - uc.RegisterHandler(c, r) + uc.RegisterHandler(r) } // Setting DomainSettings ds := embed.NewDomainSettings(pg, uc) // Setting ApiClaimsHandler - api.RegisterHandler(c, r) + sapi.RegisterHandler(r) // Setting ResourceHandler - wr.RegisterHandler(c, r, tm, api, jobs) + wr.RegisterHandler(r, tm, sapi, jobs) // Setting IndexHandler - wi.RegisterHandler(c, r, tm) + wi.RegisterHandler(r, tm) // Setting ActionHandler - wa.RegisterHandler(c, r, tm, jobs) + wa.RegisterHandler(r, tm, jobs) // Setting ProfileHandler - p.RegisterHandler(c, r, tm) + p.RegisterHandler(r, tm) // Setting EmbedExamplesHandler - wee.RegisterHandler(c, r, tm) + wee.RegisterHandler(r, tm) // Setting EmbedHandler - we.RegisterHandler(c, cl, r, tm, jobs, ds) + we.RegisterHandler(cl, r, tm, jobs, ds) // Render templates err = tm.Init() diff --git a/services/api/api.go b/services/api/api.go index 7dacc96..b943c1a 100644 --- a/services/api/api.go +++ b/services/api/api.go @@ -238,12 +238,12 @@ func New(c *cli.Context, cl *http.Client) *Api { } } log.Infof("api endpoint %v", u) - url, _ := url.Parse(c.String(services.DomainFlag)) + apiURL, _ := url.Parse(c.String(services.DomainFlag)) return &Api{ url: u, cl: cl, prepareRequest: prepareRequest, - domain: url.Host, + domain: apiURL.Host, } } @@ -343,6 +343,10 @@ func (s *Api) Download(ctx context.Context, u string) (io.ReadCloser, error) { func (s *Api) DownloadWithRange(ctx context.Context, u string, start int, end int) (io.ReadCloser, error) { req, err := http.NewRequestWithContext(ctx, "GET", u, nil) + if err != nil { + log.WithError(err).Error("failed to make new request") + return nil, err + } if start != 0 || end != -1 { startStr := strconv.Itoa(start) endStr := "" @@ -351,10 +355,6 @@ func (s *Api) DownloadWithRange(ctx context.Context, u string, start int, end in } req.Header.Set("Range", fmt.Sprintf("bytes=%v-%v", startStr, endStr)) } - if err != nil { - log.WithError(err).Error("failed to make new request") - return nil, err - } res, err := s.cl.Do(req) if err != nil { log.WithError(err).Error("failed to do request") @@ -379,7 +379,9 @@ func (s *Api) GetOpenSubtitles(ctx context.Context, u string) ([]OpenSubtitleTra return nil, errors.Wrap(err, "failed to do request") } b := res.Body - defer b.Close() + defer func(b io.ReadCloser) { + _ = b.Close() + }(b) var esubs []ExtSubtitle var subs []OpenSubtitleTrack data, err := io.ReadAll(b) @@ -414,7 +416,9 @@ func (s *Api) GetMediaProbe(ctx context.Context, u string) (*MediaProbe, error) return nil, errors.Wrap(err, "failed to do request") } b := res.Body - defer b.Close() + defer func(b io.ReadCloser) { + _ = b.Close() + }(b) mb := MediaProbe{} data, err := io.ReadAll(b) if err != nil { @@ -534,7 +538,7 @@ func getRemoteAddress(r *http.Request) string { return ip } -type ApiClaimsContext struct{} +type ClaimsContext struct{} func (s *Api) MakeClaimsFromContext(c *gin.Context) (*Claims, error) { sess, _ := c.Cookie("session") @@ -566,18 +570,17 @@ func (s *Api) MakeClaimsFromContext(c *gin.Context) (*Claims, error) { } func GetClaimsFromContext(c *gin.Context) *Claims { - return c.Request.Context().Value(ApiClaimsContext{}).(*Claims) + return c.Request.Context().Value(ClaimsContext{}).(*Claims) } -func (s *Api) RegisterHandler(c *cli.Context, r *gin.Engine) error { +func (s *Api) RegisterHandler(r *gin.Engine) { r.Use(func(c *gin.Context) { ac, err := s.MakeClaimsFromContext(c) if err != nil { _ = c.AbortWithError(http.StatusInternalServerError, err) return } - c.Request = c.Request.WithContext(context.WithValue(c.Request.Context(), ApiClaimsContext{}, ac)) + c.Request = c.Request.WithContext(context.WithValue(c.Request.Context(), ClaimsContext{}, ac)) c.Next() }) - return nil } diff --git a/services/auth/auth.go b/services/auth/auth.go index aeef011..6aa44b2 100644 --- a/services/auth/auth.go +++ b/services/auth/auth.go @@ -166,7 +166,7 @@ func GetUserFromContext(c *gin.Context) *User { u.Email = *userInfo.Email } } - if err := c.Request.Context().Value(AuthErrorContext{}); err != nil { + if err := c.Request.Context().Value(ErrorContext{}); err != nil { if defaultErrors.As(err.(error), &errors.TryRefreshTokenError{}) { u.Expired = true } @@ -174,13 +174,13 @@ func GetUserFromContext(c *gin.Context) *User { return u } -type AuthErrorContext struct{} +type ErrorContext struct{} func myVerifySession(options *sessmodels.VerifySessionOptions, otherHandler http.HandlerFunc) http.HandlerFunc { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - session, err := session.GetSession(r, w, options) + return func(w http.ResponseWriter, r *http.Request) { + sess, err := session.GetSession(r, w, options) if err != nil { - ctx := context.WithValue(r.Context(), AuthErrorContext{}, err) + ctx := context.WithValue(r.Context(), ErrorContext{}, err) r := r.WithContext(ctx) if defaultErrors.As(err, &errors.TryRefreshTokenError{}) { if r.Header.Get("X-Requested-With") != "XMLHttpRequest" { @@ -214,13 +214,13 @@ func myVerifySession(options *sessmodels.VerifySessionOptions, otherHandler http } return } - if session != nil { - ctx := context.WithValue(r.Context(), sessmodels.SessionContext, session) + if sess != nil { + ctx := context.WithValue(r.Context(), sessmodels.SessionContext, sess) otherHandler(w, r.WithContext(ctx)) } else { otherHandler(w, r) } - }) + } } func verifySession(options *sessmodels.VerifySessionOptions) gin.HandlerFunc { diff --git a/services/claims/claims.go b/services/claims/claims.go index e9e6c5f..856b54c 100644 --- a/services/claims/claims.go +++ b/services/claims/claims.go @@ -10,7 +10,7 @@ import ( "github.com/webtor-io/lazymap" proto "github.com/webtor-io/claims-provider/proto" - auth "github.com/webtor-io/web-ui-v2/services/auth" + "github.com/webtor-io/web-ui-v2/services/auth" ) const ( @@ -81,24 +81,23 @@ func (s *Claims) MakeUserClaimsFromContext(c *gin.Context) (*Data, error) { return r, nil } -type ClaimsContext struct{} +type Context struct{} func GetFromContext(c *gin.Context) *Data { - if r := c.Request.Context().Value(ClaimsContext{}); r != nil { + if r := c.Request.Context().Value(Context{}); r != nil { return r.(*Data) } return nil } -func (s *Claims) RegisterHandler(c *cli.Context, r *gin.Engine) error { +func (s *Claims) RegisterHandler(r *gin.Engine) { r.Use(func(c *gin.Context) { r, err := s.MakeUserClaimsFromContext(c) if err != nil { - c.AbortWithError(http.StatusInternalServerError, err) + _ = c.AbortWithError(http.StatusInternalServerError, err) return } - c.Request = c.Request.WithContext(context.WithValue(c.Request.Context(), ClaimsContext{}, r)) + c.Request = c.Request.WithContext(context.WithValue(c.Request.Context(), Context{}, r)) c.Next() }) - return nil } diff --git a/services/claims/client.go b/services/claims/client.go index 38d4f90..5bcbcd6 100644 --- a/services/claims/client.go +++ b/services/claims/client.go @@ -2,12 +2,12 @@ package claims import ( "fmt" + "google.golang.org/grpc/credentials/insecure" "sync" "github.com/urfave/cli" proto "github.com/webtor-io/claims-provider/proto" "google.golang.org/grpc" - "google.golang.org/grpc/credentials/insecure" ) const ( @@ -51,7 +51,7 @@ func NewClient(c *cli.Context) *Client { func (s *Client) Get() (proto.ClaimsProviderClient, error) { s.once.Do(func() { addr := fmt.Sprintf("%s:%d", s.host, s.port) - conn, err := grpc.Dial(addr, grpc.WithTransportCredentials(insecure.NewCredentials())) + conn, err := grpc.NewClient(addr, grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { s.err = err return diff --git a/services/embed/domain_settings.go b/services/embed/domain_settings.go index 0ed9126..14346de 100644 --- a/services/embed/domain_settings.go +++ b/services/embed/domain_settings.go @@ -1,6 +1,7 @@ package embed import ( + "github.com/pkg/errors" "time" "github.com/go-pg/pg/v10" @@ -37,7 +38,7 @@ func (s *DomainSettings) get(domain string) (*DomainSettingsData, error) { db := s.pg.Get() em := &models.EmbedDomain{} err := db.Model(em).Where("domain = ?", domain).Select() - if err == pg.ErrNoRows { + if errors.Is(err, pg.ErrNoRows) { return &DomainSettingsData{Ads: true}, nil } else if err != nil { return nil, err diff --git a/services/job/job.go b/services/job/job.go index 1a5ef00..70999c9 100644 --- a/services/job/job.go +++ b/services/job/job.go @@ -189,7 +189,7 @@ func (s *Job) log(l LogItem) error { } func (s *Job) Info(message string) *Job { - s.log(LogItem{ + _ = s.log(LogItem{ Level: Info, Message: message, }) @@ -198,7 +198,7 @@ func (s *Job) Info(message string) *Job { func (s *Job) Warn(err error, message string) *Job { log.WithError(err).Error("got job warning") - s.log(LogItem{ + _ = s.log(LogItem{ Level: Warn, Message: message, Tag: s.cur, @@ -208,7 +208,7 @@ func (s *Job) Warn(err error, message string) *Job { func (s *Job) Error(err error, message string) error { log.WithError(err).Error("got job error") - s.log(LogItem{ + _ = s.log(LogItem{ Level: Error, Message: message, Tag: s.cur, @@ -218,7 +218,7 @@ func (s *Job) Error(err error, message string) error { func (s *Job) InProgress(message string) *Job { s.cur = message - s.log(LogItem{ + _ = s.log(LogItem{ Level: InProgress, Message: message, Tag: s.cur, @@ -227,7 +227,7 @@ func (s *Job) InProgress(message string) *Job { } func (s *Job) StatusUpdate(message string) *Job { - s.log(LogItem{ + _ = s.log(LogItem{ Level: StatusUpdate, Message: message, Tag: s.cur, @@ -236,14 +236,14 @@ func (s *Job) StatusUpdate(message string) *Job { } func (s *Job) Done() *Job { - s.log(LogItem{ + _ = s.log(LogItem{ Level: Done, Tag: s.cur, }) return s } func (s *Job) Finish() *Job { - s.log(LogItem{ + _ = s.log(LogItem{ Level: Finish, Message: "success!", }) @@ -251,7 +251,7 @@ func (s *Job) Finish() *Job { } func (s *Job) Download(url string) *Job { - s.log(LogItem{ + _ = s.log(LogItem{ Level: Download, Location: url, }) @@ -259,7 +259,7 @@ func (s *Job) Download(url string) *Job { } func (s *Job) Redirect(url string) *Job { - s.log(LogItem{ + _ = s.log(LogItem{ Level: Redirect, Location: url, }) @@ -267,7 +267,7 @@ func (s *Job) Redirect(url string) *Job { } func (s *Job) RenderTemplate(name string, body string) *Job { - s.log(LogItem{ + _ = s.log(LogItem{ Level: RenderTemplate, Template: name, Body: body, @@ -276,7 +276,7 @@ func (s *Job) RenderTemplate(name string, body string) *Job { } func (s *Job) FinishWithMessage(m string) *Job { - s.log(LogItem{ + _ = s.log(LogItem{ Level: Finish, Message: m, }) @@ -290,7 +290,7 @@ func (s *Job) Close() { return } s.closed = true - s.log(LogItem{ + _ = s.log(LogItem{ Level: Close, }) } @@ -310,7 +310,7 @@ func newJobs(queue string, storage Storage) *Jobs { } } -func (s *Jobs) Enqueue(ctx context.Context, id string, r Runnable) *Job { +func (s *Jobs) Enqueue(ctx context.Context, cancel context.CancelFunc, id string, r Runnable) *Job { s.mux.Lock() defer s.mux.Unlock() if _, ok := s.jobs[id]; ok { @@ -319,6 +319,7 @@ func (s *Jobs) Enqueue(ctx context.Context, id string, r Runnable) *Job { j := New(ctx, id, s.queue, r, s.storage) s.jobs[id] = j go func() { + defer cancel() err := j.Run(ctx) if err != nil { log.WithError(err).Error("got job error") @@ -336,17 +337,14 @@ func (s *Jobs) Log(ctx context.Context, id string) (c chan LogItem, err error) { c = make(chan LogItem) j, ok := s.jobs[id] if !ok { - var state *JobState + var state *State state, err = s.storage.GetState(ctx, id) if err != nil || state == nil { close(c) return } - jCtx := context.Background() - if (state.TTL) > 0 { - jCtx, _ = context.WithTimeout(context.Background(), state.TTL) - } - j = s.Enqueue(jCtx, id, nil) + jCtx, cancel := context.WithTimeout(context.Background(), state.TTL) + j = s.Enqueue(jCtx, cancel, id, nil) } go func() { o := j.ObserveLog() diff --git a/services/job/redis.go b/services/job/redis.go index 0835676..ab893d5 100644 --- a/services/job/redis.go +++ b/services/job/redis.go @@ -41,7 +41,7 @@ func (s *Redis) Pub(ctx context.Context, id string, l *LogItem) (err error) { return } -func (s *Redis) GetState(ctx context.Context, id string) (state *JobState, err error) { +func (s *Redis) GetState(ctx context.Context, id string) (state *State, err error) { key := s.makeKey(id) ttlCmd := s.cl.TTL(ctx, key) if ttlCmd.Err() != nil { @@ -55,7 +55,7 @@ func (s *Redis) GetState(ctx context.Context, id string) (state *JobState, err e if val > 0 { dur = val } - return &JobState{ + return &State{ ID: id, TTL: dur, }, nil @@ -119,7 +119,9 @@ func (s *Redis) subRaw(ctx context.Context, id string) (res chan string, err err res <- i } ps := s.cl.Subscribe(ctx, key) - defer ps.Close() + defer func(ps *redis.PubSub) { + _ = ps.Close() + }(ps) if err = ps.Ping(ctx); err != nil { return diff --git a/services/job/storage.go b/services/job/storage.go index 2de389c..04105a3 100644 --- a/services/job/storage.go +++ b/services/job/storage.go @@ -7,7 +7,7 @@ import ( cs "github.com/webtor-io/common-services" ) -type JobState struct { +type State struct { ID string TTL time.Duration } @@ -15,20 +15,20 @@ type JobState struct { type Storage interface { Pub(ctx context.Context, id string, l *LogItem) error Sub(ctx context.Context, id string) (res chan LogItem, err error) - GetState(ctx context.Context, id string) (state *JobState, err error) + GetState(ctx context.Context, id string) (state *State, err error) } type NilStorage struct{} -func (s *NilStorage) Pub(ctx context.Context, id string, l *LogItem) error { +func (s *NilStorage) Pub(_ context.Context, _ string, _ *LogItem) error { return nil } -func (s *NilStorage) Sub(ctx context.Context, id string) (res chan LogItem, err error) { +func (s *NilStorage) Sub(_ context.Context, _ string) (res chan LogItem, err error) { return } -func (s *NilStorage) GetState(ctx context.Context, id string) (state *JobState, err error) { +func (s *NilStorage) GetState(_ context.Context, _ string) (state *State, err error) { return nil, nil } diff --git a/services/obfuscator/obfuscator.go b/services/obfuscator/obfuscator.go index 7144711..d985fc4 100644 --- a/services/obfuscator/obfuscator.go +++ b/services/obfuscator/obfuscator.go @@ -4,7 +4,6 @@ package obfuscator import ( "fmt" - "regexp" "strconv" "strings" ) @@ -44,32 +43,12 @@ func (o Obfuscator) encodeIt() string { for _, c := range o.code { parsed := strconv.FormatInt(int64(c)+int64(o.interval), o.option) - str += fmt.Sprint(o.hashIt(string(parsed)), string(o.mask[o.option])) + str += fmt.Sprint(o.hashIt(parsed), string(o.mask[o.option])) } return str } -func cleanJs(code string) string { - searchPatterns := []*regexp.Regexp{ - regexp.MustCompile(`/\>[^\S ]+/s`), - regexp.MustCompile(`/[^\S ]+\/`)} - - replacePatterns := []string{ - `>`, - `<`, - `\\1`, - ``} - - for i, sp := range searchPatterns { - code = sp.ReplaceAllString(code, replacePatterns[i]) - } - - return code -} - func getMask() string { charSet := strShuffle("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") return charSet[0:9] diff --git a/services/template/template.go b/services/template/template.go index 7b2f6a0..915d97e 100644 --- a/services/template/template.go +++ b/services/template/template.go @@ -40,7 +40,7 @@ type View struct { } func (s *View) makeTemplate() (t *template.Template, err error) { - templates := []string{} + var templates []string if s.LayoutBody != "" { t, err = template.New(s.Name).Parse(s.LayoutBody) if err != nil { @@ -95,7 +95,7 @@ type Context struct { Err error } -func NewContext(c *gin.Context, obj any, err error) any { +func NewContext(_ *gin.Context, obj any, err error) any { return &Context{ Data: obj, Err: err, @@ -159,7 +159,7 @@ func (s *Manager) getFiles(pattern string) ([]string, error) { if err != nil { return nil, err } - res := []string{} + var res []string for _, l := range g { f, _ := os.Stat(l) if f.IsDir() { @@ -316,12 +316,12 @@ func (s *Template) HTML(code int, context *gin.Context, obj any) { s.HTMLWithErr(nil, code, context, obj) } -func (s *Template) HTMLWithErr(err error, code int, context *gin.Context, obj any) { +func (s *Template) HTMLWithErr(err error, code int, c *gin.Context, obj any) { var name string var rerr error - if context.GetHeader("X-Requested-With") == "XMLHttpRequest" { - if context.GetHeader("X-Layout") != "" { - name, rerr = s.tm.RenderViewByNameAndLayoutBody(s.name, context.GetHeader("X-Layout")) + if c.GetHeader("X-Requested-With") == "XMLHttpRequest" { + if c.GetHeader("X-Layout") != "" { + name, rerr = s.tm.RenderViewByNameAndLayoutBody(s.name, c.GetHeader("X-Layout")) if rerr != nil { panic(rerr) } @@ -332,8 +332,8 @@ func (s *Template) HTMLWithErr(err error, code int, context *gin.Context, obj an panic(rerr) } } - context.Header("X-Template", name) - context.HTML(code, name, s.tm.contextWrapper(context, obj, err)) + c.Header("X-Template", name) + c.HTML(code, name, s.tm.contextWrapper(c, obj, err)) } func (s *Template) ToString(c *gin.Context, obj any) (res string, err error) { @@ -397,9 +397,9 @@ type Builder interface { Build(name string) *Template } -func (m *Manager) WithLayout(name string) *BuilderWithLayout { +func (s *Manager) WithLayout(name string) *BuilderWithLayout { return &BuilderWithLayout{ - tm: m, + tm: s, layout: name, } diff --git a/services/web/action/handler.go b/services/web/action/handler.go index ab7c30a..fce65f3 100644 --- a/services/web/action/handler.go +++ b/services/web/action/handler.go @@ -1,16 +1,12 @@ package action import ( - "context" - "net/http" - "time" - m "github.com/webtor-io/web-ui-v2/services/models" + "net/http" "github.com/gin-gonic/gin" "github.com/pkg/errors" - "github.com/urfave/cli" - api "github.com/webtor-io/web-ui-v2/services/api" + "github.com/webtor-io/web-ui-v2/services/api" "github.com/webtor-io/web-ui-v2/services/job" "github.com/webtor-io/web-ui-v2/services/template" wj "github.com/webtor-io/web-ui-v2/services/web/job" @@ -38,7 +34,7 @@ type Handler struct { tb template.Builder } -func RegisterHandler(c *cli.Context, r *gin.Engine, tm *template.Manager, jobs *wj.Handler) { +func RegisterHandler(r *gin.Engine, tm *template.Manager, jobs *wj.Handler) { h := &Handler{ tb: tm.MustRegisterViews("action/*").WithHelper(NewHelper()), jobs: jobs, @@ -61,25 +57,25 @@ func RegisterHandler(c *cli.Context, r *gin.Engine, tm *template.Manager, jobs * r.PUT("/stream-video/subtitle", func(c *gin.Context) { a := TrackPutArgs{} if err := c.BindJSON(&a); err != nil { - c.Error(err) + _ = c.Error(err) return } vsud := m.NewVideoStreamUserData(a.ResourceID, a.ItemID, nil) vsud.SubtitleID = a.ID if err := vsud.UpdateSessionData(c); err != nil { - c.Error(err) + _ = c.Error(err) } }) r.PUT("/stream-video/audio", func(c *gin.Context) { a := TrackPutArgs{} if err := c.BindJSON(&a); err != nil { - c.Error(err) + _ = c.Error(err) return } vsud := m.NewVideoStreamUserData(a.ResourceID, a.ItemID, nil) vsud.AudioID = a.ID if err := vsud.UpdateSessionData(c); err != nil { - c.Error(err) + _ = c.Error(err) } }) } @@ -103,10 +99,10 @@ func (s *Handler) bindPostArgs(c *gin.Context) (*PostArgs, error) { func (s *Handler) post(c *gin.Context, action string) { var ( - d PostData - err error - args *PostArgs - job *job.Job + d PostData + err error + args *PostArgs + actionJob *job.Job ) postTpl := s.tb.Build("action/post") args, err = s.bindPostArgs(c) @@ -115,12 +111,11 @@ func (s *Handler) post(c *gin.Context, action string) { return } d.Args = args - ctx, _ := context.WithTimeout(context.Background(), 5*time.Minute) - job, err = s.jobs.Action(ctx, c, args.Claims, args.ResourceID, args.ItemID, action, &m.StreamSettings{}) + actionJob, err = s.jobs.Action(c, args.Claims, args.ResourceID, args.ItemID, action, &m.StreamSettings{}) if err != nil { postTpl.HTMLWithErr(errors.Wrap(err, "failed to start downloading"), http.StatusBadRequest, c, d) return } - d.Job = job + d.Job = actionJob postTpl.HTML(http.StatusOK, c, d) } diff --git a/services/web/action/helpers.go b/services/web/action/helpers.go index e38f182..1de1f7d 100644 --- a/services/web/action/helpers.go +++ b/services/web/action/helpers.go @@ -114,8 +114,8 @@ func (s *Helper) matchLang(lis []ListItem, ud *m.VideoStreamUserData) (lIndex in } } } - langs := []language.Tag{} - for t, _ := range lx { + var langs []language.Tag + for t := range lx { langs = append(langs, t) } matcher := language.NewMatcher(langs) diff --git a/services/web/auth/handler.go b/services/web/auth/handler.go index 9a42530..a1a26cb 100644 --- a/services/web/auth/handler.go +++ b/services/web/auth/handler.go @@ -5,7 +5,6 @@ import ( "github.com/gin-gonic/gin" - "github.com/urfave/cli" "github.com/webtor-io/web-ui-v2/services/template" ) @@ -21,7 +20,7 @@ type Handler struct { tb template.Builder } -func RegisterHandler(c *cli.Context, r *gin.Engine, tm *template.Manager) { +func RegisterHandler(r *gin.Engine, tm *template.Manager) { h := &Handler{ tb: tm.MustRegisterViews("auth/*").WithLayout("main"), } diff --git a/services/web/embed/example/handler.go b/services/web/embed/example/handler.go index 300ecee..79d9395 100644 --- a/services/web/embed/example/handler.go +++ b/services/web/embed/example/handler.go @@ -4,7 +4,6 @@ import ( "net/http" "github.com/gin-gonic/gin" - "github.com/urfave/cli" "github.com/webtor-io/web-ui-v2/services/template" ) @@ -12,7 +11,7 @@ type Handler struct { tb template.Builder } -func RegisterHandler(c *cli.Context, r *gin.Engine, tm *template.Manager) { +func RegisterHandler(r *gin.Engine, tm *template.Manager) { h := &Handler{ tb: tm.MustRegisterViews("embed/example/*").WithLayout("embed/example"), } @@ -20,9 +19,9 @@ func RegisterHandler(c *cli.Context, r *gin.Engine, tm *template.Manager) { r.GET("/embed/example/:name", h.get) } -type ExampleData struct { +type Data struct { } func (s *Handler) get(c *gin.Context) { - s.tb.Build("embed/example/"+c.Param("name")).HTML(http.StatusOK, c, &ExampleData{}) + s.tb.Build("embed/example/"+c.Param("name")).HTML(http.StatusOK, c, &Data{}) } diff --git a/services/web/embed/handler.go b/services/web/embed/handler.go index 8e60618..c768341 100644 --- a/services/web/embed/handler.go +++ b/services/web/embed/handler.go @@ -4,7 +4,6 @@ import ( "net/http" "github.com/gin-gonic/gin" - "github.com/urfave/cli" "github.com/webtor-io/web-ui-v2/services/embed" "github.com/webtor-io/web-ui-v2/services/template" j "github.com/webtor-io/web-ui-v2/services/web/job" @@ -17,7 +16,7 @@ type Handler struct { ds *embed.DomainSettings } -func RegisterHandler(c *cli.Context, hCl *http.Client, r *gin.Engine, tm *template.Manager, jobs *j.Handler, ds *embed.DomainSettings) { +func RegisterHandler(hCl *http.Client, r *gin.Engine, tm *template.Manager, jobs *j.Handler, ds *embed.DomainSettings) { h := &Handler{ tb: tm.MustRegisterViews("embed/*"), jobs: jobs, diff --git a/services/web/embed/post.go b/services/web/embed/post.go index 2109883..159ba53 100644 --- a/services/web/embed/post.go +++ b/services/web/embed/post.go @@ -63,11 +63,11 @@ func (s *Handler) post(c *gin.Context) { } pd.EmbedSettings = args.EmbedSettings pd.DomainSettings = dsd - job, err := s.jobs.Embed(c, s.hCl, args.Claims, args.EmbedSettings) + embedJob, err := s.jobs.Embed(c, s.hCl, args.Claims, args.EmbedSettings) if err != nil { tpl.HTMLWithErr(err, http.StatusBadRequest, c, pd) return } - pd.Job = job + pd.Job = embedJob tpl.HTML(http.StatusAccepted, c, pd) } diff --git a/services/web/helper.go b/services/web/helper.go index 3848af5..94f3789 100644 --- a/services/web/helper.go +++ b/services/web/helper.go @@ -122,8 +122,8 @@ func (s *Helper) Asset(in string) template.HTML { } path := s.assetsHost + "/assets/" + in if !s.Dev() { - h, _ := s.ah.Get(in) - path += "?" + h + hash, _ := s.ah.Get(in) + path += "?" + hash } return template.HTML(fmt.Sprintf(t, path)) } @@ -132,7 +132,7 @@ func (s *Helper) DevAsset(in string) template.HTML { if s.Dev() { return s.Asset("dev/" + in) } - return template.HTML("") + return "" } type AssetHashes struct { @@ -145,11 +145,11 @@ func (s *AssetHashes) get(name string) (hash string, err error) { if err != nil { return "", err } - h := md5.New() - if _, err := io.Copy(h, f); err != nil { + md5Hash := md5.New() + if _, err := io.Copy(md5Hash, f); err != nil { return "", err } - return hex.EncodeToString(h.Sum(nil)), nil + return hex.EncodeToString(md5Hash.Sum(nil)), nil } func (s *AssetHashes) Get(name string) (string, error) { diff --git a/services/web/index/handler.go b/services/web/index/handler.go index 016c900..6b6e6e7 100644 --- a/services/web/index/handler.go +++ b/services/web/index/handler.go @@ -4,18 +4,17 @@ import ( "net/http" "github.com/gin-gonic/gin" - "github.com/urfave/cli" "github.com/webtor-io/web-ui-v2/services/template" ) -type IndexData struct { +type Data struct { } type Handler struct { tb template.Builder } -func RegisterHandler(c *cli.Context, r *gin.Engine, tm *template.Manager) { +func RegisterHandler(r *gin.Engine, tm *template.Manager) { h := &Handler{ tb: tm.MustRegisterViews("*").WithLayout("main"), } @@ -23,5 +22,5 @@ func RegisterHandler(c *cli.Context, r *gin.Engine, tm *template.Manager) { } func (s *Handler) index(c *gin.Context) { - s.tb.Build("index").HTML(http.StatusOK, c, &IndexData{}) + s.tb.Build("index").HTML(http.StatusOK, c, &Data{}) } diff --git a/services/web/job/action.go b/services/web/job/action.go index d09239a..60a1006 100644 --- a/services/web/job/action.go +++ b/services/web/job/action.go @@ -3,6 +3,7 @@ package job import ( "context" "github.com/webtor-io/web-ui-v2/services/models" + "time" "github.com/gin-gonic/gin" @@ -11,8 +12,9 @@ import ( "github.com/webtor-io/web-ui-v2/services/web/job/script" ) -func (s *Handler) Action(ctx context.Context, c *gin.Context, claims *api.Claims, resourceID string, itemID string, action string, settings *models.StreamSettings) (j *job.Job, err error) { +func (s *Handler) Action(c *gin.Context, claims *api.Claims, resourceID string, itemID string, action string, settings *models.StreamSettings) (j *job.Job, err error) { + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute) as, id := script.Action(s.tb, s.api, claims, c, resourceID, itemID, action, settings) - j = s.q.GetOrCreate(action).Enqueue(ctx, id, as) + j = s.q.GetOrCreate(action).Enqueue(ctx, cancel, id, as) return } diff --git a/services/web/job/embed.go b/services/web/job/embed.go index 31d1a1d..32e621f 100644 --- a/services/web/job/embed.go +++ b/services/web/job/embed.go @@ -17,7 +17,7 @@ func (s *Handler) Embed(c *gin.Context, hCl *http.Client, claims *api.Claims, se if err != nil { return } - ctx, _ := context.WithTimeout(context.Background(), 5*time.Minute) - j = s.q.GetOrCreate("embded").Enqueue(ctx, hash, es) + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute) + j = s.q.GetOrCreate("embded").Enqueue(ctx, cancel, hash, es) return } diff --git a/services/web/job/load.go b/services/web/job/load.go index ddfef82..da5e878 100644 --- a/services/web/job/load.go +++ b/services/web/job/load.go @@ -14,8 +14,8 @@ func (s *Handler) Load(claims *api.Claims, args *script.LoadArgs) (j *job.Job, e if err != nil { return } - ctx, _ := context.WithTimeout(context.Background(), 5*time.Minute) - j = s.q.GetOrCreate("load").Enqueue(ctx, hash, job.NewScript(func(j *job.Job) (err error) { + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute) + j = s.q.GetOrCreate("load").Enqueue(ctx, cancel, hash, job.NewScript(func(j *job.Job) (err error) { err = ls.Run(j) if err != nil { return diff --git a/services/web/job/log.go b/services/web/job/log.go index 3c5b895..532dd9e 100644 --- a/services/web/job/log.go +++ b/services/web/job/log.go @@ -10,7 +10,7 @@ import ( func (s *Handler) log(c *gin.Context) { l, err := s.q.GetOrCreate(c.Param("queue_id")).Log(c.Request.Context(), c.Param("job_id")) if err != nil { - c.AbortWithError(http.StatusInternalServerError, err) + _ = c.AbortWithError(http.StatusInternalServerError, err) return } diff --git a/services/web/job/script/action.go b/services/web/job/script/action.go index eb03ec2..85a5090 100644 --- a/services/web/job/script/action.go +++ b/services/web/job/script/action.go @@ -104,13 +104,13 @@ func (s *ActionScript) streamVideo(j *job.Job, c *gin.Context, claims *api.Claim } func (s *ActionScript) renderActionTemplate(j *job.Job, c *gin.Context, sc *StreamContent, name string) error { - template := "action/" + name - tpl := s.tb.Build(template).WithLayoutBody(`{{ template "main" . }}`) + actionTemplate := "action/" + name + tpl := s.tb.Build(actionTemplate).WithLayoutBody(`{{ template "main" . }}`) str, err := tpl.ToString(c, sc) if err != nil { return err } - j.RenderTemplate(template, strings.TrimSpace(str)) + j.RenderTemplate(actionTemplate, strings.TrimSpace(str)) return nil } @@ -171,7 +171,9 @@ func (s *ActionScript) warmUp(j *job.Job, m string, u string, su string, size in if err != nil { return j.Error(err, "failed to start download") } - defer b.Close() + defer func(b io.ReadCloser) { + _ = b.Close() + }(b) _, err = io.Copy(io.Discard, b) @@ -180,7 +182,9 @@ func (s *ActionScript) warmUp(j *job.Job, m string, u string, su string, size in if err != nil { return j.Error(err, "failed to start download") } - defer b2.Close() + defer func(b2 io.ReadCloser) { + _ = b2.Close() + }(b2) _, err = io.Copy(io.Discard, b2) } if err != nil { diff --git a/services/web/job/script/embed.go b/services/web/job/script/embed.go index 8dd57ba..69e8de9 100644 --- a/services/web/job/script/embed.go +++ b/services/web/job/script/embed.go @@ -52,7 +52,9 @@ func (s *EmbedScript) makeLoadArgs(settings *models.EmbedSettings) (*LoadArgs, e if err != nil { return nil, err } - defer resp.Body.Close() + defer func(Body io.ReadCloser) { + _ = Body.Close() + }(resp.Body) body, err := io.ReadAll(resp.Body) if err != nil { return nil, err diff --git a/services/web/job/script/load.go b/services/web/job/script/load.go index 5f10ff9..50f9d1a 100644 --- a/services/web/job/script/load.go +++ b/services/web/job/script/load.go @@ -4,6 +4,7 @@ import ( "context" "crypto/sha1" "fmt" + "github.com/pkg/errors" "strings" "time" @@ -43,6 +44,9 @@ func (s *LoadScript) Run(j *job.Job) (err error) { if err != nil { return err } + if res == nil { + return errors.New("resource not found") + } j.Context = context.WithValue(j.Context, "respID", res.ID) return } @@ -61,11 +65,11 @@ func (s *LoadScript) storeFile(j *job.Job, file []byte) (res *ra.ResourceRespons func (s *LoadScript) storeQuery(j *job.Job, query string) (res *ra.ResourceResponse, err error) { j.InProgress("checking magnet") - sha1 := services.SHA1R.Find([]byte(query)) - if sha1 == nil { + sha1Hash := services.SHA1R.Find([]byte(query)) + if sha1Hash == nil { return nil, j.Error(err, "wrong resource provided") } - hash := strings.ToLower(string(sha1)) + hash := strings.ToLower(string(sha1Hash)) if !strings.HasPrefix(query, "magnet:") { query = "magnet:?xt=urn:btih:" + hash } diff --git a/services/web/profile/handler.go b/services/web/profile/handler.go index f3167a8..c2ed3e3 100644 --- a/services/web/profile/handler.go +++ b/services/web/profile/handler.go @@ -4,17 +4,16 @@ import ( "net/http" "github.com/gin-gonic/gin" - "github.com/urfave/cli" "github.com/webtor-io/web-ui-v2/services/template" ) -type ProfileData struct{} +type Data struct{} type Handler struct { tb template.Builder } -func RegisterHandler(c *cli.Context, r *gin.Engine, tm *template.Manager) { +func RegisterHandler(r *gin.Engine, tm *template.Manager) { h := &Handler{ tb: tm.MustRegisterViews("profile/*").WithLayout("main"), } @@ -22,5 +21,5 @@ func RegisterHandler(c *cli.Context, r *gin.Engine, tm *template.Manager) { } func (s *Handler) get(c *gin.Context) { - s.tb.Build("profile/get").HTML(http.StatusOK, c, &ProfileData{}) + s.tb.Build("profile/get").HTML(http.StatusOK, c, &Data{}) } diff --git a/services/web/resource/get.go b/services/web/resource/get.go index bacaf41..4d6cf7b 100644 --- a/services/web/resource/get.go +++ b/services/web/resource/get.go @@ -56,7 +56,7 @@ func (s *Handler) bindGetArgs(c *gin.Context) (*GetArgs, error) { } func (s *Handler) getList(ctx context.Context, args *GetArgs) (l *ra.ListResponse, err error) { - limit := uint(args.PageSize) + limit := args.PageSize offset := (args.Page - 1) * args.PageSize l, err = s.api.ListResourceContent(ctx, args.Claims, args.ID, &api.ListResourceContentArgs{ Output: api.OutputTree, diff --git a/services/web/resource/handler.go b/services/web/resource/handler.go index 0f0ae2b..51bc465 100644 --- a/services/web/resource/handler.go +++ b/services/web/resource/handler.go @@ -2,7 +2,6 @@ package resource import ( "github.com/gin-gonic/gin" - "github.com/urfave/cli" "github.com/webtor-io/web-ui-v2/services/api" "github.com/webtor-io/web-ui-v2/services/template" j "github.com/webtor-io/web-ui-v2/services/web/job" @@ -14,8 +13,8 @@ type Handler struct { tb template.Builder } -func RegisterHandler(c *cli.Context, r *gin.Engine, tm *template.Manager, api *api.Api, jobs *j.Handler) { - helper := NewHelper(c) +func RegisterHandler(r *gin.Engine, tm *template.Manager, api *api.Api, jobs *j.Handler) { + helper := NewHelper() h := &Handler{ api: api, jobs: jobs, diff --git a/services/web/resource/helpers.go b/services/web/resource/helpers.go index 18b6c3c..f1fdf3a 100644 --- a/services/web/resource/helpers.go +++ b/services/web/resource/helpers.go @@ -5,7 +5,6 @@ import ( "strings" h "github.com/dustin/go-humanize" - "github.com/urfave/cli" ra "github.com/webtor-io/rest-api/services" w "github.com/webtor-io/web-ui-v2/services/web" ) @@ -167,6 +166,6 @@ func (s *Helper) MakePagination(lr *ra.ListResponse, page uint, pageSize uint) [ type Helper struct { } -func NewHelper(c *cli.Context) *Helper { +func NewHelper() *Helper { return &Helper{} } diff --git a/services/web/resource/post.go b/services/web/resource/post.go index e28474f..b689efa 100644 --- a/services/web/resource/post.go +++ b/services/web/resource/post.go @@ -2,6 +2,7 @@ package resource import ( "io" + "mime/multipart" "net/http" "github.com/pkg/errors" @@ -43,7 +44,9 @@ func (s *Handler) bindPostArgs(c *gin.Context) (*PostArgs, error) { if err != nil { return nil, err } - defer f.Close() + defer func(f multipart.File) { + _ = f.Close() + }(f) fd, err = io.ReadAll(f) if err != nil { return nil, err @@ -65,10 +68,10 @@ type PostData struct { func (s *Handler) post(c *gin.Context) { indexTpl := s.tb.Build("index") var ( - d PostData - err error - args *PostArgs - job *job.Job + d PostData + err error + args *PostArgs + loadJob *job.Job ) args, err = s.bindPostArgs(c) d.Args = args @@ -76,7 +79,7 @@ func (s *Handler) post(c *gin.Context) { indexTpl.HTMLWithErr(errors.Wrap(err, "wrong args provided"), http.StatusBadRequest, c, d) return } - job, err = s.jobs.Load(args.Claims, &script.LoadArgs{ + loadJob, err = s.jobs.Load(args.Claims, &script.LoadArgs{ Query: args.Query, File: args.File, }) @@ -84,6 +87,6 @@ func (s *Handler) post(c *gin.Context) { indexTpl.HTMLWithErr(errors.Wrap(err, "failed to load resource"), http.StatusInternalServerError, c, d) return } - d.Job = job + d.Job = loadJob indexTpl.HTML(http.StatusAccepted, c, d) } diff --git a/services/web/web.go b/services/web/web.go index 9af9b5e..dff81c6 100644 --- a/services/web/web.go +++ b/services/web/web.go @@ -58,7 +58,7 @@ func (s *Web) Close() { log.Info("Web closed") }() if s.ln != nil { - s.ln.Close() + _ = s.ln.Close() } }