MSP-8959 update dependencies
This commit is contained in:
1 parent
b819687470
commit
d8c91f3f72
9 files changed
+16
-54
No files matched your search
@@ -1,6 +1,6 @@
|
||||
module isp-admin-service
|
||||
|
||||
go 1.26.0
|
||||
go 1.27
|
||||
|
||||
require (
|
||||
github.com/Masterminds/squirrel v1.5.4
|
||||
@@ -8,7 +8,7 @@ require (
|
||||
github.com/iancoleman/strcase v0.3.0
|
||||
github.com/stretchr/testify v1.12.1
|
||||
github.com/txix-open/bgjob v1.6.0
|
||||
github.com/txix-open/isp-kit v1.74.1
|
||||
github.com/txix-open/isp-kit v1.75.0
|
||||
github.com/txix-open/jsonschema v1.3.0
|
||||
golang.org/x/crypto v0.55.0
|
||||
golang.org/x/sync v0.22.0
|
||||
|
||||
@@ -153,8 +153,8 @@ github.com/txix-open/etp/v4 v4.1.3 h1:u9ZyU2yKGgoQ1/DSaElhazWm8xASdqGEdWjoJ2xQlf
|
||||
github.com/txix-open/etp/v4 v4.1.3/go.mod h1:9GK+Aje8BmLFq8Hk4j6Qb976LdU9WECCWAuLK1vAKgM=
|
||||
github.com/txix-open/grmq v1.12.0 h1:lSPYvwLfTL0+b0xDQmuuN6RaKS3NCEJNK9ccWpOWa8Y=
|
||||
github.com/txix-open/grmq v1.12.0/go.mod h1:6m9CCTQao/HAFalu5rFOZGJ5KLEP6WzzIwj80Ml3KGE=
|
||||
github.com/txix-open/isp-kit v1.74.1 h1:2WQl1+e6E1TXcgkm554kYpiyORgZiyJa/zQIks4cUCw=
|
||||
github.com/txix-open/isp-kit v1.74.1/go.mod h1:i4g+hgfVQAXa02kHqr104TqYEsiW2em17RZF0KjkB78=
|
||||
github.com/txix-open/isp-kit v1.75.0 h1:0/qJoDTyjsVkQTCsQ7FAilKo7a5Y5pDI4tfMXloHYCg=
|
||||
github.com/txix-open/isp-kit v1.75.0/go.mod h1:LEBYertzXLJ3gSuxjeJTUcSGLtf28PZWDHFH9lccCHk=
|
||||
github.com/txix-open/jsonschema v1.3.0 h1:XGuOTg22G7PdqfKypjajM20/i5FyGfFYsJKmheebKi4=
|
||||
github.com/txix-open/jsonschema v1.3.0/go.mod h1:l8YDZ1nvJrw6uxWowSVOxCV/ebiMJyapffW87ZEqH00=
|
||||
github.com/txix-open/validator/v10 v10.0.0-20250506161033-f8ce404fffdb h1:UJgT4u/QMv5QHKOQeJ7igShHa36c2/vIRqJiRLdDlf0=
|
||||
|
||||
+3
-2
@@ -2,6 +2,7 @@ package handler
|
||||
|
||||
import (
|
||||
"context"
|
||||
"slices"
|
||||
|
||||
"github.com/txix-open/bgjob"
|
||||
)
|
||||
@@ -38,8 +39,8 @@ type Sync struct {
|
||||
// will be the outermost wrapper.
|
||||
func NewSync(adapter SyncHandlerAdapter, middlewares ...Middleware) Sync {
|
||||
s := Sync{}
|
||||
for i := len(middlewares) - 1; i >= 0; i-- {
|
||||
adapter = middlewares[i](adapter)
|
||||
for _, middleware := range slices.Backward(middlewares) {
|
||||
adapter = middleware(adapter)
|
||||
}
|
||||
s.handler = adapter
|
||||
return s
|
||||
|
||||
+3
-2
@@ -7,6 +7,7 @@ package client
|
||||
|
||||
import (
|
||||
"context"
|
||||
"slices"
|
||||
"strings"
|
||||
"sync/atomic"
|
||||
|
||||
@@ -96,8 +97,8 @@ func New(initialHosts []string, opts ...Option) (*Client, error) {
|
||||
cli.grpcCli = grpcCli
|
||||
|
||||
roundTripper := cli.do
|
||||
for i := len(cli.middlewares) - 1; i >= 0; i-- {
|
||||
roundTripper = cli.middlewares[i](roundTripper)
|
||||
for _, v := range slices.Backward(cli.middlewares) {
|
||||
roundTripper = v(roundTripper)
|
||||
}
|
||||
cli.roundTripper = roundTripper
|
||||
|
||||
|
||||
+3
-2
@@ -8,6 +8,7 @@ import (
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"slices"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -289,8 +290,8 @@ func defaultTransportDialContext(dialer *net.Dialer) func(context.Context, strin
|
||||
// nolint:ireturn
|
||||
func joinMiddlewares(root RoundTripper, mws ...Middleware) RoundTripper {
|
||||
roundTripper := root
|
||||
for i := len(mws) - 1; i >= 0; i-- {
|
||||
roundTripper = mws[i](roundTripper)
|
||||
for _, mw := range slices.Backward(mws) {
|
||||
roundTripper = mw(roundTripper)
|
||||
}
|
||||
return roundTripper
|
||||
}
|
||||
+1
-1
@@ -27,7 +27,7 @@ func LogLevelForError(err error) log.Level {
|
||||
// It uses LogLevelForError to determine the log level and returns the corresponding Logger method.
|
||||
func LogLevelFuncForError(err error, logger log.Logger) func(ctx context.Context, message any, fields ...log.Field) {
|
||||
logLevel := LogLevelForError(err)
|
||||
switch logLevel {
|
||||
switch logLevel { //nolint:exhaustive
|
||||
case log.ErrorLevel:
|
||||
return logger.Error
|
||||
case log.WarnLevel:
|
||||
|
||||
-5
@@ -8,14 +8,9 @@
|
||||
|
||||
Проверяет, что удалённая конфигурация соответствует сгенерированной JSON-схеме и проходит валидацию.
|
||||
|
||||
* Проверяет отсутствие устаревшего тега `valid`
|
||||
* Проверяет соответствие структуры JSON-схеме
|
||||
* Выполняет валидацию значений с помощью `validator.Default`
|
||||
|
||||
### `FindTag[T any](v T, tag string) bool`
|
||||
|
||||
Рекурсивно проверяет, содержит ли структура тег с указанным именем.
|
||||
|
||||
## Usage
|
||||
|
||||
### Example usage in test
|
||||
|
||||
-36
@@ -5,7 +5,6 @@ package rct
|
||||
|
||||
import (
|
||||
"os"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
@@ -21,7 +20,6 @@ import (
|
||||
// validator tag validation.
|
||||
//
|
||||
// The function checks:
|
||||
// - No deprecated 'valid' tags are present
|
||||
// - The default configuration file is valid against the generated schema
|
||||
// - The configuration can be unmarshaled from the file
|
||||
// - The configuration passes validation
|
||||
@@ -30,9 +28,6 @@ import (
|
||||
func Test[T any](t *testing.T, defaultRemoteConfigPath string, remoteConfig T) {
|
||||
require := require.New(t)
|
||||
|
||||
validatorTag := "valid"
|
||||
require.Falsef(FindTag(remoteConfig, validatorTag), "'%s' tag is not longer supported, you must use https://github.com/go-playground/validator", validatorTag)
|
||||
|
||||
defaultRemoteConfig, err := os.ReadFile(defaultRemoteConfigPath)
|
||||
require.NoError(err)
|
||||
|
||||
@@ -58,34 +53,3 @@ func Test[T any](t *testing.T, defaultRemoteConfigPath string, remoteConfig T) {
|
||||
err = validator.Default.ValidateToError(remoteConfig)
|
||||
require.NoError(err)
|
||||
}
|
||||
|
||||
// FindTag recursively searches a type for the specified struct tag.
|
||||
// It traverses structs, maps, arrays, and slices to find any field
|
||||
// that has the given tag. Returns true if the tag is found.
|
||||
func FindTag[T any](v T, tag string) bool {
|
||||
t := reflect.TypeOf(v)
|
||||
if t == nil {
|
||||
return false
|
||||
}
|
||||
queue := []reflect.Type{t}
|
||||
for len(queue) > 0 {
|
||||
cur := queue[0]
|
||||
queue = queue[1:]
|
||||
if cur.Kind() == reflect.Ptr {
|
||||
cur = cur.Elem()
|
||||
}
|
||||
// nolint:exhaustive
|
||||
switch cur.Kind() {
|
||||
case reflect.Struct:
|
||||
for field := range cur.Fields() {
|
||||
if field.Tag.Get(tag) != "" {
|
||||
return true
|
||||
}
|
||||
queue = append(queue, field.Type)
|
||||
}
|
||||
case reflect.Map, reflect.Array, reflect.Slice:
|
||||
queue = append(queue, cur.Elem())
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
Vendored
+2
-2
@@ -213,8 +213,8 @@ github.com/txix-open/etp/v4/bpool
|
||||
github.com/txix-open/etp/v4/internal
|
||||
github.com/txix-open/etp/v4/msg
|
||||
github.com/txix-open/etp/v4/store
|
||||
# github.com/txix-open/isp-kit v1.74.1
|
||||
## explicit; go 1.26.0
|
||||
# github.com/txix-open/isp-kit v1.75.0
|
||||
## explicit; go 1.27
|
||||
github.com/txix-open/isp-kit/app
|
||||
github.com/txix-open/isp-kit/bgjobx
|
||||
github.com/txix-open/isp-kit/bgjobx/handler
|
||||
|
||||
Reference in new issue
Block a user