Package context:

- gin: apply change following bumping gin (move value from interface{} to any, move key from string to any)

Package Database:
- gorm: removing clickhouse driver following cve and no update since publicated

Other:
- bump dependencies
This commit is contained in:
Nicolas JUHEL
2025-09-26 11:21:22 +02:00
parent 85df1023d9
commit 2a1ecadf01
5 changed files with 81 additions and 104 deletions

View File

@@ -43,20 +43,20 @@ type GinTonic interface {
CancelOnSignal(s ...os.Signal)
//gin context metadata
Set(key string, value interface{})
Get(key string) (value interface{}, exists bool)
MustGet(key string) interface{}
GetString(key string) (s string)
GetBool(key string) (b bool)
GetInt(key string) (i int)
GetInt64(key string) (i64 int64)
GetFloat64(key string) (f64 float64)
GetTime(key string) (t time.Time)
GetDuration(key string) (d time.Duration)
GetStringSlice(key string) (ss []string)
GetStringMap(key string) (sm map[string]interface{})
GetStringMapString(key string) (sms map[string]string)
GetStringMapStringSlice(key string) (smss map[string][]string)
Set(key any, value any)
Get(key any) (value any, exists bool)
MustGet(key any) any
GetString(key any) (s string)
GetBool(key any) (b bool)
GetInt(key any) (i int)
GetInt64(key any) (i64 int64)
GetFloat64(key any) (f64 float64)
GetTime(key any) (t time.Time)
GetDuration(key any) (d time.Duration)
GetStringSlice(key any) (ss []string)
GetStringMap(key any) (sm map[string]any)
GetStringMapString(key any) (sms map[string]string)
GetStringMapStringSlice(key any) (smss map[string][]string)
SetLogger(log liblog.FuncLog)
}
@@ -67,7 +67,7 @@ func New(c *ginsdk.Context, log liblog.FuncLog) GinTonic {
Request: nil,
Writer: nil,
Params: make(ginsdk.Params, 0),
Keys: make(map[string]interface{}),
Keys: make(map[any]any),
Errors: make([]*ginsdk.Error, 0),
Accepted: make([]string, 0),
}

View File

@@ -48,7 +48,7 @@ func (c *ctxGinTonic) SetLogger(fct liblog.FuncLog) {
c.l = fct
}
func (c *ctxGinTonic) log(lvl loglvl.Level, msg string, args ...interface{}) {
func (c *ctxGinTonic) log(lvl loglvl.Level, msg string, args ...any) {
if c.l != nil {
c.l().Entry(lvl, msg, args...).Log()
} else {
@@ -89,7 +89,7 @@ func (c *ctxGinTonic) Err() error {
return c.x.Err()
}
func (c *ctxGinTonic) Value(key interface{}) interface{} {
func (c *ctxGinTonic) Value(key any) any {
return c.g.Value(key)
}
@@ -97,58 +97,58 @@ func (c *ctxGinTonic) GinContext() *ginsdk.Context {
return c.g
}
func (c *ctxGinTonic) Set(key string, value interface{}) {
func (c *ctxGinTonic) Set(key any, value any) {
c.g.Set(key, value)
}
func (c *ctxGinTonic) Get(key string) (value interface{}, exists bool) {
func (c *ctxGinTonic) Get(key any) (value any, exists bool) {
return c.g.Get(key)
}
func (c *ctxGinTonic) MustGet(key string) interface{} {
func (c *ctxGinTonic) MustGet(key any) any {
return c.g.MustGet(key)
}
func (c *ctxGinTonic) GetString(key string) (s string) {
func (c *ctxGinTonic) GetString(key any) (s string) {
return c.g.GetString(key)
}
func (c *ctxGinTonic) GetBool(key string) (b bool) {
func (c *ctxGinTonic) GetBool(key any) (b bool) {
return c.g.GetBool(key)
}
func (c *ctxGinTonic) GetInt(key string) (i int) {
func (c *ctxGinTonic) GetInt(key any) (i int) {
return c.g.GetInt(key)
}
func (c *ctxGinTonic) GetInt64(key string) (i64 int64) {
func (c *ctxGinTonic) GetInt64(key any) (i64 int64) {
return c.g.GetInt64(key)
}
func (c *ctxGinTonic) GetFloat64(key string) (f64 float64) {
func (c *ctxGinTonic) GetFloat64(key any) (f64 float64) {
return c.g.GetFloat64(key)
}
func (c *ctxGinTonic) GetTime(key string) (t time.Time) {
func (c *ctxGinTonic) GetTime(key any) (t time.Time) {
return c.g.GetTime(key)
}
func (c *ctxGinTonic) GetDuration(key string) (d time.Duration) {
func (c *ctxGinTonic) GetDuration(key any) (d time.Duration) {
return c.g.GetDuration(key)
}
func (c *ctxGinTonic) GetStringSlice(key string) (ss []string) {
func (c *ctxGinTonic) GetStringSlice(key any) (ss []string) {
return c.g.GetStringSlice(key)
}
func (c *ctxGinTonic) GetStringMap(key string) (sm map[string]interface{}) {
func (c *ctxGinTonic) GetStringMap(key any) (sm map[string]any) {
return c.g.GetStringMap(key)
}
func (c *ctxGinTonic) GetStringMapString(key string) (sms map[string]string) {
func (c *ctxGinTonic) GetStringMapString(key any) (sms map[string]string) {
return c.g.GetStringMapString(key)
}
func (c *ctxGinTonic) GetStringMapStringSlice(key string) (smss map[string][]string) {
func (c *ctxGinTonic) GetStringMapStringSlice(key any) (smss map[string][]string) {
return c.g.GetStringMapStringSlice(key)
}

View File

@@ -32,7 +32,6 @@ package gorm
import (
"strings"
drvclk "gorm.io/driver/clickhouse"
drvmys "gorm.io/driver/mysql"
drvpsq "gorm.io/driver/postgres"
drvsql "gorm.io/driver/sqlite"
@@ -46,7 +45,6 @@ const (
DriverPostgreSQL = "psql"
DriverSQLite = "sqlite"
DriverSQLServer = "sqlserver"
DriverClikHouse = "clickhouse"
)
type Driver string
@@ -66,9 +64,6 @@ func DriverFromString(drv string) Driver {
case strings.ToLower(DriverSQLServer):
return DriverSQLServer
case strings.ToLower(DriverClikHouse):
return DriverClikHouse
default:
return DriverNone
}
@@ -93,9 +88,6 @@ func (d Driver) Dialector(dsn string) gormdb.Dialector {
case DriverSQLServer:
return drvsrv.Open(dsn)
case DriverClikHouse:
return drvclk.Open(dsn)
default:
return nil
}

View File

@@ -32,7 +32,6 @@ package gorm
import (
"strings"
drvclk "gorm.io/driver/clickhouse"
drvmys "gorm.io/driver/mysql"
drvpsq "gorm.io/driver/postgres"
drvsrv "gorm.io/driver/sqlserver"
@@ -44,7 +43,6 @@ const (
DriverMysql = "mysql"
DriverPostgreSQL = "psql"
DriverSQLServer = "sqlserver"
DriverClikHouse = "clickhouse"
)
type Driver string
@@ -61,9 +59,6 @@ func DriverFromString(drv string) Driver {
case strings.ToLower(DriverSQLServer):
return DriverSQLServer
case strings.ToLower(DriverClikHouse):
return DriverClikHouse
default:
return DriverNone
}
@@ -85,9 +80,6 @@ func (d Driver) Dialector(dsn string) gormdb.Dialector {
case DriverSQLServer:
return drvsrv.Open(dsn)
case DriverClikHouse:
return drvclk.Open(dsn)
default:
return nil
}

107
go.mod
View File

@@ -6,11 +6,11 @@ toolchain go1.25.0
require (
github.com/aws/aws-sdk-go v1.55.8
github.com/aws/aws-sdk-go-v2 v1.38.3
github.com/aws/aws-sdk-go-v2/config v1.31.6
github.com/aws/aws-sdk-go-v2/credentials v1.18.10
github.com/aws/aws-sdk-go-v2/service/iam v1.47.3
github.com/aws/aws-sdk-go-v2/service/s3 v1.87.3
github.com/aws/aws-sdk-go-v2 v1.39.1
github.com/aws/aws-sdk-go-v2/config v1.31.10
github.com/aws/aws-sdk-go-v2/credentials v1.18.14
github.com/aws/aws-sdk-go-v2/service/iam v1.47.6
github.com/aws/aws-sdk-go-v2/service/s3 v1.88.2
github.com/aws/smithy-go v1.23.0
github.com/bits-and-blooms/bitset v1.24.0
github.com/c-bata/go-prompt v0.2.6
@@ -18,7 +18,7 @@ require (
github.com/fatih/color v1.18.0
github.com/fsnotify/fsnotify v1.9.0
github.com/fxamacker/cbor/v2 v2.9.0
github.com/gin-gonic/gin v1.10.1
github.com/gin-gonic/gin v1.11.0
github.com/go-ldap/ldap/v3 v3.4.11
github.com/go-playground/validator/v10 v10.27.0
github.com/go-viper/mapstructure/v2 v2.4.0
@@ -33,76 +33,70 @@ require (
github.com/mitchellh/go-homedir v1.1.0
github.com/mitchellh/mapstructure v1.5.0
github.com/nats-io/jwt/v2 v2.8.0
github.com/nats-io/nats-server/v2 v2.11.8
github.com/nats-io/nats.go v1.45.0
github.com/onsi/ginkgo/v2 v2.25.2
github.com/nats-io/nats-server/v2 v2.12.0
github.com/nats-io/nats.go v1.46.0
github.com/onsi/ginkgo/v2 v2.25.3
github.com/onsi/gomega v1.38.2
github.com/pelletier/go-toml v1.9.5
github.com/pelletier/go-toml/v2 v2.2.4
github.com/pierrec/lz4/v4 v4.1.22
github.com/prometheus/client_golang v1.23.0
github.com/prometheus/client_golang v1.23.2
github.com/shirou/gopsutil v3.21.11+incompatible
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.9.1
github.com/spf13/cobra v1.10.1
github.com/spf13/jwalterweatherman v1.1.0
github.com/spf13/viper v1.20.1
github.com/spf13/viper v1.21.0
github.com/ugorji/go/codec v1.3.0
github.com/ulikunitz/xz v0.5.15
github.com/vbauerster/mpb/v8 v8.10.2
github.com/xanzy/go-gitlab v0.115.0
github.com/xhit/go-simple-mail v2.2.2+incompatible
golang.org/x/net v0.43.0
golang.org/x/oauth2 v0.30.0
golang.org/x/sync v0.16.0
golang.org/x/sys v0.35.0
golang.org/x/term v0.34.0
golang.org/x/net v0.44.0
golang.org/x/oauth2 v0.31.0
golang.org/x/sync v0.17.0
golang.org/x/sys v0.36.0
golang.org/x/term v0.35.0
gopkg.in/yaml.v3 v3.0.1
gorm.io/driver/clickhouse v0.7.0
gorm.io/driver/mysql v1.6.0
gorm.io/driver/postgres v1.6.0
gorm.io/driver/sqlite v1.6.0
gorm.io/driver/sqlserver v1.6.1
gorm.io/gorm v1.30.2
gorm.io/gorm v1.31.0
)
require (
filippo.io/edwards25519 v1.1.0 // indirect
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect
github.com/ClickHouse/ch-go v0.61.5 // indirect
github.com/ClickHouse/clickhouse-go/v2 v2.30.0 // indirect
github.com/Masterminds/semver v1.4.2 // indirect
github.com/Masterminds/semver/v3 v3.4.0 // indirect
github.com/Masterminds/sprig v2.16.0+incompatible // indirect
github.com/PuerkitoBio/goquery v1.5.0 // indirect
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect
github.com/andybalholm/brotli v1.1.1 // indirect
github.com/andybalholm/cascadia v1.0.0 // indirect
github.com/antithesishq/antithesis-sdk-go v0.4.3-default-no-op // indirect
github.com/aokoli/goutils v1.0.1 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.1 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.6 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.6 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.6 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.8 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.8 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.8 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.6 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.8 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.1 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.6 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.6 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.6 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.29.1 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.34.2 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.38.2 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.8 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.8 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.8 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.29.4 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.0 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.38.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bytedance/sonic v1.11.6 // indirect
github.com/bytedance/sonic/loader v0.1.1 // indirect
github.com/bytedance/sonic v1.14.0 // indirect
github.com/bytedance/sonic/loader v0.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/cloudwego/base64x v0.1.6 // indirect
github.com/gabriel-vasile/mimetype v1.4.8 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/gin-contrib/sse v1.1.0 // indirect
github.com/go-asn1-ber/asn1-ber v1.5.8-0.20250403174932-29230038a667 // indirect
github.com/go-faster/city v1.0.1 // indirect
github.com/go-faster/errors v0.7.1 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-playground/locales v0.14.1 // indirect
@@ -110,6 +104,7 @@ require (
github.com/go-sql-driver/mysql v1.8.1 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/goccy/go-yaml v1.18.0 // indirect
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
github.com/golang-sql/sqlexp v0.1.0 // indirect
github.com/google/go-cmp v0.7.0 // indirect
@@ -134,7 +129,7 @@ require (
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.18.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
@@ -148,21 +143,19 @@ require (
github.com/nats-io/nkeys v0.4.11 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
github.com/olekukonko/tablewriter v0.0.1 // indirect
github.com/paulmach/orb v0.11.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pkg/term v1.2.0-beta.2 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.65.0 // indirect
github.com/prometheus/common v0.66.1 // indirect
github.com/prometheus/procfs v0.16.1 // indirect
github.com/quic-go/qpack v0.5.1 // indirect
github.com/quic-go/quic-go v0.54.0 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sagikazarmark/locafero v0.7.0 // indirect
github.com/segmentio/asm v1.2.0 // indirect
github.com/shopspring/decimal v1.4.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.12.0 // indirect
github.com/spf13/cast v1.7.1 // indirect
github.com/spf13/pflag v1.0.6 // indirect
github.com/sagikazarmark/locafero v0.11.0 // indirect
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect
github.com/spf13/afero v1.15.0 // indirect
github.com/spf13/cast v1.10.0 // indirect
github.com/spf13/pflag v1.0.10 // indirect
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
@@ -170,15 +163,15 @@ require (
github.com/vanng822/go-premailer v0.0.0-20191214114701-be27abe028fe // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
go.opentelemetry.io/otel v1.29.0 // indirect
go.opentelemetry.io/otel/trace v1.29.0 // indirect
go.uber.org/automaxprocs v1.6.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/mock v0.5.0 // indirect
go.yaml.in/yaml/v2 v2.4.2 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/arch v0.20.0 // indirect
golang.org/x/crypto v0.41.0 // indirect
golang.org/x/text v0.28.0 // indirect
golang.org/x/time v0.12.0 // indirect
golang.org/x/crypto v0.42.0 // indirect
golang.org/x/mod v0.27.0 // indirect
golang.org/x/text v0.29.0 // indirect
golang.org/x/time v0.13.0 // indirect
golang.org/x/tools v0.36.0 // indirect
google.golang.org/protobuf v1.36.8 // indirect
google.golang.org/protobuf v1.36.9 // indirect
)