mirror of
https://github.com/ManyakRus/starter.git
synced 2024-11-21 18:16:31 +02:00
сделал telegram_client.go
This commit is contained in:
parent
c03e2072bd
commit
53f4efc185
@ -40,13 +40,18 @@ CHATGPT_START_TEXT=
|
||||
CHATGPT_END_TEXT=
|
||||
|
||||
EMAIL_SMTP_SERVER=""
|
||||
EMAIL_POP3_SERVER=""
|
||||
EMAIL_IMAP_SERVER=""
|
||||
EMAIL_SMTP_PORT=""
|
||||
EMAIL_POP3_PORT=""
|
||||
EMAIL_IMAP_PORT=""
|
||||
EMAIL_LOGIN=
|
||||
EMAIL_PASSWORD=
|
||||
EMAIL_SEND_TO_TEST=
|
||||
EMAIL_AUTHENTICATION="" #AuthNone, AuthLogin, AuthPlain, AuthCRAMMD5
|
||||
EMAIL_ENCRYPTION="" #EncryptionNone, EncryptionSSL, EncryptionSSLTLS, EncryptionSTARTTLS, EncryptionTLS
|
||||
|
||||
|
||||
TELEGRAM_APP_ID=""
|
||||
TELEGRAM_APP_HASH=""
|
||||
TELEGRAM_PHONE_FROM=""
|
||||
TELEGRAM_PHONE_SEND_TEST=""
|
||||
|
||||
|
1
Makefile
1
Makefile
@ -14,6 +14,7 @@ run:
|
||||
./bin/app_race
|
||||
mod:
|
||||
clear
|
||||
go get -u ./...
|
||||
go mod tidy -compat=1.18
|
||||
go mod vendor
|
||||
go fmt ./...
|
||||
|
@ -49,9 +49,7 @@ var Settings SettingsINI
|
||||
// SettingsINI - структура для хранения всех нужных переменных окружения
|
||||
type SettingsINI struct {
|
||||
EMAIL_SMTP_SERVER string
|
||||
EMAIL_POP3_SERVER string
|
||||
EMAIL_SMTP_PORT string
|
||||
EMAIL_POP3_PORT string
|
||||
EMAIL_LOGIN string
|
||||
EMAIL_PASSWORD string
|
||||
EMAIL_SEND_TO_TEST string
|
||||
@ -275,7 +273,7 @@ func LoadEnv_FromFile(filename string) {
|
||||
|
||||
Settings = SettingsINI{}
|
||||
Settings.EMAIL_SMTP_SERVER = os.Getenv("EMAIL_SMTP_SERVER")
|
||||
Settings.EMAIL_POP3_SERVER = os.Getenv("EMAIL_POP3_SERVER")
|
||||
//Settings.EMAIL_POP3_SERVER = os.Getenv("EMAIL_POP3_SERVER")
|
||||
Settings.EMAIL_SMTP_PORT = os.Getenv("EMAIL_SMTP_PORT")
|
||||
Settings.EMAIL_LOGIN = os.Getenv("EMAIL_LOGIN")
|
||||
Settings.EMAIL_PASSWORD = os.Getenv("EMAIL_PASSWORD")
|
||||
@ -288,9 +286,9 @@ func LoadEnv_FromFile(filename string) {
|
||||
log.Warn("Need fill EMAIL_SMTP_SERVER ! in file ", filename)
|
||||
}
|
||||
|
||||
if Settings.EMAIL_POP3_SERVER == "" {
|
||||
log.Warn("Need fill EMAIL_POP3_SERVER ! in file ", filename)
|
||||
}
|
||||
//if Settings.EMAIL_POP3_SERVER == "" {
|
||||
// log.Warn("Need fill EMAIL_POP3_SERVER ! in file ", filename)
|
||||
//}
|
||||
|
||||
if Settings.EMAIL_SMTP_PORT == "" {
|
||||
log.Panicln("Need fill EMAIL_SMTP_PORT ! in file ", filename)
|
||||
|
94
go.mod
94
go.mod
@ -4,91 +4,107 @@ go 1.18
|
||||
|
||||
require (
|
||||
github.com/ManyakRus/logrus v0.0.0-20230426064230-515895169d22
|
||||
github.com/camunda/zeebe/clients/go/v8 v8.1.8
|
||||
github.com/camunda/zeebe/clients/go/v8 v8.2.5
|
||||
github.com/denisenkom/go-mssqldb v0.12.3
|
||||
github.com/emersion/go-imap v1.2.1
|
||||
github.com/emersion/go-message v0.16.0
|
||||
github.com/gofiber/fiber/v2 v2.42.0
|
||||
github.com/go-faster/errors v0.6.1
|
||||
github.com/gofiber/fiber/v2 v2.46.0
|
||||
github.com/golang-module/carbon/v2 v2.2.3
|
||||
github.com/jackc/pgx/v4 v4.17.2
|
||||
github.com/gotd/contrib v0.17.0
|
||||
github.com/gotd/td v0.82.0
|
||||
github.com/jackc/pgx/v4 v4.18.1
|
||||
github.com/jmoiron/sqlx v1.3.5
|
||||
github.com/joho/godotenv v1.5.1
|
||||
github.com/lib/pq v1.10.7
|
||||
github.com/lib/pq v1.10.9
|
||||
github.com/mattn/go-sqlite3 v1.14.16
|
||||
github.com/mdp/qrterminal/v3 v3.0.0
|
||||
github.com/nats-io/nats.go v1.16.0
|
||||
github.com/sashabaranov/go-openai v1.9.1
|
||||
github.com/segmentio/kafka-go v0.4.39
|
||||
github.com/nats-io/nats.go v1.25.0
|
||||
github.com/sashabaranov/go-openai v1.9.4
|
||||
github.com/segmentio/kafka-go v0.4.40
|
||||
github.com/xhit/go-simple-mail/v2 v2.13.0
|
||||
gitlab.aescorp.ru/dsp_dev/claim/common/object_model v0.0.108
|
||||
go.mau.fi/whatsmeow v0.0.0-20230427180258-7f679583b39b
|
||||
golang.org/x/exp v0.0.0-20230418202329-0354be287a23
|
||||
gorm.io/driver/postgres v1.4.8
|
||||
gorm.io/driver/sqlserver v1.4.2
|
||||
gorm.io/gorm v1.24.5
|
||||
gitlab.aescorp.ru/dsp_dev/claim/common/object_model v1.0.163
|
||||
go.mau.fi/whatsmeow v0.0.0-20230516145702-d5485ef06d61
|
||||
golang.org/x/crypto v0.9.0
|
||||
golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc
|
||||
gorm.io/driver/postgres v1.5.1
|
||||
gorm.io/driver/sqlserver v1.5.0
|
||||
gorm.io/gorm v1.25.1
|
||||
)
|
||||
|
||||
require (
|
||||
filippo.io/edwards25519 v1.0.0 // indirect
|
||||
github.com/andybalholm/brotli v1.0.4 // indirect
|
||||
github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496 // indirect
|
||||
github.com/andybalholm/brotli v1.0.5 // indirect
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
|
||||
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/emersion/go-sasl v0.0.0-20200509203442-7bfe0ed36a21 // indirect
|
||||
github.com/emersion/go-sasl v0.0.0-20220912192320-0145f2c60ead // indirect
|
||||
github.com/emersion/go-textwrapper v0.0.0-20200911093747-65d896831594 // indirect
|
||||
github.com/go-faster/jx v1.0.0 // indirect
|
||||
github.com/go-faster/xor v1.0.0 // indirect
|
||||
github.com/go-ozzo/ozzo-validation/v4 v4.3.0 // indirect
|
||||
github.com/go-test/deep v1.1.0 // indirect
|
||||
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
|
||||
github.com/golang-sql/sqlexp v0.1.0 // indirect
|
||||
github.com/golang/protobuf v1.5.2 // indirect
|
||||
github.com/golang/protobuf v1.5.3 // indirect
|
||||
github.com/google/go-cmp v0.5.9 // indirect
|
||||
github.com/google/uuid v1.3.0 // indirect
|
||||
github.com/gorilla/websocket v1.5.0 // indirect
|
||||
github.com/gotd/ige v0.2.2 // indirect
|
||||
github.com/gotd/neo v0.1.5 // indirect
|
||||
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
|
||||
github.com/jackc/pgconn v1.13.0 // indirect
|
||||
github.com/jackc/pgconn v1.14.0 // indirect
|
||||
github.com/jackc/pgio v1.0.0 // indirect
|
||||
github.com/jackc/pgpassfile v1.0.0 // indirect
|
||||
github.com/jackc/pgproto3/v2 v2.3.1 // indirect
|
||||
github.com/jackc/pgproto3/v2 v2.3.2 // indirect
|
||||
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
|
||||
github.com/jackc/pgtype v1.12.0 // indirect
|
||||
github.com/jackc/pgx/v5 v5.3.0 // indirect
|
||||
github.com/jackc/pgtype v1.14.0 // indirect
|
||||
github.com/jackc/pgx/v5 v5.3.1 // indirect
|
||||
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||
github.com/jinzhu/now v1.1.5 // indirect
|
||||
github.com/klauspost/compress v1.15.9 // indirect
|
||||
github.com/klauspost/compress v1.16.5 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.17 // indirect
|
||||
github.com/mattn/go-isatty v0.0.18 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.14 // indirect
|
||||
github.com/microsoft/go-mssqldb v0.19.0 // indirect
|
||||
github.com/microsoft/go-mssqldb v0.21.0 // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/nats-io/jwt/v2 v2.3.0 // indirect
|
||||
github.com/nats-io/nats-server/v2 v2.8.4 // indirect
|
||||
github.com/nats-io/nkeys v0.3.0 // indirect
|
||||
github.com/nats-io/nkeys v0.4.4 // indirect
|
||||
github.com/nats-io/nuid v1.0.1 // indirect
|
||||
github.com/philhofer/fwd v1.1.1 // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.15 // indirect
|
||||
github.com/philhofer/fwd v1.1.2 // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.17 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/rivo/uniseg v0.2.0 // indirect
|
||||
github.com/rivo/uniseg v0.4.4 // indirect
|
||||
github.com/savsgio/dictpool v0.0.0-20221023140959-7bf2e61cea94 // indirect
|
||||
github.com/savsgio/gotils v0.0.0-20220530130905-52f3993e8d6d // indirect
|
||||
github.com/stretchr/testify v1.8.1 // indirect
|
||||
github.com/tinylib/msgp v1.1.6 // indirect
|
||||
github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee // indirect
|
||||
github.com/segmentio/asm v1.2.0 // indirect
|
||||
github.com/stretchr/testify v1.8.3 // indirect
|
||||
github.com/tinylib/msgp v1.1.8 // indirect
|
||||
github.com/toorop/go-dkim v0.0.0-20201103131630-e1cd1a0a5208 // indirect
|
||||
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||
github.com/valyala/fasthttp v1.44.0 // indirect
|
||||
github.com/valyala/fasthttp v1.47.0 // indirect
|
||||
github.com/valyala/tcplisten v1.0.0 // indirect
|
||||
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
|
||||
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
|
||||
go.mau.fi/libsignal v0.1.0 // indirect
|
||||
golang.org/x/crypto v0.8.0 // indirect
|
||||
golang.org/x/net v0.9.0 // indirect
|
||||
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
|
||||
golang.org/x/sys v0.7.0 // indirect
|
||||
go.opentelemetry.io/otel v1.15.1 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.15.1 // indirect
|
||||
go.uber.org/atomic v1.11.0 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
go.uber.org/zap v1.24.0 // indirect
|
||||
golang.org/x/net v0.10.0 // indirect
|
||||
golang.org/x/oauth2 v0.8.0 // indirect
|
||||
golang.org/x/sync v0.2.0 // indirect
|
||||
golang.org/x/sys v0.8.0 // indirect
|
||||
golang.org/x/term v0.8.0 // indirect
|
||||
golang.org/x/text v0.9.0 // indirect
|
||||
google.golang.org/appengine v1.6.7 // indirect
|
||||
google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f // indirect
|
||||
google.golang.org/grpc v1.49.0 // indirect
|
||||
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
|
||||
google.golang.org/grpc v1.55.0 // indirect
|
||||
google.golang.org/protobuf v1.30.0 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
nhooyr.io/websocket v1.8.7 // indirect
|
||||
rsc.io/qr v0.2.0 // indirect
|
||||
)
|
||||
|
||||
|
594
go.sum
594
go.sum
@ -1,76 +1,32 @@
|
||||
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=
|
||||
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
|
||||
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
|
||||
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
|
||||
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
|
||||
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
|
||||
cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
|
||||
cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4=
|
||||
cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
|
||||
cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc=
|
||||
cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk=
|
||||
cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs=
|
||||
cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc=
|
||||
cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
|
||||
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
|
||||
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
|
||||
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
|
||||
cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
|
||||
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
|
||||
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
|
||||
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
|
||||
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
|
||||
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
|
||||
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
|
||||
cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
|
||||
cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU=
|
||||
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
|
||||
cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
|
||||
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
|
||||
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek=
|
||||
filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.19.0/go.mod h1:h6H6c8enJmmocHUbLiiGY6sx7f9i+X3m1CHdd5c6Rdw=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.2/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.11.0/go.mod h1:HcM1YX14R7CJcghJGOYCgdezslRSVzqwLf/q+4Y2r/0=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.1/go.mod h1:gLa1CL2RNE4s7M3yopJ/p0iq5DdY6Yv5ZUt9MTRZOQM=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v0.7.0/go.mod h1:yqy467j36fJxcRV2TzfVZ1pCb5vxm4BtZPUdYWe/Xo8=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w=
|
||||
github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4=
|
||||
github.com/AzureAD/microsoft-authentication-library-for-go v0.8.1/go.mod h1:4qFor3D/HDsvBME35Xy9rwW9DecL+M2sNw1ybjPtwA0=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
github.com/ManyakRus/logrus v0.0.0-20230426064230-515895169d22 h1:DrHNlqXfwvCpCqn4MfRn4NBtezqWL5GLor3jC7QFPj0=
|
||||
github.com/ManyakRus/logrus v0.0.0-20230426064230-515895169d22/go.mod h1:KbfWJjL1T+JHs/0tdcuqW6CKUakBEQ7oG9u5xpEfbTE=
|
||||
github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
|
||||
github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY=
|
||||
github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
|
||||
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
|
||||
github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496 h1:zV3ejI06GQ59hwDQAvmK1qxOQGB3WuVTRoY0okPTAv0=
|
||||
github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs=
|
||||
github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
|
||||
github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg=
|
||||
github.com/camunda/zeebe/clients/go/v8 v8.1.8 h1:/i3t1PaToPfED+609uNR9kdGo/LPFTE4jK5/SEbwY4Y=
|
||||
github.com/camunda/zeebe/clients/go/v8 v8.1.8/go.mod h1:nQc5qX4lPSxWUW0VuJ+k3b+FdcVLNa29A/nAQG2q9u4=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
|
||||
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
|
||||
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
||||
github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI=
|
||||
github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||
github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
|
||||
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
|
||||
github.com/camunda/zeebe/clients/go/v8 v8.2.5 h1:140au6RwNLOORhPLF27GUgWTqppNh1MZ1wXlMl6XTRA=
|
||||
github.com/camunda/zeebe/clients/go/v8 v8.2.5/go.mod h1:Y6we21faDAKtsEULpzKHV8YP1PkC7RqRanuafrnBoVI=
|
||||
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
|
||||
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
|
||||
github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I=
|
||||
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
|
||||
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
@ -83,36 +39,49 @@ github.com/emersion/go-imap v1.2.1/go.mod h1:Qlx1FSx2FTxjnjWpIlVNEuX+ylerZQNFE5N
|
||||
github.com/emersion/go-message v0.15.0/go.mod h1:wQUEfE+38+7EW8p8aZ96ptg6bAb1iwdgej19uXASlE4=
|
||||
github.com/emersion/go-message v0.16.0 h1:uZLz8ClLv3V5fSFF/fFdW9jXjrZkXIpE1Fn8fKx7pO4=
|
||||
github.com/emersion/go-message v0.16.0/go.mod h1:pDJDgf/xeUIF+eicT6B/hPX/ZbEorKkUMPOxrPVG2eQ=
|
||||
github.com/emersion/go-sasl v0.0.0-20200509203442-7bfe0ed36a21 h1:OJyUGMJTzHTd1XQp98QTaHernxMYzRaOasRir9hUlFQ=
|
||||
github.com/emersion/go-sasl v0.0.0-20200509203442-7bfe0ed36a21/go.mod h1:iL2twTeMvZnrg54ZoPDNfJaJaqy0xIQFuBdrLsmspwQ=
|
||||
github.com/emersion/go-sasl v0.0.0-20220912192320-0145f2c60ead h1:fI1Jck0vUrXT8bnphprS1EoVRe2Q5CKCX8iDlpqjQ/Y=
|
||||
github.com/emersion/go-sasl v0.0.0-20220912192320-0145f2c60ead/go.mod h1:iL2twTeMvZnrg54ZoPDNfJaJaqy0xIQFuBdrLsmspwQ=
|
||||
github.com/emersion/go-textwrapper v0.0.0-20200911093747-65d896831594 h1:IbFBtwoTQyw0fIM5xv1HF+Y+3ZijDR839WMulgxCcUY=
|
||||
github.com/emersion/go-textwrapper v0.0.0-20200911093747-65d896831594/go.mod h1:aqO8z8wPrjkscevZJFVE1wXJrLpC5LtJG7fqLOsPb2U=
|
||||
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
|
||||
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
||||
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
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.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14=
|
||||
github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M=
|
||||
github.com/go-faster/errors v0.6.1 h1:nNIPOBkprlKzkThvS/0YaX8Zs9KewLCOSFQS5BU06FI=
|
||||
github.com/go-faster/errors v0.6.1/go.mod h1:5MGV2/2T9yvlrbhe9pD9LO5Z/2zCSq2T8j+Jpi2LAyY=
|
||||
github.com/go-faster/jx v1.0.0 h1:HE+ms2e6ZGkZ6u13t8u+onBinrPvIPI+0hWXGELm74g=
|
||||
github.com/go-faster/jx v1.0.0/go.mod h1:zm8SlkwK+H0TYNKYtVJ/7cWFS7soJBQWhcPctKyYL/4=
|
||||
github.com/go-faster/xor v0.3.0/go.mod h1:x5CaDY9UKErKzqfRfFZdfu+OSTfoZny3w5Ak7UxcipQ=
|
||||
github.com/go-faster/xor v1.0.0 h1:2o8vTOgErSGHP3/7XwA5ib1FTtUsNtwCoLLBjl31X38=
|
||||
github.com/go-faster/xor v1.0.0/go.mod h1:x5CaDY9UKErKzqfRfFZdfu+OSTfoZny3w5Ak7UxcipQ=
|
||||
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
|
||||
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
|
||||
github.com/go-ozzo/ozzo-validation/v4 v4.3.0 h1:byhDUpfEwjsVQb1vBunvIjh2BHQ9ead57VkAEY4V+Es=
|
||||
github.com/go-ozzo/ozzo-validation/v4 v4.3.0/go.mod h1:2NKgrcHl3z6cJs+3Oo940FPRiTzuqKbvfrL2RxCj6Ew=
|
||||
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
|
||||
github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=
|
||||
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
|
||||
github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no=
|
||||
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
|
||||
github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY=
|
||||
github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI=
|
||||
github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
|
||||
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
|
||||
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
||||
github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg=
|
||||
github.com/go-test/deep v1.1.0/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=
|
||||
github.com/gofiber/fiber/v2 v2.42.0 h1:Fnp7ybWvS+sjNQsFvkhf4G8OhXswvB6Vee8hM/LyS+8=
|
||||
github.com/gofiber/fiber/v2 v2.42.0/go.mod h1:3+SGNjqMh5VQH5Vz2Wdi43zTIV16ktlFd3x3R6O1Zlc=
|
||||
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0=
|
||||
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo=
|
||||
github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8=
|
||||
github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
|
||||
github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo=
|
||||
github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM=
|
||||
github.com/gofiber/fiber/v2 v2.46.0 h1:wkkWotblsGVlLjXj2dpgKQAYHtXumsK/HyFugQM68Ns=
|
||||
github.com/gofiber/fiber/v2 v2.46.0/go.mod h1:DNl0/c37WLe0g92U6lx1VMQuxGUQY5V7EIaVoEsUffc=
|
||||
github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw=
|
||||
github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
|
||||
github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
|
||||
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
|
||||
github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
|
||||
github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
|
||||
github.com/golang-module/carbon/v2 v2.2.3 h1:WvGIc5+qzq9drNzH+Gnjh1TZ0JgDY/IA+m2Dvk7Qm4Q=
|
||||
github.com/golang-module/carbon/v2 v2.2.3/go.mod h1:LdzRApgmDT/wt0eNT8MEJbHfJdSqCtT46uZhfF30dqI=
|
||||
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
|
||||
@ -120,73 +89,36 @@ github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0kt
|
||||
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
|
||||
github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A=
|
||||
github.com/golang-sql/sqlexp v0.1.0/go.mod h1:J4ad9Vo8ZCWQ2GMrC4UCQy1JpCbwU9m3EOqtpKwwwHI=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
|
||||
github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||
github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
|
||||
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
||||
github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
||||
github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
|
||||
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
|
||||
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
|
||||
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
|
||||
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
|
||||
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
|
||||
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 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
|
||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
|
||||
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.4.1/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.1/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.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
||||
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
||||
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||
github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
|
||||
github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
|
||||
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
|
||||
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
|
||||
github.com/gotd/contrib v0.17.0 h1:MA17Wh+MYqTTmhm1hq9XyAJxR4baFfcLncLiTWNqBgI=
|
||||
github.com/gotd/contrib v0.17.0/go.mod h1:jEGfotu+n6c+2jKWUDYdILhsIWWcbXBwXH2Le/ScpEc=
|
||||
github.com/gotd/ige v0.2.2 h1:XQ9dJZwBfDnOGSTxKXBGP4gMud3Qku2ekScRjDWWfEk=
|
||||
github.com/gotd/ige v0.2.2/go.mod h1:tuCRb+Y5Y3eNTo3ypIfNpQ4MFjrnONiL2jN2AKZXmb0=
|
||||
github.com/gotd/neo v0.1.5 h1:oj0iQfMbGClP8xI59x7fE/uHoTJD7NZH9oV1WNuPukQ=
|
||||
github.com/gotd/neo v0.1.5/go.mod h1:9A2a4bn9zL6FADufBdt7tZt+WMhvZoc5gWXihOPoiBQ=
|
||||
github.com/gotd/td v0.82.0 h1:Gnu75MfT7qP7thxwbECJCmRy3KPs2tcHcXFRvcu4Nlk=
|
||||
github.com/gotd/td v0.82.0/go.mod h1:CJlCQ0J1BN5ZsRX/N22CFFDqDtavw08CadZBtPfUjgo=
|
||||
github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||
github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo=
|
||||
github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk=
|
||||
github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8=
|
||||
@ -197,8 +129,8 @@ github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsU
|
||||
github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o=
|
||||
github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY=
|
||||
github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI=
|
||||
github.com/jackc/pgconn v1.13.0 h1:3L1XMNV2Zvca/8BYhzcRFS70Lr0WlDg16Di6SFGAbys=
|
||||
github.com/jackc/pgconn v1.13.0/go.mod h1:AnowpAqO4CMIIJNZl2VJp+KrkAZciAkhEl0W0JIobpI=
|
||||
github.com/jackc/pgconn v1.14.0 h1:vrbA9Ud87g6JdFWkHTJXppVce58qPIdP7N8y0Ml/A7Q=
|
||||
github.com/jackc/pgconn v1.14.0/go.mod h1:9mBNlny0UvkgJdCDvdVHYSjI+8tD2rnKK69Wz8ti++E=
|
||||
github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE=
|
||||
github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8=
|
||||
github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE=
|
||||
@ -214,8 +146,8 @@ github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvW
|
||||
github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM=
|
||||
github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
|
||||
github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
|
||||
github.com/jackc/pgproto3/v2 v2.3.1 h1:nwj7qwf0S+Q7ISFfBndqeLwSwxs+4DPsbRFjECT1Y4Y=
|
||||
github.com/jackc/pgproto3/v2 v2.3.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
|
||||
github.com/jackc/pgproto3/v2 v2.3.2 h1:7eY55bdBeCz1F2fTzSz69QC+pG46jYq9/jtSPiJ5nn0=
|
||||
github.com/jackc/pgproto3/v2 v2.3.2/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
|
||||
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E=
|
||||
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk=
|
||||
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
|
||||
@ -223,21 +155,20 @@ github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01C
|
||||
github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc=
|
||||
github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw=
|
||||
github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM=
|
||||
github.com/jackc/pgtype v1.12.0 h1:Dlq8Qvcch7kiehm8wPGIW0W3KsCCHJnRacKW0UM8n5w=
|
||||
github.com/jackc/pgtype v1.12.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4=
|
||||
github.com/jackc/pgtype v1.14.0 h1:y+xUdabmyMkJLyApYuPj38mW+aAIqCe5uuBB51rH3Vw=
|
||||
github.com/jackc/pgtype v1.14.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4=
|
||||
github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y=
|
||||
github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM=
|
||||
github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc=
|
||||
github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs=
|
||||
github.com/jackc/pgx/v4 v4.17.2 h1:0Ut0rpeKwvIVbMQ1KbMBU4h6wxehBI535LK6Flheh8E=
|
||||
github.com/jackc/pgx/v4 v4.17.2/go.mod h1:lcxIZN44yMIrWI78a5CpucdD14hX0SBDbNRvjDBItsw=
|
||||
github.com/jackc/pgx/v5 v5.3.0 h1:/NQi8KHMpKWHInxXesC8yD4DhkXPrVhmnwYkjp9AmBA=
|
||||
github.com/jackc/pgx/v5 v5.3.0/go.mod h1:t3JDKnCBlYIc0ewLF0Q7B8MXmoIaBOZj/ic7iHozM/8=
|
||||
github.com/jackc/pgx/v4 v4.18.1 h1:YP7G1KABtKpB5IHrO9vYwSrCOhs7p3uqhvhhQBptya0=
|
||||
github.com/jackc/pgx/v4 v4.18.1/go.mod h1:FydWkUyadDmdNH/mHnGob881GawxeEm7TcMCzkb+qQE=
|
||||
github.com/jackc/pgx/v5 v5.3.1 h1:Fcr8QJ1ZeLi5zsPZqQeUZhNhxfkkKBOgJuYkJHoBOtU=
|
||||
github.com/jackc/pgx/v5 v5.3.1/go.mod h1:t3JDKnCBlYIc0ewLF0Q7B8MXmoIaBOZj/ic7iHozM/8=
|
||||
github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
|
||||
github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
|
||||
github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
|
||||
github.com/jackc/puddle v1.3.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
|
||||
github.com/jackc/puddle/v2 v2.2.0/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
|
||||
github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs=
|
||||
github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM=
|
||||
github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o=
|
||||
@ -246,36 +177,36 @@ github.com/jcmturner/gokrb5/v8 v8.4.2/go.mod h1:sb+Xq/fTY5yktf/VxLsE3wlfPqQjp0aW
|
||||
github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc=
|
||||
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
|
||||
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
|
||||
github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
||||
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
|
||||
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
||||
github.com/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g=
|
||||
github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ=
|
||||
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
|
||||
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
|
||||
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
||||
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
|
||||
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY=
|
||||
github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
||||
github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU=
|
||||
github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI=
|
||||
github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
|
||||
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
|
||||
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/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
|
||||
github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
|
||||
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
|
||||
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||
github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw=
|
||||
github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
|
||||
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
|
||||
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
@ -286,8 +217,8 @@ github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd
|
||||
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||
github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
|
||||
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||
github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98=
|
||||
github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU=
|
||||
github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
||||
github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
|
||||
@ -296,27 +227,34 @@ github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S
|
||||
github.com/mdp/qrterminal v1.0.1/go.mod h1:Z33WhxQe9B6CdW37HaVqcRKzP+kByF3q/qLxOGe12xQ=
|
||||
github.com/mdp/qrterminal/v3 v3.0.0 h1:ywQqLRBXWTktytQNDKFjhAvoGkLVN3J2tAFZ0kMd9xQ=
|
||||
github.com/mdp/qrterminal/v3 v3.0.0/go.mod h1:NJpfAs7OAm77Dy8EkWrtE4aq+cE6McoLXlBqXQEwvE0=
|
||||
github.com/microsoft/go-mssqldb v0.19.0 h1:LMRSgLcNMF8paPX14xlyQBmBH+jnFylPsYpVZf86eHM=
|
||||
github.com/microsoft/go-mssqldb v0.19.0/go.mod h1:ukJCBnnzLzpVF0qYRT+eg1e+eSwjeQ7IvenUv8QPook=
|
||||
github.com/microsoft/go-mssqldb v0.21.0 h1:p2rpHIL7TlSv1QrbXJUAcbyRKnIT0C9rRkH2E4OjLn8=
|
||||
github.com/microsoft/go-mssqldb v0.21.0/go.mod h1:+4wZTUnz/SV6nffv+RRRB/ss8jPng5Sho2SmM1l2ts4=
|
||||
github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g=
|
||||
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
|
||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
|
||||
github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8=
|
||||
github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
|
||||
github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI=
|
||||
github.com/nats-io/jwt/v2 v2.3.0/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k=
|
||||
github.com/nats-io/nats-server/v2 v2.8.4 h1:0jQzze1T9mECg8YZEl8+WYUXb9JKluJfCBriPUtluB4=
|
||||
github.com/nats-io/nats-server/v2 v2.8.4/go.mod h1:8zZa+Al3WsESfmgSs98Fi06dRWLH5Bnq90m5bKD/eT4=
|
||||
github.com/nats-io/nats.go v1.16.0 h1:zvLE7fGBQYW6MWaFaRdsgm9qT39PJDQoju+DS8KsO1g=
|
||||
github.com/nats-io/nats.go v1.16.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w=
|
||||
github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8=
|
||||
github.com/nats-io/nats.go v1.25.0 h1:t5/wCPGciR7X3Mu8QOi4jiJaXaWM8qtkLu4lzGZvYHE=
|
||||
github.com/nats-io/nats.go v1.25.0/go.mod h1:D2WALIhz7V8M0pH8Scx8JZXlg6Oqz5VG+nQkK8nJdvg=
|
||||
github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4=
|
||||
github.com/nats-io/nkeys v0.4.4 h1:xvBJ8d69TznjcQl9t6//Q5xXuVhyYiSos6RPtvQNTwA=
|
||||
github.com/nats-io/nkeys v0.4.4/go.mod h1:XUkxdLPTufzlihbamfzQ7mw/VGx6ObUs+0bN5sNvt64=
|
||||
github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=
|
||||
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
|
||||
github.com/philhofer/fwd v1.1.1 h1:GdGcTjf5RNAxwS4QLsiMzJYj5KEvPJD3Abr261yRQXQ=
|
||||
github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
|
||||
github.com/pierrec/lz4/v4 v4.1.15 h1:MO0/ucJhngq7299dKLwIMtgTfbkoSPF6AoMYDd8Q4q0=
|
||||
github.com/philhofer/fwd v1.1.2 h1:bnDivRJ1EWPjUIRXV5KfORO897HTbpFAQddBdE8t7Gw=
|
||||
github.com/philhofer/fwd v1.1.2/go.mod h1:qkPdfjR2SIEbspLqpe1tO4n5yICnr2DY7mqEx2tUTP0=
|
||||
github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
|
||||
github.com/pierrec/lz4/v4 v4.1.17 h1:kV4Ip+/hUBC+8T6+2EgburRtkE9ef4nbY3f4dFhGjMc=
|
||||
github.com/pierrec/lz4/v4 v4.1.17/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
|
||||
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA=
|
||||
github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ=
|
||||
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI=
|
||||
@ -324,31 +262,32 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
|
||||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
|
||||
github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
|
||||
github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
|
||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=
|
||||
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
||||
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
|
||||
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
|
||||
github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU=
|
||||
github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc=
|
||||
github.com/sashabaranov/go-openai v1.9.1 h1:3N52HkJKo9Zlo/oe1AVv5ZkCOny0ra58/ACvAxkN3MM=
|
||||
github.com/sashabaranov/go-openai v1.9.1/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
|
||||
github.com/sashabaranov/go-openai v1.9.4 h1:KanoCEoowAI45jVXlenMCckutSRr39qOmSi9MyPBfZM=
|
||||
github.com/sashabaranov/go-openai v1.9.4/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
|
||||
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
|
||||
github.com/savsgio/dictpool v0.0.0-20221023140959-7bf2e61cea94 h1:rmMl4fXJhKMNWl+K+r/fq4FbbKI+Ia2m9hYBLm2h4G4=
|
||||
github.com/savsgio/dictpool v0.0.0-20221023140959-7bf2e61cea94/go.mod h1:90zrgN3D/WJsDd1iXHT96alCoN2KJo6/4x1DZC3wZs8=
|
||||
github.com/savsgio/gotils v0.0.0-20220530130905-52f3993e8d6d h1:Q+gqLBOPkFGHyCJxXMRqtUgUbTjI8/Ze8vu8GGyNFwo=
|
||||
github.com/savsgio/gotils v0.0.0-20220530130905-52f3993e8d6d/go.mod h1:Gy+0tqhJvgGlqnTF8CVGP0AaGRjwBtXs/a5PA0Y3+A4=
|
||||
github.com/segmentio/kafka-go v0.4.39 h1:75smaomhvkYRwtuOwqLsdhgCG30B82NsbdkdDfFbvrw=
|
||||
github.com/segmentio/kafka-go v0.4.39/go.mod h1:T0MLgygYvmqmBvC+s8aCcbVNfJN4znVne5j0Pzowp/Q=
|
||||
github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee h1:8Iv5m6xEo1NR1AvpV+7XmhI4r39LGNzwUL4YpMuL5vk=
|
||||
github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee/go.mod h1:qwtSXrKuJh/zsFQ12yEE89xfCrGKK63Rr7ctU/uCo4g=
|
||||
github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys=
|
||||
github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=
|
||||
github.com/segmentio/kafka-go v0.4.40 h1:sszW7c0/uyv7+VcTW5trx2ZC7kMWDTxuR/6Zn8U1bm8=
|
||||
github.com/segmentio/kafka-go v0.4.40/go.mod h1:naFEZc5MQKdeL3W6NkZIAn48Y6AazqjRFDhnXeg3h94=
|
||||
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
|
||||
github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=
|
||||
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
|
||||
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
|
||||
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
||||
github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
|
||||
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
|
||||
@ -362,61 +301,70 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
|
||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/tinylib/msgp v1.1.6 h1:i+SbKraHhnrf9M5MYmvQhFnbLhAXSDWF8WWsuyRdocw=
|
||||
github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
|
||||
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/tinylib/msgp v1.1.6/go.mod h1:75BAfg2hauQhs3qedfdDZmWAPcFMAvJE5b9rGOMufyw=
|
||||
github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0=
|
||||
github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw=
|
||||
github.com/toorop/go-dkim v0.0.0-20201103131630-e1cd1a0a5208 h1:PM5hJF7HVfNWmCjMdEfbuOBNXSVF2cMFGgQTPdKCbwM=
|
||||
github.com/toorop/go-dkim v0.0.0-20201103131630-e1cd1a0a5208/go.mod h1:BzWtXXrXzZUvMacR0oF/fbDDgUPO8L36tDMmRAf14ns=
|
||||
github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo=
|
||||
github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
|
||||
github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs=
|
||||
github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
|
||||
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
||||
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
||||
github.com/valyala/fasthttp v1.44.0 h1:R+gLUhldIsfg1HokMuQjdQ5bh9nuXHPIfvkYUu9eR5Q=
|
||||
github.com/valyala/fasthttp v1.44.0/go.mod h1:f6VbjjoI3z1NDOZOv17o6RvtRSWxC77seBFc2uWtgiY=
|
||||
github.com/valyala/fasthttp v1.47.0 h1:y7moDoxYzMooFpT5aHgNgVOQDrS3qlkfiP9mDtGGK9c=
|
||||
github.com/valyala/fasthttp v1.47.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA=
|
||||
github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8=
|
||||
github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc=
|
||||
github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU=
|
||||
github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc=
|
||||
github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=
|
||||
github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
|
||||
github.com/xdg/scram v1.0.5 h1:TuS0RFmt5Is5qm9Tm2SoD89OPqe4IRiFtyFY4iwWXsw=
|
||||
github.com/xdg/scram v1.0.5/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I=
|
||||
github.com/xdg/stringprep v1.0.3 h1:cmL5Enob4W83ti/ZHuZLuKD/xqJfus4fVPwE+/BDm+4=
|
||||
github.com/xdg/stringprep v1.0.3/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y=
|
||||
github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=
|
||||
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
|
||||
github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY=
|
||||
github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4=
|
||||
github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8=
|
||||
github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM=
|
||||
github.com/xhit/go-simple-mail/v2 v2.13.0 h1:OANWU9jHZrVfBkNkvLf8Ww0fexwpQVF/v/5f96fFTLI=
|
||||
github.com/xhit/go-simple-mail/v2 v2.13.0/go.mod h1:b7P5ygho6SYE+VIqpxA6QkYfv4teeyG4MKqB3utRu98=
|
||||
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q=
|
||||
gitlab.aescorp.ru/dsp_dev/claim/common/object_model v0.0.108 h1:ZtBQuNckYPeoheh0Cb+UcJlrxaFEainLMDoY+1TG45g=
|
||||
gitlab.aescorp.ru/dsp_dev/claim/common/object_model v0.0.108/go.mod h1:GipQ/BQkeb4EgKMMXyZtfnydEqSooOxQCxCqhbnp5/k=
|
||||
gitlab.aescorp.ru/dsp_dev/claim/common/object_model v1.0.163 h1:/btKXM6CJdd+7/XbF5kFXP6t/v08kKpBnjgfr5UGPVQ=
|
||||
gitlab.aescorp.ru/dsp_dev/claim/common/object_model v1.0.163/go.mod h1:GipQ/BQkeb4EgKMMXyZtfnydEqSooOxQCxCqhbnp5/k=
|
||||
go.mau.fi/libsignal v0.1.0 h1:vAKI/nJ5tMhdzke4cTK1fb0idJzz1JuEIpmjprueC+c=
|
||||
go.mau.fi/libsignal v0.1.0/go.mod h1:R8ovrTezxtUNzCQE5PH30StOQWWeBskBsWE55vMfY9I=
|
||||
go.mau.fi/whatsmeow v0.0.0-20230427180258-7f679583b39b h1:VSSc37LfKMt7HYeu9NibbSRwELFN5wc/hreGyY+z+o4=
|
||||
go.mau.fi/whatsmeow v0.0.0-20230427180258-7f679583b39b/go.mod h1:+ObGpFE6cbbY4hKc1FmQH9MVfqaemmlXGXSnwDvCOyE=
|
||||
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
|
||||
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
|
||||
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
|
||||
go.mau.fi/whatsmeow v0.0.0-20230516145702-d5485ef06d61 h1:6gGY98Ji8JiW48q3wB9tqJZPj8/Gvahf9Po5ELUrUNw=
|
||||
go.mau.fi/whatsmeow v0.0.0-20230516145702-d5485ef06d61/go.mod h1:+ObGpFE6cbbY4hKc1FmQH9MVfqaemmlXGXSnwDvCOyE=
|
||||
go.opentelemetry.io/otel v1.15.1 h1:3Iwq3lfRByPaws0f6bU3naAqOR1n5IeDWd9390kWHa8=
|
||||
go.opentelemetry.io/otel v1.15.1/go.mod h1:mHHGEHVDLal6YrKMmk9LqC4a3sF5g+fHfrttQIB1NTc=
|
||||
go.opentelemetry.io/otel/trace v1.15.1 h1:uXLo6iHJEzDfrNC0L0mNjItIp06SyaBQxu5t3xMlngY=
|
||||
go.opentelemetry.io/otel/trace v1.15.1/go.mod h1:IWdQG/5N1x7f6YUlmdLeJvH9yxtuJAfc4VW5Agv9r/8=
|
||||
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
|
||||
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
|
||||
go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
|
||||
go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
|
||||
go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI=
|
||||
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
|
||||
go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
|
||||
go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
|
||||
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
|
||||
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
|
||||
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
|
||||
go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
|
||||
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
|
||||
go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM=
|
||||
go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60=
|
||||
go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
|
||||
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
@ -427,144 +375,60 @@ golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm
|
||||
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
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.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20221005025214-4161e89ecf1b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
|
||||
golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ=
|
||||
golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
|
||||
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
|
||||
golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||
golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
|
||||
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
|
||||
golang.org/x/exp v0.0.0-20230418202329-0354be287a23 h1:4NKENAGIctmZYLK9W+X1kDK8ObBFqOSCJM6WE7CvkJY=
|
||||
golang.org/x/exp v0.0.0-20230418202329-0354be287a23/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
|
||||
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g=
|
||||
golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0=
|
||||
golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc h1:mCRnTeVUjcrhlRmO0VK8a6k6Rrf6TF9htwo2pJVSjIU=
|
||||
golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w=
|
||||
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
|
||||
golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
|
||||
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
|
||||
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
||||
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
|
||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
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.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
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=
|
||||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||
golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||
golang.org/x/net v0.0.0-20220706163947-c90051bbdb60/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.0.0-20220906165146-f3363e06e74c/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
|
||||
golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
|
||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM=
|
||||
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
|
||||
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.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 h1:RerP+noqYHUQ8CMRcPlC2nvTa4dcBIjegkuWdcUDuqg=
|
||||
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=
|
||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8=
|
||||
golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/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.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI=
|
||||
golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/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-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
@ -572,184 +436,69 @@ golang.org/x/sys v0.0.0-20220224120231-95c6836cb0e7/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
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=
|
||||
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU=
|
||||
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
|
||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols=
|
||||
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/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.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.5/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.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 h1:GZokNIeuVkl3aZHJchRrr13WCsols02MLUcz1U9is6M=
|
||||
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
|
||||
golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
|
||||
golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
|
||||
golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ=
|
||||
golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
|
||||
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
|
||||
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||
google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||
google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||
google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||
google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||
google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||
google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||
google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||
google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||
google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
|
||||
google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
|
||||
google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
|
||||
google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
|
||||
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
|
||||
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
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-20190418145605-e7d98fc518a7/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-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
|
||||
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
|
||||
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
|
||||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
|
||||
google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
|
||||
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f h1:hJ/Y5SqPXbarffmAsApliUlcvMU+wScNGfyop4bZm8o=
|
||||
google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
||||
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
|
||||
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
|
||||
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
|
||||
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
|
||||
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||
google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
|
||||
google.golang.org/grpc v1.49.0 h1:WTLtQzmQori5FUH25Pq4WT22oCsv8USpQ+F6rqtsmxw=
|
||||
google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
|
||||
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
|
||||
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
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.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
|
||||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A=
|
||||
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU=
|
||||
google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag=
|
||||
google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8=
|
||||
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.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
|
||||
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/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/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s=
|
||||
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU=
|
||||
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.8/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=
|
||||
@ -757,23 +506,14 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C
|
||||
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=
|
||||
gorm.io/driver/postgres v1.4.8 h1:NDWizaclb7Q2aupT0jkwK8jx1HVCNzt+PQ8v/VnxviA=
|
||||
gorm.io/driver/postgres v1.4.8/go.mod h1:O9MruWGNLUBUWVYfWuBClpf3HeGjOoybY0SNmCs3wsw=
|
||||
gorm.io/driver/sqlserver v1.4.2 h1:nMtEeKqv2R/vv9FoHUFWfXfP6SskAgRar0TPlZV1stk=
|
||||
gorm.io/driver/sqlserver v1.4.2/go.mod h1:XHwBuB4Tlh7DqO0x7Ema8dmyWsQW7wi38VQOAFkrbXY=
|
||||
gorm.io/gorm v1.24.0/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA=
|
||||
gorm.io/gorm v1.24.2/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA=
|
||||
gorm.io/gorm v1.24.5 h1:g6OPREKqqlWq4kh/3MCQbZKImeB9e6Xgc4zD+JgNZGE=
|
||||
gorm.io/gorm v1.24.5/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
gorm.io/driver/postgres v1.5.1 h1:C/mvtmn3ryHjllfWjZYiPWXA4FleJGJcvURie+3c+qc=
|
||||
gorm.io/driver/postgres v1.5.1/go.mod h1:fmpX0m2I1PKuR7mKZiEluwrP3hbs+ps7JIGMUBpCgl8=
|
||||
gorm.io/driver/sqlserver v1.5.0 h1:zol7ePfY1XiPfjEvjjBh4VatIF3kycNcPE0EMCXznHY=
|
||||
gorm.io/driver/sqlserver v1.5.0/go.mod h1:tBAqioK34BHl0Iiez+BFfG5/K9nDAlhLxRkgc2qy3+4=
|
||||
gorm.io/gorm v1.25.1 h1:nsSALe5Pr+cM3V1qwwQ7rOkw+6UeLrX5O4v3llhHa64=
|
||||
gorm.io/gorm v1.25.1/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k=
|
||||
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||
nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g=
|
||||
nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0=
|
||||
rsc.io/qr v0.2.0 h1:6vBLea5/NRMVTz8V66gipeLycZMl/+UlFmk8DvqQ6WY=
|
||||
rsc.io/qr v0.2.0/go.mod h1:IF+uZjkb9fqyeF/4tlBoynqmQxUoPfWEKh921coOuXs=
|
||||
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
||||
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
||||
|
@ -207,9 +207,9 @@ func Exit(code int) {
|
||||
GetLog().Exit(code)
|
||||
}
|
||||
|
||||
//When file is opened with appending mode, it's safe to
|
||||
//write concurrently to a file (within 4k message on Linux).
|
||||
//In these cases user can choose to disable the lock.
|
||||
// When file is opened with appending mode, it's safe to
|
||||
// write concurrently to a file (within 4k message on Linux).
|
||||
// In these cases user can choose to disable the lock.
|
||||
func SetNoLock() {
|
||||
GetLog().SetNoLock()
|
||||
}
|
||||
|
@ -290,7 +290,7 @@ func Trim(s string) string {
|
||||
return Otvet
|
||||
}
|
||||
|
||||
// Max returns the larger of x or y.
|
||||
// Max returns the largest of x or y.
|
||||
func Max(x, y int) int {
|
||||
if x < y {
|
||||
return y
|
||||
@ -298,7 +298,7 @@ func Max(x, y int) int {
|
||||
return x
|
||||
}
|
||||
|
||||
// Min returns the smaller of x or y.
|
||||
// Min returns the smallest of x or y.
|
||||
func Min(x, y int) int {
|
||||
if x > y {
|
||||
return y
|
||||
@ -306,7 +306,7 @@ func Min(x, y int) int {
|
||||
return x
|
||||
}
|
||||
|
||||
// Max returns the larger of x or y.
|
||||
// Max returns the largest of x or y.
|
||||
func MaxInt64(x, y int64) int64 {
|
||||
if x < y {
|
||||
return y
|
||||
@ -314,7 +314,7 @@ func MaxInt64(x, y int64) int64 {
|
||||
return x
|
||||
}
|
||||
|
||||
// Min returns the smaller of x or y.
|
||||
// Min returns the smallest of x or y.
|
||||
func MinInt64(x, y int64) int64 {
|
||||
if x > y {
|
||||
return y
|
||||
@ -322,6 +322,22 @@ func MinInt64(x, y int64) int64 {
|
||||
return x
|
||||
}
|
||||
|
||||
// MaxDate returns the largest of x or y.
|
||||
func MaxDate(x, y time.Time) time.Time {
|
||||
if x.Before(y) == true {
|
||||
return y
|
||||
}
|
||||
return x
|
||||
}
|
||||
|
||||
// MinDate returns the smallest of x or y.
|
||||
func MinDate(x, y time.Time) time.Time {
|
||||
if x.Before(y) == false {
|
||||
return y
|
||||
}
|
||||
return x
|
||||
}
|
||||
|
||||
// GoGo - запускает функцию в отдельном потоке
|
||||
func GoGo(ctx context.Context, fn func() error) error {
|
||||
var err error
|
||||
|
@ -229,3 +229,19 @@ func TestGoGo(t *testing.T) {
|
||||
err := GoGo(ctx, fn)
|
||||
t.Log("Err:", err)
|
||||
}
|
||||
|
||||
func TestMaxDate(t *testing.T) {
|
||||
now := time.Now()
|
||||
Otvet := MaxDate(now, time.Date(1, 1, 1, 1, 1, 1, 1, time.Local))
|
||||
if Otvet != now {
|
||||
t.Error("microfunctions_test.TestMaxDate() error: Otvet != ", now)
|
||||
}
|
||||
}
|
||||
|
||||
func TestMinDate(t *testing.T) {
|
||||
now := time.Now()
|
||||
Otvet := MinDate(now, time.Date(9999, 1, 1, 1, 1, 1, 1, time.Local))
|
||||
if Otvet != now {
|
||||
t.Error("microfunctions_test.TestMinDate() error: Otvet != ", now)
|
||||
}
|
||||
}
|
||||
|
@ -216,13 +216,6 @@ func FillSettings() {
|
||||
Settings.MSSQL_ADDRESS = os.Getenv("MSSQL_ADDRESS")
|
||||
Settings.MSSQL_BASENAME = os.Getenv("MSSQL_BASENAME")
|
||||
Settings.MSSQL_PORT = os.Getenv("MSSQL_PORT")
|
||||
if Settings.MSSQL_LOGIN == "" {
|
||||
log.Panicln("Need fill MSSQL_LOGIN ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.MSSQL_PASSWORD == "" {
|
||||
log.Panicln("Need fill MSSQL_PASSWORD ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.MSSQL_ADDRESS == "" {
|
||||
log.Panicln("Need fill MSSQL_ADDRESS ! in os.ENV ")
|
||||
@ -235,6 +228,15 @@ func FillSettings() {
|
||||
if Settings.MSSQL_PORT == "" {
|
||||
log.Panicln("Need fill MSSQL_PORT ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.MSSQL_LOGIN == "" {
|
||||
log.Panicln("Need fill MSSQL_LOGIN ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.MSSQL_PASSWORD == "" {
|
||||
log.Panicln("Need fill MSSQL_PASSWORD ! in os.ENV ")
|
||||
}
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
|
@ -231,13 +231,6 @@ func FillSettings() {
|
||||
Settings.MSSQL_BASENAME = os.Getenv("MSSQL_BASENAME")
|
||||
Settings.MSSQL_PORT = os.Getenv("MSSQL_PORT")
|
||||
Settings.MSSQL_SCHEMA = os.Getenv("MSSQL_SCHEMA")
|
||||
if Settings.MSSQL_LOGIN == "" {
|
||||
log.Panicln("Need fill MSSQL_LOGIN ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.MSSQL_PASSWORD == "" {
|
||||
log.Panicln("Need fill MSSQL_PASSWORD ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.MSSQL_ADDRESS == "" {
|
||||
log.Panicln("Need fill MSSQL_ADDRESS ! in os.ENV ")
|
||||
@ -254,6 +247,14 @@ func FillSettings() {
|
||||
if Settings.MSSQL_SCHEMA == "" {
|
||||
log.Panicln("Need fill MSSQL_SCHEMA ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.MSSQL_LOGIN == "" {
|
||||
log.Panicln("Need fill MSSQL_LOGIN ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.MSSQL_PASSWORD == "" {
|
||||
log.Panicln("Need fill MSSQL_PASSWORD ! in os.ENV ")
|
||||
}
|
||||
//
|
||||
}
|
||||
|
||||
|
@ -242,6 +242,22 @@ func FillSettings() {
|
||||
Settings.DB_SCHEMA = os.Getenv("DB_SCHEME")
|
||||
Settings.DB_USER = os.Getenv("DB_USER")
|
||||
Settings.DB_PASSWORD = os.Getenv("DB_PASSWORD")
|
||||
|
||||
if Settings.DB_HOST == "" {
|
||||
log.Panicln("Need fill DB_HOST ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.DB_PORT == "" {
|
||||
log.Panicln("Need fill DB_PORT ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.DB_NAME == "" {
|
||||
log.Panicln("Need fill DB_NAME ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.DB_SCHEMA == "" {
|
||||
log.Panicln("Need fill DB_SCHEME ! in os.ENV ")
|
||||
}
|
||||
if Settings.DB_USER == "" {
|
||||
log.Panicln("Need fill DB_USER ! in os.ENV ")
|
||||
}
|
||||
@ -250,21 +266,6 @@ func FillSettings() {
|
||||
log.Panicln("Need fill DB_PASSWORD ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.DB_HOST == "" {
|
||||
log.Panicln("Need fill DB_HOST ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.DB_NAME == "" {
|
||||
log.Panicln("Need fill DB_NAME ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.DB_PORT == "" {
|
||||
log.Panicln("Need fill DB_PORT ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.DB_SCHEMA == "" {
|
||||
log.Panicln("Need fill DB_SCHEME ! in os.ENV ")
|
||||
}
|
||||
//
|
||||
}
|
||||
|
||||
|
@ -261,6 +261,23 @@ func FillSettings() {
|
||||
Settings.DB_SCHEMA = os.Getenv("DB_SCHEME")
|
||||
Settings.DB_USER = os.Getenv("DB_USER")
|
||||
Settings.DB_PASSWORD = os.Getenv("DB_PASSWORD")
|
||||
|
||||
if Settings.DB_HOST == "" {
|
||||
log.Panicln("Need fill DB_HOST ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.DB_PORT == "" {
|
||||
log.Panicln("Need fill DB_PORT ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.DB_NAME == "" {
|
||||
log.Panicln("Need fill DB_NAME ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.DB_SCHEMA == "" {
|
||||
log.Panicln("Need fill DB_SCHEMA ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.DB_USER == "" {
|
||||
log.Panicln("Need fill DB_USER ! in os.ENV ")
|
||||
}
|
||||
@ -269,21 +286,6 @@ func FillSettings() {
|
||||
log.Panicln("Need fill DB_PASSWORD ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.DB_HOST == "" {
|
||||
log.Panicln("Need fill DB_HOST ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.DB_NAME == "" {
|
||||
log.Panicln("Need fill DB_NAME ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.DB_PORT == "" {
|
||||
log.Panicln("Need fill DB_PORT ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.DB_SCHEMA == "" {
|
||||
log.Panicln("Need fill DB_SCHEMA ! in os.ENV ")
|
||||
}
|
||||
//
|
||||
}
|
||||
|
||||
|
@ -255,6 +255,22 @@ func FillSettings() {
|
||||
Settings.DB_SCHEMA = os.Getenv("DB_SCHEME")
|
||||
Settings.DB_USER = os.Getenv("DB_USER")
|
||||
Settings.DB_PASSWORD = os.Getenv("DB_PASSWORD")
|
||||
|
||||
if Settings.DB_HOST == "" {
|
||||
log.Panicln("Need fill DB_HOST ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.DB_PORT == "" {
|
||||
log.Panicln("Need fill DB_PORT ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.DB_NAME == "" {
|
||||
log.Panicln("Need fill DB_NAME ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.DB_SCHEMA == "" {
|
||||
log.Panicln("Need fill DB_SCHEME ! in os.ENV ")
|
||||
}
|
||||
if Settings.DB_USER == "" {
|
||||
log.Panicln("Need fill DB_USER ! in os.ENV ")
|
||||
}
|
||||
@ -263,21 +279,6 @@ func FillSettings() {
|
||||
log.Panicln("Need fill DB_PASSWORD ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.DB_HOST == "" {
|
||||
log.Panicln("Need fill DB_HOST ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.DB_NAME == "" {
|
||||
log.Panicln("Need fill DB_NAME ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.DB_PORT == "" {
|
||||
log.Panicln("Need fill DB_PORT ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.DB_SCHEMA == "" {
|
||||
log.Panicln("Need fill DB_SCHEME ! in os.ENV ")
|
||||
}
|
||||
//
|
||||
}
|
||||
|
||||
|
0
session.txt
Normal file
0
session.txt
Normal file
618
telegram_client/telegram_client.go
Normal file
618
telegram_client/telegram_client.go
Normal file
@ -0,0 +1,618 @@
|
||||
// модуль для использования Телеграмм Клиента (или бота)
|
||||
package telegram_client
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/ManyakRus/starter/logger"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/ManyakRus/starter/contextmain"
|
||||
"github.com/ManyakRus/starter/micro"
|
||||
"github.com/ManyakRus/starter/stopapp"
|
||||
|
||||
"github.com/gotd/td/clock"
|
||||
"github.com/gotd/td/telegram/message"
|
||||
"github.com/gotd/td/tg"
|
||||
"github.com/gotd/td/tgerr"
|
||||
|
||||
"golang.org/x/crypto/ssh/terminal"
|
||||
|
||||
"github.com/go-faster/errors"
|
||||
"github.com/gotd/contrib/bg"
|
||||
"github.com/gotd/td/session"
|
||||
"github.com/gotd/td/telegram"
|
||||
"github.com/gotd/td/telegram/auth"
|
||||
)
|
||||
|
||||
// filenameSession - имя файла сохранения сессии мессенджера Телеграм
|
||||
var filenameSession string
|
||||
|
||||
// client - клиент соединения мессенджера Телеграм
|
||||
var client *telegram.Client
|
||||
|
||||
// lastSendTime - время последней отправки сообщения и мьютекс
|
||||
var lastSendTime = lastSendTimeMutex{}
|
||||
|
||||
// log - глобальный логгер приложения
|
||||
var log = logger.GetLog()
|
||||
|
||||
// stopTelegramFunc - функция остановки соединения с мессенджером Телеграм
|
||||
var stopTelegramFunc bg.StopFunc
|
||||
|
||||
// MAX_MESSAGE_LEN - максимальная длина сообщения
|
||||
const MAX_MESSAGE_LEN = 4096
|
||||
|
||||
// MaxSendMessageCountIn1Second - максимальное количество сообщений в 1 секунду
|
||||
var MaxSendMessageCountIn1Second float32 = 0.13 //0.13 =4 сообщения в секунду
|
||||
|
||||
// lastSendTimeMutex - структура хранения времени последней отправки и мьютекс
|
||||
type lastSendTimeMutex struct {
|
||||
time time.Time
|
||||
sync.Mutex
|
||||
}
|
||||
|
||||
// noSignUp can be embedded to prevent signing up.
|
||||
type noSignUp struct{}
|
||||
|
||||
// Settings хранит все нужные переменные окружения
|
||||
var Settings SettingsINI
|
||||
|
||||
// SettingsINI - структура для хранения всех нужных переменных окружения
|
||||
// TELEGRAM_APP_ID, TELEGRAM_APP_HASH - первоначально получить по ссылке: https://my.telegram.org/apps
|
||||
// TELEGRAM_PHONE_FROM - номер телефона с которого отправляются сообщения
|
||||
type SettingsINI struct {
|
||||
TELEGRAM_APP_ID int
|
||||
TELEGRAM_APP_HASH string
|
||||
TELEGRAM_PHONE_FROM string
|
||||
TELEGRAM_PHONE_SEND_TEST string
|
||||
}
|
||||
|
||||
// SendMessage - отправка сообщения в мессенджер Телеграм
|
||||
// возвращает:
|
||||
// id = id отправленного сообщения в telegram
|
||||
// err = error
|
||||
func SendMessage(phone_send_to string, text string) (int, error) {
|
||||
var id int
|
||||
//var is_sent bool
|
||||
//
|
||||
|
||||
if client == nil {
|
||||
CreateTelegramClient(nil)
|
||||
//if err != nil {
|
||||
// log.Error("ConnectTelegram() error: ", err)
|
||||
// return 0, false, err
|
||||
//}
|
||||
}
|
||||
|
||||
if text == "" {
|
||||
text1 := "ConnectTelegram() text id empty ! "
|
||||
log.Error(text1)
|
||||
err := errors.New(text1)
|
||||
return 0, err
|
||||
}
|
||||
|
||||
if phone_send_to == "" {
|
||||
text1 := "ConnectTelegram() phone_send_to id empty ! "
|
||||
log.Error(text1)
|
||||
err := errors.New(text1)
|
||||
return 0, err
|
||||
}
|
||||
|
||||
TimeLimit()
|
||||
log.Debug("phone_send_to: ", phone_send_to, ", text: "+text)
|
||||
|
||||
text = micro.SubstringLeft(text, MAX_MESSAGE_LEN)
|
||||
|
||||
//
|
||||
api := client.API()
|
||||
|
||||
//ctxMain := contextmain.GetContext()
|
||||
ctxMain := context.Background()
|
||||
ctx, cancel := context.WithTimeout(ctxMain, 600*time.Second)
|
||||
defer cancel()
|
||||
|
||||
sender := message.NewSender(api)
|
||||
|
||||
//peer := api.ContactsImportContacts()
|
||||
//target0 := sender.To(peer)
|
||||
|
||||
target := sender.Resolve(phone_send_to)
|
||||
target.NoForwards()
|
||||
UpdatesClass, err := target.Text(ctx, text)
|
||||
|
||||
isFlood := false
|
||||
if err != nil {
|
||||
textFind := "peer: can't resolve phone"
|
||||
if micro.SubstringLeft(err.Error(), len(textFind)) == textFind {
|
||||
err2 := AddContact(ctx, phone_send_to)
|
||||
|
||||
isFlood = FloodWait(ctx, err2) //ожидание при ошибке FloodWait
|
||||
if isFlood {
|
||||
return SendMessage(phone_send_to, text)
|
||||
}
|
||||
|
||||
if err2 == nil {
|
||||
return SendMessage(phone_send_to, text)
|
||||
} else {
|
||||
log.Error("not send, text: " + err.Error())
|
||||
return 0, err
|
||||
}
|
||||
} else {
|
||||
isFlood = FloodWait(ctx, err) //ожидание при ошибке FloodWait
|
||||
if isFlood {
|
||||
return SendMessage(phone_send_to, text)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if UpdatesClass != nil {
|
||||
id = findIdFromUpdatesClass(UpdatesClass)
|
||||
}
|
||||
log.Debug("id: ", id, ", error: ", err, ", text: "+text)
|
||||
|
||||
//log.Print("Success")
|
||||
|
||||
// Return to close client connection and free up resources.
|
||||
// Client is closed.
|
||||
return id, err
|
||||
|
||||
}
|
||||
|
||||
// AddContact - добавляет новый контакт в список контактов Телеграм
|
||||
func AddContact(ctx context.Context, phone_send_to string) error {
|
||||
var err error
|
||||
|
||||
if phone_send_to == "" {
|
||||
text1 := "phone_send_to='' !"
|
||||
err := errors.New(text1)
|
||||
log.Error(text1)
|
||||
return err
|
||||
}
|
||||
|
||||
TimeLimit()
|
||||
|
||||
api := client.API()
|
||||
|
||||
//var contacts []tg.InputPhoneContact
|
||||
contact := tg.InputPhoneContact{}
|
||||
contact.Phone = phone_send_to
|
||||
contact.FirstName = phone_send_to
|
||||
|
||||
contacts := make([]tg.InputPhoneContact, 1)
|
||||
contacts = append(contacts, contact)
|
||||
|
||||
ContactsImportedContacts, err := api.ContactsImportContacts(ctx, contacts)
|
||||
if ContactsImportedContacts == nil {
|
||||
text1 := "ContactsImportedContacts == nil. Не удалось добавить контакт !"
|
||||
err = errors.New(text1)
|
||||
log.Error(text1)
|
||||
} else if ContactsImportedContacts.Imported == nil {
|
||||
text1 := "ContactsImportedContacts.Imported =nil. Не удалось добавить контакт !"
|
||||
err = errors.New(text1)
|
||||
log.Error(text1)
|
||||
} else if len(ContactsImportedContacts.Imported) == 0 {
|
||||
text1 := "ContactsImportedContacts.Imported len=0. Не удалось добавить контакт !"
|
||||
err = errors.New(text1)
|
||||
log.Error(text1)
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// SignUp - обязательная функция клиента Телеграм
|
||||
func (noSignUp) SignUp(context.Context) (auth.UserInfo, error) {
|
||||
return auth.UserInfo{}, errors.New("not implemented")
|
||||
}
|
||||
|
||||
// AcceptTermsOfService - обязательная функция клиента Телеграм
|
||||
func (noSignUp) AcceptTermsOfService(ctx context.Context, tos tg.HelpTermsOfService) error {
|
||||
if ctx == nil {
|
||||
text1 := "telegramclient.AcceptTermsOfService() error: Context=nil"
|
||||
return errors.New(text1)
|
||||
}
|
||||
|
||||
return &auth.SignUpRequired{TermsOfService: tos}
|
||||
}
|
||||
|
||||
// termAuth implements authentication via terminal.
|
||||
type termAuth struct {
|
||||
noSignUp
|
||||
|
||||
phone string
|
||||
}
|
||||
|
||||
// Phone - обязательная функция клиента Телеграм
|
||||
func (a termAuth) Phone(_ context.Context) (string, error) {
|
||||
return a.phone, nil
|
||||
}
|
||||
|
||||
// Password - обязательная функция клиента Телеграм
|
||||
// ввод пароля с терминала
|
||||
func (a termAuth) Password(ctx context.Context) (string, error) {
|
||||
if ctx == nil {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
fmt.Print("Enter 2FA password: ")
|
||||
bytePwd, err := terminal.ReadPassword(0)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return strings.TrimSpace(string(bytePwd)), nil
|
||||
}
|
||||
|
||||
// Code - обязательная функция клиента Телеграм
|
||||
// ввод кода CODE с терминала
|
||||
func (a termAuth) Code(ctx context.Context, _ *tg.AuthSentCode) (string, error) {
|
||||
if ctx == nil {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
fmt.Print("Enter code: ")
|
||||
code, err := bufio.NewReader(os.Stdin).ReadString('\n')
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return strings.TrimSpace(code), nil
|
||||
}
|
||||
|
||||
// memorySession implements in-memory session storage.
|
||||
// Goroutine-safe.
|
||||
type memorySession struct {
|
||||
mux sync.RWMutex
|
||||
data []byte
|
||||
}
|
||||
|
||||
// LoadSession loads session from memory.
|
||||
func (s *memorySession) LoadSession(context.Context) ([]byte, error) {
|
||||
if s == nil {
|
||||
return nil, session.ErrNotFound
|
||||
}
|
||||
|
||||
s.mux.RLock()
|
||||
defer s.mux.RUnlock()
|
||||
|
||||
// read the whole file at once
|
||||
cpy, err := ioutil.ReadFile(filenameSession)
|
||||
if err != nil {
|
||||
cpy = nil
|
||||
log.Info(err)
|
||||
return nil, nil
|
||||
//return nil, session.ErrNotFound
|
||||
}
|
||||
|
||||
////было
|
||||
//if len(s.data) == 0 {
|
||||
// return nil, session.ErrNotFound
|
||||
//}
|
||||
//cpy = append([]byte(nil), s.data...)
|
||||
|
||||
return cpy, nil
|
||||
}
|
||||
|
||||
// StoreSession stores session to memory.
|
||||
func (s *memorySession) StoreSession(ctx context.Context, data []byte) error {
|
||||
if ctx == nil {
|
||||
text1 := "telegramclient.StoreSession() error: Context=nil"
|
||||
return errors.New(text1)
|
||||
}
|
||||
|
||||
s.mux.Lock()
|
||||
//s.data = data
|
||||
|
||||
// write the whole body at once
|
||||
err := ioutil.WriteFile(filenameSession, data, 0644)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
s.mux.Unlock()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// CreateTelegramClient создание клиента Телеграм
|
||||
func CreateTelegramClient(func_OnNewMessage func(ctx context.Context, entities tg.Entities, u *tg.UpdateNewMessage) error) {
|
||||
// https://core.telegram.org/api/obtaining_api_id
|
||||
|
||||
programDir := micro.ProgramDir()
|
||||
filenameSession = programDir + "session.txt"
|
||||
|
||||
sessionStorage := &memorySession{}
|
||||
|
||||
dispatcher := tg.NewUpdateDispatcher()
|
||||
client = telegram.NewClient(Settings.TELEGRAM_APP_ID, Settings.TELEGRAM_APP_HASH,
|
||||
telegram.Options{
|
||||
SessionStorage: sessionStorage,
|
||||
UpdateHandler: dispatcher,
|
||||
})
|
||||
|
||||
if func_OnNewMessage != nil {
|
||||
dispatcher.OnNewMessage(func_OnNewMessage)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// OnNewMessage_Test - пример функции для получения новых сообщений
|
||||
func OnNewMessage_Test(ctx context.Context, entities tg.Entities, u *tg.UpdateNewMessage) error {
|
||||
var err error
|
||||
|
||||
m, ok := u.Message.(*tg.Message)
|
||||
if !ok || m.Out {
|
||||
// Outgoing message, not interesting.
|
||||
return nil
|
||||
}
|
||||
|
||||
// тестовый пример эхо
|
||||
// Helper for sending messages.
|
||||
api := client.API()
|
||||
sender := message.NewSender(api)
|
||||
|
||||
// Sending reply.
|
||||
_, err = sender.Reply(entities, u).Text(ctx, m.Message)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// TimeLimit пауза для ограничения количество сообщений в секунду
|
||||
func TimeLimit() {
|
||||
//if MaxSendMessageCountIn1Second == 0 {
|
||||
// return
|
||||
//}
|
||||
|
||||
lastSendTime.Lock()
|
||||
defer lastSendTime.Unlock()
|
||||
|
||||
if lastSendTime.time.IsZero() {
|
||||
lastSendTime.time = time.Now()
|
||||
return
|
||||
}
|
||||
|
||||
t := time.Now()
|
||||
ms := int(t.Sub(lastSendTime.time).Milliseconds())
|
||||
msNeedWait := int(1000 / MaxSendMessageCountIn1Second)
|
||||
if ms < msNeedWait {
|
||||
micro.Sleep(msNeedWait - ms)
|
||||
}
|
||||
|
||||
lastSendTime.time = time.Now()
|
||||
}
|
||||
|
||||
// ConnectTelegram подключение к серверу Телеграм
|
||||
func ConnectTelegram() error {
|
||||
|
||||
ctxMain := context.Background()
|
||||
//ctxMain := contextmain.GetContext()
|
||||
ctx, cancel := context.WithTimeout(ctxMain, 60*time.Second) //60
|
||||
defer cancel()
|
||||
|
||||
bg.WithContext(ctx)
|
||||
var err error
|
||||
stopTelegramFunc, err = bg.Connect(client)
|
||||
if err != nil {
|
||||
log.Fatalln("Can not connect to Telegram ! Error: ", err)
|
||||
}
|
||||
|
||||
micro.Sleep(10) //не успевает
|
||||
//for i := 1; i <= 5; i++ {
|
||||
// err = client.Ping(ctx)
|
||||
// if err != nil {
|
||||
// micro.Sleep(1000)
|
||||
// }
|
||||
//}
|
||||
|
||||
//fmt.Println("Client: ", client)
|
||||
|
||||
//
|
||||
flow := auth.NewFlow(
|
||||
termAuth{phone: Settings.TELEGRAM_PHONE_FROM},
|
||||
auth.SendCodeOptions{},
|
||||
)
|
||||
|
||||
if err := client.Auth().IfNecessary(ctx, flow); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// findIdFromUpdatesClass - возвращает id сообщения из ответа Телеграм сервера
|
||||
func findIdFromUpdatesClass(UpdatesClass tg.UpdatesClass) int {
|
||||
var id int
|
||||
|
||||
switch v := UpdatesClass.(type) {
|
||||
case *tg.UpdatesTooLong: // updatesTooLong#e317af7e
|
||||
case *tg.UpdateShortMessage: // updateShortMessage#313bc7f8
|
||||
case *tg.UpdateShortChatMessage: // updateShortChatMessage#4d6deea5
|
||||
case *tg.UpdateShort: // updateShort#78d4dec1
|
||||
case *tg.UpdatesCombined: // updatesCombined#725b04c3
|
||||
case *tg.Updates: // updates#74ae4240
|
||||
UpdatesClass1 := UpdatesClass.(*tg.Updates)
|
||||
for _, row1 := range UpdatesClass1.Updates {
|
||||
switch row1.(type) {
|
||||
case *tg.UpdateMessageID:
|
||||
{
|
||||
rowV := row1.(*tg.UpdateMessageID)
|
||||
id = rowV.ID
|
||||
}
|
||||
case *tg.UpdateNewMessage:
|
||||
{
|
||||
rowV := row1.(*tg.UpdateNewMessage)
|
||||
MessageV := rowV.Message.(*tg.Message)
|
||||
//is_sent = MessageV.Out
|
||||
if id == 0 {
|
||||
id = MessageV.ID
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
case *tg.UpdateShortSentMessage: // updateShortSentMessage#9015e101
|
||||
UpdatesClass1 := UpdatesClass.(*tg.UpdateShortSentMessage)
|
||||
id = UpdatesClass1.ID
|
||||
default:
|
||||
log.Fatalln("Wrong type: ", v)
|
||||
}
|
||||
|
||||
return id
|
||||
}
|
||||
|
||||
// FindMessageByID - находит сообщение на сервере Телеграм по id
|
||||
func FindMessageByID(ctx context.Context, id int) (*tg.Message, error) {
|
||||
var Otvet *tg.Message
|
||||
|
||||
if id == 0 {
|
||||
text1 := "telegramclient.FindMessageByID() id=0 !"
|
||||
err := errors.New(text1)
|
||||
return Otvet, err
|
||||
}
|
||||
|
||||
api := client.API()
|
||||
|
||||
var IMC []tg.InputMessageClass
|
||||
IMC = append(IMC, &tg.InputMessageID{ID: id})
|
||||
|
||||
MMC, err := api.MessagesGetMessages(ctx, IMC)
|
||||
if err != nil {
|
||||
return Otvet, err
|
||||
}
|
||||
|
||||
if MMC == nil {
|
||||
return Otvet, err
|
||||
}
|
||||
|
||||
MMCV := MMC.(*tg.MessagesMessages)
|
||||
Messages := MMCV.Messages
|
||||
for _, v := range Messages {
|
||||
Otvet = v.(*tg.Message)
|
||||
//Otvet.MediaUnread
|
||||
}
|
||||
|
||||
return Otvet, err
|
||||
}
|
||||
|
||||
// WaitStop - ожидает отмену глобального контекста или сигнала завершения приложения
|
||||
func WaitStop() {
|
||||
//stopapp.GetWaitGroup_Main().Add(1)
|
||||
select {
|
||||
case <-contextmain.GetContext().Done():
|
||||
log.Warn("Context app is canceled.")
|
||||
}
|
||||
|
||||
//
|
||||
stopapp.WaitTotalMessagesSendingNow("telegram")
|
||||
|
||||
//
|
||||
StopTelegram()
|
||||
|
||||
//
|
||||
stopapp.GetWaitGroup_Main().Done()
|
||||
}
|
||||
|
||||
// StopTelegram - остановка работы клиента Телеграм
|
||||
func StopTelegram() {
|
||||
if stopTelegramFunc != nil {
|
||||
err := stopTelegramFunc()
|
||||
if err != nil {
|
||||
log.Error("error: ", err)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// FloodWait sleeps required duration and returns true if err is FLOOD_WAIT
|
||||
// or false and context or original error otherwise.
|
||||
func FloodWait(ctx context.Context, err error) bool {
|
||||
otvet := false
|
||||
|
||||
if err == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
sec, ok := AsFloodWait(err)
|
||||
if ok {
|
||||
otvet = true
|
||||
log.Debug("isFlood sec: ", sec)
|
||||
|
||||
var duration time.Duration
|
||||
duration = time.Second * time.Duration(sec)
|
||||
timer := clock.System.Timer(duration)
|
||||
defer clock.StopTimer(timer)
|
||||
|
||||
select {
|
||||
case <-timer.C():
|
||||
return otvet
|
||||
case <-ctx.Done():
|
||||
return otvet
|
||||
}
|
||||
} else {
|
||||
log.Warn("AsFloodWait() ok =false")
|
||||
}
|
||||
|
||||
return otvet
|
||||
}
|
||||
|
||||
// AsFloodWait returns wait duration and true boolean if err is
|
||||
// the "FLOOD_WAIT" error.
|
||||
//
|
||||
// Client should wait for that duration before issuing new requests with
|
||||
// same method.
|
||||
func AsFloodWait(err error) (d int, ok bool) {
|
||||
rpcErr, ok := tgerr.AsType(err, tgerr.ErrFloodWait)
|
||||
//log.Debugf("error response: %v", rpcErr)
|
||||
if ok {
|
||||
return rpcErr.Argument, true
|
||||
}
|
||||
return 0, false
|
||||
}
|
||||
|
||||
// StartTelegram - подключается к телеграмму, запускает остановку приложения.
|
||||
// func_OnNewMessage - функция для приёма новых сообщений
|
||||
func StartTelegram(func_OnNewMessage func(ctx context.Context, entities tg.Entities, u *tg.UpdateNewMessage) error) {
|
||||
CreateTelegramClient(func_OnNewMessage)
|
||||
|
||||
err := ConnectTelegram()
|
||||
if err != nil {
|
||||
log.Fatalln("Can not login to telegram ! Error: ", err)
|
||||
}
|
||||
|
||||
stopapp.GetWaitGroup_Main().Add(1)
|
||||
go WaitStop()
|
||||
|
||||
}
|
||||
|
||||
// FillSettings загружает переменные окружения в структуру из переменных окружения
|
||||
func FillSettings() {
|
||||
Settings = SettingsINI{}
|
||||
Settings.TELEGRAM_APP_ID, _ = strconv.Atoi(os.Getenv("TELEGRAM_APP_ID"))
|
||||
Settings.TELEGRAM_APP_HASH = os.Getenv("TELEGRAM_APP_HASH")
|
||||
Settings.TELEGRAM_PHONE_FROM = os.Getenv("TELEGRAM_PHONE_FROM")
|
||||
Settings.TELEGRAM_PHONE_SEND_TEST = os.Getenv("TELEGRAM_PHONE_SEND_TEST")
|
||||
|
||||
if Settings.TELEGRAM_APP_ID == 0 {
|
||||
log.Panicln("Need fill TELEGRAM_APP_ID ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.TELEGRAM_APP_HASH == "" {
|
||||
log.Panicln("Need fill TELEGRAM_APP_HASH ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.TELEGRAM_PHONE_FROM == "" {
|
||||
log.Panicln("Need fill TELEGRAM_PHONE_FROM ! in os.ENV ")
|
||||
}
|
||||
|
||||
if Settings.TELEGRAM_PHONE_SEND_TEST == "" && micro.IsTestApp() == true {
|
||||
log.Info("Need fill TELEGRAM_PHONE_SEND_TEST ! in os.ENV ")
|
||||
}
|
||||
|
||||
}
|
219
telegram_client/telegram_client_test.go
Normal file
219
telegram_client/telegram_client_test.go
Normal file
@ -0,0 +1,219 @@
|
||||
package telegram_client
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
//log "github.com/sirupsen/logrus"
|
||||
|
||||
//log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/gotd/td/tg"
|
||||
|
||||
"github.com/ManyakRus/starter/config"
|
||||
"github.com/ManyakRus/starter/contextmain"
|
||||
"github.com/ManyakRus/starter/micro"
|
||||
"github.com/ManyakRus/starter/stopapp"
|
||||
)
|
||||
|
||||
//var log = logger.GetLog()
|
||||
|
||||
func TestCreateTelegramClient(t *testing.T) {
|
||||
|
||||
config.LoadEnv()
|
||||
|
||||
//ctx := contextmain.GetContext()
|
||||
CreateTelegramClient(nil)
|
||||
//if err != nil {
|
||||
// t.Error("CreateTelegramClient error: ", err)
|
||||
//}
|
||||
StopTelegram()
|
||||
|
||||
}
|
||||
|
||||
func TestTimeLimit(t *testing.T) {
|
||||
TimeLimit()
|
||||
}
|
||||
|
||||
func TestSendMessage(t *testing.T) {
|
||||
config.LoadEnv()
|
||||
//stopapp.StartWaitStop()
|
||||
|
||||
ctx := contextmain.GetContext()
|
||||
MaxSendMessageCountIn1Second0 := MaxSendMessageCountIn1Second
|
||||
MaxSendMessageCountIn1Second = 1000
|
||||
|
||||
CreateTelegramClient(nil)
|
||||
|
||||
err := ConnectTelegram()
|
||||
if err != nil {
|
||||
t.Error("telegramclient_test.TestSendMessage() error: ", err)
|
||||
}
|
||||
|
||||
text := "Test www.ya.ru " + time.Now().String()
|
||||
id, err := SendMessage(Settings.TELEGRAM_PHONE_SEND_TEST, text)
|
||||
log.Info("Message id: ", id)
|
||||
if err != nil {
|
||||
t.Error("telegramclient_test.TestSendMessage() SendMessage() error: ", err)
|
||||
}
|
||||
|
||||
if id == 0 {
|
||||
t.Error("telegramclient_test.TestSendMessage() SendMessage() id=0 error: ", err)
|
||||
}
|
||||
|
||||
message1, err := FindMessageByID(ctx, id)
|
||||
if err != nil {
|
||||
t.Error("telegramclient_test.TestSendMessage() SendMessage() error: ", err)
|
||||
}
|
||||
if message1 == nil {
|
||||
t.Error("telegramclient_test.TestSendMessage() SendMessage() error: ", err)
|
||||
}
|
||||
|
||||
StopTelegram()
|
||||
//stopapp.SignalInterrupt <- syscall.SIGINT
|
||||
//stopapp.GetWaitGroup_Main().Wait()
|
||||
|
||||
MaxSendMessageCountIn1Second = MaxSendMessageCountIn1Second0
|
||||
}
|
||||
|
||||
//func TestWaitStop(t *testing.T) {
|
||||
// contextmain.GetContext()
|
||||
//
|
||||
// stopapp.StartWaitStop()
|
||||
// go WaitStop()
|
||||
//
|
||||
// stopapp.SignalInterrupt <- syscall.SIGINT
|
||||
// //contextmain.CancelContext()
|
||||
// //micro.Pause(100)
|
||||
//
|
||||
// //stopapp.SignalInterrupt <- syscall.SIGINT
|
||||
//}
|
||||
|
||||
func TestConnectTelegram(t *testing.T) {
|
||||
config.LoadEnv()
|
||||
|
||||
//ctx := contextmain.GetContext()
|
||||
|
||||
CreateTelegramClient(nil)
|
||||
|
||||
err := ConnectTelegram()
|
||||
if err != nil {
|
||||
t.Error("telegramclient_test.TestConnectTelegram() error: ", err)
|
||||
}
|
||||
|
||||
StopTelegram()
|
||||
}
|
||||
|
||||
func Test_termAuth_Phone(t *testing.T) {
|
||||
a := termAuth{
|
||||
phone: "111",
|
||||
}
|
||||
got, err := a.Phone(contextmain.Ctx)
|
||||
if got != "111" {
|
||||
t.Error("telegramclient_test.Test_termAuth_Phone() error: ", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSendMessage_Many(t *testing.T) {
|
||||
t.SkipNow() //убрать комментарий
|
||||
config.LoadEnv()
|
||||
stopapp.StartWaitStop()
|
||||
|
||||
CreateTelegramClient(nil)
|
||||
|
||||
err := ConnectTelegram()
|
||||
if err != nil {
|
||||
t.Error("telegramclient_test.TestSendMessage() ConnectTelegram() error: ", err)
|
||||
}
|
||||
|
||||
text := "Test www.ya.ru " + time.Now().String()
|
||||
_, err = SendMessage(Settings.TELEGRAM_PHONE_SEND_TEST, text)
|
||||
_, err = SendMessage(Settings.TELEGRAM_PHONE_SEND_TEST, text)
|
||||
_, err = SendMessage(Settings.TELEGRAM_PHONE_SEND_TEST, text)
|
||||
_, err = SendMessage(Settings.TELEGRAM_PHONE_SEND_TEST, text)
|
||||
_, err = SendMessage(Settings.TELEGRAM_PHONE_SEND_TEST, text)
|
||||
_, err = SendMessage(Settings.TELEGRAM_PHONE_SEND_TEST, text)
|
||||
_, err = SendMessage(Settings.TELEGRAM_PHONE_SEND_TEST, text)
|
||||
_, err = SendMessage(Settings.TELEGRAM_PHONE_SEND_TEST, text)
|
||||
_, err = SendMessage(Settings.TELEGRAM_PHONE_SEND_TEST, text)
|
||||
_, err = SendMessage(Settings.TELEGRAM_PHONE_SEND_TEST, text)
|
||||
if err != nil {
|
||||
t.Error("telegramclient_test.TestSendMessage() SendMessage() error: ", err)
|
||||
}
|
||||
|
||||
micro.Pause(18000)
|
||||
|
||||
StopTelegram()
|
||||
//stopapp.SignalInterrupt <- syscall.SIGINT
|
||||
//stopapp.GetWaitGroup_Main().Wait()
|
||||
}
|
||||
|
||||
func TestFloodWait(t *testing.T) {
|
||||
ctx := contextmain.GetContext()
|
||||
FloodWait(ctx, nil)
|
||||
}
|
||||
|
||||
func TestAsFloodWait(t *testing.T) {
|
||||
sec, ok := AsFloodWait(nil)
|
||||
|
||||
if sec != 0 {
|
||||
t.Error("telegramclient_test.TestAsFloodWait() sec != 0 !")
|
||||
}
|
||||
|
||||
if ok == true {
|
||||
t.Error("telegramclient_test.TestAsFloodWait() ok = true !")
|
||||
}
|
||||
}
|
||||
|
||||
func Test_noSignUp_SignUp(t *testing.T) {
|
||||
ctx := contextmain.GetContext()
|
||||
no := noSignUp{}
|
||||
_, err := no.SignUp(ctx)
|
||||
//if UserInfo.FirstName != "" {
|
||||
// t.Error("telegramclient_test.Test_noSignUp_SignUp() UserInfo=nil !")
|
||||
//}
|
||||
if err == nil {
|
||||
t.Error("telegramclient_test.Test_noSignUp_SignUp() err: ", err)
|
||||
}
|
||||
}
|
||||
|
||||
func Test_noSignUp_AcceptTermsOfService(t *testing.T) {
|
||||
no := noSignUp{}
|
||||
tos := tg.HelpTermsOfService{}
|
||||
err := no.AcceptTermsOfService(nil, tos)
|
||||
if err == nil {
|
||||
t.Error("telegramclient_test.Test_noSignUp_SignUp() err: ", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAddContact(t *testing.T) {
|
||||
ctx := contextmain.GetContext()
|
||||
err := AddContact(ctx, "")
|
||||
if err == nil {
|
||||
t.Error("telegramclient_test.TestAddContact() error = nil !")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func Test_termAuth_Password(t *testing.T) {
|
||||
|
||||
termAuth := termAuth{}
|
||||
_, _ = termAuth.Password(nil)
|
||||
|
||||
}
|
||||
|
||||
func Test_termAuth_Code(t *testing.T) {
|
||||
termAuth := termAuth{}
|
||||
sentcode := &tg.AuthSentCode{}
|
||||
_, _ = termAuth.Code(nil, sentcode)
|
||||
|
||||
}
|
||||
|
||||
func TestStartTelegram(t *testing.T) {
|
||||
StartTelegram(nil)
|
||||
|
||||
micro.Sleep(200)
|
||||
|
||||
StopTelegram()
|
||||
contextmain.CancelContext()
|
||||
contextmain.GetNewContext()
|
||||
}
|
17
vendor/github.com/andybalholm/brotli/decode.go
generated
vendored
17
vendor/github.com/andybalholm/brotli/decode.go
generated
vendored
@ -1304,26 +1304,21 @@ func wrapRingBuffer(s *Reader) {
|
||||
Last two bytes of ring-buffer are initialized to 0, so context calculation
|
||||
could be done uniformly for the first two and all other positions. */
|
||||
func ensureRingBuffer(s *Reader) bool {
|
||||
var old_ringbuffer []byte = s.ringbuffer
|
||||
var old_ringbuffer []byte
|
||||
if s.ringbuffer_size == s.new_ringbuffer_size {
|
||||
return true
|
||||
}
|
||||
|
||||
s.ringbuffer = make([]byte, uint(s.new_ringbuffer_size)+uint(kRingBufferWriteAheadSlack))
|
||||
if s.ringbuffer == nil {
|
||||
/* Restore previous value. */
|
||||
s.ringbuffer = old_ringbuffer
|
||||
|
||||
return false
|
||||
spaceNeeded := int(s.new_ringbuffer_size) + int(kRingBufferWriteAheadSlack)
|
||||
if len(s.ringbuffer) < spaceNeeded {
|
||||
old_ringbuffer = s.ringbuffer
|
||||
s.ringbuffer = make([]byte, spaceNeeded)
|
||||
}
|
||||
|
||||
s.ringbuffer[s.new_ringbuffer_size-2] = 0
|
||||
s.ringbuffer[s.new_ringbuffer_size-1] = 0
|
||||
|
||||
if !(old_ringbuffer == nil) {
|
||||
if old_ringbuffer != nil {
|
||||
copy(s.ringbuffer, old_ringbuffer[:uint(s.pos)])
|
||||
|
||||
old_ringbuffer = nil
|
||||
}
|
||||
|
||||
s.ringbuffer_size = s.new_ringbuffer_size
|
||||
|
8
vendor/github.com/andybalholm/brotli/reader.go
generated
vendored
8
vendor/github.com/andybalholm/brotli/reader.go
generated
vendored
@ -27,10 +27,16 @@ func NewReader(src io.Reader) *Reader {
|
||||
}
|
||||
|
||||
// Reset discards the Reader's state and makes it equivalent to the result of
|
||||
// its original state from NewReader, but writing to src instead.
|
||||
// its original state from NewReader, but reading from src instead.
|
||||
// This permits reusing a Reader rather than allocating a new one.
|
||||
// Error is always nil
|
||||
func (r *Reader) Reset(src io.Reader) error {
|
||||
if r.error_code < 0 {
|
||||
// There was an unrecoverable error, leaving the Reader's state
|
||||
// undefined. Clear out everything but the buffer.
|
||||
*r = Reader{buf: r.buf}
|
||||
}
|
||||
|
||||
decoderStateInit(r)
|
||||
r.src = src
|
||||
if r.buf == nil {
|
||||
|
1
vendor/github.com/andybalholm/brotli/state.go
generated
vendored
1
vendor/github.com/andybalholm/brotli/state.go
generated
vendored
@ -200,7 +200,6 @@ func decoderStateInit(s *Reader) bool {
|
||||
|
||||
s.block_type_trees = nil
|
||||
s.block_len_trees = nil
|
||||
s.ringbuffer = nil
|
||||
s.ringbuffer_size = 0
|
||||
s.new_ringbuffer_size = 0
|
||||
s.ringbuffer_mask = 0
|
||||
|
22
vendor/github.com/asaskevich/govalidator/.travis.yml
generated
vendored
22
vendor/github.com/asaskevich/govalidator/.travis.yml
generated
vendored
@ -1,18 +1,12 @@
|
||||
dist: bionic
|
||||
language: go
|
||||
env: GO111MODULE=on GOFLAGS='-mod vendor'
|
||||
install: true
|
||||
email: false
|
||||
|
||||
dist: xenial
|
||||
go:
|
||||
- 1.10
|
||||
- 1.11
|
||||
- 1.12
|
||||
- 1.13
|
||||
- tip
|
||||
- '1.10'
|
||||
- '1.11'
|
||||
- '1.12'
|
||||
- '1.13'
|
||||
- 'tip'
|
||||
|
||||
before_script:
|
||||
- go install github.com/golangci/golangci-lint/cmd/golangci-lint
|
||||
script:
|
||||
- golangci-lint run # run a bunch of code checkers/linters in parallel
|
||||
- go test -v -race ./... # Run all the tests with the race detector enabled
|
||||
- go test -coverpkg=./... -coverprofile=coverage.info -timeout=5s
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
|
43
vendor/github.com/asaskevich/govalidator/CODE_OF_CONDUCT.md
generated
vendored
Normal file
43
vendor/github.com/asaskevich/govalidator/CODE_OF_CONDUCT.md
generated
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
# Contributor Code of Conduct
|
||||
|
||||
This project adheres to [The Code Manifesto](http://codemanifesto.com)
|
||||
as its guidelines for contributor interactions.
|
||||
|
||||
## The Code Manifesto
|
||||
|
||||
We want to work in an ecosystem that empowers developers to reach their
|
||||
potential — one that encourages growth and effective collaboration. A space
|
||||
that is safe for all.
|
||||
|
||||
A space such as this benefits everyone that participates in it. It encourages
|
||||
new developers to enter our field. It is through discussion and collaboration
|
||||
that we grow, and through growth that we improve.
|
||||
|
||||
In the effort to create such a place, we hold to these values:
|
||||
|
||||
1. **Discrimination limits us.** This includes discrimination on the basis of
|
||||
race, gender, sexual orientation, gender identity, age, nationality,
|
||||
technology and any other arbitrary exclusion of a group of people.
|
||||
2. **Boundaries honor us.** Your comfort levels are not everyone’s comfort
|
||||
levels. Remember that, and if brought to your attention, heed it.
|
||||
3. **We are our biggest assets.** None of us were born masters of our trade.
|
||||
Each of us has been helped along the way. Return that favor, when and where
|
||||
you can.
|
||||
4. **We are resources for the future.** As an extension of #3, share what you
|
||||
know. Make yourself a resource to help those that come after you.
|
||||
5. **Respect defines us.** Treat others as you wish to be treated. Make your
|
||||
discussions, criticisms and debates from a position of respectfulness. Ask
|
||||
yourself, is it true? Is it necessary? Is it constructive? Anything less is
|
||||
unacceptable.
|
||||
6. **Reactions require grace.** Angry responses are valid, but abusive language
|
||||
and vindictive actions are toxic. When something happens that offends you,
|
||||
handle it assertively, but be respectful. Escalate reasonably, and try to
|
||||
allow the offender an opportunity to explain themselves, and possibly
|
||||
correct the issue.
|
||||
7. **Opinions are just that: opinions.** Each and every one of us, due to our
|
||||
background and upbringing, have varying opinions. That is perfectly
|
||||
acceptable. Remember this: if you respect your own opinions, you should
|
||||
respect the opinions of others.
|
||||
8. **To err is human.** You might not intend it, but mistakes do happen and
|
||||
contribute to build experience. Tolerate honest mistakes, and don't
|
||||
hesitate to apologize if you make one yourself.
|
2
vendor/github.com/asaskevich/govalidator/LICENSE
generated
vendored
2
vendor/github.com/asaskevich/govalidator/LICENSE
generated
vendored
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Alex Saskevich
|
||||
Copyright (c) 2014-2020 Alex Saskevich
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
45
vendor/github.com/asaskevich/govalidator/README.md
generated
vendored
45
vendor/github.com/asaskevich/govalidator/README.md
generated
vendored
@ -1,7 +1,8 @@
|
||||
govalidator
|
||||
===========
|
||||
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/asaskevich/govalidator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![GoDoc](https://godoc.org/github.com/asaskevich/govalidator?status.png)](https://godoc.org/github.com/asaskevich/govalidator) [![Coverage Status](https://img.shields.io/coveralls/asaskevich/govalidator.svg)](https://coveralls.io/r/asaskevich/govalidator?branch=master) [![wercker status](https://app.wercker.com/status/1ec990b09ea86c910d5f08b0e02c6043/s "wercker status")](https://app.wercker.com/project/bykey/1ec990b09ea86c910d5f08b0e02c6043)
|
||||
[![Build Status](https://travis-ci.org/asaskevich/govalidator.svg?branch=master)](https://travis-ci.org/asaskevich/govalidator) [![Go Report Card](https://goreportcard.com/badge/github.com/asaskevich/govalidator)](https://goreportcard.com/report/github.com/asaskevich/govalidator) [![GoSearch](http://go-search.org/badge?id=github.com%2Fasaskevich%2Fgovalidator)](http://go-search.org/view?id=github.com%2Fasaskevich%2Fgovalidator) [![Backers on Open Collective](https://opencollective.com/govalidator/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/govalidator/sponsors/badge.svg)](#sponsors) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator?ref=badge_shield)
|
||||
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/asaskevich/govalidator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![GoDoc](https://godoc.org/github.com/asaskevich/govalidator?status.png)](https://godoc.org/github.com/asaskevich/govalidator)
|
||||
[![Build Status](https://travis-ci.org/asaskevich/govalidator.svg?branch=master)](https://travis-ci.org/asaskevich/govalidator)
|
||||
[![Coverage](https://codecov.io/gh/asaskevich/govalidator/branch/master/graph/badge.svg)](https://codecov.io/gh/asaskevich/govalidator) [![Go Report Card](https://goreportcard.com/badge/github.com/asaskevich/govalidator)](https://goreportcard.com/report/github.com/asaskevich/govalidator) [![GoSearch](http://go-search.org/badge?id=github.com%2Fasaskevich%2Fgovalidator)](http://go-search.org/view?id=github.com%2Fasaskevich%2Fgovalidator) [![Backers on Open Collective](https://opencollective.com/govalidator/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/govalidator/sponsors/badge.svg)](#sponsors) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator?ref=badge_shield)
|
||||
|
||||
A package of validators and sanitizers for strings, structs and collections. Based on [validator.js](https://github.com/chriso/validator.js).
|
||||
|
||||
@ -83,14 +84,14 @@ This was changed to prevent data races when accessing custom validators.
|
||||
import "github.com/asaskevich/govalidator"
|
||||
|
||||
// before
|
||||
govalidator.CustomTypeTagMap["customByteArrayValidator"] = CustomTypeValidator(func(i interface{}, o interface{}) bool {
|
||||
govalidator.CustomTypeTagMap["customByteArrayValidator"] = func(i interface{}, o interface{}) bool {
|
||||
// ...
|
||||
})
|
||||
}
|
||||
|
||||
// after
|
||||
govalidator.CustomTypeTagMap.Set("customByteArrayValidator", CustomTypeValidator(func(i interface{}, o interface{}) bool {
|
||||
govalidator.CustomTypeTagMap.Set("customByteArrayValidator", func(i interface{}, o interface{}) bool {
|
||||
// ...
|
||||
}))
|
||||
})
|
||||
```
|
||||
|
||||
#### List of functions:
|
||||
@ -176,6 +177,7 @@ func IsPrintableASCII(str string) bool
|
||||
func IsRFC3339(str string) bool
|
||||
func IsRFC3339WithoutZone(str string) bool
|
||||
func IsRGBcolor(str string) bool
|
||||
func IsRegex(str string) bool
|
||||
func IsRequestURI(rawurl string) bool
|
||||
func IsRequestURL(rawurl string) bool
|
||||
func IsRipeMD128(str string) bool
|
||||
@ -202,6 +204,7 @@ func IsUUID(str string) bool
|
||||
func IsUUIDv3(str string) bool
|
||||
func IsUUIDv4(str string) bool
|
||||
func IsUUIDv5(str string) bool
|
||||
func IsULID(str string) bool
|
||||
func IsUnixTime(str string) bool
|
||||
func IsUpperCase(str string) bool
|
||||
func IsVariableWidth(str string) bool
|
||||
@ -238,7 +241,7 @@ func Trim(str, chars string) string
|
||||
func Truncate(str string, length int, ending string) string
|
||||
func TruncatingErrorf(str string, args ...interface{}) error
|
||||
func UnderscoreToCamelCase(s string) string
|
||||
func ValidateMap(s map[string]interface{}, m map[string]interface{}) (bool, error)
|
||||
func ValidateMap(inputMap map[string]interface{}, validationMap map[string]interface{}) (bool, error)
|
||||
func ValidateStruct(s interface{}) (bool, error)
|
||||
func WhiteList(str, chars string) string
|
||||
type ConditionIterator
|
||||
@ -279,7 +282,7 @@ type User struct {
|
||||
Age int `valid:"type(int)"`
|
||||
Meta interface{} `valid:"type(string)"`
|
||||
}
|
||||
result, err := govalidator.ValidateStruct(user{"Bob", 20, "meta"})
|
||||
result, err := govalidator.ValidateStruct(User{"Bob", 20, "meta"})
|
||||
if err != nil {
|
||||
println("error: " + err.Error())
|
||||
}
|
||||
@ -381,6 +384,7 @@ Here is a list of available validators for struct fields (validator - used funct
|
||||
"rfc3339WithoutZone": IsRFC3339WithoutZone,
|
||||
"ISO3166Alpha2": IsISO3166Alpha2,
|
||||
"ISO3166Alpha3": IsISO3166Alpha3,
|
||||
"ulid": IsULID,
|
||||
```
|
||||
Validators with parameters
|
||||
|
||||
@ -392,6 +396,8 @@ Validators with parameters
|
||||
"matches(pattern)": StringMatches,
|
||||
"in(string1|string2|...|stringN)": IsIn,
|
||||
"rsapub(keylength)" : IsRsaPub,
|
||||
"minstringlength(int): MinStringLength,
|
||||
"maxstringlength(int): MaxStringLength,
|
||||
```
|
||||
Validators with parameters for any type
|
||||
|
||||
@ -461,7 +467,7 @@ var inputMap = map[string]interface{}{
|
||||
},
|
||||
}
|
||||
|
||||
result, err := govalidator.ValidateMap(mapTemplate, inputMap)
|
||||
result, err := govalidator.ValidateMap(inputMap, mapTemplate)
|
||||
if err != nil {
|
||||
println("error: " + err.Error())
|
||||
}
|
||||
@ -487,7 +493,7 @@ type StructWithCustomByteArray struct {
|
||||
CustomMinLength int `valid:"-"`
|
||||
}
|
||||
|
||||
govalidator.CustomTypeTagMap.Set("customByteArrayValidator", CustomTypeValidator(func(i interface{}, context interface{}) bool {
|
||||
govalidator.CustomTypeTagMap.Set("customByteArrayValidator", func(i interface{}, context interface{}) bool {
|
||||
switch v := context.(type) { // you can type switch on the context interface being validated
|
||||
case StructWithCustomByteArray:
|
||||
// you can check and validate against some other field in the context,
|
||||
@ -507,14 +513,25 @@ govalidator.CustomTypeTagMap.Set("customByteArrayValidator", CustomTypeValidator
|
||||
}
|
||||
}
|
||||
return false
|
||||
}))
|
||||
govalidator.CustomTypeTagMap.Set("customMinLengthValidator", CustomTypeValidator(func(i interface{}, context interface{}) bool {
|
||||
})
|
||||
govalidator.CustomTypeTagMap.Set("customMinLengthValidator", func(i interface{}, context interface{}) bool {
|
||||
switch v := context.(type) { // this validates a field against the value in another field, i.e. dependent validation
|
||||
case StructWithCustomByteArray:
|
||||
return len(v.ID) >= v.CustomMinLength
|
||||
}
|
||||
return false
|
||||
}))
|
||||
})
|
||||
```
|
||||
|
||||
###### Loop over Error()
|
||||
By default .Error() returns all errors in a single String. To access each error you can do this:
|
||||
```go
|
||||
if err != nil {
|
||||
errs := err.(govalidator.Errors).Errors()
|
||||
for _, e := range errs {
|
||||
fmt.Println(e.Error())
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
###### Custom error messages
|
||||
@ -602,4 +619,4 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
|
||||
|
||||
|
||||
## License
|
||||
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator?ref=badge_large)
|
||||
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator?ref=badge_large)
|
||||
|
29
vendor/github.com/asaskevich/govalidator/arrays.go
generated
vendored
29
vendor/github.com/asaskevich/govalidator/arrays.go
generated
vendored
@ -9,6 +9,35 @@ type ResultIterator func(interface{}, int) interface{}
|
||||
// ConditionIterator is the function that accepts element of slice/array and its index and returns boolean
|
||||
type ConditionIterator func(interface{}, int) bool
|
||||
|
||||
// ReduceIterator is the function that accepts two element of slice/array and returns result of merging those values
|
||||
type ReduceIterator func(interface{}, interface{}) interface{}
|
||||
|
||||
// Some validates that any item of array corresponds to ConditionIterator. Returns boolean.
|
||||
func Some(array []interface{}, iterator ConditionIterator) bool {
|
||||
res := false
|
||||
for index, data := range array {
|
||||
res = res || iterator(data, index)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
// Every validates that every item of array corresponds to ConditionIterator. Returns boolean.
|
||||
func Every(array []interface{}, iterator ConditionIterator) bool {
|
||||
res := true
|
||||
for index, data := range array {
|
||||
res = res && iterator(data, index)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
// Reduce boils down a list of values into a single value by ReduceIterator
|
||||
func Reduce(array []interface{}, iterator ReduceIterator, initialValue interface{}) interface{} {
|
||||
for _, data := range array {
|
||||
initialValue = iterator(initialValue, data)
|
||||
}
|
||||
return initialValue
|
||||
}
|
||||
|
||||
// Each iterates over the slice and apply Iterator to every item
|
||||
func Each(array []interface{}, iterator Iterator) {
|
||||
for index, data := range array {
|
||||
|
33
vendor/github.com/asaskevich/govalidator/converter.go
generated
vendored
33
vendor/github.com/asaskevich/govalidator/converter.go
generated
vendored
@ -10,7 +10,7 @@ import (
|
||||
// ToString convert the input to a string.
|
||||
func ToString(obj interface{}) string {
|
||||
res := fmt.Sprintf("%v", obj)
|
||||
return string(res)
|
||||
return res
|
||||
}
|
||||
|
||||
// ToJSON convert the input to a valid JSON string
|
||||
@ -23,12 +23,27 @@ func ToJSON(obj interface{}) (string, error) {
|
||||
}
|
||||
|
||||
// ToFloat convert the input string to a float, or 0.0 if the input is not a float.
|
||||
func ToFloat(str string) (float64, error) {
|
||||
res, err := strconv.ParseFloat(str, 64)
|
||||
if err != nil {
|
||||
res = 0.0
|
||||
func ToFloat(value interface{}) (res float64, err error) {
|
||||
val := reflect.ValueOf(value)
|
||||
|
||||
switch value.(type) {
|
||||
case int, int8, int16, int32, int64:
|
||||
res = float64(val.Int())
|
||||
case uint, uint8, uint16, uint32, uint64:
|
||||
res = float64(val.Uint())
|
||||
case float32, float64:
|
||||
res = val.Float()
|
||||
case string:
|
||||
res, err = strconv.ParseFloat(val.String(), 64)
|
||||
if err != nil {
|
||||
res = 0
|
||||
}
|
||||
default:
|
||||
err = fmt.Errorf("ToInt: unknown interface type %T", value)
|
||||
res = 0
|
||||
}
|
||||
return res, err
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ToInt convert the input string or any int type to an integer type 64, or 0 if the input is not an integer.
|
||||
@ -40,6 +55,8 @@ func ToInt(value interface{}) (res int64, err error) {
|
||||
res = val.Int()
|
||||
case uint, uint8, uint16, uint32, uint64:
|
||||
res = int64(val.Uint())
|
||||
case float32, float64:
|
||||
res = int64(val.Float())
|
||||
case string:
|
||||
if IsInt(val.String()) {
|
||||
res, err = strconv.ParseInt(val.String(), 0, 64)
|
||||
@ -47,11 +64,11 @@ func ToInt(value interface{}) (res int64, err error) {
|
||||
res = 0
|
||||
}
|
||||
} else {
|
||||
err = fmt.Errorf("math: square root of negative number %g", value)
|
||||
err = fmt.Errorf("ToInt: invalid numeric format %g", value)
|
||||
res = 0
|
||||
}
|
||||
default:
|
||||
err = fmt.Errorf("math: square root of negative number %g", value)
|
||||
err = fmt.Errorf("ToInt: unknown interface type %T", value)
|
||||
res = 0
|
||||
}
|
||||
|
||||
|
6
vendor/github.com/asaskevich/govalidator/error.go
generated
vendored
6
vendor/github.com/asaskevich/govalidator/error.go
generated
vendored
@ -1,6 +1,9 @@
|
||||
package govalidator
|
||||
|
||||
import "strings"
|
||||
import (
|
||||
"sort"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Errors is an array of multiple errors and conforms to the error interface.
|
||||
type Errors []error
|
||||
@ -15,6 +18,7 @@ func (es Errors) Error() string {
|
||||
for _, e := range es {
|
||||
errs = append(errs, e.Error())
|
||||
}
|
||||
sort.Strings(errs)
|
||||
return strings.Join(errs, ";")
|
||||
}
|
||||
|
||||
|
37
vendor/github.com/asaskevich/govalidator/numerics.go
generated
vendored
37
vendor/github.com/asaskevich/govalidator/numerics.go
generated
vendored
@ -2,7 +2,6 @@ package govalidator
|
||||
|
||||
import (
|
||||
"math"
|
||||
"reflect"
|
||||
)
|
||||
|
||||
// Abs returns absolute value of number
|
||||
@ -41,7 +40,7 @@ func IsNonPositive(value float64) bool {
|
||||
return value <= 0
|
||||
}
|
||||
|
||||
// InRange returns true if value lies between left and right border
|
||||
// InRangeInt returns true if value lies between left and right border
|
||||
func InRangeInt(value, left, right interface{}) bool {
|
||||
value64, _ := ToInt(value)
|
||||
left64, _ := ToInt(left)
|
||||
@ -52,7 +51,7 @@ func InRangeInt(value, left, right interface{}) bool {
|
||||
return value64 >= left64 && value64 <= right64
|
||||
}
|
||||
|
||||
// InRange returns true if value lies between left and right border
|
||||
// InRangeFloat32 returns true if value lies between left and right border
|
||||
func InRangeFloat32(value, left, right float32) bool {
|
||||
if left > right {
|
||||
left, right = right, left
|
||||
@ -60,7 +59,7 @@ func InRangeFloat32(value, left, right float32) bool {
|
||||
return value >= left && value <= right
|
||||
}
|
||||
|
||||
// InRange returns true if value lies between left and right border
|
||||
// InRangeFloat64 returns true if value lies between left and right border
|
||||
func InRangeFloat64(value, left, right float64) bool {
|
||||
if left > right {
|
||||
left, right = right, left
|
||||
@ -68,20 +67,24 @@ func InRangeFloat64(value, left, right float64) bool {
|
||||
return value >= left && value <= right
|
||||
}
|
||||
|
||||
// InRange returns true if value lies between left and right border, generic type to handle int, float32 or float64, all types must the same type
|
||||
// InRange returns true if value lies between left and right border, generic type to handle int, float32, float64 and string.
|
||||
// All types must the same type.
|
||||
// False if value doesn't lie in range or if it incompatible or not comparable
|
||||
func InRange(value interface{}, left interface{}, right interface{}) bool {
|
||||
|
||||
reflectValue := reflect.TypeOf(value).Kind()
|
||||
reflectLeft := reflect.TypeOf(left).Kind()
|
||||
reflectRight := reflect.TypeOf(right).Kind()
|
||||
|
||||
if reflectValue == reflect.Int && reflectLeft == reflect.Int && reflectRight == reflect.Int {
|
||||
return InRangeInt(value.(int), left.(int), right.(int))
|
||||
} else if reflectValue == reflect.Float32 && reflectLeft == reflect.Float32 && reflectRight == reflect.Float32 {
|
||||
return InRangeFloat32(value.(float32), left.(float32), right.(float32))
|
||||
} else if reflectValue == reflect.Float64 && reflectLeft == reflect.Float64 && reflectRight == reflect.Float64 {
|
||||
return InRangeFloat64(value.(float64), left.(float64), right.(float64))
|
||||
} else {
|
||||
switch value.(type) {
|
||||
case int:
|
||||
intValue, _ := ToInt(value)
|
||||
intLeft, _ := ToInt(left)
|
||||
intRight, _ := ToInt(right)
|
||||
return InRangeInt(intValue, intLeft, intRight)
|
||||
case float32, float64:
|
||||
intValue, _ := ToFloat(value)
|
||||
intLeft, _ := ToFloat(left)
|
||||
intRight, _ := ToFloat(right)
|
||||
return InRangeFloat64(intValue, intLeft, intRight)
|
||||
case string:
|
||||
return value.(string) >= left.(string) && value.(string) <= right.(string)
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
12
vendor/github.com/asaskevich/govalidator/patterns.go
generated
vendored
12
vendor/github.com/asaskevich/govalidator/patterns.go
generated
vendored
@ -38,16 +38,21 @@ const (
|
||||
URLPort string = `(:(\d{1,5}))`
|
||||
URLIP string = `([1-9]\d?|1\d\d|2[01]\d|22[0-3]|24\d|25[0-5])(\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])){2}(?:\.([0-9]\d?|1\d\d|2[0-4]\d|25[0-5]))`
|
||||
URLSubdomain string = `((www\.)|([a-zA-Z0-9]+([-_\.]?[a-zA-Z0-9])*[a-zA-Z0-9]\.[a-zA-Z0-9]+))`
|
||||
URL string = `^` + URLSchema + `?` + URLUsername + `?` + `((` + URLIP + `|(\[` + IP + `\])|(([a-zA-Z0-9]([a-zA-Z0-9-_]+)?[a-zA-Z0-9]([-\.][a-zA-Z0-9]+)*)|(` + URLSubdomain + `?))?(([a-zA-Z\x{00a1}-\x{ffff}0-9]+-?-?)*[a-zA-Z\x{00a1}-\x{ffff}0-9]+)(?:\.([a-zA-Z\x{00a1}-\x{ffff}]{1,}))?))\.?` + URLPort + `?` + URLPath + `?$`
|
||||
URL = `^` + URLSchema + `?` + URLUsername + `?` + `((` + URLIP + `|(\[` + IP + `\])|(([a-zA-Z0-9]([a-zA-Z0-9-_]+)?[a-zA-Z0-9]([-\.][a-zA-Z0-9]+)*)|(` + URLSubdomain + `?))?(([a-zA-Z\x{00a1}-\x{ffff}0-9]+-?-?)*[a-zA-Z\x{00a1}-\x{ffff}0-9]+)(?:\.([a-zA-Z\x{00a1}-\x{ffff}]{1,}))?))\.?` + URLPort + `?` + URLPath + `?$`
|
||||
SSN string = `^\d{3}[- ]?\d{2}[- ]?\d{4}$`
|
||||
WinPath string = `^[a-zA-Z]:\\(?:[^\\/:*?"<>|\r\n]+\\)*[^\\/:*?"<>|\r\n]*$`
|
||||
UnixPath string = `^(/[^/\x00]*)+/?$`
|
||||
WinARPath string = `^(?:(?:[a-zA-Z]:|\\\\[a-z0-9_.$●-]+\\[a-z0-9_.$●-]+)\\|\\?[^\\/:*?"<>|\r\n]+\\?)(?:[^\\/:*?"<>|\r\n]+\\)*[^\\/:*?"<>|\r\n]*$`
|
||||
UnixARPath string = `^((\.{0,2}/)?([^/\x00]*))+/?$`
|
||||
Semver string = "^v?(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(-(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(\\.(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\\+[0-9a-zA-Z-]+(\\.[0-9a-zA-Z-]+)*)?$"
|
||||
tagName string = "valid"
|
||||
hasLowerCase string = ".*[[:lower:]]"
|
||||
hasUpperCase string = ".*[[:upper:]]"
|
||||
hasWhitespace string = ".*[[:space:]]"
|
||||
hasWhitespaceOnly string = "^[[:space:]]+$"
|
||||
IMEI string = "^[0-9a-f]{14}$|^\\d{15}$|^\\d{18}$"
|
||||
IMSI string = "^\\d{14,15}$"
|
||||
E164 string = `^\+?[1-9]\d{1,14}$`
|
||||
)
|
||||
|
||||
// Used by IsFilePath func
|
||||
@ -95,9 +100,14 @@ var (
|
||||
rxSSN = regexp.MustCompile(SSN)
|
||||
rxWinPath = regexp.MustCompile(WinPath)
|
||||
rxUnixPath = regexp.MustCompile(UnixPath)
|
||||
rxARWinPath = regexp.MustCompile(WinARPath)
|
||||
rxARUnixPath = regexp.MustCompile(UnixARPath)
|
||||
rxSemver = regexp.MustCompile(Semver)
|
||||
rxHasLowerCase = regexp.MustCompile(hasLowerCase)
|
||||
rxHasUpperCase = regexp.MustCompile(hasUpperCase)
|
||||
rxHasWhitespace = regexp.MustCompile(hasWhitespace)
|
||||
rxHasWhitespaceOnly = regexp.MustCompile(hasWhitespaceOnly)
|
||||
rxIMEI = regexp.MustCompile(IMEI)
|
||||
rxIMSI = regexp.MustCompile(IMSI)
|
||||
rxE164 = regexp.MustCompile(E164)
|
||||
)
|
||||
|
26
vendor/github.com/asaskevich/govalidator/types.go
generated
vendored
26
vendor/github.com/asaskevich/govalidator/types.go
generated
vendored
@ -14,8 +14,10 @@ type Validator func(str string) bool
|
||||
// The second parameter should be the context (in the case of validating a struct: the whole object being validated).
|
||||
type CustomTypeValidator func(i interface{}, o interface{}) bool
|
||||
|
||||
// ParamValidator is a wrapper for validator functions that accepts additional parameters.
|
||||
// ParamValidator is a wrapper for validator functions that accept additional parameters.
|
||||
type ParamValidator func(str string, params ...string) bool
|
||||
|
||||
// InterfaceParamValidator is a wrapper for functions that accept variants parameters for an interface value
|
||||
type InterfaceParamValidator func(in interface{}, params ...string) bool
|
||||
type tagOptionsMap map[string]tagOption
|
||||
|
||||
@ -72,13 +74,13 @@ var ParamTagMap = map[string]ParamValidator{
|
||||
|
||||
// ParamTagRegexMap maps param tags to their respective regexes.
|
||||
var ParamTagRegexMap = map[string]*regexp.Regexp{
|
||||
"range": regexp.MustCompile("^range\\((\\d+)\\|(\\d+)\\)$"),
|
||||
"length": regexp.MustCompile("^length\\((\\d+)\\|(\\d+)\\)$"),
|
||||
"runelength": regexp.MustCompile("^runelength\\((\\d+)\\|(\\d+)\\)$"),
|
||||
"stringlength": regexp.MustCompile("^stringlength\\((\\d+)\\|(\\d+)\\)$"),
|
||||
"in": regexp.MustCompile(`^in\((.*)\)`),
|
||||
"matches": regexp.MustCompile(`^matches\((.+)\)$`),
|
||||
"rsapub": regexp.MustCompile("^rsapub\\((\\d+)\\)$"),
|
||||
"range": regexp.MustCompile("^range\\((\\d+)\\|(\\d+)\\)$"),
|
||||
"length": regexp.MustCompile("^length\\((\\d+)\\|(\\d+)\\)$"),
|
||||
"runelength": regexp.MustCompile("^runelength\\((\\d+)\\|(\\d+)\\)$"),
|
||||
"stringlength": regexp.MustCompile("^stringlength\\((\\d+)\\|(\\d+)\\)$"),
|
||||
"in": regexp.MustCompile(`^in\((.*)\)`),
|
||||
"matches": regexp.MustCompile(`^matches\((.+)\)$`),
|
||||
"rsapub": regexp.MustCompile("^rsapub\\((\\d+)\\)$"),
|
||||
"minstringlength": regexp.MustCompile("^minstringlength\\((\\d+)\\)$"),
|
||||
"maxstringlength": regexp.MustCompile("^maxstringlength\\((\\d+)\\)$"),
|
||||
}
|
||||
@ -162,6 +164,8 @@ var TagMap = map[string]Validator{
|
||||
"ISO3166Alpha2": IsISO3166Alpha2,
|
||||
"ISO3166Alpha3": IsISO3166Alpha3,
|
||||
"ISO4217": IsISO4217,
|
||||
"IMEI": IsIMEI,
|
||||
"ulid": IsULID,
|
||||
}
|
||||
|
||||
// ISO3166Entry stores country codes
|
||||
@ -446,10 +450,10 @@ var ISO4217List = []string{
|
||||
"PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG",
|
||||
"QAR",
|
||||
"RON", "RSD", "RUB", "RWF",
|
||||
"SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "SVC", "SYP", "SZL",
|
||||
"SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "STN", "SVC", "SYP", "SZL",
|
||||
"THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS",
|
||||
"UAH", "UGX", "USD", "USN", "UYI", "UYU", "UZS",
|
||||
"VEF", "VND", "VUV",
|
||||
"UAH", "UGX", "USD", "USN", "UYI", "UYU", "UYW", "UZS",
|
||||
"VEF", "VES", "VND", "VUV",
|
||||
"WST",
|
||||
"XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XSU", "XTS", "XUA", "XXX",
|
||||
"YER",
|
||||
|
496
vendor/github.com/asaskevich/govalidator/validator.go
generated
vendored
496
vendor/github.com/asaskevich/govalidator/validator.go
generated
vendored
File diff suppressed because it is too large
Load Diff
4
vendor/github.com/camunda/zeebe/clients/go/v8/internal/embedded/embedded.go
generated
vendored
4
vendor/github.com/camunda/zeebe/clients/go/v8/internal/embedded/embedded.go
generated
vendored
@ -77,7 +77,7 @@ func (fi bindataFileInfo) Sys() interface{} {
|
||||
return nil
|
||||
}
|
||||
|
||||
var _version = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb2\xd0\x33\xd4\xb3\xe0\x02\x04\x00\x00\xff\xff\xcd\x14\x14\xaa\x06\x00\x00\x00")
|
||||
var _version = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb2\xd0\x33\xd2\x33\xe5\x02\x04\x00\x00\xff\xff\x6e\xc5\x0f\x0d\x06\x00\x00\x00")
|
||||
|
||||
func versionBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
@ -92,7 +92,7 @@ func version() (*asset, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "VERSION", size: 6, mode: os.FileMode(420), modTime: time.Unix(1676385308, 0)}
|
||||
info := bindataFileInfo{name: "VERSION", size: 6, mode: os.FileMode(420), modTime: time.Unix(1684244223, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
112
vendor/github.com/camunda/zeebe/clients/go/v8/pkg/commands/broadcast_signal.go
generated
vendored
Normal file
112
vendor/github.com/camunda/zeebe/clients/go/v8/pkg/commands/broadcast_signal.go
generated
vendored
Normal file
@ -0,0 +1,112 @@
|
||||
// Copyright © 2018 Camunda Services GmbH (info@camunda.com)
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package commands
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/camunda/zeebe/clients/go/v8/internal/utils"
|
||||
"github.com/camunda/zeebe/clients/go/v8/pkg/pb"
|
||||
)
|
||||
|
||||
type DispatchBroadcastSignalCommand interface {
|
||||
Send(context.Context) (*pb.BroadcastSignalResponse, error)
|
||||
}
|
||||
|
||||
type BroadcastSignalCommandStep1 interface {
|
||||
SignalName(string) BroadcastSignalCommandStep2
|
||||
}
|
||||
|
||||
type BroadcastSignalCommandStep2 interface {
|
||||
DispatchBroadcastSignalCommand
|
||||
|
||||
// Expected to be valid JSON string
|
||||
VariablesFromString(string) (BroadcastSignalCommandStep2, error)
|
||||
|
||||
// Expected to construct a valid JSON string
|
||||
VariablesFromStringer(fmt.Stringer) (BroadcastSignalCommandStep2, error)
|
||||
|
||||
// Expected that object is JSON serializable
|
||||
VariablesFromObject(interface{}) (BroadcastSignalCommandStep2, error)
|
||||
VariablesFromObjectIgnoreOmitempty(interface{}) (BroadcastSignalCommandStep2, error)
|
||||
VariablesFromMap(map[string]interface{}) (BroadcastSignalCommandStep2, error)
|
||||
}
|
||||
|
||||
type BroadcastSignalCommand struct {
|
||||
Command
|
||||
request pb.BroadcastSignalRequest
|
||||
}
|
||||
|
||||
func (cmd *BroadcastSignalCommand) VariablesFromString(variables string) (BroadcastSignalCommandStep2, error) {
|
||||
err := cmd.mixin.Validate("variables", variables)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
cmd.request.Variables = variables
|
||||
return cmd, nil
|
||||
}
|
||||
|
||||
func (cmd *BroadcastSignalCommand) VariablesFromStringer(variables fmt.Stringer) (BroadcastSignalCommandStep2, error) {
|
||||
return cmd.VariablesFromString(variables.String())
|
||||
}
|
||||
|
||||
func (cmd *BroadcastSignalCommand) VariablesFromObject(variables interface{}) (BroadcastSignalCommandStep2, error) {
|
||||
value, err := cmd.mixin.AsJSON("variables", variables, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
cmd.request.Variables = value
|
||||
return cmd, err
|
||||
}
|
||||
|
||||
func (cmd *BroadcastSignalCommand) VariablesFromObjectIgnoreOmitempty(variables interface{}) (BroadcastSignalCommandStep2, error) {
|
||||
value, err := cmd.mixin.AsJSON("variables", variables, true)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
cmd.request.Variables = value
|
||||
return cmd, err
|
||||
}
|
||||
|
||||
func (cmd *BroadcastSignalCommand) VariablesFromMap(variables map[string]interface{}) (BroadcastSignalCommandStep2, error) {
|
||||
return cmd.VariablesFromObject(variables)
|
||||
}
|
||||
|
||||
func (cmd *BroadcastSignalCommand) SignalName(signalName string) BroadcastSignalCommandStep2 {
|
||||
cmd.request.SignalName = signalName
|
||||
return cmd
|
||||
}
|
||||
|
||||
func (cmd *BroadcastSignalCommand) Send(ctx context.Context) (*pb.BroadcastSignalResponse, error) {
|
||||
response, err := cmd.gateway.BroadcastSignal(ctx, &cmd.request)
|
||||
if cmd.shouldRetry(ctx, err) {
|
||||
return cmd.Send(ctx)
|
||||
}
|
||||
|
||||
return response, err
|
||||
}
|
||||
|
||||
func NewBroadcastSignalCommand(gateway pb.GatewayClient, pred retryPredicate) BroadcastSignalCommandStep1 {
|
||||
return &BroadcastSignalCommand{
|
||||
Command: Command{
|
||||
mixin: utils.NewJSONStringSerializer(),
|
||||
gateway: gateway,
|
||||
shouldRetry: pred,
|
||||
},
|
||||
}
|
||||
}
|
6
vendor/github.com/camunda/zeebe/clients/go/v8/pkg/commands/create_instance.go
generated
vendored
6
vendor/github.com/camunda/zeebe/clients/go/v8/pkg/commands/create_instance.go
generated
vendored
@ -119,9 +119,7 @@ func (cmd *CreateInstanceCommand) StartBeforeElement(elementID string) CreateIns
|
||||
ElementId: elementID,
|
||||
}
|
||||
|
||||
updatedStartInstructions := append(cmd.request.StartInstructions, &startInstruction)
|
||||
|
||||
cmd.request.StartInstructions = updatedStartInstructions
|
||||
cmd.request.StartInstructions = append(cmd.request.StartInstructions, &startInstruction)
|
||||
return cmd
|
||||
}
|
||||
|
||||
@ -140,7 +138,7 @@ func (cmd *CreateInstanceCommand) ProcessDefinitionKey(key int64) CreateInstance
|
||||
return cmd
|
||||
}
|
||||
|
||||
//nolint:golint
|
||||
//nolint:revive
|
||||
func (cmd *CreateInstanceCommand) BPMNProcessId(id string) CreateInstanceCommandStep2 {
|
||||
cmd.request.BpmnProcessId = id
|
||||
return cmd
|
||||
|
4
vendor/github.com/camunda/zeebe/clients/go/v8/pkg/commands/deploy.go
generated
vendored
4
vendor/github.com/camunda/zeebe/clients/go/v8/pkg/commands/deploy.go
generated
vendored
@ -17,8 +17,8 @@ package commands
|
||||
import (
|
||||
"context"
|
||||
"github.com/camunda/zeebe/clients/go/v8/pkg/pb"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
)
|
||||
|
||||
type DeployCommand struct {
|
||||
@ -27,7 +27,7 @@ type DeployCommand struct {
|
||||
}
|
||||
|
||||
func (cmd *DeployCommand) AddResourceFile(path string) *DeployCommand {
|
||||
b, err := ioutil.ReadFile(path)
|
||||
b, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
4
vendor/github.com/camunda/zeebe/clients/go/v8/pkg/commands/deploy_resource.go
generated
vendored
4
vendor/github.com/camunda/zeebe/clients/go/v8/pkg/commands/deploy_resource.go
generated
vendored
@ -17,8 +17,8 @@ package commands
|
||||
import (
|
||||
"context"
|
||||
"github.com/camunda/zeebe/clients/go/v8/pkg/pb"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
)
|
||||
|
||||
type DeployResourceCommand struct {
|
||||
@ -27,7 +27,7 @@ type DeployResourceCommand struct {
|
||||
}
|
||||
|
||||
func (cmd *DeployResourceCommand) AddResourceFile(path string) *DeployResourceCommand {
|
||||
b, err := ioutil.ReadFile(path)
|
||||
b, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
119
vendor/github.com/camunda/zeebe/clients/go/v8/pkg/commands/evaluate_decision.go
generated
vendored
Normal file
119
vendor/github.com/camunda/zeebe/clients/go/v8/pkg/commands/evaluate_decision.go
generated
vendored
Normal file
@ -0,0 +1,119 @@
|
||||
// Copyright © 2018 Camunda Services GmbH (info@camunda.com)
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package commands
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/camunda/zeebe/clients/go/v8/internal/utils"
|
||||
"github.com/camunda/zeebe/clients/go/v8/pkg/pb"
|
||||
)
|
||||
|
||||
type DispatchEvaluateDecisionCommand interface {
|
||||
Send(context.Context) (*pb.EvaluateDecisionResponse, error)
|
||||
}
|
||||
|
||||
type EvaluateDecisionCommandStep1 interface {
|
||||
DecisionId(string) EvaluateDecisionCommandStep2
|
||||
DecisionKey(int64) EvaluateDecisionCommandStep2
|
||||
}
|
||||
|
||||
type EvaluateDecisionCommandStep2 interface {
|
||||
DispatchEvaluateDecisionCommand
|
||||
|
||||
// Expected to be valid JSON string
|
||||
VariablesFromString(string) (EvaluateDecisionCommandStep2, error)
|
||||
|
||||
// Expected to construct a valid JSON string
|
||||
VariablesFromStringer(fmt.Stringer) (EvaluateDecisionCommandStep2, error)
|
||||
|
||||
// Expected that object is JSON serializable
|
||||
VariablesFromObject(interface{}) (EvaluateDecisionCommandStep2, error)
|
||||
VariablesFromObjectIgnoreOmitempty(interface{}) (EvaluateDecisionCommandStep2, error)
|
||||
VariablesFromMap(map[string]interface{}) (EvaluateDecisionCommandStep2, error)
|
||||
}
|
||||
|
||||
type EvaluateDecisionCommand struct {
|
||||
Command
|
||||
request pb.EvaluateDecisionRequest
|
||||
}
|
||||
|
||||
func (cmd *EvaluateDecisionCommand) VariablesFromString(variables string) (EvaluateDecisionCommandStep2, error) {
|
||||
err := cmd.mixin.Validate("variables", variables)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
cmd.request.Variables = variables
|
||||
return cmd, nil
|
||||
}
|
||||
|
||||
func (cmd *EvaluateDecisionCommand) VariablesFromStringer(variables fmt.Stringer) (EvaluateDecisionCommandStep2, error) {
|
||||
return cmd.VariablesFromString(variables.String())
|
||||
}
|
||||
|
||||
func (cmd *EvaluateDecisionCommand) VariablesFromObject(variables interface{}) (EvaluateDecisionCommandStep2, error) {
|
||||
value, err := cmd.mixin.AsJSON("variables", variables, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
cmd.request.Variables = value
|
||||
return cmd, err
|
||||
}
|
||||
|
||||
func (cmd *EvaluateDecisionCommand) VariablesFromObjectIgnoreOmitempty(variables interface{}) (EvaluateDecisionCommandStep2, error) {
|
||||
value, err := cmd.mixin.AsJSON("variables", variables, true)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
cmd.request.Variables = value
|
||||
return cmd, err
|
||||
}
|
||||
|
||||
func (cmd *EvaluateDecisionCommand) VariablesFromMap(variables map[string]interface{}) (EvaluateDecisionCommandStep2, error) {
|
||||
return cmd.VariablesFromObject(variables)
|
||||
}
|
||||
|
||||
func (cmd *EvaluateDecisionCommand) DecisionKey(key int64) EvaluateDecisionCommandStep2 {
|
||||
cmd.request.DecisionKey = key
|
||||
return cmd
|
||||
}
|
||||
|
||||
//nolint:revive
|
||||
func (cmd *EvaluateDecisionCommand) DecisionId(id string) EvaluateDecisionCommandStep2 {
|
||||
cmd.request.DecisionId = id
|
||||
return cmd
|
||||
}
|
||||
|
||||
func (cmd *EvaluateDecisionCommand) Send(ctx context.Context) (*pb.EvaluateDecisionResponse, error) {
|
||||
response, err := cmd.gateway.EvaluateDecision(ctx, &cmd.request)
|
||||
if cmd.shouldRetry(ctx, err) {
|
||||
return cmd.Send(ctx)
|
||||
}
|
||||
|
||||
return response, err
|
||||
}
|
||||
|
||||
func NewEvaluateDecisionCommand(gateway pb.GatewayClient, pred retryPredicate) EvaluateDecisionCommandStep1 {
|
||||
return &EvaluateDecisionCommand{
|
||||
Command: Command{
|
||||
mixin: utils.NewJSONStringSerializer(),
|
||||
gateway: gateway,
|
||||
shouldRetry: pred,
|
||||
},
|
||||
}
|
||||
}
|
50
vendor/github.com/camunda/zeebe/clients/go/v8/pkg/commands/fail_job.go
generated
vendored
50
vendor/github.com/camunda/zeebe/clients/go/v8/pkg/commands/fail_job.go
generated
vendored
@ -17,6 +17,8 @@ package commands
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/camunda/zeebe/clients/go/v8/internal/utils"
|
||||
"github.com/camunda/zeebe/clients/go/v8/pkg/pb"
|
||||
"time"
|
||||
)
|
||||
@ -37,6 +39,12 @@ type FailJobCommandStep3 interface {
|
||||
DispatchFailJobCommand
|
||||
RetryBackoff(retryBackoff time.Duration) FailJobCommandStep3
|
||||
ErrorMessage(string) FailJobCommandStep3
|
||||
|
||||
VariablesFromString(string) (DispatchFailJobCommand, error)
|
||||
VariablesFromStringer(fmt.Stringer) (DispatchFailJobCommand, error)
|
||||
VariablesFromMap(map[string]interface{}) (DispatchFailJobCommand, error)
|
||||
VariablesFromObject(interface{}) (DispatchFailJobCommand, error)
|
||||
VariablesFromObjectIgnoreOmitempty(interface{}) (DispatchFailJobCommand, error)
|
||||
}
|
||||
|
||||
type FailJobCommand struct {
|
||||
@ -64,6 +72,44 @@ func (cmd *FailJobCommand) ErrorMessage(errorMessage string) FailJobCommandStep3
|
||||
return cmd
|
||||
}
|
||||
|
||||
func (cmd *FailJobCommand) VariablesFromString(variables string) (DispatchFailJobCommand, error) {
|
||||
err := cmd.mixin.Validate("variables", variables)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
cmd.request.Variables = variables
|
||||
return cmd, nil
|
||||
}
|
||||
|
||||
func (cmd *FailJobCommand) VariablesFromStringer(variables fmt.Stringer) (DispatchFailJobCommand, error) {
|
||||
return cmd.VariablesFromString(variables.String())
|
||||
}
|
||||
|
||||
func (cmd *FailJobCommand) VariablesFromObject(variables interface{}) (DispatchFailJobCommand, error) {
|
||||
value, err := cmd.mixin.AsJSON("variables", variables, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
cmd.request.Variables = value
|
||||
return cmd, nil
|
||||
}
|
||||
|
||||
func (cmd *FailJobCommand) VariablesFromObjectIgnoreOmitempty(variables interface{}) (DispatchFailJobCommand, error) {
|
||||
value, err := cmd.mixin.AsJSON("variables", variables, true)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
cmd.request.Variables = value
|
||||
return cmd, nil
|
||||
}
|
||||
|
||||
func (cmd *FailJobCommand) VariablesFromMap(variables map[string]interface{}) (DispatchFailJobCommand, error) {
|
||||
return cmd.VariablesFromObject(variables)
|
||||
}
|
||||
|
||||
func (cmd *FailJobCommand) Send(ctx context.Context) (*pb.FailJobResponse, error) {
|
||||
response, err := cmd.gateway.FailJob(ctx, &cmd.request)
|
||||
if cmd.shouldRetry(ctx, err) {
|
||||
@ -75,7 +121,9 @@ func (cmd *FailJobCommand) Send(ctx context.Context) (*pb.FailJobResponse, error
|
||||
|
||||
func NewFailJobCommand(gateway pb.GatewayClient, pred retryPredicate) FailJobCommandStep1 {
|
||||
return &FailJobCommand{
|
||||
Command: Command{gateway: gateway,
|
||||
Command: Command{
|
||||
mixin: utils.NewJSONStringSerializer(),
|
||||
gateway: gateway,
|
||||
shouldRetry: pred,
|
||||
},
|
||||
}
|
||||
|
2
vendor/github.com/camunda/zeebe/clients/go/v8/pkg/commands/publish_message.go
generated
vendored
2
vendor/github.com/camunda/zeebe/clients/go/v8/pkg/commands/publish_message.go
generated
vendored
@ -58,7 +58,7 @@ type PublishMessageCommand struct {
|
||||
request pb.PublishMessageRequest
|
||||
}
|
||||
|
||||
//nolint:golint
|
||||
//nolint:revive
|
||||
func (cmd *PublishMessageCommand) MessageId(messageId string) PublishMessageCommandStep3 {
|
||||
cmd.request.MessageId = messageId
|
||||
return cmd
|
||||
|
48
vendor/github.com/camunda/zeebe/clients/go/v8/pkg/commands/throw_error.go
generated
vendored
48
vendor/github.com/camunda/zeebe/clients/go/v8/pkg/commands/throw_error.go
generated
vendored
@ -17,6 +17,8 @@ package commands
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/camunda/zeebe/clients/go/v8/internal/utils"
|
||||
"github.com/camunda/zeebe/clients/go/v8/pkg/pb"
|
||||
)
|
||||
|
||||
@ -30,6 +32,13 @@ type ThrowErrorCommandStep2 interface {
|
||||
|
||||
type DispatchThrowErrorCommand interface {
|
||||
ErrorMessage(string) DispatchThrowErrorCommand
|
||||
|
||||
VariablesFromString(string) (DispatchThrowErrorCommand, error)
|
||||
VariablesFromStringer(fmt.Stringer) (DispatchThrowErrorCommand, error)
|
||||
VariablesFromMap(map[string]interface{}) (DispatchThrowErrorCommand, error)
|
||||
VariablesFromObject(interface{}) (DispatchThrowErrorCommand, error)
|
||||
VariablesFromObjectIgnoreOmitempty(interface{}) (DispatchThrowErrorCommand, error)
|
||||
|
||||
Send(context.Context) (*pb.ThrowErrorResponse, error)
|
||||
}
|
||||
|
||||
@ -53,6 +62,44 @@ func (c *ThrowErrorCommand) ErrorMessage(errorMsg string) DispatchThrowErrorComm
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *ThrowErrorCommand) VariablesFromString(variables string) (DispatchThrowErrorCommand, error) {
|
||||
err := c.mixin.Validate("variables", variables)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
c.request.Variables = variables
|
||||
return c, nil
|
||||
}
|
||||
|
||||
func (c *ThrowErrorCommand) VariablesFromStringer(variables fmt.Stringer) (DispatchThrowErrorCommand, error) {
|
||||
return c.VariablesFromString(variables.String())
|
||||
}
|
||||
|
||||
func (c *ThrowErrorCommand) VariablesFromObject(variables interface{}) (DispatchThrowErrorCommand, error) {
|
||||
value, err := c.mixin.AsJSON("variables", variables, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
c.request.Variables = value
|
||||
return c, nil
|
||||
}
|
||||
|
||||
func (c *ThrowErrorCommand) VariablesFromObjectIgnoreOmitempty(variables interface{}) (DispatchThrowErrorCommand, error) {
|
||||
value, err := c.mixin.AsJSON("variables", variables, true)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
c.request.Variables = value
|
||||
return c, nil
|
||||
}
|
||||
|
||||
func (c *ThrowErrorCommand) VariablesFromMap(variables map[string]interface{}) (DispatchThrowErrorCommand, error) {
|
||||
return c.VariablesFromObject(variables)
|
||||
}
|
||||
|
||||
func (c *ThrowErrorCommand) Send(ctx context.Context) (*pb.ThrowErrorResponse, error) {
|
||||
response, err := c.gateway.ThrowError(ctx, &c.request)
|
||||
if c.shouldRetry(ctx, err) {
|
||||
@ -65,6 +112,7 @@ func (c *ThrowErrorCommand) Send(ctx context.Context) (*pb.ThrowErrorResponse, e
|
||||
func NewThrowErrorCommand(gateway pb.GatewayClient, pred retryPredicate) ThrowErrorCommandStep1 {
|
||||
return &ThrowErrorCommand{
|
||||
Command: Command{
|
||||
mixin: utils.NewJSONStringSerializer(),
|
||||
gateway: gateway,
|
||||
shouldRetry: pred,
|
||||
},
|
||||
|
7961
vendor/github.com/camunda/zeebe/clients/go/v8/pkg/pb/gateway.pb.go
generated
vendored
7961
vendor/github.com/camunda/zeebe/clients/go/v8/pkg/pb/gateway.pb.go
generated
vendored
File diff suppressed because it is too large
Load Diff
5
vendor/github.com/camunda/zeebe/clients/go/v8/pkg/worker/jobWorker_builder.go
generated
vendored
5
vendor/github.com/camunda/zeebe/clients/go/v8/pkg/worker/jobWorker_builder.go
generated
vendored
@ -194,8 +194,9 @@ func (builder *JobWorkerBuilder) Open() JobWorker {
|
||||
}
|
||||
|
||||
// NewJobWorkerBuilder should use the same retryPredicate used by the CredentialProvider (ShouldRetry method):
|
||||
// credsProvider, _ := zbc.NewOAuthCredentialsProvider(...)
|
||||
// worker.NewJobWorkerBuilder(..., credsProvider.ShouldRetry)
|
||||
//
|
||||
// credsProvider, _ := zbc.NewOAuthCredentialsProvider(...)
|
||||
// worker.NewJobWorkerBuilder(..., credsProvider.ShouldRetry)
|
||||
func NewJobWorkerBuilder(gatewayClient pb.GatewayClient, jobClient JobClient, retryPred func(ctx context.Context, err error) bool) JobWorkerBuilderStep1 {
|
||||
return &JobWorkerBuilder{
|
||||
gatewayClient: gatewayClient,
|
||||
|
4
vendor/github.com/camunda/zeebe/clients/go/v8/pkg/zbc/api.go
generated
vendored
4
vendor/github.com/camunda/zeebe/clients/go/v8/pkg/zbc/api.go
generated
vendored
@ -31,8 +31,12 @@ type Client interface {
|
||||
NewSetVariablesCommand() commands.SetVariablesCommandStep1
|
||||
NewResolveIncidentCommand() commands.ResolveIncidentCommandStep1
|
||||
|
||||
NewEvaluateDecisionCommand() commands.EvaluateDecisionCommandStep1
|
||||
|
||||
NewPublishMessageCommand() commands.PublishMessageCommandStep1
|
||||
|
||||
NewBroadcastSignalCommand() commands.BroadcastSignalCommandStep1
|
||||
|
||||
NewActivateJobsCommand() commands.ActivateJobsCommandStep1
|
||||
NewCompleteJobCommand() commands.CompleteJobCommandStep1
|
||||
NewFailJobCommand() commands.FailJobCommandStep1
|
||||
|
8
vendor/github.com/camunda/zeebe/clients/go/v8/pkg/zbc/client.go
generated
vendored
8
vendor/github.com/camunda/zeebe/clients/go/v8/pkg/zbc/client.go
generated
vendored
@ -92,10 +92,18 @@ func (c *ClientImpl) NewDeployResourceCommand() *commands.DeployResourceCommand
|
||||
return commands.NewDeployResourceCommand(c.gateway, c.credentialsProvider.ShouldRetryRequest)
|
||||
}
|
||||
|
||||
func (c *ClientImpl) NewEvaluateDecisionCommand() commands.EvaluateDecisionCommandStep1 {
|
||||
return commands.NewEvaluateDecisionCommand(c.gateway, c.credentialsProvider.ShouldRetryRequest)
|
||||
}
|
||||
|
||||
func (c *ClientImpl) NewPublishMessageCommand() commands.PublishMessageCommandStep1 {
|
||||
return commands.NewPublishMessageCommand(c.gateway, c.credentialsProvider.ShouldRetryRequest)
|
||||
}
|
||||
|
||||
func (c *ClientImpl) NewBroadcastSignalCommand() commands.BroadcastSignalCommandStep1 {
|
||||
return commands.NewBroadcastSignalCommand(c.gateway, c.credentialsProvider.ShouldRetryRequest)
|
||||
}
|
||||
|
||||
func (c *ClientImpl) NewResolveIncidentCommand() commands.ResolveIncidentCommandStep1 {
|
||||
return commands.NewResolveIncidentCommand(c.gateway, c.credentialsProvider.ShouldRetryRequest)
|
||||
}
|
||||
|
5
vendor/github.com/camunda/zeebe/clients/go/v8/pkg/zbc/oauthCredentialsCache.go
generated
vendored
5
vendor/github.com/camunda/zeebe/clients/go/v8/pkg/zbc/oauthCredentialsCache.go
generated
vendored
@ -18,7 +18,6 @@ import (
|
||||
"github.com/mitchellh/go-homedir"
|
||||
"golang.org/x/oauth2"
|
||||
"gopkg.in/yaml.v2"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"path"
|
||||
@ -117,7 +116,7 @@ func (cache *oauthYamlCredentialsCache) put(audience string, credentials *oauth2
|
||||
|
||||
// readCache will overwrite the current contents of cache.audiences, so use carefully
|
||||
func (cache *oauthYamlCredentialsCache) readCache() error {
|
||||
cacheContents, err := ioutil.ReadFile(cache.path)
|
||||
cacheContents, err := os.ReadFile(cache.path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -139,7 +138,7 @@ func (cache *oauthYamlCredentialsCache) writeCache() error {
|
||||
return err
|
||||
}
|
||||
|
||||
return ioutil.WriteFile(cache.path, cacheContents, 0600)
|
||||
return os.WriteFile(cache.path, cacheContents, 0600)
|
||||
}
|
||||
|
||||
func getDefaultOAuthYamlCredentialsCacheRelativePath() string {
|
||||
|
4
vendor/github.com/camunda/zeebe/clients/go/v8/pkg/zbc/oauthCredentialsProvider.go
generated
vendored
4
vendor/github.com/camunda/zeebe/clients/go/v8/pkg/zbc/oauthCredentialsProvider.go
generated
vendored
@ -29,7 +29,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
//nolint:golint
|
||||
//nolint:revive
|
||||
const OAuthClientIdEnvVar = "ZEEBE_CLIENT_ID"
|
||||
|
||||
// #nosec 101
|
||||
@ -38,7 +38,7 @@ const OAuthClientSecretEnvVar = "ZEEBE_CLIENT_SECRET"
|
||||
// #nosec 101
|
||||
const OAuthTokenAudienceEnvVar = "ZEEBE_TOKEN_AUDIENCE"
|
||||
|
||||
//nolint:golint
|
||||
//nolint:revive
|
||||
const OAuthAuthorizationUrlEnvVar = "ZEEBE_AUTHORIZATION_SERVER_URL"
|
||||
const OAuthRequestTimeoutEnvVar = "ZEEBE_AUTH_REQUEST_TIMEOUT"
|
||||
|
||||
|
25
vendor/github.com/cenkalti/backoff/v4/.gitignore
generated
vendored
Normal file
25
vendor/github.com/cenkalti/backoff/v4/.gitignore
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
# Compiled Object files, Static and Dynamic libs (Shared Objects)
|
||||
*.o
|
||||
*.a
|
||||
*.so
|
||||
|
||||
# Folders
|
||||
_obj
|
||||
_test
|
||||
|
||||
# Architecture specific extensions/prefixes
|
||||
*.[568vq]
|
||||
[568vq].out
|
||||
|
||||
*.cgo1.go
|
||||
*.cgo2.c
|
||||
_cgo_defun.c
|
||||
_cgo_gotypes.go
|
||||
_cgo_export.*
|
||||
|
||||
_testmain.go
|
||||
|
||||
*.exe
|
||||
|
||||
# IDEs
|
||||
.idea/
|
20
vendor/github.com/cenkalti/backoff/v4/LICENSE
generated
vendored
Normal file
20
vendor/github.com/cenkalti/backoff/v4/LICENSE
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Cenk Altı
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
32
vendor/github.com/cenkalti/backoff/v4/README.md
generated
vendored
Normal file
32
vendor/github.com/cenkalti/backoff/v4/README.md
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
# Exponential Backoff [![GoDoc][godoc image]][godoc] [![Build Status][travis image]][travis] [![Coverage Status][coveralls image]][coveralls]
|
||||
|
||||
This is a Go port of the exponential backoff algorithm from [Google's HTTP Client Library for Java][google-http-java-client].
|
||||
|
||||
[Exponential backoff][exponential backoff wiki]
|
||||
is an algorithm that uses feedback to multiplicatively decrease the rate of some process,
|
||||
in order to gradually find an acceptable rate.
|
||||
The retries exponentially increase and stop increasing when a certain threshold is met.
|
||||
|
||||
## Usage
|
||||
|
||||
Import path is `github.com/cenkalti/backoff/v4`. Please note the version part at the end.
|
||||
|
||||
Use https://pkg.go.dev/github.com/cenkalti/backoff/v4 to view the documentation.
|
||||
|
||||
## Contributing
|
||||
|
||||
* I would like to keep this library as small as possible.
|
||||
* Please don't send a PR without opening an issue and discussing it first.
|
||||
* If proposed change is not a common use case, I will probably not accept it.
|
||||
|
||||
[godoc]: https://pkg.go.dev/github.com/cenkalti/backoff/v4
|
||||
[godoc image]: https://godoc.org/github.com/cenkalti/backoff?status.png
|
||||
[travis]: https://travis-ci.org/cenkalti/backoff
|
||||
[travis image]: https://travis-ci.org/cenkalti/backoff.png?branch=master
|
||||
[coveralls]: https://coveralls.io/github/cenkalti/backoff?branch=master
|
||||
[coveralls image]: https://coveralls.io/repos/github/cenkalti/backoff/badge.svg?branch=master
|
||||
|
||||
[google-http-java-client]: https://github.com/google/google-http-java-client/blob/da1aa993e90285ec18579f1553339b00e19b3ab5/google-http-client/src/main/java/com/google/api/client/util/ExponentialBackOff.java
|
||||
[exponential backoff wiki]: http://en.wikipedia.org/wiki/Exponential_backoff
|
||||
|
||||
[advanced example]: https://pkg.go.dev/github.com/cenkalti/backoff/v4?tab=doc#pkg-examples
|
66
vendor/github.com/cenkalti/backoff/v4/backoff.go
generated
vendored
Normal file
66
vendor/github.com/cenkalti/backoff/v4/backoff.go
generated
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
// Package backoff implements backoff algorithms for retrying operations.
|
||||
//
|
||||
// Use Retry function for retrying operations that may fail.
|
||||
// If Retry does not meet your needs,
|
||||
// copy/paste the function into your project and modify as you wish.
|
||||
//
|
||||
// There is also Ticker type similar to time.Ticker.
|
||||
// You can use it if you need to work with channels.
|
||||
//
|
||||
// See Examples section below for usage examples.
|
||||
package backoff
|
||||
|
||||
import "time"
|
||||
|
||||
// BackOff is a backoff policy for retrying an operation.
|
||||
type BackOff interface {
|
||||
// NextBackOff returns the duration to wait before retrying the operation,
|
||||
// or backoff. Stop to indicate that no more retries should be made.
|
||||
//
|
||||
// Example usage:
|
||||
//
|
||||
// duration := backoff.NextBackOff();
|
||||
// if (duration == backoff.Stop) {
|
||||
// // Do not retry operation.
|
||||
// } else {
|
||||
// // Sleep for duration and retry operation.
|
||||
// }
|
||||
//
|
||||
NextBackOff() time.Duration
|
||||
|
||||
// Reset to initial state.
|
||||
Reset()
|
||||
}
|
||||
|
||||
// Stop indicates that no more retries should be made for use in NextBackOff().
|
||||
const Stop time.Duration = -1
|
||||
|
||||
// ZeroBackOff is a fixed backoff policy whose backoff time is always zero,
|
||||
// meaning that the operation is retried immediately without waiting, indefinitely.
|
||||
type ZeroBackOff struct{}
|
||||
|
||||
func (b *ZeroBackOff) Reset() {}
|
||||
|
||||
func (b *ZeroBackOff) NextBackOff() time.Duration { return 0 }
|
||||
|
||||
// StopBackOff is a fixed backoff policy that always returns backoff.Stop for
|
||||
// NextBackOff(), meaning that the operation should never be retried.
|
||||
type StopBackOff struct{}
|
||||
|
||||
func (b *StopBackOff) Reset() {}
|
||||
|
||||
func (b *StopBackOff) NextBackOff() time.Duration { return Stop }
|
||||
|
||||
// ConstantBackOff is a backoff policy that always returns the same backoff delay.
|
||||
// This is in contrast to an exponential backoff policy,
|
||||
// which returns a delay that grows longer as you call NextBackOff() over and over again.
|
||||
type ConstantBackOff struct {
|
||||
Interval time.Duration
|
||||
}
|
||||
|
||||
func (b *ConstantBackOff) Reset() {}
|
||||
func (b *ConstantBackOff) NextBackOff() time.Duration { return b.Interval }
|
||||
|
||||
func NewConstantBackOff(d time.Duration) *ConstantBackOff {
|
||||
return &ConstantBackOff{Interval: d}
|
||||
}
|
62
vendor/github.com/cenkalti/backoff/v4/context.go
generated
vendored
Normal file
62
vendor/github.com/cenkalti/backoff/v4/context.go
generated
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
package backoff
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
)
|
||||
|
||||
// BackOffContext is a backoff policy that stops retrying after the context
|
||||
// is canceled.
|
||||
type BackOffContext interface { // nolint: golint
|
||||
BackOff
|
||||
Context() context.Context
|
||||
}
|
||||
|
||||
type backOffContext struct {
|
||||
BackOff
|
||||
ctx context.Context
|
||||
}
|
||||
|
||||
// WithContext returns a BackOffContext with context ctx
|
||||
//
|
||||
// ctx must not be nil
|
||||
func WithContext(b BackOff, ctx context.Context) BackOffContext { // nolint: golint
|
||||
if ctx == nil {
|
||||
panic("nil context")
|
||||
}
|
||||
|
||||
if b, ok := b.(*backOffContext); ok {
|
||||
return &backOffContext{
|
||||
BackOff: b.BackOff,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
return &backOffContext{
|
||||
BackOff: b,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
func getContext(b BackOff) context.Context {
|
||||
if cb, ok := b.(BackOffContext); ok {
|
||||
return cb.Context()
|
||||
}
|
||||
if tb, ok := b.(*backOffTries); ok {
|
||||
return getContext(tb.delegate)
|
||||
}
|
||||
return context.Background()
|
||||
}
|
||||
|
||||
func (b *backOffContext) Context() context.Context {
|
||||
return b.ctx
|
||||
}
|
||||
|
||||
func (b *backOffContext) NextBackOff() time.Duration {
|
||||
select {
|
||||
case <-b.ctx.Done():
|
||||
return Stop
|
||||
default:
|
||||
return b.BackOff.NextBackOff()
|
||||
}
|
||||
}
|
161
vendor/github.com/cenkalti/backoff/v4/exponential.go
generated
vendored
Normal file
161
vendor/github.com/cenkalti/backoff/v4/exponential.go
generated
vendored
Normal file
@ -0,0 +1,161 @@
|
||||
package backoff
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"time"
|
||||
)
|
||||
|
||||
/*
|
||||
ExponentialBackOff is a backoff implementation that increases the backoff
|
||||
period for each retry attempt using a randomization function that grows exponentially.
|
||||
|
||||
NextBackOff() is calculated using the following formula:
|
||||
|
||||
randomized interval =
|
||||
RetryInterval * (random value in range [1 - RandomizationFactor, 1 + RandomizationFactor])
|
||||
|
||||
In other words NextBackOff() will range between the randomization factor
|
||||
percentage below and above the retry interval.
|
||||
|
||||
For example, given the following parameters:
|
||||
|
||||
RetryInterval = 2
|
||||
RandomizationFactor = 0.5
|
||||
Multiplier = 2
|
||||
|
||||
the actual backoff period used in the next retry attempt will range between 1 and 3 seconds,
|
||||
multiplied by the exponential, that is, between 2 and 6 seconds.
|
||||
|
||||
Note: MaxInterval caps the RetryInterval and not the randomized interval.
|
||||
|
||||
If the time elapsed since an ExponentialBackOff instance is created goes past the
|
||||
MaxElapsedTime, then the method NextBackOff() starts returning backoff.Stop.
|
||||
|
||||
The elapsed time can be reset by calling Reset().
|
||||
|
||||
Example: Given the following default arguments, for 10 tries the sequence will be,
|
||||
and assuming we go over the MaxElapsedTime on the 10th try:
|
||||
|
||||
Request # RetryInterval (seconds) Randomized Interval (seconds)
|
||||
|
||||
1 0.5 [0.25, 0.75]
|
||||
2 0.75 [0.375, 1.125]
|
||||
3 1.125 [0.562, 1.687]
|
||||
4 1.687 [0.8435, 2.53]
|
||||
5 2.53 [1.265, 3.795]
|
||||
6 3.795 [1.897, 5.692]
|
||||
7 5.692 [2.846, 8.538]
|
||||
8 8.538 [4.269, 12.807]
|
||||
9 12.807 [6.403, 19.210]
|
||||
10 19.210 backoff.Stop
|
||||
|
||||
Note: Implementation is not thread-safe.
|
||||
*/
|
||||
type ExponentialBackOff struct {
|
||||
InitialInterval time.Duration
|
||||
RandomizationFactor float64
|
||||
Multiplier float64
|
||||
MaxInterval time.Duration
|
||||
// After MaxElapsedTime the ExponentialBackOff returns Stop.
|
||||
// It never stops if MaxElapsedTime == 0.
|
||||
MaxElapsedTime time.Duration
|
||||
Stop time.Duration
|
||||
Clock Clock
|
||||
|
||||
currentInterval time.Duration
|
||||
startTime time.Time
|
||||
}
|
||||
|
||||
// Clock is an interface that returns current time for BackOff.
|
||||
type Clock interface {
|
||||
Now() time.Time
|
||||
}
|
||||
|
||||
// Default values for ExponentialBackOff.
|
||||
const (
|
||||
DefaultInitialInterval = 500 * time.Millisecond
|
||||
DefaultRandomizationFactor = 0.5
|
||||
DefaultMultiplier = 1.5
|
||||
DefaultMaxInterval = 60 * time.Second
|
||||
DefaultMaxElapsedTime = 15 * time.Minute
|
||||
)
|
||||
|
||||
// NewExponentialBackOff creates an instance of ExponentialBackOff using default values.
|
||||
func NewExponentialBackOff() *ExponentialBackOff {
|
||||
b := &ExponentialBackOff{
|
||||
InitialInterval: DefaultInitialInterval,
|
||||
RandomizationFactor: DefaultRandomizationFactor,
|
||||
Multiplier: DefaultMultiplier,
|
||||
MaxInterval: DefaultMaxInterval,
|
||||
MaxElapsedTime: DefaultMaxElapsedTime,
|
||||
Stop: Stop,
|
||||
Clock: SystemClock,
|
||||
}
|
||||
b.Reset()
|
||||
return b
|
||||
}
|
||||
|
||||
type systemClock struct{}
|
||||
|
||||
func (t systemClock) Now() time.Time {
|
||||
return time.Now()
|
||||
}
|
||||
|
||||
// SystemClock implements Clock interface that uses time.Now().
|
||||
var SystemClock = systemClock{}
|
||||
|
||||
// Reset the interval back to the initial retry interval and restarts the timer.
|
||||
// Reset must be called before using b.
|
||||
func (b *ExponentialBackOff) Reset() {
|
||||
b.currentInterval = b.InitialInterval
|
||||
b.startTime = b.Clock.Now()
|
||||
}
|
||||
|
||||
// NextBackOff calculates the next backoff interval using the formula:
|
||||
// Randomized interval = RetryInterval * (1 ± RandomizationFactor)
|
||||
func (b *ExponentialBackOff) NextBackOff() time.Duration {
|
||||
// Make sure we have not gone over the maximum elapsed time.
|
||||
elapsed := b.GetElapsedTime()
|
||||
next := getRandomValueFromInterval(b.RandomizationFactor, rand.Float64(), b.currentInterval)
|
||||
b.incrementCurrentInterval()
|
||||
if b.MaxElapsedTime != 0 && elapsed+next > b.MaxElapsedTime {
|
||||
return b.Stop
|
||||
}
|
||||
return next
|
||||
}
|
||||
|
||||
// GetElapsedTime returns the elapsed time since an ExponentialBackOff instance
|
||||
// is created and is reset when Reset() is called.
|
||||
//
|
||||
// The elapsed time is computed using time.Now().UnixNano(). It is
|
||||
// safe to call even while the backoff policy is used by a running
|
||||
// ticker.
|
||||
func (b *ExponentialBackOff) GetElapsedTime() time.Duration {
|
||||
return b.Clock.Now().Sub(b.startTime)
|
||||
}
|
||||
|
||||
// Increments the current interval by multiplying it with the multiplier.
|
||||
func (b *ExponentialBackOff) incrementCurrentInterval() {
|
||||
// Check for overflow, if overflow is detected set the current interval to the max interval.
|
||||
if float64(b.currentInterval) >= float64(b.MaxInterval)/b.Multiplier {
|
||||
b.currentInterval = b.MaxInterval
|
||||
} else {
|
||||
b.currentInterval = time.Duration(float64(b.currentInterval) * b.Multiplier)
|
||||
}
|
||||
}
|
||||
|
||||
// Returns a random value from the following interval:
|
||||
// [currentInterval - randomizationFactor * currentInterval, currentInterval + randomizationFactor * currentInterval].
|
||||
func getRandomValueFromInterval(randomizationFactor, random float64, currentInterval time.Duration) time.Duration {
|
||||
if randomizationFactor == 0 {
|
||||
return currentInterval // make sure no randomness is used when randomizationFactor is 0.
|
||||
}
|
||||
var delta = randomizationFactor * float64(currentInterval)
|
||||
var minInterval = float64(currentInterval) - delta
|
||||
var maxInterval = float64(currentInterval) + delta
|
||||
|
||||
// Get a random value from the range [minInterval, maxInterval].
|
||||
// The formula used below has a +1 because if the minInterval is 1 and the maxInterval is 3 then
|
||||
// we want a 33% chance for selecting either 1, 2 or 3.
|
||||
return time.Duration(minInterval + (random * (maxInterval - minInterval + 1)))
|
||||
}
|
146
vendor/github.com/cenkalti/backoff/v4/retry.go
generated
vendored
Normal file
146
vendor/github.com/cenkalti/backoff/v4/retry.go
generated
vendored
Normal file
@ -0,0 +1,146 @@
|
||||
package backoff
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"time"
|
||||
)
|
||||
|
||||
// An OperationWithData is executing by RetryWithData() or RetryNotifyWithData().
|
||||
// The operation will be retried using a backoff policy if it returns an error.
|
||||
type OperationWithData[T any] func() (T, error)
|
||||
|
||||
// An Operation is executing by Retry() or RetryNotify().
|
||||
// The operation will be retried using a backoff policy if it returns an error.
|
||||
type Operation func() error
|
||||
|
||||
func (o Operation) withEmptyData() OperationWithData[struct{}] {
|
||||
return func() (struct{}, error) {
|
||||
return struct{}{}, o()
|
||||
}
|
||||
}
|
||||
|
||||
// Notify is a notify-on-error function. It receives an operation error and
|
||||
// backoff delay if the operation failed (with an error).
|
||||
//
|
||||
// NOTE that if the backoff policy stated to stop retrying,
|
||||
// the notify function isn't called.
|
||||
type Notify func(error, time.Duration)
|
||||
|
||||
// Retry the operation o until it does not return error or BackOff stops.
|
||||
// o is guaranteed to be run at least once.
|
||||
//
|
||||
// If o returns a *PermanentError, the operation is not retried, and the
|
||||
// wrapped error is returned.
|
||||
//
|
||||
// Retry sleeps the goroutine for the duration returned by BackOff after a
|
||||
// failed operation returns.
|
||||
func Retry(o Operation, b BackOff) error {
|
||||
return RetryNotify(o, b, nil)
|
||||
}
|
||||
|
||||
// RetryWithData is like Retry but returns data in the response too.
|
||||
func RetryWithData[T any](o OperationWithData[T], b BackOff) (T, error) {
|
||||
return RetryNotifyWithData(o, b, nil)
|
||||
}
|
||||
|
||||
// RetryNotify calls notify function with the error and wait duration
|
||||
// for each failed attempt before sleep.
|
||||
func RetryNotify(operation Operation, b BackOff, notify Notify) error {
|
||||
return RetryNotifyWithTimer(operation, b, notify, nil)
|
||||
}
|
||||
|
||||
// RetryNotifyWithData is like RetryNotify but returns data in the response too.
|
||||
func RetryNotifyWithData[T any](operation OperationWithData[T], b BackOff, notify Notify) (T, error) {
|
||||
return doRetryNotify(operation, b, notify, nil)
|
||||
}
|
||||
|
||||
// RetryNotifyWithTimer calls notify function with the error and wait duration using the given Timer
|
||||
// for each failed attempt before sleep.
|
||||
// A default timer that uses system timer is used when nil is passed.
|
||||
func RetryNotifyWithTimer(operation Operation, b BackOff, notify Notify, t Timer) error {
|
||||
_, err := doRetryNotify(operation.withEmptyData(), b, notify, t)
|
||||
return err
|
||||
}
|
||||
|
||||
// RetryNotifyWithTimerAndData is like RetryNotifyWithTimer but returns data in the response too.
|
||||
func RetryNotifyWithTimerAndData[T any](operation OperationWithData[T], b BackOff, notify Notify, t Timer) (T, error) {
|
||||
return doRetryNotify(operation, b, notify, t)
|
||||
}
|
||||
|
||||
func doRetryNotify[T any](operation OperationWithData[T], b BackOff, notify Notify, t Timer) (T, error) {
|
||||
var (
|
||||
err error
|
||||
next time.Duration
|
||||
res T
|
||||
)
|
||||
if t == nil {
|
||||
t = &defaultTimer{}
|
||||
}
|
||||
|
||||
defer func() {
|
||||
t.Stop()
|
||||
}()
|
||||
|
||||
ctx := getContext(b)
|
||||
|
||||
b.Reset()
|
||||
for {
|
||||
res, err = operation()
|
||||
if err == nil {
|
||||
return res, nil
|
||||
}
|
||||
|
||||
var permanent *PermanentError
|
||||
if errors.As(err, &permanent) {
|
||||
return res, permanent.Err
|
||||
}
|
||||
|
||||
if next = b.NextBackOff(); next == Stop {
|
||||
if cerr := ctx.Err(); cerr != nil {
|
||||
return res, cerr
|
||||
}
|
||||
|
||||
return res, err
|
||||
}
|
||||
|
||||
if notify != nil {
|
||||
notify(err, next)
|
||||
}
|
||||
|
||||
t.Start(next)
|
||||
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return res, ctx.Err()
|
||||
case <-t.C():
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PermanentError signals that the operation should not be retried.
|
||||
type PermanentError struct {
|
||||
Err error
|
||||
}
|
||||
|
||||
func (e *PermanentError) Error() string {
|
||||
return e.Err.Error()
|
||||
}
|
||||
|
||||
func (e *PermanentError) Unwrap() error {
|
||||
return e.Err
|
||||
}
|
||||
|
||||
func (e *PermanentError) Is(target error) bool {
|
||||
_, ok := target.(*PermanentError)
|
||||
return ok
|
||||
}
|
||||
|
||||
// Permanent wraps the given err in a *PermanentError.
|
||||
func Permanent(err error) error {
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
return &PermanentError{
|
||||
Err: err,
|
||||
}
|
||||
}
|
97
vendor/github.com/cenkalti/backoff/v4/ticker.go
generated
vendored
Normal file
97
vendor/github.com/cenkalti/backoff/v4/ticker.go
generated
vendored
Normal file
@ -0,0 +1,97 @@
|
||||
package backoff
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Ticker holds a channel that delivers `ticks' of a clock at times reported by a BackOff.
|
||||
//
|
||||
// Ticks will continue to arrive when the previous operation is still running,
|
||||
// so operations that take a while to fail could run in quick succession.
|
||||
type Ticker struct {
|
||||
C <-chan time.Time
|
||||
c chan time.Time
|
||||
b BackOff
|
||||
ctx context.Context
|
||||
timer Timer
|
||||
stop chan struct{}
|
||||
stopOnce sync.Once
|
||||
}
|
||||
|
||||
// NewTicker returns a new Ticker containing a channel that will send
|
||||
// the time at times specified by the BackOff argument. Ticker is
|
||||
// guaranteed to tick at least once. The channel is closed when Stop
|
||||
// method is called or BackOff stops. It is not safe to manipulate the
|
||||
// provided backoff policy (notably calling NextBackOff or Reset)
|
||||
// while the ticker is running.
|
||||
func NewTicker(b BackOff) *Ticker {
|
||||
return NewTickerWithTimer(b, &defaultTimer{})
|
||||
}
|
||||
|
||||
// NewTickerWithTimer returns a new Ticker with a custom timer.
|
||||
// A default timer that uses system timer is used when nil is passed.
|
||||
func NewTickerWithTimer(b BackOff, timer Timer) *Ticker {
|
||||
if timer == nil {
|
||||
timer = &defaultTimer{}
|
||||
}
|
||||
c := make(chan time.Time)
|
||||
t := &Ticker{
|
||||
C: c,
|
||||
c: c,
|
||||
b: b,
|
||||
ctx: getContext(b),
|
||||
timer: timer,
|
||||
stop: make(chan struct{}),
|
||||
}
|
||||
t.b.Reset()
|
||||
go t.run()
|
||||
return t
|
||||
}
|
||||
|
||||
// Stop turns off a ticker. After Stop, no more ticks will be sent.
|
||||
func (t *Ticker) Stop() {
|
||||
t.stopOnce.Do(func() { close(t.stop) })
|
||||
}
|
||||
|
||||
func (t *Ticker) run() {
|
||||
c := t.c
|
||||
defer close(c)
|
||||
|
||||
// Ticker is guaranteed to tick at least once.
|
||||
afterC := t.send(time.Now())
|
||||
|
||||
for {
|
||||
if afterC == nil {
|
||||
return
|
||||
}
|
||||
|
||||
select {
|
||||
case tick := <-afterC:
|
||||
afterC = t.send(tick)
|
||||
case <-t.stop:
|
||||
t.c = nil // Prevent future ticks from being sent to the channel.
|
||||
return
|
||||
case <-t.ctx.Done():
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (t *Ticker) send(tick time.Time) <-chan time.Time {
|
||||
select {
|
||||
case t.c <- tick:
|
||||
case <-t.stop:
|
||||
return nil
|
||||
}
|
||||
|
||||
next := t.b.NextBackOff()
|
||||
if next == Stop {
|
||||
t.Stop()
|
||||
return nil
|
||||
}
|
||||
|
||||
t.timer.Start(next)
|
||||
return t.timer.C()
|
||||
}
|
35
vendor/github.com/cenkalti/backoff/v4/timer.go
generated
vendored
Normal file
35
vendor/github.com/cenkalti/backoff/v4/timer.go
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
package backoff
|
||||
|
||||
import "time"
|
||||
|
||||
type Timer interface {
|
||||
Start(duration time.Duration)
|
||||
Stop()
|
||||
C() <-chan time.Time
|
||||
}
|
||||
|
||||
// defaultTimer implements Timer interface using time.Timer
|
||||
type defaultTimer struct {
|
||||
timer *time.Timer
|
||||
}
|
||||
|
||||
// C returns the timers channel which receives the current time when the timer fires.
|
||||
func (t *defaultTimer) C() <-chan time.Time {
|
||||
return t.timer.C
|
||||
}
|
||||
|
||||
// Start starts the timer to fire after the given duration
|
||||
func (t *defaultTimer) Start(duration time.Duration) {
|
||||
if t.timer == nil {
|
||||
t.timer = time.NewTimer(duration)
|
||||
} else {
|
||||
t.timer.Reset(duration)
|
||||
}
|
||||
}
|
||||
|
||||
// Stop is called when the timer is not used anymore and resources may be freed.
|
||||
func (t *defaultTimer) Stop() {
|
||||
if t.timer != nil {
|
||||
t.timer.Stop()
|
||||
}
|
||||
}
|
38
vendor/github.com/cenkalti/backoff/v4/tries.go
generated
vendored
Normal file
38
vendor/github.com/cenkalti/backoff/v4/tries.go
generated
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
package backoff
|
||||
|
||||
import "time"
|
||||
|
||||
/*
|
||||
WithMaxRetries creates a wrapper around another BackOff, which will
|
||||
return Stop if NextBackOff() has been called too many times since
|
||||
the last time Reset() was called
|
||||
|
||||
Note: Implementation is not thread-safe.
|
||||
*/
|
||||
func WithMaxRetries(b BackOff, max uint64) BackOff {
|
||||
return &backOffTries{delegate: b, maxTries: max}
|
||||
}
|
||||
|
||||
type backOffTries struct {
|
||||
delegate BackOff
|
||||
maxTries uint64
|
||||
numTries uint64
|
||||
}
|
||||
|
||||
func (b *backOffTries) NextBackOff() time.Duration {
|
||||
if b.maxTries == 0 {
|
||||
return Stop
|
||||
}
|
||||
if b.maxTries > 0 {
|
||||
if b.maxTries <= b.numTries {
|
||||
return Stop
|
||||
}
|
||||
b.numTries++
|
||||
}
|
||||
return b.delegate.NextBackOff()
|
||||
}
|
||||
|
||||
func (b *backOffTries) Reset() {
|
||||
b.numTries = 0
|
||||
b.delegate.Reset()
|
||||
}
|
3
vendor/github.com/emersion/go-sasl/README.md
generated
vendored
3
vendor/github.com/emersion/go-sasl/README.md
generated
vendored
@ -1,11 +1,12 @@
|
||||
# go-sasl
|
||||
|
||||
[![GoDoc](https://godoc.org/github.com/emersion/go-sasl?status.svg)](https://godoc.org/github.com/emersion/go-sasl)
|
||||
[![godocs.io](https://godocs.io/github.com/emersion/go-sasl?status.svg)](https://godocs.io/github.com/emersion/go-sasl)
|
||||
[![Build Status](https://travis-ci.org/emersion/go-sasl.svg?branch=master)](https://travis-ci.org/emersion/go-sasl)
|
||||
|
||||
A [SASL](https://tools.ietf.org/html/rfc4422) library written in Go.
|
||||
|
||||
Implemented mechanisms:
|
||||
|
||||
* [ANONYMOUS](https://tools.ietf.org/html/rfc4505)
|
||||
* [EXTERNAL](https://tools.ietf.org/html/rfc4422#appendix-A)
|
||||
* [LOGIN](https://tools.ietf.org/html/draft-murchison-sasl-login-00) (obsolete, use PLAIN instead)
|
||||
|
2
vendor/github.com/emersion/go-sasl/anonymous.go
generated
vendored
2
vendor/github.com/emersion/go-sasl/anonymous.go
generated
vendored
@ -27,7 +27,7 @@ func NewAnonymousClient(trace string) Client {
|
||||
type AnonymousAuthenticator func(trace string) error
|
||||
|
||||
type anonymousServer struct {
|
||||
done bool
|
||||
done bool
|
||||
authenticate AnonymousAuthenticator
|
||||
}
|
||||
|
||||
|
41
vendor/github.com/emersion/go-sasl/external.go
generated
vendored
41
vendor/github.com/emersion/go-sasl/external.go
generated
vendored
@ -1,5 +1,10 @@
|
||||
package sasl
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
)
|
||||
|
||||
// The EXTERNAL mechanism name.
|
||||
const External = "EXTERNAL"
|
||||
|
||||
@ -24,3 +29,39 @@ func (a *externalClient) Next(challenge []byte) (response []byte, err error) {
|
||||
func NewExternalClient(identity string) Client {
|
||||
return &externalClient{identity}
|
||||
}
|
||||
|
||||
// ExternalAuthenticator authenticates users with the EXTERNAL mechanism. If
|
||||
// the identity is left blank, it indicates that it is the same as the one used
|
||||
// in the external credentials. If identity is not empty and the server doesn't
|
||||
// support it, an error must be returned.
|
||||
type ExternalAuthenticator func(identity string) error
|
||||
|
||||
type externalServer struct {
|
||||
done bool
|
||||
authenticate ExternalAuthenticator
|
||||
}
|
||||
|
||||
func (a *externalServer) Next(response []byte) (challenge []byte, done bool, err error) {
|
||||
if a.done {
|
||||
return nil, false, ErrUnexpectedClientResponse
|
||||
}
|
||||
|
||||
// No initial response, send an empty challenge
|
||||
if response == nil {
|
||||
return []byte{}, false, nil
|
||||
}
|
||||
|
||||
a.done = true
|
||||
|
||||
if bytes.Contains(response, []byte("\x00")) {
|
||||
return nil, false, errors.New("identity contains a NUL character")
|
||||
}
|
||||
|
||||
return nil, true, a.authenticate(string(response))
|
||||
}
|
||||
|
||||
// NewExternalServer creates a server implementation of the EXTERNAL
|
||||
// authentication mechanism, as described in RFC 4422.
|
||||
func NewExternalServer(authenticator ExternalAuthenticator) Server {
|
||||
return &externalServer{authenticate: authenticator}
|
||||
}
|
||||
|
23
vendor/github.com/emersion/go-sasl/oauthbearer.go
generated
vendored
23
vendor/github.com/emersion/go-sasl/oauthbearer.go
generated
vendored
@ -35,8 +35,11 @@ type oauthBearerClient struct {
|
||||
}
|
||||
|
||||
func (a *oauthBearerClient) Start() (mech string, ir []byte, err error) {
|
||||
mech = OAuthBearer
|
||||
var str = "n,a=" + a.Username + ","
|
||||
var authzid string
|
||||
if a.Username != "" {
|
||||
authzid = "a=" + a.Username
|
||||
}
|
||||
str := "n," + authzid + ","
|
||||
|
||||
if a.Host != "" {
|
||||
str += "\x01host=" + a.Host
|
||||
@ -47,7 +50,7 @@ func (a *oauthBearerClient) Start() (mech string, ir []byte, err error) {
|
||||
}
|
||||
str += "\x01auth=Bearer " + a.Token + "\x01\x01"
|
||||
ir = []byte(str)
|
||||
return
|
||||
return OAuthBearer, ir, nil
|
||||
}
|
||||
|
||||
func (a *oauthBearerClient) Next(challenge []byte) ([]byte, error) {
|
||||
@ -121,14 +124,18 @@ func (a *oauthBearerServer) Next(response []byte) (challenge []byte, done bool,
|
||||
if len(parts) != 3 {
|
||||
return a.fail("Invalid response")
|
||||
}
|
||||
if !bytes.Equal(parts[0], []byte{'n'}) {
|
||||
return a.fail("Invalid response, missing 'n'")
|
||||
flag := parts[0]
|
||||
authzid := parts[1]
|
||||
if !bytes.Equal(flag, []byte{'n'}) {
|
||||
return a.fail("Invalid response, missing 'n' in gs2-cb-flag")
|
||||
}
|
||||
opts := OAuthBearerOptions{}
|
||||
if !bytes.HasPrefix(parts[1], []byte("a=")) {
|
||||
return a.fail("Invalid response, missing 'a'")
|
||||
if len(authzid) > 0 {
|
||||
if !bytes.HasPrefix(authzid, []byte("a=")) {
|
||||
return a.fail("Invalid response, missing 'a=' in gs2-authzid")
|
||||
}
|
||||
opts.Username = string(bytes.TrimPrefix(authzid, []byte("a=")))
|
||||
}
|
||||
opts.Username = string(bytes.TrimPrefix(parts[1], []byte("a=")))
|
||||
|
||||
// Cut \x01host=...\x01auth=...\x01\x01
|
||||
// into
|
||||
|
2
vendor/github.com/emersion/go-sasl/plain.go
generated
vendored
2
vendor/github.com/emersion/go-sasl/plain.go
generated
vendored
@ -38,7 +38,7 @@ func NewPlainClient(identity, username, password string) Client {
|
||||
type PlainAuthenticator func(identity, username, password string) error
|
||||
|
||||
type plainServer struct {
|
||||
done bool
|
||||
done bool
|
||||
authenticate PlainAuthenticator
|
||||
}
|
||||
|
||||
|
2
vendor/github.com/emersion/go-sasl/sasl.go
generated
vendored
2
vendor/github.com/emersion/go-sasl/sasl.go
generated
vendored
@ -12,7 +12,7 @@ import (
|
||||
|
||||
// Common SASL errors.
|
||||
var (
|
||||
ErrUnexpectedClientResponse = errors.New("sasl: unexpected client response")
|
||||
ErrUnexpectedClientResponse = errors.New("sasl: unexpected client response")
|
||||
ErrUnexpectedServerChallenge = errors.New("sasl: unexpected server challenge")
|
||||
)
|
||||
|
||||
|
8
vendor/github.com/go-faster/errors/.codecov.yml
generated
vendored
Normal file
8
vendor/github.com/go-faster/errors/.codecov.yml
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
ignore:
|
||||
- cmd/**/*.go
|
||||
coverage:
|
||||
status:
|
||||
patch: false
|
||||
project:
|
||||
default:
|
||||
threshold: 0.5%
|
25
vendor/github.com/go-faster/errors/.editorconfig
generated
vendored
Normal file
25
vendor/github.com/go-faster/errors/.editorconfig
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
# http://editorconfig.org/
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
end_of_line = lf
|
||||
|
||||
[{*.go, go.mod}]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
|
||||
[{*.yml,*.yaml}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.py]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
# Makefiles always use tabs for indentation
|
||||
[Makefile]
|
||||
indent_style = tab
|
8
vendor/github.com/go-faster/errors/.gitignore
generated
vendored
Normal file
8
vendor/github.com/go-faster/errors/.gitignore
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
.idea
|
||||
_bin/*
|
||||
./examples
|
||||
|
||||
*-fuzz.zip
|
||||
|
||||
*.out
|
||||
*.dump
|
108
vendor/github.com/go-faster/errors/.golangci.yml
generated
vendored
Normal file
108
vendor/github.com/go-faster/errors/.golangci.yml
generated
vendored
Normal file
@ -0,0 +1,108 @@
|
||||
linters-settings:
|
||||
govet:
|
||||
check-shadowing: true
|
||||
gocyclo:
|
||||
min-complexity: 15
|
||||
maligned:
|
||||
suggest-new: true
|
||||
dupl:
|
||||
threshold: 120
|
||||
goconst:
|
||||
min-len: 2
|
||||
min-occurrences: 3
|
||||
misspell:
|
||||
locale: US
|
||||
lll:
|
||||
line-length: 140
|
||||
goimports:
|
||||
local-prefixes: github.com/ogen/
|
||||
gocritic:
|
||||
enabled-tags:
|
||||
- diagnostic
|
||||
- experimental
|
||||
- opinionated
|
||||
- performance
|
||||
- style
|
||||
disabled-checks:
|
||||
- hugeParam
|
||||
- rangeValCopy
|
||||
- exitAfterDefer
|
||||
- whyNoLint
|
||||
- singleCaseSwitch
|
||||
- commentedOutCode
|
||||
- appendAssign
|
||||
- unnecessaryBlock
|
||||
- redundantSprint
|
||||
|
||||
linters:
|
||||
disable-all: true
|
||||
enable:
|
||||
- deadcode
|
||||
- depguard
|
||||
- dogsled
|
||||
- errcheck
|
||||
- goconst
|
||||
- gocritic
|
||||
- gofmt
|
||||
- goimports
|
||||
- revive
|
||||
- gosec
|
||||
- gosimple
|
||||
- govet
|
||||
- ineffassign
|
||||
- misspell
|
||||
- nakedret
|
||||
- staticcheck
|
||||
- structcheck
|
||||
- stylecheck
|
||||
- typecheck
|
||||
- unconvert
|
||||
- unparam
|
||||
- unused
|
||||
- varcheck
|
||||
- whitespace
|
||||
|
||||
# Do not enable:
|
||||
# - wsl (too opinionated about newlines)
|
||||
# - godox (todos are OK)
|
||||
# - bodyclose (false positives on helper functions)
|
||||
# - prealloc (not worth it in scope of this project)
|
||||
# - maligned (same as prealloc)
|
||||
# - funlen (gocyclo is enough)
|
||||
# - gochecknoglobals (we know when it is ok to use globals)
|
||||
|
||||
issues:
|
||||
exclude-use-default: false
|
||||
exclude-rules:
|
||||
# Disable linters that are annoying in tests.
|
||||
- path: _test\.go
|
||||
linters:
|
||||
- gocyclo
|
||||
- errcheck
|
||||
- dupl
|
||||
- gosec
|
||||
- funlen
|
||||
- goconst
|
||||
- gocognit
|
||||
- scopelint
|
||||
- lll
|
||||
|
||||
- path: _test\.go
|
||||
text: "Combine"
|
||||
linters: [gocritic]
|
||||
|
||||
# Ignore shadowing of err.
|
||||
- linters: [ govet ]
|
||||
text: 'declaration of "(err|ctx|log|c)"'
|
||||
|
||||
# Ignore linters in main packages.
|
||||
- path: main\.go
|
||||
linters: [ goconst, funlen, gocognit, gocyclo ]
|
||||
|
||||
- path: _test\.go
|
||||
text: "suspicious identical"
|
||||
linters: [gocritic]
|
||||
|
||||
- path: _test\.go
|
||||
text: "identical expressions"
|
||||
linters: [staticcheck]
|
27
vendor/github.com/go-faster/errors/LICENSE
generated
vendored
Normal file
27
vendor/github.com/go-faster/errors/LICENSE
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
Copyright (c) 2009 The Go Authors. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Google Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
10
vendor/github.com/go-faster/errors/Makefile
generated
vendored
Normal file
10
vendor/github.com/go-faster/errors/Makefile
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
test:
|
||||
@./go.test.sh
|
||||
.PHONY: test
|
||||
|
||||
coverage:
|
||||
@./go.coverage.sh
|
||||
.PHONY: coverage
|
||||
|
||||
tidy:
|
||||
go mod tidy
|
34
vendor/github.com/go-faster/errors/README.md
generated
vendored
Normal file
34
vendor/github.com/go-faster/errors/README.md
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
# errors [![Go Reference](https://img.shields.io/badge/go-pkg-00ADD8)](https://pkg.go.dev/github.com/go-faster/errors#section-documentation) [![codecov](https://img.shields.io/codecov/c/github/go-faster/errors?label=cover)](https://codecov.io/gh/go-faster/errors)
|
||||
|
||||
Fork of [xerrors](https://pkg.go.dev/golang.org/x/xerrors) with explicit [Wrap](https://pkg.go.dev/github.com/go-faster/errors#Wrap) instead of `%w`.
|
||||
|
||||
> Clear is better than clever.
|
||||
|
||||
```
|
||||
go get github.com/go-faster/errors
|
||||
```
|
||||
|
||||
```go
|
||||
errors.Wrap(err, "message")
|
||||
```
|
||||
|
||||
## Why
|
||||
* Using `Wrap` is the most explicit way to wrap errors
|
||||
* Wrapping with `fmt.Errorf("foo: %w", err)` is implicit, redundant and error-prone
|
||||
* Parsing `"foo: %w"` is implicit, redundant and slow
|
||||
* The [pkg/errors](https://github.com/pkg/errors) and [xerrrors](https://pkg.go.dev/golang.org/x/xerrors) are not maintainted
|
||||
* The [cockroachdb/errors](https://github.com/cockroachdb/errors) is too big
|
||||
* The `errors` has no caller stack trace
|
||||
|
||||
## Don't need traces?
|
||||
Call `errors.DisableTrace` or use build tag `noerrtrace`.
|
||||
|
||||
## Migration
|
||||
```
|
||||
go get github.com/go-faster/errors/cmd/gowrapper@latest
|
||||
gowrapper ./...
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
BSD-3-Clause, same as Go sources
|
193
vendor/github.com/go-faster/errors/adaptor.go
generated
vendored
Normal file
193
vendor/github.com/go-faster/errors/adaptor.go
generated
vendored
Normal file
@ -0,0 +1,193 @@
|
||||
// Copyright 2018 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package errors
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"reflect"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// FormatError calls the FormatError method of f with an errors.Printer
|
||||
// configured according to s and verb, and writes the result to s.
|
||||
func FormatError(f Formatter, s fmt.State, verb rune) {
|
||||
// Assuming this function is only called from the Format method, and given
|
||||
// that FormatError takes precedence over Format, it cannot be called from
|
||||
// any package that supports errors.Formatter. It is therefore safe to
|
||||
// disregard that State may be a specific printer implementation and use one
|
||||
// of our choice instead.
|
||||
|
||||
// limitations: does not support printing error as Go struct.
|
||||
|
||||
var (
|
||||
sep = " " // separator before next error
|
||||
p = &state{State: s}
|
||||
direct = true
|
||||
)
|
||||
|
||||
var err error = f
|
||||
|
||||
switch verb {
|
||||
// Note that this switch must match the preference order
|
||||
// for ordinary string printing (%#v before %+v, and so on).
|
||||
|
||||
case 'v':
|
||||
if s.Flag('#') {
|
||||
if stringer, ok := err.(fmt.GoStringer); ok {
|
||||
p.buf.WriteString(stringer.GoString())
|
||||
goto exit
|
||||
}
|
||||
// proceed as if it were %v
|
||||
} else if s.Flag('+') {
|
||||
p.printDetail = true
|
||||
sep = "\n - "
|
||||
}
|
||||
case 's':
|
||||
case 'q', 'x', 'X':
|
||||
// Use an intermediate buffer in the rare cases that precision,
|
||||
// truncation, or one of the alternative verbs (q, x, and X) are
|
||||
// specified.
|
||||
direct = false
|
||||
|
||||
default:
|
||||
p.buf.WriteString("%!")
|
||||
p.buf.WriteRune(verb)
|
||||
p.buf.WriteByte('(')
|
||||
switch {
|
||||
case err != nil:
|
||||
p.buf.WriteString(reflect.TypeOf(f).String())
|
||||
default:
|
||||
p.buf.WriteString("<nil>")
|
||||
}
|
||||
p.buf.WriteByte(')')
|
||||
_, _ = io.Copy(s, &p.buf)
|
||||
return
|
||||
}
|
||||
|
||||
loop:
|
||||
for {
|
||||
switch v := err.(type) {
|
||||
case Formatter:
|
||||
err = v.FormatError((*printer)(p))
|
||||
case fmt.Formatter:
|
||||
v.Format(p, 'v')
|
||||
break loop
|
||||
default:
|
||||
_, _ = p.buf.WriteString(v.Error())
|
||||
break loop
|
||||
}
|
||||
if err == nil {
|
||||
break
|
||||
}
|
||||
if p.needColon || !p.printDetail {
|
||||
p.buf.WriteByte(':')
|
||||
p.needColon = false
|
||||
}
|
||||
p.buf.WriteString(sep)
|
||||
p.inDetail = false
|
||||
p.needNewline = false
|
||||
}
|
||||
|
||||
exit:
|
||||
width, okW := s.Width()
|
||||
prec, okP := s.Precision()
|
||||
|
||||
if !direct || (okW && width > 0) || okP {
|
||||
// Construct format string from State s.
|
||||
format := []byte{'%'}
|
||||
if s.Flag('-') {
|
||||
format = append(format, '-')
|
||||
}
|
||||
if s.Flag('+') {
|
||||
format = append(format, '+')
|
||||
}
|
||||
if s.Flag(' ') {
|
||||
format = append(format, ' ')
|
||||
}
|
||||
if okW {
|
||||
format = strconv.AppendInt(format, int64(width), 10)
|
||||
}
|
||||
if okP {
|
||||
format = append(format, '.')
|
||||
format = strconv.AppendInt(format, int64(prec), 10)
|
||||
}
|
||||
format = append(format, string(verb)...)
|
||||
_, _ = fmt.Fprintf(s, string(format), p.buf.String())
|
||||
} else {
|
||||
_, _ = io.Copy(s, &p.buf)
|
||||
}
|
||||
}
|
||||
|
||||
var detailSep = []byte("\n ")
|
||||
|
||||
// state tracks error printing state. It implements fmt.State.
|
||||
type state struct {
|
||||
fmt.State
|
||||
buf bytes.Buffer
|
||||
|
||||
printDetail bool
|
||||
inDetail bool
|
||||
needColon bool
|
||||
needNewline bool
|
||||
}
|
||||
|
||||
func (s *state) Write(b []byte) (n int, err error) {
|
||||
if s.printDetail {
|
||||
if len(b) == 0 {
|
||||
return 0, nil
|
||||
}
|
||||
if s.inDetail && s.needColon {
|
||||
s.needNewline = true
|
||||
if b[0] == '\n' {
|
||||
b = b[1:]
|
||||
}
|
||||
}
|
||||
k := 0
|
||||
for i, c := range b {
|
||||
if s.needNewline {
|
||||
if s.inDetail && s.needColon {
|
||||
s.buf.WriteByte(':')
|
||||
s.needColon = false
|
||||
}
|
||||
s.buf.Write(detailSep)
|
||||
s.needNewline = false
|
||||
}
|
||||
if c == '\n' {
|
||||
s.buf.Write(b[k:i])
|
||||
k = i + 1
|
||||
s.needNewline = true
|
||||
}
|
||||
}
|
||||
s.buf.Write(b[k:])
|
||||
if !s.inDetail {
|
||||
s.needColon = true
|
||||
}
|
||||
} else if !s.inDetail {
|
||||
s.buf.Write(b)
|
||||
}
|
||||
return len(b), nil
|
||||
}
|
||||
|
||||
// printer wraps a state to implement an xerrors.Printer.
|
||||
type printer state
|
||||
|
||||
func (s *printer) Print(args ...interface{}) {
|
||||
if !s.inDetail || s.printDetail {
|
||||
_, _ = fmt.Fprint((*state)(s), args...)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *printer) Printf(format string, args ...interface{}) {
|
||||
if !s.inDetail || s.printDetail {
|
||||
_, _ = fmt.Fprintf((*state)(s), format, args...)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *printer) Detail() bool {
|
||||
s.inDetail = true
|
||||
return s.printDetail
|
||||
}
|
9
vendor/github.com/go-faster/errors/doc.go
generated
vendored
Normal file
9
vendor/github.com/go-faster/errors/doc.go
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
// Copyright 2019 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Package errors implements functions to manipulate errors.
|
||||
//
|
||||
// This package expands "errors" with stack traces and explicit error
|
||||
// wrapping.
|
||||
package errors
|
37
vendor/github.com/go-faster/errors/errors.go
generated
vendored
Normal file
37
vendor/github.com/go-faster/errors/errors.go
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
// Copyright 2011 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package errors
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// errorString is a trivial implementation of error.
|
||||
type errorString struct {
|
||||
s string
|
||||
frame Frame
|
||||
}
|
||||
|
||||
// New returns an error that formats as the given text.
|
||||
//
|
||||
// The returned error contains a Frame set to the caller's location and
|
||||
// implements Formatter to show this information when printed with details.
|
||||
func New(text string) error {
|
||||
if !Trace() {
|
||||
return errors.New(text)
|
||||
}
|
||||
return &errorString{text, Caller(1)}
|
||||
}
|
||||
|
||||
func (e *errorString) Error() string { return e.s }
|
||||
|
||||
func (e *errorString) Format(s fmt.State, v rune) { FormatError(e, s, v) }
|
||||
|
||||
func (e *errorString) FormatError(p Printer) (next error) {
|
||||
p.Print(e.s)
|
||||
e.frame.Format(p)
|
||||
return nil
|
||||
}
|
47
vendor/github.com/go-faster/errors/format.go
generated
vendored
Normal file
47
vendor/github.com/go-faster/errors/format.go
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
// Copyright 2018 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package errors
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// A Formatter formats error messages.
|
||||
type Formatter interface {
|
||||
error
|
||||
|
||||
// FormatError prints the receiver's first error and returns the next error in
|
||||
// the error chain, if any.
|
||||
FormatError(p Printer) (next error)
|
||||
}
|
||||
|
||||
// A Printer formats error messages.
|
||||
//
|
||||
// The most common implementation of Printer is the one provided by package fmt
|
||||
// during Printf (as of Go 1.13). Localization packages such as golang.org/x/text/message
|
||||
// typically provide their own implementations.
|
||||
type Printer interface {
|
||||
// Print appends args to the message output.
|
||||
Print(args ...interface{})
|
||||
|
||||
// Printf writes a formatted string.
|
||||
Printf(format string, args ...interface{})
|
||||
|
||||
// Detail reports whether error detail is requested.
|
||||
// After the first call to Detail, all text written to the Printer
|
||||
// is formatted as additional detail, or ignored when
|
||||
// detail has not been requested.
|
||||
// If Detail returns false, the caller can avoid printing the detail at all.
|
||||
Detail() bool
|
||||
}
|
||||
|
||||
// Errorf creates new error with format.
|
||||
func Errorf(format string, a ...interface{}) error {
|
||||
if !Trace() || strings.Contains(format, "%w") {
|
||||
return fmt.Errorf(format, a...)
|
||||
}
|
||||
return &errorString{fmt.Sprintf(format, a...), Caller(1)}
|
||||
}
|
56
vendor/github.com/go-faster/errors/frame.go
generated
vendored
Normal file
56
vendor/github.com/go-faster/errors/frame.go
generated
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
// Copyright 2018 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package errors
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
)
|
||||
|
||||
// A Frame contains part of a call stack.
|
||||
type Frame struct {
|
||||
// Make room for three PCs: the one we were asked for, what it called,
|
||||
// and possibly a PC for skipPleaseUseCallersFrames. See:
|
||||
// https://go.googlesource.com/go/+/032678e0fb/src/runtime/extern.go#169
|
||||
frames [3]uintptr
|
||||
}
|
||||
|
||||
// Caller returns a Frame that describes a frame on the caller's stack.
|
||||
// The argument skip is the number of frames to skip over.
|
||||
// Caller(0) returns the frame for the caller of Caller.
|
||||
func Caller(skip int) Frame {
|
||||
var s Frame
|
||||
runtime.Callers(skip+1, s.frames[:])
|
||||
return s
|
||||
}
|
||||
|
||||
// Location reports the file, line, and function of a frame.
|
||||
//
|
||||
// The returned function may be "" even if file and line are not.
|
||||
func (f Frame) Location() (function, file string, line int) {
|
||||
frames := runtime.CallersFrames(f.frames[:])
|
||||
if _, ok := frames.Next(); !ok {
|
||||
return "", "", 0
|
||||
}
|
||||
fr, ok := frames.Next()
|
||||
if !ok {
|
||||
return "", "", 0
|
||||
}
|
||||
return fr.Function, fr.File, fr.Line
|
||||
}
|
||||
|
||||
// Format prints the stack as error detail.
|
||||
// It should be called from an error's Format implementation
|
||||
// after printing any other error detail.
|
||||
func (f Frame) Format(p Printer) {
|
||||
if p.Detail() {
|
||||
function, file, line := f.Location()
|
||||
if function != "" {
|
||||
p.Printf("%s\n ", function)
|
||||
}
|
||||
if file != "" {
|
||||
p.Printf("%s:%d\n", file, line)
|
||||
}
|
||||
}
|
||||
}
|
6
vendor/github.com/go-faster/errors/go.coverage.sh
generated
vendored
Normal file
6
vendor/github.com/go-faster/errors/go.coverage.sh
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
go test -v -coverpkg=./... -coverprofile=profile.out ./...
|
||||
go tool cover -func profile.out
|
12
vendor/github.com/go-faster/errors/go.test.sh
generated
vendored
Normal file
12
vendor/github.com/go-faster/errors/go.test.sh
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
# test with -race
|
||||
echo "with race:"
|
||||
go test --timeout 5m -race ./...
|
||||
|
||||
# test with noerrtrace build tag
|
||||
tag=noerrtrace
|
||||
echo "with ${tag} build tag:"
|
||||
go test -tags "${tag}" --timeout 5m -race ./...
|
11
vendor/github.com/go-faster/errors/into.go
generated
vendored
Normal file
11
vendor/github.com/go-faster/errors/into.go
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
//go:build go1.18
|
||||
|
||||
package errors
|
||||
|
||||
// Into finds the first error in err's chain that matches target type T, and if so, returns it.
|
||||
//
|
||||
// Into is type-safe alternative to As.
|
||||
func Into[T error](err error) (val T, ok bool) {
|
||||
ok = As(err, &val)
|
||||
return val, ok
|
||||
}
|
12
vendor/github.com/go-faster/errors/must.go
generated
vendored
Normal file
12
vendor/github.com/go-faster/errors/must.go
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
//go:build go1.18
|
||||
|
||||
package errors
|
||||
|
||||
// Must is a generic helper, like template.Must, that wraps a call to a function returning (T, error)
|
||||
// and panics if the error is non-nil.
|
||||
func Must[T any](val T, err error) T {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return val
|
||||
}
|
13
vendor/github.com/go-faster/errors/noerrtrace.go
generated
vendored
Normal file
13
vendor/github.com/go-faster/errors/noerrtrace.go
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
//go:build noerrtrace
|
||||
// +build noerrtrace
|
||||
|
||||
package errors
|
||||
|
||||
// enableTrace does nothing.
|
||||
func enableTrace() {}
|
||||
|
||||
// DisableTrace does nothing.
|
||||
func DisableTrace() {}
|
||||
|
||||
// Trace always returns false.
|
||||
func Trace() bool { return false }
|
37
vendor/github.com/go-faster/errors/trace.go
generated
vendored
Normal file
37
vendor/github.com/go-faster/errors/trace.go
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
//go:build !noerrtrace
|
||||
// +build !noerrtrace
|
||||
|
||||
package errors
|
||||
|
||||
import (
|
||||
"sync/atomic"
|
||||
)
|
||||
|
||||
var traceFlag int64
|
||||
|
||||
const (
|
||||
traceEnabled = 0 // enabled by default
|
||||
traceDisabled = 1
|
||||
)
|
||||
|
||||
// setTrace sets tracing flag that controls capturing caller frames.
|
||||
func setTrace(trace bool) {
|
||||
if trace {
|
||||
atomic.StoreInt64(&traceFlag, traceEnabled)
|
||||
} else {
|
||||
atomic.StoreInt64(&traceFlag, traceDisabled)
|
||||
}
|
||||
}
|
||||
|
||||
// enableTrace enables capturing caller frames.
|
||||
//
|
||||
// Intentionally left unexported.
|
||||
func enableTrace() { setTrace(true) }
|
||||
|
||||
// DisableTrace disables capturing caller frames.
|
||||
func DisableTrace() { setTrace(false) }
|
||||
|
||||
// Trace reports whether caller stack capture is enabled.
|
||||
func Trace() bool {
|
||||
return atomic.LoadInt64(&traceFlag) == traceEnabled
|
||||
}
|
134
vendor/github.com/go-faster/errors/wrap.go
generated
vendored
Normal file
134
vendor/github.com/go-faster/errors/wrap.go
generated
vendored
Normal file
@ -0,0 +1,134 @@
|
||||
// Copyright 2018 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package errors
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// A Wrapper provides context around another error.
|
||||
type Wrapper interface {
|
||||
// Unwrap returns the next error in the error chain.
|
||||
// If there is no next error, Unwrap returns nil.
|
||||
Unwrap() error
|
||||
}
|
||||
|
||||
// Opaque returns an error with the same error formatting as err
|
||||
// but that does not match err and cannot be unwrapped.
|
||||
func Opaque(err error) error {
|
||||
return noWrapper{err}
|
||||
}
|
||||
|
||||
type noWrapper struct {
|
||||
error
|
||||
}
|
||||
|
||||
func (e noWrapper) FormatError(p Printer) (next error) {
|
||||
if f, ok := e.error.(Formatter); ok {
|
||||
return f.FormatError(p)
|
||||
}
|
||||
p.Print(e.error)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Unwrap returns the result of calling the Unwrap method on err, if err's
|
||||
// type contains an Unwrap method returning error.
|
||||
// Otherwise, Unwrap returns nil.
|
||||
func Unwrap(err error) error {
|
||||
return errors.Unwrap(err)
|
||||
}
|
||||
|
||||
// Cause returns first recorded Frame.
|
||||
func Cause(err error) (f Frame, r bool) {
|
||||
for {
|
||||
we, ok := err.(*wrapError)
|
||||
if !ok {
|
||||
return f, r
|
||||
}
|
||||
f = we.frame
|
||||
r = r || ok
|
||||
|
||||
err = we.err
|
||||
}
|
||||
}
|
||||
|
||||
type wrapError struct {
|
||||
msg string
|
||||
err error
|
||||
frame Frame
|
||||
}
|
||||
|
||||
func (e *wrapError) Error() string {
|
||||
return fmt.Sprint(e)
|
||||
}
|
||||
|
||||
func (e *wrapError) Format(s fmt.State, v rune) { FormatError(e, s, v) }
|
||||
|
||||
func (e *wrapError) FormatError(p Printer) (next error) {
|
||||
p.Print(e.msg)
|
||||
e.frame.Format(p)
|
||||
return e.err
|
||||
}
|
||||
|
||||
func (e *wrapError) Unwrap() error {
|
||||
return e.err
|
||||
}
|
||||
|
||||
// Wrap error with message and caller.
|
||||
func Wrap(err error, message string) error {
|
||||
frame := Frame{}
|
||||
if Trace() {
|
||||
frame = Caller(1)
|
||||
}
|
||||
return &wrapError{msg: message, err: err, frame: frame}
|
||||
}
|
||||
|
||||
// Wrapf wraps error with formatted message and caller.
|
||||
func Wrapf(err error, format string, a ...interface{}) error {
|
||||
frame := Frame{}
|
||||
if Trace() {
|
||||
frame = Caller(1)
|
||||
}
|
||||
msg := fmt.Sprintf(format, a...)
|
||||
return &wrapError{msg: msg, err: err, frame: frame}
|
||||
}
|
||||
|
||||
// Is reports whether any error in err's chain matches target.
|
||||
//
|
||||
// The chain consists of err itself followed by the sequence of errors obtained by
|
||||
// repeatedly calling Unwrap.
|
||||
//
|
||||
// An error is considered to match a target if it is equal to that target or if
|
||||
// it implements a method Is(error) bool such that Is(target) returns true.
|
||||
//
|
||||
// An error type might provide an Is method so it can be treated as equivalent
|
||||
// to an existing error. For example, if MyError defines
|
||||
//
|
||||
// func (m MyError) Is(target error) bool { return target == fs.ErrExist }
|
||||
//
|
||||
// then Is(MyError{}, fs.ErrExist) returns true. See syscall.Errno.Is for
|
||||
// an example in the standard library.
|
||||
func Is(err, target error) bool {
|
||||
return errors.Is(err, target)
|
||||
}
|
||||
|
||||
// As finds the first error in err's chain that matches target, and if so, sets
|
||||
// target to that error value and returns true. Otherwise, it returns false.
|
||||
//
|
||||
// The chain consists of err itself followed by the sequence of errors obtained by
|
||||
// repeatedly calling Unwrap.
|
||||
//
|
||||
// An error matches target if the error's concrete value is assignable to the value
|
||||
// pointed to by target, or if the error has a method As(interface{}) bool such that
|
||||
// As(target) returns true. In the latter case, the As method is responsible for
|
||||
// setting target.
|
||||
//
|
||||
// An error type might provide an As method so it can be treated as if it were a
|
||||
// different error type.
|
||||
//
|
||||
// As panics if target is not a non-nil pointer to either a type that implements
|
||||
// error, or to any interface type.
|
||||
func As(err error, target interface{}) bool { return errors.As(err, target) }
|
8
vendor/github.com/go-faster/jx/.codecov.yml
generated
vendored
Normal file
8
vendor/github.com/go-faster/jx/.codecov.yml
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
ignore:
|
||||
- tools/**
|
||||
coverage:
|
||||
status:
|
||||
patch: false
|
||||
project:
|
||||
default:
|
||||
threshold: 0.5%
|
25
vendor/github.com/go-faster/jx/.editorconfig
generated
vendored
Normal file
25
vendor/github.com/go-faster/jx/.editorconfig
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
# http://editorconfig.org/
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
end_of_line = lf
|
||||
|
||||
[{*.go, go.mod, *.tmpl}]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
|
||||
[{*.yml,*.yaml}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.py]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
# Makefiles always use tabs for indentation
|
||||
[Makefile]
|
||||
indent_style = tab
|
2
vendor/github.com/go-faster/jx/.gitattributes
generated
vendored
Normal file
2
vendor/github.com/go-faster/jx/.gitattributes
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
# Never modify line endings of corpus.
|
||||
testdata/fuzz/** text eol=lf
|
15
vendor/github.com/go-faster/jx/.gitignore
generated
vendored
Normal file
15
vendor/github.com/go-faster/jx/.gitignore
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
/vendor
|
||||
/bug_test.go
|
||||
/coverage.txt
|
||||
/.idea
|
||||
.idea
|
||||
_bin/*
|
||||
./examples
|
||||
|
||||
*-fuzz.zip
|
||||
|
||||
*.out
|
||||
*.dump
|
||||
*.test
|
||||
|
||||
corpus
|
108
vendor/github.com/go-faster/jx/.golangci.yml
generated
vendored
Normal file
108
vendor/github.com/go-faster/jx/.golangci.yml
generated
vendored
Normal file
@ -0,0 +1,108 @@
|
||||
linters-settings:
|
||||
govet:
|
||||
check-shadowing: true
|
||||
gocyclo:
|
||||
min-complexity: 15
|
||||
maligned:
|
||||
suggest-new: true
|
||||
dupl:
|
||||
threshold: 120
|
||||
goconst:
|
||||
min-len: 2
|
||||
min-occurrences: 3
|
||||
misspell:
|
||||
locale: US
|
||||
lll:
|
||||
line-length: 140
|
||||
goimports:
|
||||
local-prefixes: github.com/go-faster/
|
||||
gocritic:
|
||||
enabled-tags:
|
||||
- diagnostic
|
||||
- experimental
|
||||
- opinionated
|
||||
- performance
|
||||
- style
|
||||
disabled-checks:
|
||||
- hugeParam
|
||||
- rangeValCopy
|
||||
- exitAfterDefer
|
||||
- whyNoLint
|
||||
- singleCaseSwitch
|
||||
- commentedOutCode
|
||||
- appendAssign
|
||||
- unnecessaryBlock
|
||||
- redundantSprint
|
||||
|
||||
linters:
|
||||
disable-all: true
|
||||
enable:
|
||||
- deadcode
|
||||
- depguard
|
||||
- dogsled
|
||||
- errcheck
|
||||
- goconst
|
||||
- gocritic
|
||||
- gofmt
|
||||
- goimports
|
||||
- revive
|
||||
- gosec
|
||||
- govet
|
||||
- ineffassign
|
||||
- misspell
|
||||
- nakedret
|
||||
- structcheck
|
||||
- typecheck
|
||||
- unconvert
|
||||
- varcheck
|
||||
- whitespace
|
||||
|
||||
# Breaks with buildssa error for some reason.
|
||||
#- unparam
|
||||
|
||||
# Do not enable:
|
||||
# - wsl (too opinionated about newlines)
|
||||
# - godox (todos are OK)
|
||||
# - bodyclose (false positives on helper functions)
|
||||
# - prealloc (not worth it in scope of this project)
|
||||
# - maligned (same as prealloc)
|
||||
# - funlen (gocyclo is enough)
|
||||
# - gochecknoglobals (we know when it is ok to use globals)
|
||||
# - gochecknoinits (we know when it is ok to use inits)
|
||||
# - dupl (too opinionated)
|
||||
|
||||
issues:
|
||||
exclude-use-default: false
|
||||
exclude-rules:
|
||||
# Disable linters that are annoying in tests.
|
||||
- path: _test\.go
|
||||
linters:
|
||||
- gocyclo
|
||||
- errcheck
|
||||
- dupl
|
||||
- gosec
|
||||
- funlen
|
||||
- goconst
|
||||
- gocognit
|
||||
- scopelint
|
||||
- lll
|
||||
|
||||
- path: _test\.go
|
||||
text: "Combine"
|
||||
linters:
|
||||
- gocritic
|
||||
|
||||
# Check that equal to self is true
|
||||
- linters: [gocritic]
|
||||
source: '(assert|require).+Equal'
|
||||
text: 'dupArg'
|
||||
path: _test\.go
|
||||
|
||||
# Ignore shadowing of err.
|
||||
- linters: [ govet ]
|
||||
text: 'declaration of "(err|ctx|log|c)"'
|
||||
|
||||
# Ignore linters in main packages.
|
||||
- path: main\.go
|
||||
linters: [ goconst, funlen, gocognit, gocyclo ]
|
||||
|
21
vendor/github.com/go-faster/jx/LICENSE
generated
vendored
Normal file
21
vendor/github.com/go-faster/jx/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2016 json-iterator
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
13
vendor/github.com/go-faster/jx/Makefile
generated
vendored
Normal file
13
vendor/github.com/go-faster/jx/Makefile
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
test:
|
||||
@./go.test.sh
|
||||
.PHONY: test
|
||||
|
||||
coverage:
|
||||
@./go.coverage.sh
|
||||
.PHONY: coverage
|
||||
|
||||
test_fast:
|
||||
go test ./...
|
||||
|
||||
tidy:
|
||||
go mod tidy
|
306
vendor/github.com/go-faster/jx/README.md
generated
vendored
Normal file
306
vendor/github.com/go-faster/jx/README.md
generated
vendored
Normal file
@ -0,0 +1,306 @@
|
||||
# jx [![](https://img.shields.io/badge/go-pkg-00ADD8)](https://pkg.go.dev/github.com/go-faster/jx#section-documentation) [![](https://img.shields.io/codecov/c/github/go-faster/jx?label=cover)](https://codecov.io/gh/go-faster/jx) [![stable](https://img.shields.io/badge/-stable-brightgreen)](https://go-faster.org/docs/projects/status#stable)
|
||||
|
||||
Package jx implements encoding and decoding of json [[RFC 7159](https://www.rfc-editor.org/rfc/rfc7159.html)].
|
||||
Lightweight fork of [jsoniter](https://github.com/json-iterator/go).
|
||||
|
||||
```console
|
||||
go get github.com/go-faster/jx
|
||||
```
|
||||
|
||||
* [Usage and examples](#usage)
|
||||
* [Roadmap](#roadmap)
|
||||
* [Non-goals](#non-goals)
|
||||
|
||||
## Features
|
||||
* Directly encode and decode json values
|
||||
* No reflect or `interface{}`
|
||||
* Pools and direct buffer access for less (or none) allocations
|
||||
* Multi-pass decoding
|
||||
* Validation
|
||||
|
||||
See [usage](#Usage) for examples. Mostly suitable for fast low-level json manipulation
|
||||
with high control, for dynamic parsing and encoding unstructured data. Used in [ogen](https://github.com/ogen-go/ogen) project for
|
||||
json (un)marshaling code generation based on json and OpenAPI schemas.
|
||||
|
||||
For example, we have following OpenTelemetry log entry:
|
||||
|
||||
```json
|
||||
{
|
||||
"Timestamp": "1586960586000000000",
|
||||
"Attributes": {
|
||||
"http.status_code": 500,
|
||||
"http.url": "http://example.com",
|
||||
"my.custom.application.tag": "hello"
|
||||
},
|
||||
"Resource": {
|
||||
"service.name": "donut_shop",
|
||||
"service.version": "2.0.0",
|
||||
"k8s.pod.uid": "1138528c-c36e-11e9-a1a7-42010a800198"
|
||||
},
|
||||
"TraceId": "13e2a0921288b3ff80df0a0482d4fc46",
|
||||
"SpanId": "43222c2d51a7abe3",
|
||||
"SeverityText": "INFO",
|
||||
"SeverityNumber": 9,
|
||||
"Body": "20200415T072306-0700 INFO I like donuts"
|
||||
}
|
||||
```
|
||||
|
||||
Flexibility of `jx` enables highly efficient semantic-aware encoding and decoding,
|
||||
e.g. using `[16]byte` for `TraceId` with zero-allocation `hex` encoding in json:
|
||||
|
||||
| Name | Speed | Allocations |
|
||||
|----------|-----------|-------------|
|
||||
| Decode | 970 MB/s | 0 allocs/op |
|
||||
| Validate | 1535 MB/s | 0 allocs/op |
|
||||
| Encode | 1104 MB/s | 0 allocs/op |
|
||||
| Write | 2146 MB/s | 0 allocs/op |
|
||||
|
||||
See [otel_test.go](./otel_test.go) for example.
|
||||
|
||||
## Why
|
||||
|
||||
Most of [jsoniter](https://github.com/json-iterator/go) issues are caused by necessity
|
||||
to be drop-in replacement for standard `encoding/json`. Removing such constrains greatly
|
||||
simplified implementation and reduced scope, allowing to focus on json stream processing.
|
||||
|
||||
* Commas are handled automatically while encoding
|
||||
* Raw json, Number and Base64 support
|
||||
* Reduced scope
|
||||
* No reflection
|
||||
* No `encoding/json` adapter
|
||||
* 3.5x less code (8.5K to 2.4K SLOC)
|
||||
* Fuzzing, improved test coverage
|
||||
* Drastically refactored and simplified
|
||||
* Explicit error returns
|
||||
* No `Config` or `API`
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
* [Decoding](#decode)
|
||||
* [Encoding](#encode)
|
||||
* [Writer](#writer)
|
||||
* [Raw message](#raw)
|
||||
* [Number](#number)
|
||||
* [Base64](#base64)
|
||||
* [Validation](#validate)
|
||||
* [Multi pass decoding](#capture)
|
||||
|
||||
### Decode
|
||||
|
||||
Use [jx.Decoder](https://pkg.go.dev/github.com/go-faster/jx#Decoder). Zero value is valid,
|
||||
but constructors are available for convenience:
|
||||
* [jx.Decode(reader io.Reader, bufSize int)](https://pkg.go.dev/github.com/go-faster/jx#Decode) for `io.Reader`
|
||||
* [jx.DecodeBytes([]byte)](https://pkg.go.dev/github.com/go-faster/jx#Decode) for byte slices
|
||||
* [jx.DecodeStr(string)](https://pkg.go.dev/github.com/go-faster/jx#Decode) for strings
|
||||
|
||||
To reuse decoders and their buffers, use [jx.GetDecoder](https://pkg.go.dev/github.com/go-faster/jx#GetDecoder)
|
||||
and [jx.PutDecoder](https://pkg.go.dev/github.com/go-faster/jx#PutDecoder) alongside with reset functions:
|
||||
* [jx.Decoder.Reset(io.Reader)](https://pkg.go.dev/github.com/go-faster/jx#Decoder.Reset) to reset to new `io.Reader`
|
||||
* [jx.Decoder.ResetBytes([]byte)](https://pkg.go.dev/github.com/go-faster/jx#Decoder.ResetBytes) to decode another byte slice
|
||||
|
||||
Decoder is reset on `PutDecoder`.
|
||||
|
||||
```go
|
||||
d := jx.DecodeStr(`{"values":[4,8,15,16,23,42]}`)
|
||||
|
||||
// Save all integers from "values" array to slice.
|
||||
var values []int
|
||||
|
||||
// Iterate over each object field.
|
||||
if err := d.Obj(func(d *jx.Decoder, key string) error {
|
||||
switch key {
|
||||
case "values":
|
||||
// Iterate over each array element.
|
||||
return d.Arr(func(d *jx.Decoder) error {
|
||||
v, err := d.Int()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
values = append(values, v)
|
||||
return nil
|
||||
})
|
||||
default:
|
||||
// Skip unknown fields if any.
|
||||
return d.Skip()
|
||||
}
|
||||
}); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(values)
|
||||
// Output: [4 8 15 16 23 42]
|
||||
```
|
||||
|
||||
### Encode
|
||||
Use [jx.Encoder](https://pkg.go.dev/github.com/go-faster/jx#Encoder). Zero value is valid, reuse with
|
||||
[jx.GetEncoder](https://pkg.go.dev/github.com/go-faster/jx#GetEncoder),
|
||||
[jx.PutEncoder](https://pkg.go.dev/github.com/go-faster/jx#PutEncoder) and
|
||||
[jx.Encoder.Reset()](https://pkg.go.dev/github.com/go-faster/jx#Encoder.Reset). Encoder is reset on `PutEncoder`.
|
||||
```go
|
||||
var e jx.Encoder
|
||||
e.ObjStart() // {
|
||||
e.FieldStart("values") // "values":
|
||||
e.ArrStart() // [
|
||||
for _, v := range []int{4, 8, 15, 16, 23, 42} {
|
||||
e.Int(v)
|
||||
}
|
||||
e.ArrEnd() // ]
|
||||
e.ObjEnd() // }
|
||||
fmt.Println(e)
|
||||
fmt.Println("Buffer len:", len(e.Bytes()))
|
||||
// Output: {"values":[4,8,15,16,23,42]}
|
||||
// Buffer len: 28
|
||||
```
|
||||
|
||||
### Writer
|
||||
|
||||
Use [jx.Writer](https://pkg.go.dev/github.com/go-faster/jx#Writer) for low level json writing.
|
||||
|
||||
No automatic commas or indentation for lowest possible overhead, useful for code generated json encoding.
|
||||
|
||||
### Raw
|
||||
Use [jx.Decoder.Raw](https://pkg.go.dev/github.com/go-faster/jx#Decoder.Raw) to read raw json values, similar to `json.RawMessage`.
|
||||
```go
|
||||
d := jx.DecodeStr(`{"foo": [1, 2, 3]}`)
|
||||
|
||||
var raw jx.Raw
|
||||
if err := d.Obj(func(d *jx.Decoder, key string) error {
|
||||
v, err := d.Raw()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
raw = v
|
||||
return nil
|
||||
}); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(raw.Type(), raw)
|
||||
// Output:
|
||||
// array [1, 2, 3]
|
||||
```
|
||||
|
||||
### Number
|
||||
|
||||
Use [jx.Decoder.Num](https://pkg.go.dev/github.com/go-faster/jx#Decoder.Num) to read numbers, similar to `json.Number`.
|
||||
Also supports number strings, like `"12345"`, which is common compatible way to represent `uint64`.
|
||||
|
||||
```go
|
||||
d := jx.DecodeStr(`{"foo": "10531.0"}`)
|
||||
|
||||
var n jx.Num
|
||||
if err := d.Obj(func(d *jx.Decoder, key string) error {
|
||||
v, err := d.Num()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
n = v
|
||||
return nil
|
||||
}); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(n)
|
||||
fmt.Println("positive:", n.Positive())
|
||||
|
||||
// Can decode floats with zero fractional part as integers:
|
||||
v, err := n.Int64()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Println("int64:", v)
|
||||
// Output:
|
||||
// "10531.0"
|
||||
// positive: true
|
||||
// int64: 10531
|
||||
```
|
||||
|
||||
### Base64
|
||||
Use [jx.Encoder.Base64](https://pkg.go.dev/github.com/go-faster/jx#Encoder.Base64) and
|
||||
[jx.Decoder.Base64](https://pkg.go.dev/github.com/go-faster/jx#Decoder.Base64) or
|
||||
[jx.Decoder.Base64Append](https://pkg.go.dev/github.com/go-faster/jx#Decoder.Base64Append).
|
||||
|
||||
Same as encoding/json, base64.StdEncoding or [[RFC 4648](https://www.rfc-editor.org/rfc/rfc4648.html)].
|
||||
```go
|
||||
var e jx.Encoder
|
||||
e.Base64([]byte("Hello"))
|
||||
fmt.Println(e)
|
||||
|
||||
data, _ := jx.DecodeBytes(e.Bytes()).Base64()
|
||||
fmt.Printf("%s", data)
|
||||
// Output:
|
||||
// "SGVsbG8="
|
||||
// Hello
|
||||
```
|
||||
|
||||
### Validate
|
||||
|
||||
Check that byte slice is valid json with [jx.Valid](https://pkg.go.dev/github.com/go-faster/jx#Valid):
|
||||
|
||||
```go
|
||||
fmt.Println(jx.Valid([]byte(`{"field": "value"}`))) // true
|
||||
fmt.Println(jx.Valid([]byte(`"Hello, world!"`))) // true
|
||||
fmt.Println(jx.Valid([]byte(`["foo"}`))) // false
|
||||
```
|
||||
|
||||
### Capture
|
||||
The [jx.Decoder.Capture](https://pkg.go.dev/github.com/go-faster/jx#Decoder.Capture) method allows to unread everything is read in callback.
|
||||
Useful for multi-pass parsing:
|
||||
```go
|
||||
d := jx.DecodeStr(`["foo", "bar", "baz"]`)
|
||||
var elems int
|
||||
// NB: Currently Capture does not support io.Reader, only buffers.
|
||||
if err := d.Capture(func(d *jx.Decoder) error {
|
||||
// Everything decoded in this callback will be rolled back.
|
||||
return d.Arr(func(d *jx.Decoder) error {
|
||||
elems++
|
||||
return d.Skip()
|
||||
})
|
||||
}); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
// Decoder is rolled back to state before "Capture" call.
|
||||
fmt.Println("Read", elems, "elements on first pass")
|
||||
fmt.Println("Next element is", d.Next(), "again")
|
||||
|
||||
// Output:
|
||||
// Read 3 elements on first pass
|
||||
// Next element is array again
|
||||
```
|
||||
|
||||
### ObjBytes
|
||||
|
||||
The `Decoder.ObjBytes` method tries not to allocate memory for keys, reusing existing buffer.
|
||||
```go
|
||||
d := DecodeStr(`{"id":1,"randomNumber":10}`)
|
||||
d.ObjBytes(func(d *Decoder, key []byte) error {
|
||||
switch string(key) {
|
||||
case "id":
|
||||
case "randomNumber":
|
||||
}
|
||||
return d.Skip()
|
||||
})
|
||||
```
|
||||
|
||||
## Roadmap
|
||||
- [ ] Rework and export `Any`
|
||||
- [x] Support `Raw` for io.Reader
|
||||
- [x] Support `Capture` for io.Reader
|
||||
- [ ] Improve Num
|
||||
- Better validation on decoding
|
||||
- Support BigFloat and BigInt
|
||||
- Support equivalence check, like `eq(1.0, 1) == true`
|
||||
- [ ] Add non-callback decoding of objects
|
||||
|
||||
## Non-goals
|
||||
* Code generation for decoding or encoding
|
||||
* Replacement for `encoding/json`
|
||||
* Reflection or `interface{}` based encoding or decoding
|
||||
* Support for json path or similar
|
||||
|
||||
This package should be kept as simple as possible and be used as
|
||||
low-level foundation for high-level projects like code generator.
|
||||
|
||||
## License
|
||||
MIT, same as jsoniter
|
148
vendor/github.com/go-faster/jx/dec.go
generated
vendored
Normal file
148
vendor/github.com/go-faster/jx/dec.go
generated
vendored
Normal file
@ -0,0 +1,148 @@
|
||||
package jx
|
||||
|
||||
import (
|
||||
"io"
|
||||
)
|
||||
|
||||
// Type of json value.
|
||||
type Type int
|
||||
|
||||
func (t Type) String() string {
|
||||
switch t {
|
||||
case Invalid:
|
||||
return "invalid"
|
||||
case String:
|
||||
return "string"
|
||||
case Number:
|
||||
return "number"
|
||||
case Null:
|
||||
return "null"
|
||||
case Bool:
|
||||
return "bool"
|
||||
case Array:
|
||||
return "array"
|
||||
case Object:
|
||||
return "object"
|
||||
default:
|
||||
return "unknown"
|
||||
}
|
||||
}
|
||||
|
||||
const (
|
||||
// Invalid json value.
|
||||
Invalid Type = iota
|
||||
// String json value, like "foo".
|
||||
String
|
||||
// Number json value, like 100 or 1.01.
|
||||
Number
|
||||
// Null json value.
|
||||
Null
|
||||
// Bool json value, true or false.
|
||||
Bool
|
||||
// Array json value, like [1, 2, 3].
|
||||
Array
|
||||
// Object json value, like {"foo": 1}.
|
||||
Object
|
||||
)
|
||||
|
||||
var types []Type
|
||||
|
||||
func init() {
|
||||
types = make([]Type, 256)
|
||||
for i := range types {
|
||||
types[i] = Invalid
|
||||
}
|
||||
types['"'] = String
|
||||
types['-'] = Number
|
||||
types['0'] = Number
|
||||
types['1'] = Number
|
||||
types['2'] = Number
|
||||
types['3'] = Number
|
||||
types['4'] = Number
|
||||
types['5'] = Number
|
||||
types['6'] = Number
|
||||
types['7'] = Number
|
||||
types['8'] = Number
|
||||
types['9'] = Number
|
||||
types['t'] = Bool
|
||||
types['f'] = Bool
|
||||
types['n'] = Null
|
||||
types['['] = Array
|
||||
types['{'] = Object
|
||||
}
|
||||
|
||||
// Decoder decodes json.
|
||||
//
|
||||
// Can decode from io.Reader or byte slice directly.
|
||||
type Decoder struct {
|
||||
reader io.Reader
|
||||
|
||||
// buf is current buffer.
|
||||
//
|
||||
// Contains full json if reader is nil or used as a read buffer
|
||||
// otherwise.
|
||||
buf []byte
|
||||
head int // offset in buf to start of current json stream
|
||||
tail int // offset in buf to end of current json stream
|
||||
|
||||
streamOffset int // for reader, offset in stream to start of current buf contents
|
||||
depth int
|
||||
}
|
||||
|
||||
const defaultBuf = 512
|
||||
|
||||
// Decode creates a Decoder that reads json from io.Reader.
|
||||
func Decode(reader io.Reader, bufSize int) *Decoder {
|
||||
if bufSize <= 0 {
|
||||
bufSize = defaultBuf
|
||||
}
|
||||
return &Decoder{
|
||||
reader: reader,
|
||||
buf: make([]byte, bufSize),
|
||||
}
|
||||
}
|
||||
|
||||
// DecodeBytes creates a Decoder that reads json from byte slice.
|
||||
func DecodeBytes(input []byte) *Decoder {
|
||||
return &Decoder{
|
||||
buf: input,
|
||||
tail: len(input),
|
||||
}
|
||||
}
|
||||
|
||||
// DecodeStr creates a Decoder that reads string as json.
|
||||
func DecodeStr(input string) *Decoder {
|
||||
return DecodeBytes([]byte(input))
|
||||
}
|
||||
|
||||
func (d *Decoder) offset() int {
|
||||
return d.streamOffset + d.head
|
||||
}
|
||||
|
||||
// Reset resets reader and underlying state, next reads will use provided io.Reader.
|
||||
func (d *Decoder) Reset(reader io.Reader) {
|
||||
d.reader = reader
|
||||
d.head = 0
|
||||
d.tail = 0
|
||||
d.depth = 0
|
||||
|
||||
// Reads from reader need buffer.
|
||||
if cap(d.buf) == 0 {
|
||||
// Allocate new buffer if none.
|
||||
d.buf = make([]byte, defaultBuf)
|
||||
}
|
||||
if len(d.buf) == 0 {
|
||||
// Set buffer to full capacity if needed.
|
||||
d.buf = d.buf[:cap(d.buf)]
|
||||
}
|
||||
}
|
||||
|
||||
// ResetBytes resets underlying state, next reads will use provided buffer.
|
||||
func (d *Decoder) ResetBytes(input []byte) {
|
||||
d.reader = nil
|
||||
d.head = 0
|
||||
d.tail = len(input)
|
||||
d.depth = 0
|
||||
|
||||
d.buf = input
|
||||
}
|
81
vendor/github.com/go-faster/jx/dec_arr.go
generated
vendored
Normal file
81
vendor/github.com/go-faster/jx/dec_arr.go
generated
vendored
Normal file
@ -0,0 +1,81 @@
|
||||
package jx
|
||||
|
||||
import (
|
||||
"github.com/go-faster/errors"
|
||||
)
|
||||
|
||||
// Elem skips to the start of next array element, returning true boolean
|
||||
// if element exists.
|
||||
//
|
||||
// Can be called before or in Array.
|
||||
func (d *Decoder) Elem() (ok bool, err error) {
|
||||
c, err := d.next()
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
switch c {
|
||||
case '[':
|
||||
c, err := d.more()
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
if c != ']' {
|
||||
d.unread()
|
||||
return true, nil
|
||||
}
|
||||
return false, nil
|
||||
case ']':
|
||||
return false, nil
|
||||
case ',':
|
||||
return true, nil
|
||||
default:
|
||||
return false, errors.Wrap(badToken(c, d.offset()), `"[", "," or "]" expected`)
|
||||
}
|
||||
}
|
||||
|
||||
// Arr decodes array and invokes callback on each array element.
|
||||
func (d *Decoder) Arr(f func(d *Decoder) error) error {
|
||||
if err := d.consume('['); err != nil {
|
||||
return errors.Wrap(err, `"[" expected`)
|
||||
}
|
||||
if f == nil {
|
||||
return d.skipArr()
|
||||
}
|
||||
if err := d.incDepth(); err != nil {
|
||||
return err
|
||||
}
|
||||
c, err := d.more()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, `value or "]" expected`)
|
||||
}
|
||||
if c == ']' {
|
||||
return d.decDepth()
|
||||
}
|
||||
d.unread()
|
||||
if err := f(d); err != nil {
|
||||
return errors.Wrap(err, "callback")
|
||||
}
|
||||
|
||||
c, err = d.more()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, `"," or "]" expected`)
|
||||
}
|
||||
for c == ',' {
|
||||
// Skip whitespace before reading element.
|
||||
if _, err := d.next(); err != nil {
|
||||
return err
|
||||
}
|
||||
d.unread()
|
||||
if err := f(d); err != nil {
|
||||
return errors.Wrap(err, "callback")
|
||||
}
|
||||
if c, err = d.next(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if c != ']' {
|
||||
err := badToken(c, d.offset()-1)
|
||||
return errors.Wrap(err, `"]" expected`)
|
||||
}
|
||||
return d.decDepth()
|
||||
}
|
63
vendor/github.com/go-faster/jx/dec_arr_iter.go
generated
vendored
Normal file
63
vendor/github.com/go-faster/jx/dec_arr_iter.go
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
package jx
|
||||
|
||||
import (
|
||||
"github.com/go-faster/errors"
|
||||
)
|
||||
|
||||
// ArrIter is decoding array iterator.
|
||||
type ArrIter struct {
|
||||
d *Decoder
|
||||
err error
|
||||
closed bool
|
||||
comma bool
|
||||
}
|
||||
|
||||
// ArrIter creates new array iterator.
|
||||
func (d *Decoder) ArrIter() (ArrIter, error) {
|
||||
if err := d.consume('['); err != nil {
|
||||
return ArrIter{}, errors.Wrap(err, `"[" expected`)
|
||||
}
|
||||
if err := d.incDepth(); err != nil {
|
||||
return ArrIter{}, err
|
||||
}
|
||||
if _, err := d.more(); err != nil {
|
||||
return ArrIter{}, err
|
||||
}
|
||||
d.unread()
|
||||
return ArrIter{d: d}, nil
|
||||
}
|
||||
|
||||
// Next consumes element and returns false, if there is no elements anymore.
|
||||
func (i *ArrIter) Next() bool {
|
||||
if i.closed || i.err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
dec := i.d
|
||||
c, err := dec.more()
|
||||
if err != nil {
|
||||
i.err = err
|
||||
return false
|
||||
}
|
||||
if c == ']' {
|
||||
i.closed = true
|
||||
i.err = dec.decDepth()
|
||||
return false
|
||||
}
|
||||
if i.comma {
|
||||
if c != ',' {
|
||||
err := badToken(c, dec.offset()-1)
|
||||
i.err = errors.Wrap(err, `"," expected`)
|
||||
return false
|
||||
}
|
||||
} else {
|
||||
dec.unread()
|
||||
}
|
||||
i.comma = true
|
||||
return true
|
||||
}
|
||||
|
||||
// Err returns the error, if any, that was encountered during iteration.
|
||||
func (i *ArrIter) Err() error {
|
||||
return i.err
|
||||
}
|
47
vendor/github.com/go-faster/jx/dec_b64.go
generated
vendored
Normal file
47
vendor/github.com/go-faster/jx/dec_b64.go
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
package jx
|
||||
|
||||
import (
|
||||
"github.com/segmentio/asm/base64"
|
||||
|
||||
"github.com/go-faster/errors"
|
||||
)
|
||||
|
||||
// Base64 decodes base64 encoded data from string.
|
||||
//
|
||||
// Same as encoding/json, base64.StdEncoding or RFC 4648.
|
||||
func (d *Decoder) Base64() ([]byte, error) {
|
||||
if d.Next() == Null {
|
||||
if err := d.Null(); err != nil {
|
||||
return nil, errors.Wrap(err, "read null")
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
return d.Base64Append([]byte{})
|
||||
}
|
||||
|
||||
// Base64Append appends base64 encoded data from string.
|
||||
//
|
||||
// Same as encoding/json, base64.StdEncoding or RFC 4648.
|
||||
func (d *Decoder) Base64Append(b []byte) ([]byte, error) {
|
||||
if d.Next() == Null {
|
||||
if err := d.Null(); err != nil {
|
||||
return nil, errors.Wrap(err, "read null")
|
||||
}
|
||||
return b, nil
|
||||
}
|
||||
buf, err := d.StrBytes()
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "bytes")
|
||||
}
|
||||
|
||||
decodedLen := base64.StdEncoding.DecodedLen(len(buf))
|
||||
start := len(b)
|
||||
b = append(b, make([]byte, decodedLen)...)
|
||||
|
||||
n, err := base64.StdEncoding.Decode(b[start:], buf)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "decode")
|
||||
}
|
||||
|
||||
return b[:start+n], nil
|
||||
}
|
41
vendor/github.com/go-faster/jx/dec_bool.go
generated
vendored
Normal file
41
vendor/github.com/go-faster/jx/dec_bool.go
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
package jx
|
||||
|
||||
// Bool reads a json object as Bool
|
||||
func (d *Decoder) Bool() (bool, error) {
|
||||
if err := d.skipSpace(); err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
var (
|
||||
offset = d.offset()
|
||||
buf [4]byte
|
||||
)
|
||||
if err := d.readExact4(&buf); err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
switch string(buf[:]) {
|
||||
case "true":
|
||||
return true, nil
|
||||
case "fals":
|
||||
c, err := d.byte()
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
if c != 'e' {
|
||||
return false, badToken(c, offset+4)
|
||||
}
|
||||
return false, nil
|
||||
default:
|
||||
switch c := buf[0]; c {
|
||||
case 't':
|
||||
const encodedTrue = 't' | 'r'<<8 | 'u'<<16 | 'e'<<24
|
||||
return false, findInvalidToken4(buf, encodedTrue, offset)
|
||||
case 'f':
|
||||
const encodedFals = 'f' | 'a'<<8 | 'l'<<16 | 's'<<24
|
||||
return false, findInvalidToken4(buf, encodedFals, offset)
|
||||
default:
|
||||
return false, badToken(c, offset)
|
||||
}
|
||||
}
|
||||
}
|
31
vendor/github.com/go-faster/jx/dec_capture.go
generated
vendored
Normal file
31
vendor/github.com/go-faster/jx/dec_capture.go
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
package jx
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io"
|
||||
)
|
||||
|
||||
// Capture calls f and then rolls back to state before call.
|
||||
func (d *Decoder) Capture(f func(d *Decoder) error) error {
|
||||
if f == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
if d.reader != nil {
|
||||
// TODO(tdakkota): May it be more efficient?
|
||||
var (
|
||||
buf bytes.Buffer
|
||||
streamOffset = d.streamOffset
|
||||
)
|
||||
reader := io.TeeReader(d.reader, &buf)
|
||||
defer func() {
|
||||
d.reader = io.MultiReader(&buf, d.reader)
|
||||
d.streamOffset = streamOffset
|
||||
}()
|
||||
d.reader = reader
|
||||
}
|
||||
head, tail, depth := d.head, d.tail, d.depth
|
||||
err := f(d)
|
||||
d.head, d.tail, d.depth = head, tail, depth
|
||||
return err
|
||||
}
|
26
vendor/github.com/go-faster/jx/dec_depth.go
generated
vendored
Normal file
26
vendor/github.com/go-faster/jx/dec_depth.go
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
package jx
|
||||
|
||||
import "github.com/go-faster/errors"
|
||||
|
||||
// limit maximum depth of nesting, as allowed by https://tools.ietf.org/html/rfc7159#section-9
|
||||
const maxDepth = 10000
|
||||
|
||||
var errMaxDepth = errors.New("depth: maximum")
|
||||
|
||||
func (d *Decoder) incDepth() error {
|
||||
d.depth++
|
||||
if d.depth > maxDepth {
|
||||
return errMaxDepth
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var errNegativeDepth = errors.New("depth: negative")
|
||||
|
||||
func (d *Decoder) decDepth() error {
|
||||
d.depth--
|
||||
if d.depth < 0 {
|
||||
return errNegativeDepth
|
||||
}
|
||||
return nil
|
||||
}
|
17
vendor/github.com/go-faster/jx/dec_error.go
generated
vendored
Normal file
17
vendor/github.com/go-faster/jx/dec_error.go
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
package jx
|
||||
|
||||
import "fmt"
|
||||
|
||||
// badTokenErr means that Token was unexpected while decoding.
|
||||
type badTokenErr struct {
|
||||
Token byte
|
||||
Offset int
|
||||
}
|
||||
|
||||
func (e *badTokenErr) Error() string {
|
||||
return fmt.Sprintf("unexpected byte %d %q at %d", e.Token, e.Token, e.Offset)
|
||||
}
|
||||
|
||||
func badToken(c byte, offset int) error {
|
||||
return &badTokenErr{Token: c, Offset: offset}
|
||||
}
|
322
vendor/github.com/go-faster/jx/dec_float.go
generated
vendored
Normal file
322
vendor/github.com/go-faster/jx/dec_float.go
generated
vendored
Normal file
@ -0,0 +1,322 @@
|
||||
package jx
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-faster/errors"
|
||||
)
|
||||
|
||||
var (
|
||||
pow10 = [...]uint64{1, 10, 100, 1000, 10000, 100000, 1000000}
|
||||
floatDigits = [256]int8{}
|
||||
)
|
||||
|
||||
const (
|
||||
dotInNumber int8 = -iota - 1
|
||||
expInNumber
|
||||
plusInNumber
|
||||
minusInNumber
|
||||
endOfNumber
|
||||
invalidCharForNumber
|
||||
|
||||
maxFloat64 = 1<<63 - 1
|
||||
)
|
||||
|
||||
func init() {
|
||||
for i := 0; i < len(floatDigits); i++ {
|
||||
floatDigits[i] = invalidCharForNumber
|
||||
}
|
||||
floatDigits[','] = endOfNumber
|
||||
floatDigits[']'] = endOfNumber
|
||||
floatDigits['}'] = endOfNumber
|
||||
floatDigits[' '] = endOfNumber
|
||||
floatDigits['\t'] = endOfNumber
|
||||
floatDigits['\n'] = endOfNumber
|
||||
|
||||
for i := int8('0'); i <= int8('9'); i++ {
|
||||
floatDigits[i] = i - int8('0')
|
||||
}
|
||||
floatDigits['.'] = dotInNumber
|
||||
floatDigits['e'] = expInNumber
|
||||
floatDigits['E'] = expInNumber
|
||||
floatDigits['+'] = plusInNumber
|
||||
floatDigits['-'] = minusInNumber
|
||||
}
|
||||
|
||||
// Float32 reads float32 value.
|
||||
func (d *Decoder) Float32() (float32, error) {
|
||||
c, err := d.more()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if c != '-' {
|
||||
d.unread()
|
||||
}
|
||||
v, err := d.positiveFloat32()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if c == '-' {
|
||||
v *= -1
|
||||
}
|
||||
return v, nil
|
||||
}
|
||||
|
||||
func (d *Decoder) positiveFloat32() (float32, error) {
|
||||
i := d.head
|
||||
// First char.
|
||||
if i == d.tail {
|
||||
return d.float32Slow()
|
||||
}
|
||||
c := d.buf[i]
|
||||
i++
|
||||
ind := floatDigits[c]
|
||||
switch ind {
|
||||
case invalidCharForNumber, endOfNumber:
|
||||
return 0, badToken(c, d.offset())
|
||||
case dotInNumber, plusInNumber, expInNumber:
|
||||
err := badToken(c, d.offset())
|
||||
return 0, errors.Wrapf(err, "leading %q", c)
|
||||
case minusInNumber: // minus handled by caller
|
||||
err := badToken(c, d.offset())
|
||||
return 0, errors.Wrap(err, "double minus")
|
||||
case 0:
|
||||
if i == d.tail {
|
||||
return d.float32Slow()
|
||||
}
|
||||
c = d.buf[i]
|
||||
if floatDigits[c] >= 0 {
|
||||
err := badToken(c, d.offset()+1)
|
||||
return 0, errors.Wrap(err, "leading zero")
|
||||
}
|
||||
}
|
||||
value := uint64(ind)
|
||||
// Chars before dot.
|
||||
NonDecimalLoop:
|
||||
for ; i < d.tail; i++ {
|
||||
c = d.buf[i]
|
||||
ind := floatDigits[c]
|
||||
switch ind {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(c, d.offset()+i)
|
||||
case endOfNumber:
|
||||
d.head = i
|
||||
return float32(value), nil
|
||||
case dotInNumber, expInNumber:
|
||||
break NonDecimalLoop
|
||||
}
|
||||
if value > uint64SafeToMultiple10 {
|
||||
return d.float32Slow()
|
||||
}
|
||||
value = (value << 3) + (value << 1) + uint64(ind) // value = value * 10 + ind;
|
||||
}
|
||||
// Chars after dot.
|
||||
if c == '.' {
|
||||
i++
|
||||
decimalPlaces := 0
|
||||
if i == d.tail {
|
||||
return d.float32Slow()
|
||||
}
|
||||
for ; i < d.tail; i++ {
|
||||
c = d.buf[i]
|
||||
ind := floatDigits[c]
|
||||
switch ind {
|
||||
case endOfNumber:
|
||||
if decimalPlaces > 0 && decimalPlaces < len(pow10) {
|
||||
d.head = i
|
||||
return float32(float64(value) / float64(pow10[decimalPlaces])), nil
|
||||
}
|
||||
// too many decimal places
|
||||
return d.float32Slow()
|
||||
case dotInNumber, expInNumber, plusInNumber, minusInNumber:
|
||||
return d.float32Slow()
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(c, d.offset()+i)
|
||||
}
|
||||
decimalPlaces++
|
||||
if value > uint64SafeToMultiple10 {
|
||||
return d.float32Slow()
|
||||
}
|
||||
value = (value << 3) + (value << 1) + uint64(ind)
|
||||
}
|
||||
}
|
||||
return d.float32Slow()
|
||||
}
|
||||
|
||||
// Float64 read float64
|
||||
func (d *Decoder) Float64() (float64, error) {
|
||||
c, err := d.more()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if c != '-' {
|
||||
d.unread()
|
||||
}
|
||||
v, err := d.positiveFloat64()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if c == '-' {
|
||||
v *= -1
|
||||
}
|
||||
return v, nil
|
||||
}
|
||||
|
||||
func (d *Decoder) positiveFloat64() (float64, error) {
|
||||
i := d.head
|
||||
// First char.
|
||||
if i == d.tail {
|
||||
return d.float64Slow()
|
||||
}
|
||||
c := d.buf[i]
|
||||
i++
|
||||
ind := floatDigits[c]
|
||||
switch ind {
|
||||
case invalidCharForNumber, endOfNumber:
|
||||
return 0, badToken(c, d.offset())
|
||||
case dotInNumber, plusInNumber, expInNumber:
|
||||
err := badToken(c, d.offset())
|
||||
return 0, errors.Wrapf(err, "leading %q", c)
|
||||
case minusInNumber: // minus handled by caller
|
||||
err := badToken(c, d.offset())
|
||||
return 0, errors.Wrap(err, "double minus")
|
||||
case 0:
|
||||
if i == d.tail {
|
||||
return d.float64Slow()
|
||||
}
|
||||
c = d.buf[i]
|
||||
if floatDigits[c] >= 0 {
|
||||
err := badToken(c, d.offset()+1)
|
||||
return 0, errors.Wrap(err, "leading zero")
|
||||
}
|
||||
}
|
||||
value := uint64(ind)
|
||||
// Chars before dot.
|
||||
NonDecimal:
|
||||
for ; i < d.tail; i++ {
|
||||
c = d.buf[i]
|
||||
ind := floatDigits[c]
|
||||
switch ind {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(c, d.offset()+i)
|
||||
case endOfNumber:
|
||||
d.head = i
|
||||
return float64(value), nil
|
||||
case dotInNumber, expInNumber:
|
||||
break NonDecimal
|
||||
}
|
||||
if value > uint64SafeToMultiple10 {
|
||||
return d.float64Slow()
|
||||
}
|
||||
value = (value << 3) + (value << 1) + uint64(ind) // value = value * 10 + ind;
|
||||
}
|
||||
// chars after dot
|
||||
if c == '.' {
|
||||
i++
|
||||
decimalPlaces := 0
|
||||
if i == d.tail {
|
||||
return d.float64Slow()
|
||||
}
|
||||
for ; i < d.tail; i++ {
|
||||
c = d.buf[i]
|
||||
ind := floatDigits[c]
|
||||
switch ind {
|
||||
case endOfNumber:
|
||||
if decimalPlaces > 0 && decimalPlaces < len(pow10) {
|
||||
d.head = i
|
||||
return float64(value) / float64(pow10[decimalPlaces]), nil
|
||||
}
|
||||
// too many decimal places
|
||||
return d.float64Slow()
|
||||
case dotInNumber, expInNumber, plusInNumber, minusInNumber:
|
||||
return d.float64Slow()
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(c, d.offset()+i)
|
||||
}
|
||||
decimalPlaces++
|
||||
// Not checking for uint64SafeToMultiple10 here because
|
||||
// if condition is positive value multiplied by 10 is
|
||||
// guaranteed to be bigger than maxFloat64.
|
||||
value = (value << 3) + (value << 1) + uint64(ind)
|
||||
if value > maxFloat64 {
|
||||
return d.float64Slow()
|
||||
}
|
||||
}
|
||||
}
|
||||
return d.float64Slow()
|
||||
}
|
||||
|
||||
func (d *Decoder) float32Slow() (float32, error) {
|
||||
v, err := d.floatSlow(32)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return float32(v), err
|
||||
}
|
||||
|
||||
func (d *Decoder) float64Slow() (float64, error) { return d.floatSlow(64) }
|
||||
|
||||
func (d *Decoder) floatSlow(size int) (float64, error) {
|
||||
var (
|
||||
buf [32]byte
|
||||
offset = d.offset()
|
||||
)
|
||||
|
||||
str, err := d.numberAppend(buf[:0])
|
||||
if err != nil {
|
||||
return 0, errors.Wrap(err, "number")
|
||||
}
|
||||
|
||||
if err := validateFloat(str, offset); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
val, err := strconv.ParseFloat(string(str), size)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return val, nil
|
||||
}
|
||||
|
||||
func validateFloat(str []byte, offset int) error {
|
||||
// strconv.ParseFloat is not validating `1.` or `1.e1`
|
||||
if len(str) == 0 {
|
||||
// FIXME(tdakkota): use io.ErrUnexpectedEOF?
|
||||
return errors.New("empty")
|
||||
}
|
||||
|
||||
switch c := str[0]; floatDigits[c] {
|
||||
case dotInNumber, plusInNumber, expInNumber:
|
||||
err := badToken(c, offset)
|
||||
return errors.Wrapf(err, "leading %q", c)
|
||||
case minusInNumber: // minus handled by caller
|
||||
err := badToken(c, offset)
|
||||
return errors.Wrap(err, "double minus")
|
||||
case 0:
|
||||
if len(str) >= 2 {
|
||||
switch str[1] {
|
||||
case 'e', 'E', '.':
|
||||
default:
|
||||
err := badToken(str[1], offset+1)
|
||||
return errors.Wrap(err, "leading zero")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dotPos := bytes.IndexByte(str, '.')
|
||||
if dotPos != -1 {
|
||||
if dotPos == len(str)-1 {
|
||||
// FIXME(tdakkota): use io.ErrUnexpectedEOF?
|
||||
return errors.New("dot as last char")
|
||||
}
|
||||
switch c := str[dotPos+1]; c {
|
||||
case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
|
||||
default:
|
||||
err := badToken(c, offset+dotPos+1)
|
||||
return errors.Wrap(err, "no digit after dot")
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
80
vendor/github.com/go-faster/jx/dec_float_big.go
generated
vendored
Normal file
80
vendor/github.com/go-faster/jx/dec_float_big.go
generated
vendored
Normal file
@ -0,0 +1,80 @@
|
||||
package jx
|
||||
|
||||
import (
|
||||
"io"
|
||||
"math/big"
|
||||
|
||||
"github.com/go-faster/errors"
|
||||
)
|
||||
|
||||
// BigFloat read big.Float
|
||||
func (d *Decoder) BigFloat() (*big.Float, error) {
|
||||
str, err := d.numberAppend(nil)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "number")
|
||||
}
|
||||
prec := 64
|
||||
if len(str) > prec {
|
||||
prec = len(str)
|
||||
}
|
||||
val, _, err := big.ParseFloat(string(str), 10, uint(prec), big.ToZero)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "float")
|
||||
}
|
||||
return val, nil
|
||||
}
|
||||
|
||||
// BigInt read big.Int
|
||||
func (d *Decoder) BigInt() (*big.Int, error) {
|
||||
str, err := d.numberAppend(nil)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "number")
|
||||
}
|
||||
v := big.NewInt(0)
|
||||
var ok bool
|
||||
if v, ok = v.SetString(string(str), 10); !ok {
|
||||
return nil, errors.New("invalid")
|
||||
}
|
||||
return v, nil
|
||||
}
|
||||
|
||||
func (d *Decoder) number() ([]byte, error) {
|
||||
start := d.head
|
||||
buf := d.buf[d.head:d.tail]
|
||||
for i, c := range buf {
|
||||
switch floatDigits[c] {
|
||||
case invalidCharForNumber:
|
||||
return nil, badToken(c, d.offset()+i)
|
||||
case endOfNumber:
|
||||
// End of number.
|
||||
d.head += i
|
||||
return d.buf[start:d.head], nil
|
||||
default:
|
||||
continue
|
||||
}
|
||||
}
|
||||
// Buffer is number within head:tail.
|
||||
d.head = d.tail
|
||||
return d.buf[start:d.tail], nil
|
||||
}
|
||||
|
||||
func (d *Decoder) numberAppend(b []byte) ([]byte, error) {
|
||||
for {
|
||||
r, err := d.number()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
b = append(b, r...)
|
||||
if d.head != d.tail {
|
||||
return b, nil
|
||||
}
|
||||
|
||||
if err := d.read(); err != nil {
|
||||
if err == io.EOF {
|
||||
return b, nil
|
||||
}
|
||||
return b, err
|
||||
}
|
||||
}
|
||||
}
|
993
vendor/github.com/go-faster/jx/dec_int.gen.go
generated
vendored
Normal file
993
vendor/github.com/go-faster/jx/dec_int.gen.go
generated
vendored
Normal file
@ -0,0 +1,993 @@
|
||||
// Code generated by mkint, DO NOT EDIT.
|
||||
|
||||
package jx
|
||||
|
||||
import (
|
||||
"io"
|
||||
"math"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-faster/errors"
|
||||
)
|
||||
|
||||
var errOverflow = strconv.ErrRange
|
||||
|
||||
const (
|
||||
uint8SafeToMultiple10 = uint8(0xff)/10 - 1
|
||||
uint16SafeToMultiple10 = uint16(0xffff)/10 - 1
|
||||
uint32SafeToMultiple10 = uint32(0xffffffff)/10 - 1
|
||||
uint64SafeToMultiple10 = uint64(0xffffffffffffffff)/10 - 1
|
||||
)
|
||||
|
||||
// UInt8 reads uint8.
|
||||
func (d *Decoder) UInt8() (uint8, error) {
|
||||
c, err := d.more()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return d.readUInt8(c)
|
||||
}
|
||||
|
||||
func (d *Decoder) readUInt8(c byte) (uint8, error) {
|
||||
ind := floatDigits[c]
|
||||
switch ind {
|
||||
case 0:
|
||||
// Check that next byte is not a digit.
|
||||
c, err := d.peek()
|
||||
if err == nil {
|
||||
switch floatDigits[c] {
|
||||
case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9:
|
||||
err := badToken(c, d.offset())
|
||||
return 0, errors.Wrap(err, "digit after leading zero")
|
||||
case dotInNumber, expInNumber, plusInNumber, minusInNumber:
|
||||
err := badToken(c, d.offset())
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(c, d.offset())
|
||||
}
|
||||
}
|
||||
return 0, nil // single zero
|
||||
default:
|
||||
if ind < 0 {
|
||||
return 0, badToken(c, d.offset()-1)
|
||||
}
|
||||
}
|
||||
value := uint8(ind)
|
||||
if d.tail-d.head > 3 {
|
||||
i := d.head
|
||||
// Iteration 0.
|
||||
ind2 := floatDigits[d.buf[i]]
|
||||
switch ind2 {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(d.buf[i], d.offset()+0)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(d.buf[i], d.offset()+0)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head = i
|
||||
value *= 1
|
||||
return value, nil
|
||||
}
|
||||
i++
|
||||
// Iteration 1.
|
||||
ind3 := floatDigits[d.buf[i]]
|
||||
switch ind3 {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(d.buf[i], d.offset()+1)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(d.buf[i], d.offset()+1)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head = i
|
||||
value *= 10
|
||||
value += uint8(ind2) * 1
|
||||
return value, nil
|
||||
}
|
||||
i++
|
||||
// Iteration 2.
|
||||
ind4 := floatDigits[d.buf[i]]
|
||||
switch ind4 {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(d.buf[i], d.offset()+2)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(d.buf[i], d.offset()+2)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head = i
|
||||
value *= 100
|
||||
value += uint8(ind2) * 10
|
||||
value += uint8(ind3) * 1
|
||||
return value, nil
|
||||
}
|
||||
d.head = i
|
||||
value *= 100
|
||||
value += uint8(ind2) * 10
|
||||
value += uint8(ind3) * 1
|
||||
}
|
||||
for {
|
||||
buf := d.buf[d.head:d.tail]
|
||||
for i, c := range buf {
|
||||
ind = floatDigits[c]
|
||||
switch ind {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(c, d.offset()+i)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(c, d.offset()+i)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head += i
|
||||
return value, nil
|
||||
}
|
||||
if value > uint8SafeToMultiple10 {
|
||||
value2 := (value << 3) + (value << 1) + uint8(ind)
|
||||
if value2 < value {
|
||||
return 0, errOverflow
|
||||
}
|
||||
value = value2
|
||||
continue
|
||||
}
|
||||
value = (value << 3) + (value << 1) + uint8(ind)
|
||||
}
|
||||
switch err := d.read(); err {
|
||||
case io.EOF:
|
||||
return value, nil
|
||||
case nil:
|
||||
continue
|
||||
default:
|
||||
return 0, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Int8 reads int8.
|
||||
func (d *Decoder) Int8() (int8, error) {
|
||||
c, err := d.more()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if c == '-' {
|
||||
c, err := d.byte()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
val, err := d.readUInt8(c)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if val > math.MaxInt8+1 {
|
||||
return 0, errOverflow
|
||||
}
|
||||
return -int8(val), nil
|
||||
}
|
||||
val, err := d.readUInt8(c)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if val > math.MaxInt8 {
|
||||
return 0, errOverflow
|
||||
}
|
||||
return int8(val), nil
|
||||
}
|
||||
|
||||
// UInt16 reads uint16.
|
||||
func (d *Decoder) UInt16() (uint16, error) {
|
||||
c, err := d.more()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return d.readUInt16(c)
|
||||
}
|
||||
|
||||
func (d *Decoder) readUInt16(c byte) (uint16, error) {
|
||||
ind := floatDigits[c]
|
||||
switch ind {
|
||||
case 0:
|
||||
// Check that next byte is not a digit.
|
||||
c, err := d.peek()
|
||||
if err == nil {
|
||||
switch floatDigits[c] {
|
||||
case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9:
|
||||
err := badToken(c, d.offset())
|
||||
return 0, errors.Wrap(err, "digit after leading zero")
|
||||
case dotInNumber, expInNumber, plusInNumber, minusInNumber:
|
||||
err := badToken(c, d.offset())
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(c, d.offset())
|
||||
}
|
||||
}
|
||||
return 0, nil // single zero
|
||||
default:
|
||||
if ind < 0 {
|
||||
return 0, badToken(c, d.offset()-1)
|
||||
}
|
||||
}
|
||||
value := uint16(ind)
|
||||
if d.tail-d.head > 5 {
|
||||
i := d.head
|
||||
// Iteration 0.
|
||||
ind2 := floatDigits[d.buf[i]]
|
||||
switch ind2 {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(d.buf[i], d.offset()+0)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(d.buf[i], d.offset()+0)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head = i
|
||||
value *= 1
|
||||
return value, nil
|
||||
}
|
||||
i++
|
||||
// Iteration 1.
|
||||
ind3 := floatDigits[d.buf[i]]
|
||||
switch ind3 {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(d.buf[i], d.offset()+1)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(d.buf[i], d.offset()+1)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head = i
|
||||
value *= 10
|
||||
value += uint16(ind2) * 1
|
||||
return value, nil
|
||||
}
|
||||
i++
|
||||
// Iteration 2.
|
||||
ind4 := floatDigits[d.buf[i]]
|
||||
switch ind4 {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(d.buf[i], d.offset()+2)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(d.buf[i], d.offset()+2)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head = i
|
||||
value *= 100
|
||||
value += uint16(ind2) * 10
|
||||
value += uint16(ind3) * 1
|
||||
return value, nil
|
||||
}
|
||||
i++
|
||||
// Iteration 3.
|
||||
ind5 := floatDigits[d.buf[i]]
|
||||
switch ind5 {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(d.buf[i], d.offset()+3)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(d.buf[i], d.offset()+3)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head = i
|
||||
value *= 1000
|
||||
value += uint16(ind2) * 100
|
||||
value += uint16(ind3) * 10
|
||||
value += uint16(ind4) * 1
|
||||
return value, nil
|
||||
}
|
||||
i++
|
||||
// Iteration 4.
|
||||
ind6 := floatDigits[d.buf[i]]
|
||||
switch ind6 {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(d.buf[i], d.offset()+4)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(d.buf[i], d.offset()+4)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head = i
|
||||
value *= 10000
|
||||
value += uint16(ind2) * 1000
|
||||
value += uint16(ind3) * 100
|
||||
value += uint16(ind4) * 10
|
||||
value += uint16(ind5) * 1
|
||||
return value, nil
|
||||
}
|
||||
d.head = i
|
||||
value *= 10000
|
||||
value += uint16(ind2) * 1000
|
||||
value += uint16(ind3) * 100
|
||||
value += uint16(ind4) * 10
|
||||
value += uint16(ind5) * 1
|
||||
}
|
||||
for {
|
||||
buf := d.buf[d.head:d.tail]
|
||||
for i, c := range buf {
|
||||
ind = floatDigits[c]
|
||||
switch ind {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(c, d.offset()+i)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(c, d.offset()+i)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head += i
|
||||
return value, nil
|
||||
}
|
||||
if value > uint16SafeToMultiple10 {
|
||||
value2 := (value << 3) + (value << 1) + uint16(ind)
|
||||
if value2 < value {
|
||||
return 0, errOverflow
|
||||
}
|
||||
value = value2
|
||||
continue
|
||||
}
|
||||
value = (value << 3) + (value << 1) + uint16(ind)
|
||||
}
|
||||
switch err := d.read(); err {
|
||||
case io.EOF:
|
||||
return value, nil
|
||||
case nil:
|
||||
continue
|
||||
default:
|
||||
return 0, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Int16 reads int16.
|
||||
func (d *Decoder) Int16() (int16, error) {
|
||||
c, err := d.more()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if c == '-' {
|
||||
c, err := d.byte()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
val, err := d.readUInt16(c)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if val > math.MaxInt16+1 {
|
||||
return 0, errOverflow
|
||||
}
|
||||
return -int16(val), nil
|
||||
}
|
||||
val, err := d.readUInt16(c)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if val > math.MaxInt16 {
|
||||
return 0, errOverflow
|
||||
}
|
||||
return int16(val), nil
|
||||
}
|
||||
|
||||
// UInt32 reads uint32.
|
||||
func (d *Decoder) UInt32() (uint32, error) {
|
||||
c, err := d.more()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return d.readUInt32(c)
|
||||
}
|
||||
|
||||
func (d *Decoder) readUInt32(c byte) (uint32, error) {
|
||||
ind := floatDigits[c]
|
||||
switch ind {
|
||||
case 0:
|
||||
// Check that next byte is not a digit.
|
||||
c, err := d.peek()
|
||||
if err == nil {
|
||||
switch floatDigits[c] {
|
||||
case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9:
|
||||
err := badToken(c, d.offset())
|
||||
return 0, errors.Wrap(err, "digit after leading zero")
|
||||
case dotInNumber, expInNumber, plusInNumber, minusInNumber:
|
||||
err := badToken(c, d.offset())
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(c, d.offset())
|
||||
}
|
||||
}
|
||||
return 0, nil // single zero
|
||||
default:
|
||||
if ind < 0 {
|
||||
return 0, badToken(c, d.offset()-1)
|
||||
}
|
||||
}
|
||||
value := uint32(ind)
|
||||
if d.tail-d.head > 9 {
|
||||
i := d.head
|
||||
// Iteration 0.
|
||||
ind2 := floatDigits[d.buf[i]]
|
||||
switch ind2 {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(d.buf[i], d.offset()+0)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(d.buf[i], d.offset()+0)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head = i
|
||||
value *= 1
|
||||
return value, nil
|
||||
}
|
||||
i++
|
||||
// Iteration 1.
|
||||
ind3 := floatDigits[d.buf[i]]
|
||||
switch ind3 {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(d.buf[i], d.offset()+1)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(d.buf[i], d.offset()+1)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head = i
|
||||
value *= 10
|
||||
value += uint32(ind2) * 1
|
||||
return value, nil
|
||||
}
|
||||
i++
|
||||
// Iteration 2.
|
||||
ind4 := floatDigits[d.buf[i]]
|
||||
switch ind4 {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(d.buf[i], d.offset()+2)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(d.buf[i], d.offset()+2)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head = i
|
||||
value *= 100
|
||||
value += uint32(ind2) * 10
|
||||
value += uint32(ind3) * 1
|
||||
return value, nil
|
||||
}
|
||||
i++
|
||||
// Iteration 3.
|
||||
ind5 := floatDigits[d.buf[i]]
|
||||
switch ind5 {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(d.buf[i], d.offset()+3)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(d.buf[i], d.offset()+3)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head = i
|
||||
value *= 1000
|
||||
value += uint32(ind2) * 100
|
||||
value += uint32(ind3) * 10
|
||||
value += uint32(ind4) * 1
|
||||
return value, nil
|
||||
}
|
||||
i++
|
||||
// Iteration 4.
|
||||
ind6 := floatDigits[d.buf[i]]
|
||||
switch ind6 {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(d.buf[i], d.offset()+4)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(d.buf[i], d.offset()+4)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head = i
|
||||
value *= 10000
|
||||
value += uint32(ind2) * 1000
|
||||
value += uint32(ind3) * 100
|
||||
value += uint32(ind4) * 10
|
||||
value += uint32(ind5) * 1
|
||||
return value, nil
|
||||
}
|
||||
i++
|
||||
// Iteration 5.
|
||||
ind7 := floatDigits[d.buf[i]]
|
||||
switch ind7 {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(d.buf[i], d.offset()+5)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(d.buf[i], d.offset()+5)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head = i
|
||||
value *= 100000
|
||||
value += uint32(ind2) * 10000
|
||||
value += uint32(ind3) * 1000
|
||||
value += uint32(ind4) * 100
|
||||
value += uint32(ind5) * 10
|
||||
value += uint32(ind6) * 1
|
||||
return value, nil
|
||||
}
|
||||
i++
|
||||
// Iteration 6.
|
||||
ind8 := floatDigits[d.buf[i]]
|
||||
switch ind8 {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(d.buf[i], d.offset()+6)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(d.buf[i], d.offset()+6)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head = i
|
||||
value *= 1000000
|
||||
value += uint32(ind2) * 100000
|
||||
value += uint32(ind3) * 10000
|
||||
value += uint32(ind4) * 1000
|
||||
value += uint32(ind5) * 100
|
||||
value += uint32(ind6) * 10
|
||||
value += uint32(ind7) * 1
|
||||
return value, nil
|
||||
}
|
||||
i++
|
||||
// Iteration 7.
|
||||
ind9 := floatDigits[d.buf[i]]
|
||||
switch ind9 {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(d.buf[i], d.offset()+7)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(d.buf[i], d.offset()+7)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head = i
|
||||
value *= 10000000
|
||||
value += uint32(ind2) * 1000000
|
||||
value += uint32(ind3) * 100000
|
||||
value += uint32(ind4) * 10000
|
||||
value += uint32(ind5) * 1000
|
||||
value += uint32(ind6) * 100
|
||||
value += uint32(ind7) * 10
|
||||
value += uint32(ind8) * 1
|
||||
return value, nil
|
||||
}
|
||||
i++
|
||||
// Iteration 8.
|
||||
ind10 := floatDigits[d.buf[i]]
|
||||
switch ind10 {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(d.buf[i], d.offset()+8)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(d.buf[i], d.offset()+8)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head = i
|
||||
value *= 100000000
|
||||
value += uint32(ind2) * 10000000
|
||||
value += uint32(ind3) * 1000000
|
||||
value += uint32(ind4) * 100000
|
||||
value += uint32(ind5) * 10000
|
||||
value += uint32(ind6) * 1000
|
||||
value += uint32(ind7) * 100
|
||||
value += uint32(ind8) * 10
|
||||
value += uint32(ind9) * 1
|
||||
return value, nil
|
||||
}
|
||||
d.head = i
|
||||
value *= 100000000
|
||||
value += uint32(ind2) * 10000000
|
||||
value += uint32(ind3) * 1000000
|
||||
value += uint32(ind4) * 100000
|
||||
value += uint32(ind5) * 10000
|
||||
value += uint32(ind6) * 1000
|
||||
value += uint32(ind7) * 100
|
||||
value += uint32(ind8) * 10
|
||||
value += uint32(ind9) * 1
|
||||
}
|
||||
for {
|
||||
buf := d.buf[d.head:d.tail]
|
||||
for i, c := range buf {
|
||||
ind = floatDigits[c]
|
||||
switch ind {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(c, d.offset()+i)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(c, d.offset()+i)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head += i
|
||||
return value, nil
|
||||
}
|
||||
if value > uint32SafeToMultiple10 {
|
||||
value2 := (value << 3) + (value << 1) + uint32(ind)
|
||||
if value2 < value {
|
||||
return 0, errOverflow
|
||||
}
|
||||
value = value2
|
||||
continue
|
||||
}
|
||||
value = (value << 3) + (value << 1) + uint32(ind)
|
||||
}
|
||||
switch err := d.read(); err {
|
||||
case io.EOF:
|
||||
return value, nil
|
||||
case nil:
|
||||
continue
|
||||
default:
|
||||
return 0, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Int32 reads int32.
|
||||
func (d *Decoder) Int32() (int32, error) {
|
||||
c, err := d.more()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if c == '-' {
|
||||
c, err := d.byte()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
val, err := d.readUInt32(c)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if val > math.MaxInt32+1 {
|
||||
return 0, errOverflow
|
||||
}
|
||||
return -int32(val), nil
|
||||
}
|
||||
val, err := d.readUInt32(c)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if val > math.MaxInt32 {
|
||||
return 0, errOverflow
|
||||
}
|
||||
return int32(val), nil
|
||||
}
|
||||
|
||||
// UInt64 reads uint64.
|
||||
func (d *Decoder) UInt64() (uint64, error) {
|
||||
c, err := d.more()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return d.readUInt64(c)
|
||||
}
|
||||
|
||||
func (d *Decoder) readUInt64(c byte) (uint64, error) {
|
||||
ind := floatDigits[c]
|
||||
switch ind {
|
||||
case 0:
|
||||
// Check that next byte is not a digit.
|
||||
c, err := d.peek()
|
||||
if err == nil {
|
||||
switch floatDigits[c] {
|
||||
case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9:
|
||||
err := badToken(c, d.offset())
|
||||
return 0, errors.Wrap(err, "digit after leading zero")
|
||||
case dotInNumber, expInNumber, plusInNumber, minusInNumber:
|
||||
err := badToken(c, d.offset())
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(c, d.offset())
|
||||
}
|
||||
}
|
||||
return 0, nil // single zero
|
||||
default:
|
||||
if ind < 0 {
|
||||
return 0, badToken(c, d.offset()-1)
|
||||
}
|
||||
}
|
||||
value := uint64(ind)
|
||||
if d.tail-d.head > 9 {
|
||||
i := d.head
|
||||
// Iteration 0.
|
||||
ind2 := floatDigits[d.buf[i]]
|
||||
switch ind2 {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(d.buf[i], d.offset()+0)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(d.buf[i], d.offset()+0)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head = i
|
||||
value *= 1
|
||||
return value, nil
|
||||
}
|
||||
i++
|
||||
// Iteration 1.
|
||||
ind3 := floatDigits[d.buf[i]]
|
||||
switch ind3 {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(d.buf[i], d.offset()+1)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(d.buf[i], d.offset()+1)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head = i
|
||||
value *= 10
|
||||
value += uint64(ind2) * 1
|
||||
return value, nil
|
||||
}
|
||||
i++
|
||||
// Iteration 2.
|
||||
ind4 := floatDigits[d.buf[i]]
|
||||
switch ind4 {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(d.buf[i], d.offset()+2)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(d.buf[i], d.offset()+2)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head = i
|
||||
value *= 100
|
||||
value += uint64(ind2) * 10
|
||||
value += uint64(ind3) * 1
|
||||
return value, nil
|
||||
}
|
||||
i++
|
||||
// Iteration 3.
|
||||
ind5 := floatDigits[d.buf[i]]
|
||||
switch ind5 {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(d.buf[i], d.offset()+3)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(d.buf[i], d.offset()+3)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head = i
|
||||
value *= 1000
|
||||
value += uint64(ind2) * 100
|
||||
value += uint64(ind3) * 10
|
||||
value += uint64(ind4) * 1
|
||||
return value, nil
|
||||
}
|
||||
i++
|
||||
// Iteration 4.
|
||||
ind6 := floatDigits[d.buf[i]]
|
||||
switch ind6 {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(d.buf[i], d.offset()+4)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(d.buf[i], d.offset()+4)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head = i
|
||||
value *= 10000
|
||||
value += uint64(ind2) * 1000
|
||||
value += uint64(ind3) * 100
|
||||
value += uint64(ind4) * 10
|
||||
value += uint64(ind5) * 1
|
||||
return value, nil
|
||||
}
|
||||
i++
|
||||
// Iteration 5.
|
||||
ind7 := floatDigits[d.buf[i]]
|
||||
switch ind7 {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(d.buf[i], d.offset()+5)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(d.buf[i], d.offset()+5)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head = i
|
||||
value *= 100000
|
||||
value += uint64(ind2) * 10000
|
||||
value += uint64(ind3) * 1000
|
||||
value += uint64(ind4) * 100
|
||||
value += uint64(ind5) * 10
|
||||
value += uint64(ind6) * 1
|
||||
return value, nil
|
||||
}
|
||||
i++
|
||||
// Iteration 6.
|
||||
ind8 := floatDigits[d.buf[i]]
|
||||
switch ind8 {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(d.buf[i], d.offset()+6)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(d.buf[i], d.offset()+6)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head = i
|
||||
value *= 1000000
|
||||
value += uint64(ind2) * 100000
|
||||
value += uint64(ind3) * 10000
|
||||
value += uint64(ind4) * 1000
|
||||
value += uint64(ind5) * 100
|
||||
value += uint64(ind6) * 10
|
||||
value += uint64(ind7) * 1
|
||||
return value, nil
|
||||
}
|
||||
i++
|
||||
// Iteration 7.
|
||||
ind9 := floatDigits[d.buf[i]]
|
||||
switch ind9 {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(d.buf[i], d.offset()+7)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(d.buf[i], d.offset()+7)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head = i
|
||||
value *= 10000000
|
||||
value += uint64(ind2) * 1000000
|
||||
value += uint64(ind3) * 100000
|
||||
value += uint64(ind4) * 10000
|
||||
value += uint64(ind5) * 1000
|
||||
value += uint64(ind6) * 100
|
||||
value += uint64(ind7) * 10
|
||||
value += uint64(ind8) * 1
|
||||
return value, nil
|
||||
}
|
||||
i++
|
||||
// Iteration 8.
|
||||
ind10 := floatDigits[d.buf[i]]
|
||||
switch ind10 {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(d.buf[i], d.offset()+8)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(d.buf[i], d.offset()+8)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head = i
|
||||
value *= 100000000
|
||||
value += uint64(ind2) * 10000000
|
||||
value += uint64(ind3) * 1000000
|
||||
value += uint64(ind4) * 100000
|
||||
value += uint64(ind5) * 10000
|
||||
value += uint64(ind6) * 1000
|
||||
value += uint64(ind7) * 100
|
||||
value += uint64(ind8) * 10
|
||||
value += uint64(ind9) * 1
|
||||
return value, nil
|
||||
}
|
||||
d.head = i
|
||||
value *= 100000000
|
||||
value += uint64(ind2) * 10000000
|
||||
value += uint64(ind3) * 1000000
|
||||
value += uint64(ind4) * 100000
|
||||
value += uint64(ind5) * 10000
|
||||
value += uint64(ind6) * 1000
|
||||
value += uint64(ind7) * 100
|
||||
value += uint64(ind8) * 10
|
||||
value += uint64(ind9) * 1
|
||||
}
|
||||
for {
|
||||
buf := d.buf[d.head:d.tail]
|
||||
for i, c := range buf {
|
||||
ind = floatDigits[c]
|
||||
switch ind {
|
||||
case invalidCharForNumber:
|
||||
return 0, badToken(c, d.offset()+i)
|
||||
case dotInNumber,
|
||||
expInNumber,
|
||||
plusInNumber,
|
||||
minusInNumber:
|
||||
err := badToken(c, d.offset()+i)
|
||||
return 0, errors.Wrap(err, "unexpected floating point character")
|
||||
case endOfNumber:
|
||||
d.head += i
|
||||
return value, nil
|
||||
}
|
||||
if value > uint64SafeToMultiple10 {
|
||||
value2 := (value << 3) + (value << 1) + uint64(ind)
|
||||
if value2 < value {
|
||||
return 0, errOverflow
|
||||
}
|
||||
value = value2
|
||||
continue
|
||||
}
|
||||
value = (value << 3) + (value << 1) + uint64(ind)
|
||||
}
|
||||
switch err := d.read(); err {
|
||||
case io.EOF:
|
||||
return value, nil
|
||||
case nil:
|
||||
continue
|
||||
default:
|
||||
return 0, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Int64 reads int64.
|
||||
func (d *Decoder) Int64() (int64, error) {
|
||||
c, err := d.more()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if c == '-' {
|
||||
c, err := d.byte()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
val, err := d.readUInt64(c)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if val > math.MaxInt64+1 {
|
||||
return 0, errOverflow
|
||||
}
|
||||
return -int64(val), nil
|
||||
}
|
||||
val, err := d.readUInt64(c)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if val > math.MaxInt64 {
|
||||
return 0, errOverflow
|
||||
}
|
||||
return int64(val), nil
|
||||
}
|
49
vendor/github.com/go-faster/jx/dec_int.go
generated
vendored
Normal file
49
vendor/github.com/go-faster/jx/dec_int.go
generated
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
package jx
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
)
|
||||
|
||||
func (d *Decoder) int(size int) (int, error) {
|
||||
switch size {
|
||||
case 8:
|
||||
v, err := d.Int8()
|
||||
return int(v), err
|
||||
case 16:
|
||||
v, err := d.Int16()
|
||||
return int(v), err
|
||||
case 32:
|
||||
v, err := d.Int32()
|
||||
return int(v), err
|
||||
default:
|
||||
v, err := d.Int64()
|
||||
return int(v), err
|
||||
}
|
||||
}
|
||||
|
||||
// Int reads int.
|
||||
func (d *Decoder) Int() (int, error) {
|
||||
return d.int(strconv.IntSize)
|
||||
}
|
||||
|
||||
func (d *Decoder) uint(size int) (uint, error) {
|
||||
switch size {
|
||||
case 8:
|
||||
v, err := d.UInt8()
|
||||
return uint(v), err
|
||||
case 16:
|
||||
v, err := d.UInt16()
|
||||
return uint(v), err
|
||||
case 32:
|
||||
v, err := d.UInt32()
|
||||
return uint(v), err
|
||||
default:
|
||||
v, err := d.UInt64()
|
||||
return uint(v), err
|
||||
}
|
||||
}
|
||||
|
||||
// UInt reads uint.
|
||||
func (d *Decoder) UInt() (uint, error) {
|
||||
return d.uint(strconv.IntSize)
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user