diff --git a/Makefile b/Makefile index 2125bc5c..bb32b491 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ run: mod: clear go get -u ./... - go mod tidy -compat=1.18 + go mod tidy -compat=1.20 go mod vendor go fmt ./... build: @@ -26,15 +26,11 @@ build: lint: clear go fmt ./... - golangci-lint run ./internal/v0/... - golangci-lint run ./pkg/v0/... - gocyclo -over 10 ./internal/v0 - gocyclo -over 10 ./pkg/v0 - gocritic check ./internal/v0/... - gocritic check ./pkg/v0/... - staticcheck ./internal/v0/... - staticcheck ./pkg/v0/... -run.test: + golangci-lint run ./... + gocyclo -over 10 ./ + gocritic check ./... + staticcheck ./... +test.run: clear go fmt ./... go test -coverprofile cover.out ./... diff --git a/config/config_test.go b/config/config_test.go index 2aa022dd..8b6f7af5 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -1,6 +1,8 @@ package config import ( + "github.com/ManyakRus/starter/micro" + "os" "testing" ) @@ -13,3 +15,14 @@ func TestLoadEnv(t *testing.T) { //t.Error("Error TestLoadEnv") } + +func TestLoadEnv_from_file(t *testing.T) { + dir := micro.ProgramDir() + FileName := dir + "test.sh" + LoadEnv_from_file(FileName) + + value := os.Getenv("SERVICE_NAME") + if value == "" { + t.Error("TestLoadEnv_from_file() error: value =''") + } +} diff --git a/contextmain/contextmain.go b/contextmain/contextmain.go index a5636432..fdd35b79 100644 --- a/contextmain/contextmain.go +++ b/contextmain/contextmain.go @@ -9,7 +9,8 @@ import ( // Ctx хранит глобальный контекст программы // не использовать -var Ctx context.Context +// * - чтоб можно было засунуть ссылку на чужой контекст +var Ctx *context.Context // CancelContext - функция отмены глобального контекста var CancelContext func() @@ -32,16 +33,20 @@ func GetContext() context.Context { onceCtx.Do(func() { CtxBg := context.Background() - Ctx, CancelContext = context.WithCancel(CtxBg) + var Ctx0 context.Context + Ctx0, CancelContext = context.WithCancel(CtxBg) + Ctx = &Ctx0 }) - return Ctx + return *Ctx } // GetNewContext - создаёт и возвращает новый контекст приложения func GetNewContext() context.Context { CtxBg := context.Background() - Ctx, CancelContext = context.WithCancel(CtxBg) + var Ctx0 context.Context + Ctx0, CancelContext = context.WithCancel(CtxBg) + Ctx = &Ctx0 - return Ctx + return *Ctx } diff --git a/folders/folders.go b/folders/folders.go index ef0b31a6..341ecf25 100644 --- a/folders/folders.go +++ b/folders/folders.go @@ -13,9 +13,10 @@ type File struct { } type Folder struct { - Name string - Files []*File - Folders map[string]*Folder + FileName string + Name string + Files []*File + Folders map[string]*Folder } func (f *Folder) String() string { @@ -30,7 +31,7 @@ func FindFoldersTree(dir string, NeedFolders, NeedFiles, NeedDot bool, exclude s var nodes = map[string]interface{}{} var walkFun filepath.WalkFunc = func(p string, info os.FileInfo, err error) error { if info.IsDir() { - nodes[p] = &Folder{path.Base(p), []*File{}, map[string]*Folder{}} + nodes[p] = &Folder{p, path.Base(p), []*File{}, map[string]*Folder{}} } else { nodes[p] = &File{path.Base(p)} } @@ -50,28 +51,36 @@ func FindFoldersTree(dir string, NeedFolders, NeedFiles, NeedDot bool, exclude s parentFolder = nodes[path.Dir(key)].(*Folder) } + // найдём название Папки/Файла + var Name string + switch value.(type) { + case *File: + Name = value.(*File).Name + case *Folder: + Name = value.(*Folder).Name + } + + // проверка скрытые файлы с точкой + if NeedDot == false && len(Name) > 0 && Name[0:1] == "." { + continue + } + + // проверка кроме exclude + if exclude != "" && len(Name) >= len(exclude) && Name[0:len(exclude)] == exclude { + continue + } + + // switch v := value.(type) { case *File: if NeedFiles == false { break } - if NeedDot == false && len(v.Name) > 0 && v.Name[0:1] == "." { - break - } - if exclude != "" && len(v.Name) >= len(exclude) && v.Name[0:len(exclude)] == exclude { - break - } parentFolder.Files = append(parentFolder.Files, v) case *Folder: if NeedFolders == false { break } - if NeedDot == false && len(v.Name) > 0 && v.Name[0:1] == "." { - break - } - if exclude != "" && len(v.Name) >= len(exclude) && v.Name[0:len(exclude)] == exclude { - break - } parentFolder.Folders[v.Name] = v } } diff --git a/folders/folders_test.go b/folders/folders_test.go index ca3be829..41d665d3 100644 --- a/folders/folders_test.go +++ b/folders/folders_test.go @@ -8,5 +8,8 @@ import ( func TestFindFolders(t *testing.T) { //dir := `/home/user/GolandProjects/!sanek/image_packages/` dir := micro.ProgramDir() - FindFoldersTree(dir, true, false, false, "vendor") + Otvet := FindFoldersTree(dir, true, false, false, "vendor") + if Otvet == nil { + t.Log("TestFindFolders() error: Otvet = nil") + } } diff --git a/go.mod b/go.mod index 93626c3c..b66a78e8 100644 --- a/go.mod +++ b/go.mod @@ -1,15 +1,15 @@ module github.com/ManyakRus/starter -go 1.18 +go 1.20 require ( github.com/ManyakRus/logrus v0.0.0-20230426064230-515895169d22 - github.com/camunda/zeebe/clients/go/v8 v8.2.5 + github.com/camunda/zeebe/clients/go/v8 v8.2.7 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/go-faster/errors v0.6.1 - github.com/gofiber/fiber/v2 v2.46.0 + github.com/gofiber/fiber/v2 v2.47.0 github.com/golang-module/carbon/v2 v2.2.3 github.com/gotd/contrib v0.19.0 github.com/gotd/td v0.83.0 @@ -19,17 +19,17 @@ require ( github.com/lib/pq v1.10.9 github.com/mattn/go-sqlite3 v1.14.17 github.com/mdp/qrterminal/v3 v3.1.1 - github.com/minio/minio-go/v7 v7.0.56 - github.com/nats-io/nats.go v1.26.0 - github.com/sashabaranov/go-openai v1.9.5 + github.com/minio/minio-go/v7 v7.0.57 + github.com/nats-io/nats.go v1.27.0 + github.com/sashabaranov/go-openai v1.11.2 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 v1.0.171 - go.mau.fi/whatsmeow v0.0.0-20230601124015-46f2ff088640 - golang.org/x/crypto v0.9.0 + gitlab.aescorp.ru/dsp_dev/claim/common/object_model v1.0.191 + go.mau.fi/whatsmeow v0.0.0-20230616194828-be0edabb0bf3 + golang.org/x/crypto v0.10.0 golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 gorm.io/driver/postgres v1.5.2 - gorm.io/driver/sqlserver v1.5.0 + gorm.io/driver/sqlserver v1.5.1 gorm.io/gorm v1.25.1 ) @@ -61,12 +61,12 @@ require ( github.com/jackc/pgproto3/v2 v2.3.2 // indirect github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect github.com/jackc/pgtype v1.14.0 // indirect - github.com/jackc/pgx/v5 v5.3.1 // indirect + github.com/jackc/pgx/v5 v5.4.1 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.16.5 // indirect - github.com/klauspost/cpuid/v2 v2.2.4 // indirect + github.com/klauspost/compress v1.16.6 // indirect + github.com/klauspost/cpuid/v2 v2.2.5 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-runewidth v0.0.14 // indirect @@ -81,14 +81,14 @@ require ( github.com/nats-io/nkeys v0.4.4 // indirect github.com/nats-io/nuid v1.0.1 // indirect github.com/philhofer/fwd v1.1.2 // indirect - github.com/pierrec/lz4/v4 v4.1.17 // indirect + github.com/pierrec/lz4/v4 v4.1.18 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/rs/xid v1.5.0 // indirect github.com/savsgio/dictpool v0.0.0-20221023140959-7bf2e61cea94 // indirect github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee // indirect github.com/segmentio/asm v1.2.0 // indirect - github.com/sirupsen/logrus v1.9.2 // indirect + github.com/sirupsen/logrus v1.9.3 // indirect github.com/stretchr/testify v1.8.4 // indirect github.com/tinylib/msgp v1.1.8 // indirect github.com/toorop/go-dkim v0.0.0-20201103131630-e1cd1a0a5208 // indirect @@ -103,15 +103,15 @@ require ( 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 + golang.org/x/net v0.11.0 // indirect + golang.org/x/oauth2 v0.9.0 // indirect + golang.org/x/sync v0.3.0 // indirect + golang.org/x/sys v0.9.0 // indirect + golang.org/x/term v0.9.0 // indirect + golang.org/x/text v0.10.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect - google.golang.org/grpc v1.55.0 // indirect + google.golang.org/grpc v1.56.0 // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index dbb444e3..7a2bdcd9 100644 --- a/go.sum +++ b/go.sum @@ -1,16 +1,11 @@ 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/azcore v1.6.0/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= 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.2.1/go.mod h1:gLa1CL2RNE4s7M3yopJ/p0iq5DdY6Yv5ZUt9MTRZOQM= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0/go.mod h1:OQeznEEkTZ9OrhHJoDD8ZDq51FHgXjqtP9z6bEwBq9U= 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/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= -github.com/AzureAD/microsoft-authentication-library-for-go v0.8.1/go.mod h1:4qFor3D/HDsvBME35Xy9rwW9DecL+M2sNw1ybjPtwA0= github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/ManyakRus/logrus v0.0.0-20230426064230-515895169d22 h1:DrHNlqXfwvCpCqn4MfRn4NBtezqWL5GLor3jC7QFPj0= @@ -22,8 +17,8 @@ github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:o 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/camunda/zeebe/clients/go/v8 v8.2.7 h1:fkL1ExWIqsVMg56nGDl/XfWf7W4PE3lzI9p1MdE3IkU= +github.com/camunda/zeebe/clients/go/v8 v8.2.7/go.mod h1:epiKnbOo1QeAD7BhdQoDNsdE0dJ2qoAx4uGxob1gHAQ= 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= @@ -83,11 +78,10 @@ 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/gofiber/fiber/v2 v2.47.0 h1:EN5lHVCc+Pyqh5OEsk8fzRiifgwpbrP0rulQ4iNf3fs= +github.com/gofiber/fiber/v2 v2.47.0/go.mod h1:mbFMVN1lQuzziTkkakgtKKdjfsXSw9BKR5lmcNksUoU= 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/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-jwt/jwt/v4 v4.4.3/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-module/carbon/v2 v2.2.3 h1:WvGIc5+qzq9drNzH+Gnjh1TZ0JgDY/IA+m2Dvk7Qm4Q= @@ -110,7 +104,6 @@ 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/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.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= @@ -172,18 +165,16 @@ github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQ github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= 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/pgx/v5 v5.4.1 h1:oKfB/FhuVtit1bBM3zNRRsZ925ZkMN3HXL+LgLUM9lE= +github.com/jackc/pgx/v5 v5.4.1/go.mod h1:q6iHT8uDNXWiFNOlRqJzBTaSH3+2xCXkokxHZC5qWFY= 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/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= github.com/jcmturner/gofork v1.7.6/go.mod h1:1622LH6i/EZqLloHfE7IeZ0uEJwMSUyQ/nDd82IeqRo= github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg= -github.com/jcmturner/gokrb5/v8 v8.4.2/go.mod h1:sb+Xq/fTY5yktf/VxLsE3wlfPqQjp0aWNYyvBVK62bc= github.com/jcmturner/gokrb5/v8 v8.4.4/go.mod h1:1btQEpgT6k+unzCwX1KdWMEwPPkkgBtP+F6aCACiMrs= 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= @@ -200,11 +191,11 @@ github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHm github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= 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/klauspost/compress v1.16.6 h1:91SKEy4K37vkp255cJ8QesJhjyRO0hn9i9G0GoUwLsk= +github.com/klauspost/compress v1.16.6/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= -github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= +github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= +github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= 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= @@ -239,14 +230,13 @@ github.com/mattn/go-sqlite3 v1.14.17 h1:mCRHCLDUBXgpKAqIKsaAaAsrAlbkeomtRFKXh2L6 github.com/mattn/go-sqlite3 v1.14.17/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/mdp/qrterminal/v3 v3.1.1 h1:cIPwg3QU0OIm9+ce/lRfWXhPwEjOSKwk3HBwL3HBTyc= github.com/mdp/qrterminal/v3 v3.1.1/go.mod h1:5lJlXe7Jdr8wlPDdcsJttv1/knsRgzXASyr4dcGZqNU= -github.com/microsoft/go-mssqldb v0.21.0/go.mod h1:+4wZTUnz/SV6nffv+RRRB/ss8jPng5Sho2SmM1l2ts4= github.com/microsoft/go-mssqldb v1.1.0 h1:jsV+tpvcPTbNNKW0o3kiCD69kOHICsfjZ2VcVu2lKYc= github.com/microsoft/go-mssqldb v1.1.0/go.mod h1:LzkFdl4z2Ck+Hi+ycGOTbL56VEfgoyA2DvYejrNGbRk= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= -github.com/minio/minio-go/v7 v7.0.56 h1:pkZplIEHu8vinjkmhsexcXpWth2tjVLphrTZx6fBVZY= -github.com/minio/minio-go/v7 v7.0.56/go.mod h1:NUDy4A4oXPq1l2yK6LTSvCEzAMeIcoz9lcj5dbzSrRE= +github.com/minio/minio-go/v7 v7.0.57 h1:xsFiOiWjpC1XAGbFEUOzj1/gMXGz7ljfxifwcb/5YXU= +github.com/minio/minio-go/v7 v7.0.57/go.mod h1:NUDy4A4oXPq1l2yK6LTSvCEzAMeIcoz9lcj5dbzSrRE= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= @@ -258,14 +248,13 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/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/montanaflynn/stats v0.7.0/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.26.0 h1:fWJTYPnZ8DzxIaqIHOAMfColuznchnd5Ab5dbJpgPIE= -github.com/nats-io/nats.go v1.26.0/go.mod h1:XpbWUlOElGwTYbMR7imivs7jJj9GtK7ypv321Wp6pjc= +github.com/nats-io/nats.go v1.27.0 h1:3o9fsPhmoKm+yK7rekH2GtWoE+D9jFbw8N3/ayI1C00= +github.com/nats-io/nats.go v1.27.0/go.mod h1:XpbWUlOElGwTYbMR7imivs7jJj9GtK7ypv321Wp6pjc= 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= @@ -275,10 +264,9 @@ github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG 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/pierrec/lz4/v4 v4.1.18 h1:xaKrnTkyoqfh1YItXl56+6KJNVYWlEEPuAQW9xsplYQ= +github.com/pierrec/lz4/v4 v4.1.18/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= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -294,8 +282,8 @@ github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= 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.5 h1:z1VCMXsfnug+U0ceTTIXr/L26AYl9jafqA9lptlSX0c= -github.com/sashabaranov/go-openai v1.9.5/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg= +github.com/sashabaranov/go-openai v1.11.2 h1:HuMf+18eldSKbqVblyeCQbtcqSpGVfqTshvi8Bn6zes= +github.com/sashabaranov/go-openai v1.11.2/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= @@ -311,8 +299,8 @@ github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXY 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.9.2 h1:oxx1eChJGI6Uks2ZC4W1zpLlVgqB8ner4EuQwV4Ik1Y= -github.com/sirupsen/logrus v1.9.2/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= 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= @@ -359,12 +347,12 @@ github.com/xhit/go-simple-mail/v2 v2.13.0/go.mod h1:b7P5ygho6SYE+VIqpxA6QkYfv4te 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 v1.0.171 h1:lAk/J6zGsxudQs1CVRmNikmCfL6Tsgb0NkfueVm2NNw= -gitlab.aescorp.ru/dsp_dev/claim/common/object_model v1.0.171/go.mod h1:GipQ/BQkeb4EgKMMXyZtfnydEqSooOxQCxCqhbnp5/k= +gitlab.aescorp.ru/dsp_dev/claim/common/object_model v1.0.191 h1:mXQD9yf90a0DTsGoPmF9K/YOCDyGizkko4/vQkhInT4= +gitlab.aescorp.ru/dsp_dev/claim/common/object_model v1.0.191/go.mod h1:ebgXvp8SHE+OD/Aw24PgGcJ04ztJdALAckffNI+3370= 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-20230601124015-46f2ff088640 h1:y6EK/+hX6hOY69oubStlxBSVZw6UTS7xxgVaFEPK6Xk= -go.mau.fi/whatsmeow v0.0.0-20230601124015-46f2ff088640/go.mod h1:+ObGpFE6cbbY4hKc1FmQH9MVfqaemmlXGXSnwDvCOyE= +go.mau.fi/whatsmeow v0.0.0-20230616194828-be0edabb0bf3 h1:CByCFmtYMsj/4tO+j9YvLLcUa5xnnrDyJXFbl52quhU= +go.mau.fi/whatsmeow v0.0.0-20230616194828-be0edabb0bf3/go.mod h1:+ObGpFE6cbbY4hKc1FmQH9MVfqaemmlXGXSnwDvCOyE= go.opentelemetry.io/otel v1.16.0 h1:Z7GVAX/UkAXPKsy94IU+i6thsQS4nb7LviLpnaNeW8s= go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeHrT/bx4= go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZEu5MQs= @@ -394,19 +382,17 @@ golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8U 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= golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= 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-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-20221005025214-4161e89ecf1b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -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/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= +golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -422,28 +408,27 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20190620200207-3b0461eec859/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-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -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-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-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= 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.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -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/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= +golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= +golang.org/x/oauth2 v0.9.0 h1:BPpt2kU7oMRq3kCHAA1tbSEshXRw1LpG2ztgDwrzuAs= +golang.org/x/oauth2 v0.9.0/go.mod h1:qYgFZaFiu6Wg24azG8bdV52QJXJGbZzIIsRCdVKzbLw= golang.org/x/sync v0.0.0-20190423024810-112230192c58/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/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= -golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= 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= @@ -456,30 +441,28 @@ golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/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-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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= -golang.org/x/sys v0.0.0-20220224120231-95c6836cb0e7/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/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-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.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/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= +golang.org/x/sys v0.9.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/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -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/term v0.9.0 h1:GRRCnKYhdQrD8kfRAdQ6Zcw1P0OcELxGLKJvtjVMZ28= +golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -490,8 +473,9 @@ 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.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -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/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= +golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -517,8 +501,8 @@ google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6 google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -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/grpc v1.56.0 h1:+y7Bs8rtMd07LeXmL3NxcTLn7mUkbKZqEpPhMNkwJEE= +google.golang.org/grpc v1.56.0/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= 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.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= @@ -543,8 +527,8 @@ 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.5.2 h1:ytTDxxEv+MplXOfFe3Lzm7SjG09fcdb3Z/c056DTBx0= gorm.io/driver/postgres v1.5.2/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/driver/sqlserver v1.5.1 h1:wpyW/pR26U94uaujltiFGXY7fd2Jw5hC9PB1ZF/Y5s4= +gorm.io/driver/sqlserver v1.5.1/go.mod h1:AYHzzte2msKTmYBYsSIq8ZUsznLJwBdkB2wpI+kt0nM= 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= diff --git a/micro/microfunctions.go b/micro/microfunctions.go index f6819126..de2da6f5 100644 --- a/micro/microfunctions.go +++ b/micro/microfunctions.go @@ -6,7 +6,10 @@ import ( "context" "errors" "fmt" + "hash/fnv" + "reflect" "runtime" + "strconv" "strings" "unicode" @@ -384,4 +387,243 @@ func gogo_chan(fn func() error, chanErr chan error) { chanErr <- err } +// CheckInnKpp - проверяет правильность ИНН и КПП +func CheckInnKpp(Inn, Kpp string, is_individual bool) error { + var err error + + if Inn == "" { + Text1 := "ИНН не должен быть пустой" + err = errors.New(Text1) + return err + } + + if is_individual == true { + if len(Inn) != 12 { + Text1 := "Длина ИНН должна быть 12 символов" + err = errors.New(Text1) + return err + } + if len(Kpp) != 0 { + Text1 := "КПП должен быть пустой" + err = errors.New(Text1) + return err + } + } else { + if len(Inn) != 10 { + Text1 := "Длина ИНН должна быть 10 символов" + err = errors.New(Text1) + return err + } + if len(Kpp) != 9 { + Text1 := "КПП должен быть 9 символов" + err = errors.New(Text1) + return err + } + + err = CheckINNControlSum(Inn) + } + + return err +} + +// CheckINNControlSum - проверяет правильность ИНН по контрольной сумме +func CheckINNControlSum(Inn string) error { + var err error + + if len(Inn) == 10 { + err = CheckINNControlSum10(Inn) + } else if len(Inn) == 12 { + err = CheckINNControlSum12(Inn) + } else { + err = errors.New("ИНН должен быть 10 или 12 символов") + } + + return err +} + +// CheckINNControlSum10 - проверяет правильность 10-значного ИНН по контрольной сумме +func CheckINNControlSum10(Inn string) error { + var err error + + MassKoef := [10]int{2, 4, 10, 3, 5, 9, 4, 6, 8, 0} + + var sum int + var x int + for i, _ := range Inn { + s := Inn[i : i+1] + var err1 error + x, err1 = strconv.Atoi(s) + if err1 != nil { + err = errors.New("Неправильная цифра в ИНН: " + s) + return err + } + + sum = sum + x*MassKoef[i] + } + + ControlSum := sum % 11 + ControlSum = ControlSum % 10 + if ControlSum != x { + err = errors.New("Неправильная контрольная сумма ИНН") + return err + } + + return err +} + +// CheckINNControlSum2 - проверяет правильность 12-значного ИНН по контрольной сумме +func CheckINNControlSum12(Inn string) error { + var err error + + //контрольное чилос по 11 знакам + MassKoef := [11]int{7, 2, 4, 10, 3, 5, 9, 4, 6, 8, 0} + + var sum int + var x11 int + for i := 0; i < 11; i++ { + s := Inn[i : i+1] + var err1 error + x, err1 := strconv.Atoi(s) + if err1 != nil { + err = errors.New("Неправильная цифра в ИНН: " + s) + return err + } + if i == 10 { + x11 = x + } + + sum = sum + x*MassKoef[i] + } + + ControlSum := sum % 11 + ControlSum = ControlSum % 10 + + if ControlSum != x11 { + err = errors.New("Неправильная контрольная сумма ИНН") + return err + } + + //контрольное чилос по 12 знакам + MassKoef2 := [12]int{3, 7, 2, 4, 10, 3, 5, 9, 4, 6, 8, 0} + + var sum2 int + var x12 int + for i := 0; i < 12; i++ { + s := Inn[i : i+1] + var err1 error + x, err1 := strconv.Atoi(s) + if err1 != nil { + err = errors.New("Неправильная цифра в ИНН: " + s) + return err + } + if i == 11 { + x12 = x + } + + sum2 = sum2 + x*MassKoef2[i] + } + + ControlSum2 := sum2 % 11 + ControlSum2 = ControlSum2 % 10 + + if ControlSum2 != x12 { + err = errors.New("Неправильная контрольная сумма ИНН") + return err + } + + return err +} + +// StringFromInt64 - возвращает строку из числа +func StringFromInt64(i int64) string { + Otvet := "" + + Otvet = strconv.FormatInt(i, 10) + + return Otvet +} + +// StringDate - возвращает строку дата без времени +func StringDate(t time.Time) string { + Otvet := "" + + Otvet = t.Format("02.01.2006") + + return Otvet +} + +// ProgramDir_bin - возвращает каталог "bin" или каталог программы +func ProgramDir_bin() string { + Otvet := "" + + dir := ProgramDir() + FileName := dir + "bin" + SeparatorFile() + + ok, _ := FileExists(FileName) + if ok == true { + return FileName + } + + Otvet = dir + return Otvet +} + +// SaveTempFile - записывает массив байт в файл +func SaveTempFile(bytes []byte) string { + Otvet, err := SaveTempFile_err(bytes) + if err != nil { + TextError := fmt.Sprint("SaveTempFile() error: ", err) + print(TextError) + panic(TextError) + } + + return Otvet +} + +// SaveTempFile_err - записывает массив байт в файл, возвращает ошибку +func SaveTempFile_err(bytes []byte) (string, error) { + Otvet := "" + + // create and open a temporary file + f, err := os.CreateTemp("", "") // in Go version older than 1.17 you can use ioutil.TempFile + if err != nil { + return Otvet, err + } + + // close and remove the temporary file at the end of the program + defer f.Close() + defer os.Remove(f.Name()) + + // write data to the temporary file + if _, err := f.Write(bytes); err != nil { + return Otvet, err + } + + Otvet = f.Name() + + return Otvet, err +} + +// Hash - возвращает число хэш из строки +func Hash(s string) uint32 { + h := fnv.New32a() + h.Write([]byte(s)) + return h.Sum32() +} + +// TextError - возвращает текст ошибки из error +func TextError(err error) string { + Otvet := "" + + if err != nil { + Otvet = err.Error() + } + + return Otvet +} + +// GetType - возвращает строку тип объекта +func GetType(myvar interface{}) string { + return reflect.TypeOf(myvar).String() +} diff --git a/micro/microfunctions_test.go b/micro/microfunctions_test.go index 811dce1f..5edcbdb8 100644 --- a/micro/microfunctions_test.go +++ b/micro/microfunctions_test.go @@ -245,3 +245,85 @@ func TestMinDate(t *testing.T) { t.Error("microfunctions_test.TestMinDate() error: Otvet != ", now) } } + +func TestCheckINNControlSum(t *testing.T) { + Inn := "" + err := CheckINNControlSum(Inn) + if err == nil { + t.Error("TestCheckINNControlSum() error") + } + +} + +func TestCheckINNControlSum10(t *testing.T) { + + Inn := "5111002549" + err := CheckINNControlSum10(Inn) + if err != nil { + t.Error("TestCheckINNControlSum10() error: ", err) + } + +} + +func TestCheckINNControlSum12(t *testing.T) { + + Inn := "510800222725" + err := CheckINNControlSum12(Inn) + if err != nil { + t.Error("TestCheckINNControlSum12() error: ", err) + } + +} + +func TestStringFromInt64(t *testing.T) { + Otvet := StringFromInt64(0) + if Otvet != "0" { + t.Error("TestStringFromInt64() error: != '0'") + } +} + +func TestStringDate(t *testing.T) { + Otvet := StringDate(time.Now()) + if Otvet == "" { + t.Error("TestStringDate() error: =''") + } +} + +func TestProgramDir_bin(t *testing.T) { + Otvet := ProgramDir_bin() + if Otvet == "" { + t.Error("TestProgramDir_bin() error: =''") + } +} + +func TestSaveTempFile(t *testing.T) { + + bytes := []byte("123") + Otvet := SaveTempFile(bytes) + if Otvet == "" { + t.Error("TestSaveTempFile() error: Otvet =''") + } + +} + +func TestHash(t *testing.T) { + Otvet := Hash("123") + if Otvet == 0 { + t.Error("TestHash() error: =0") + } +} + +func TestTextError(t *testing.T) { + err := errors.New("1") + s := TextError(err) + if s != "1" { + t.Error("TestTextError() error") + } +} + +func TestGetType(t *testing.T) { + Otvet := GetType(1) + if Otvet != "int" { + t.Error("TestGetType() error: Otvet: ", Otvet) + } +} diff --git a/minio_connect/minio_connect.go b/minio_connect/minio_connect.go index c2ca91b0..00395076 100644 --- a/minio_connect/minio_connect.go +++ b/minio_connect/minio_connect.go @@ -49,7 +49,7 @@ func Connect() { FillSettings() } - ping.Ping(Settings.MINIO_HOST, Settings.MINIO_PORT) + //ping.Ping(Settings.MINIO_HOST, Settings.MINIO_PORT) err := Connect_err() if err != nil { diff --git a/minio_connect/minio_connect_test.go b/minio_connect/minio_connect_test.go index 190404f5..93bbdf33 100644 --- a/minio_connect/minio_connect_test.go +++ b/minio_connect/minio_connect_test.go @@ -106,7 +106,10 @@ func TestCreateBucketCtx(t *testing.T) { defer CloseConnection() ctxMain := contextmain.GetContext() - CreateBucketCtx(ctxMain, "claim", "moscow") + err := CreateBucketCtx_err(ctxMain, "claim", "moscow") + if err != nil { + t.Error("TestCreateBucketCtx() error: ", err) + } } func TestUploadFileCtx(t *testing.T) { diff --git a/postgres_gorm/postgres_gorm.go b/postgres_gorm/postgres_gorm.go index 8498e617..f1a62392 100644 --- a/postgres_gorm/postgres_gorm.go +++ b/postgres_gorm/postgres_gorm.go @@ -252,6 +252,7 @@ func StartDB() { // FillSettings загружает переменные окружения в структуру из файла или из переменных окружения func FillSettings() { Settings = SettingsINI{} + // заполним из переменных оуружения Settings.DB_HOST = os.Getenv("DB_HOST") Settings.DB_PORT = os.Getenv("DB_PORT") Settings.DB_NAME = os.Getenv("DB_NAME") @@ -259,6 +260,16 @@ func FillSettings() { Settings.DB_USER = os.Getenv("DB_USER") Settings.DB_PASSWORD = os.Getenv("DB_PASSWORD") + // заполним из переменных оуружения как у Нечаева + if Settings.DB_HOST == "" { + Settings.DB_HOST = os.Getenv("STORE_HOST") + Settings.DB_PORT = os.Getenv("STORE_PORT") + Settings.DB_NAME = os.Getenv("STORE_NAME") + Settings.DB_SCHEMA = os.Getenv("STORE_SCHEME") + Settings.DB_USER = os.Getenv("STORE_LOGIN") + Settings.DB_PASSWORD = os.Getenv("STORE_PASSWORD") + } + if Settings.DB_HOST == "" { log.Panicln("Need fill DB_HOST ! in os.ENV ") } diff --git a/stopapp/stopapp.go b/stopapp/stopapp.go index 58dd395a..1f0253f1 100644 --- a/stopapp/stopapp.go +++ b/stopapp/stopapp.go @@ -41,6 +41,11 @@ var TotalMessagesSendingNow int32 // SecondsWaitTotalMessagesSendingNow - количество секунд ожидания для отправки последнего сообщения const SecondsWaitTotalMessagesSendingNow = 10 +// SetWaitGroup_Main - присваивает внешний WaitGroup +func SetWaitGroup_Main(wg *sync.WaitGroup) { + wgMain = wg +} + // GetWaitGroup_Main - возвращает группу ожидания завершения всех частей программы func GetWaitGroup_Main() *sync.WaitGroup { lockWGMain.Lock() @@ -50,9 +55,11 @@ func GetWaitGroup_Main() *sync.WaitGroup { // wgMain = &sync.WaitGroup{} //} - onceWGMain.Do(func() { + if wgMain == nil { + //onceWGMain.Do(func() { wgMain = &sync.WaitGroup{} - }) + //}) + } return wgMain } diff --git a/stopapp/stopapp_test.go b/stopapp/stopapp_test.go index b0aab66a..82a2556c 100644 --- a/stopapp/stopapp_test.go +++ b/stopapp/stopapp_test.go @@ -1,5 +1,9 @@ package stopapp +import ( + "testing" +) + //import ( // "testing" // @@ -39,3 +43,11 @@ package stopapp //func TestWaitTotalMessagesSendingNow(t *testing.T) { // WaitTotalMessagesSendingNow("stopapp_test") //} + +func TestSetWaitGroup_Main(t *testing.T) { + SetWaitGroup_Main(nil) + wg := GetWaitGroup_Main() + if wg == nil { + t.Error("TestSetWaitGroup_Main() error: wg = nil") + } +} diff --git a/telegram_client/telegram_client_test.go b/telegram_client/telegram_client_test.go index e06ee842..d54cc4aa 100644 --- a/telegram_client/telegram_client_test.go +++ b/telegram_client/telegram_client_test.go @@ -109,7 +109,7 @@ func Test_termAuth_Phone(t *testing.T) { a := termAuth{ phone: "111", } - got, err := a.Phone(contextmain.Ctx) + got, err := a.Phone(contextmain.GetContext()) if got != "111" { t.Error("telegramclient_test.Test_termAuth_Phone() error: ", err) } diff --git a/test.sh b/test.sh new file mode 100755 index 00000000..69798493 --- /dev/null +++ b/test.sh @@ -0,0 +1 @@ +export SERVICE_NAME="nikitin" diff --git a/vendor/github.com/camunda/zeebe/clients/go/v8/internal/embedded/embedded.go b/vendor/github.com/camunda/zeebe/clients/go/v8/internal/embedded/embedded.go index 15bf125c..74579bdc 100644 --- a/vendor/github.com/camunda/zeebe/clients/go/v8/internal/embedded/embedded.go +++ b/vendor/github.com/camunda/zeebe/clients/go/v8/internal/embedded/embedded.go @@ -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\xd2\x33\xe5\x02\x04\x00\x00\xff\xff\x6e\xc5\x0f\x0d\x06\x00\x00\x00") +var _version = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb2\xd0\x33\xd2\x33\xe7\x02\x04\x00\x00\xff\xff\xec\xa7\x39\x3f\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(1684244223, 0)} + info := bindataFileInfo{name: "VERSION", size: 6, mode: os.FileMode(420), modTime: time.Unix(1686657931, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/vendor/github.com/camunda/zeebe/clients/go/v8/internal/utils/structmap.go b/vendor/github.com/camunda/zeebe/clients/go/v8/internal/utils/structmap.go index 2d901c7a..b452aaeb 100644 --- a/vendor/github.com/camunda/zeebe/clients/go/v8/internal/utils/structmap.go +++ b/vendor/github.com/camunda/zeebe/clients/go/v8/internal/utils/structmap.go @@ -64,9 +64,7 @@ func MapStructMarshal(value reflect.Value, tag string, omitempty, omitminus bool dostrconv = strings.Contains(tagvalue, ",string") } if name == "-" { - if omitminus { - continue - } else { + if !omitminus { name = "" } } diff --git a/vendor/github.com/camunda/zeebe/clients/go/v8/pkg/zbc/oauthCredentialsCache.go b/vendor/github.com/camunda/zeebe/clients/go/v8/pkg/zbc/oauthCredentialsCache.go index b9c30284..2c038a52 100644 --- a/vendor/github.com/camunda/zeebe/clients/go/v8/pkg/zbc/oauthCredentialsCache.go +++ b/vendor/github.com/camunda/zeebe/clients/go/v8/pkg/zbc/oauthCredentialsCache.go @@ -11,6 +11,7 @@ // 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 zbc import ( diff --git a/vendor/github.com/gofiber/fiber/v2/app.go b/vendor/github.com/gofiber/fiber/v2/app.go index d5f07003..e82faae3 100644 --- a/vendor/github.com/gofiber/fiber/v2/app.go +++ b/vendor/github.com/gofiber/fiber/v2/app.go @@ -30,7 +30,7 @@ import ( ) // Version of current fiber package -const Version = "2.46.0" +const Version = "2.47.0" // Handler defines a function to serve HTTP requests. type Handler = func(*Ctx) error @@ -609,18 +609,23 @@ func (app *App) SetTLSHandler(tlsHandler *TLSHandler) { // Name Assign name to specific route. func (app *App) Name(name string) Router { app.mutex.Lock() + defer app.mutex.Unlock() - latestGroup := app.latestRoute.group - if latestGroup != nil { - app.latestRoute.Name = latestGroup.name + name - } else { - app.latestRoute.Name = name + for _, routes := range app.stack { + for _, route := range routes { + if route.Path == app.latestRoute.path { + route.Name = name + + if route.group != nil { + route.Name = route.group.name + route.Name + } + } + } } if err := app.hooks.executeOnNameHooks(*app.latestRoute); err != nil { panic(err) } - app.mutex.Unlock() return app } @@ -754,12 +759,16 @@ func (app *App) Patch(path string, handlers ...Handler) Router { // Add allows you to specify a HTTP method to register a route func (app *App) Add(method, path string, handlers ...Handler) Router { - return app.register(method, path, nil, handlers...) + app.register(method, path, nil, handlers...) + + return app } // Static will create a file server serving static files func (app *App) Static(prefix, root string, config ...Static) Router { - return app.registerStatic(prefix, root, config...) + app.registerStatic(prefix, root, config...) + + return app } // All will register the handler on all HTTP methods @@ -1083,10 +1092,6 @@ func (app *App) serverErrorHandler(fctx *fasthttp.RequestCtx, err error) { // startupProcess Is the method which executes all the necessary processes just before the start of the server. func (app *App) startupProcess() *App { - if err := app.hooks.executeOnListenHooks(); err != nil { - panic(err) - } - app.mutex.Lock() defer app.mutex.Unlock() @@ -1097,3 +1102,10 @@ func (app *App) startupProcess() *App { return app } + +// Run onListen hooks. If they return an error, panic. +func (app *App) runOnListenHooks() { + if err := app.hooks.executeOnListenHooks(); err != nil { + panic(err) + } +} diff --git a/vendor/github.com/gofiber/fiber/v2/ctx.go b/vendor/github.com/gofiber/fiber/v2/ctx.go index 2f9394bd..9a9694dc 100644 --- a/vendor/github.com/gofiber/fiber/v2/ctx.go +++ b/vendor/github.com/gofiber/fiber/v2/ctx.go @@ -597,7 +597,7 @@ func (c *Ctx) GetRespHeader(key string, defaultValue ...string) string { func (c *Ctx) GetReqHeaders() map[string]string { headers := make(map[string]string) c.Request().Header.VisitAll(func(k, v []byte) { - headers[string(k)] = c.app.getString(v) + headers[c.app.getString(k)] = c.app.getString(v) }) return headers @@ -609,7 +609,7 @@ func (c *Ctx) GetReqHeaders() map[string]string { func (c *Ctx) GetRespHeaders() map[string]string { headers := make(map[string]string) c.Response().Header.VisitAll(func(k, v []byte) { - headers[string(k)] = c.app.getString(v) + headers[c.app.getString(k)] = c.app.getString(v) }) return headers @@ -1054,6 +1054,35 @@ func (c *Ctx) Query(key string, defaultValue ...string) string { return defaultString(c.app.getString(c.fasthttp.QueryArgs().Peek(key)), defaultValue) } +// Queries returns a map of query parameters and their values. +// +// GET /?name=alex&wanna_cake=2&id= +// Queries()["name"] == "alex" +// Queries()["wanna_cake"] == "2" +// Queries()["id"] == "" +// +// GET /?field1=value1&field1=value2&field2=value3 +// Queries()["field1"] == "value2" +// Queries()["field2"] == "value3" +// +// GET /?list_a=1&list_a=2&list_a=3&list_b[]=1&list_b[]=2&list_b[]=3&list_c=1,2,3 +// Queries()["list_a"] == "3" +// Queries()["list_b[]"] == "3" +// Queries()["list_c"] == "1,2,3" +// +// GET /api/search?filters.author.name=John&filters.category.name=Technology&filters[customer][name]=Alice&filters[status]=pending +// Queries()["filters.author.name"] == "John" +// Queries()["filters.category.name"] == "Technology" +// Queries()["filters[customer][name]"] == "Alice" +// Queries()["filters[status]"] == "pending" +func (c *Ctx) Queries() map[string]string { + m := make(map[string]string, c.Context().QueryArgs().Len()) + c.Context().QueryArgs().VisitAll(func(key, value []byte) { + m[c.app.getString(key)] = c.app.getString(value) + }) + return m +} + // QueryInt returns integer value of key string parameter in the url. // Default to empty or invalid key is 0. // diff --git a/vendor/github.com/gofiber/fiber/v2/group.go b/vendor/github.com/gofiber/fiber/v2/group.go index 91c28062..0e546a3f 100644 --- a/vendor/github.com/gofiber/fiber/v2/group.go +++ b/vendor/github.com/gofiber/fiber/v2/group.go @@ -11,17 +11,26 @@ import ( // Group struct type Group struct { - app *App - parentGroup *Group - name string + app *App + parentGroup *Group + name string + anyRouteDefined bool Prefix string } -// Name Assign name to specific route. +// Name Assign name to specific route or group itself. +// +// If this method is used before any route added to group, it'll set group name and OnGroupNameHook will be used. +// Otherwise, it'll set route name and OnName hook will be used. func (grp *Group) Name(name string) Router { - grp.app.mutex.Lock() + if grp.anyRouteDefined { + grp.app.Name(name) + return grp + } + + grp.app.mutex.Lock() if grp.parentGroup != nil { grp.name = grp.parentGroup.name + name } else { @@ -76,6 +85,10 @@ func (grp *Group) Use(args ...interface{}) Router { grp.app.register(methodUse, getGroupPath(grp.Prefix, prefix), grp, handlers...) } + if !grp.anyRouteDefined { + grp.anyRouteDefined = true + } + return grp } @@ -135,12 +148,22 @@ func (grp *Group) Patch(path string, handlers ...Handler) Router { // Add allows you to specify a HTTP method to register a route func (grp *Group) Add(method, path string, handlers ...Handler) Router { - return grp.app.register(method, getGroupPath(grp.Prefix, path), grp, handlers...) + grp.app.register(method, getGroupPath(grp.Prefix, path), grp, handlers...) + if !grp.anyRouteDefined { + grp.anyRouteDefined = true + } + + return grp } // Static will create a file server serving static files func (grp *Group) Static(prefix, root string, config ...Static) Router { - return grp.app.registerStatic(getGroupPath(grp.Prefix, prefix), root, config...) + grp.app.registerStatic(getGroupPath(grp.Prefix, prefix), root, config...) + if !grp.anyRouteDefined { + grp.anyRouteDefined = true + } + + return grp } // All will register the handler on all HTTP methods @@ -158,7 +181,7 @@ func (grp *Group) All(path string, handlers ...Handler) Router { func (grp *Group) Group(prefix string, handlers ...Handler) Router { prefix = getGroupPath(grp.Prefix, prefix) if len(handlers) > 0 { - _ = grp.app.register(methodUse, prefix, grp, handlers...) + grp.app.register(methodUse, prefix, grp, handlers...) } // Create new group diff --git a/vendor/github.com/gofiber/fiber/v2/helpers.go b/vendor/github.com/gofiber/fiber/v2/helpers.go index a211d787..cedab4c5 100644 --- a/vendor/github.com/gofiber/fiber/v2/helpers.go +++ b/vendor/github.com/gofiber/fiber/v2/helpers.go @@ -25,6 +25,16 @@ import ( "github.com/valyala/fasthttp" ) +// acceptType is a struct that holds the parsed value of an Accept header +// along with quality, specificity, and order. +// used for sorting accept headers. +type acceptedType struct { + spec string + quality float64 + specificity int + order int +} + // getTLSConfig returns a net listener's tls config func getTLSConfig(ln net.Listener) *tls.Config { // Get listener type @@ -263,33 +273,89 @@ func acceptsOfferType(spec, offerType string) bool { func getOffer(header string, isAccepted func(spec, offer string) bool, offers ...string) string { if len(offers) == 0 { return "" - } else if header == "" { + } + if header == "" { return offers[0] } - for _, offer := range offers { - if len(offer) == 0 { - continue + // Parse header and get accepted types with their quality and specificity + // See: https://www.rfc-editor.org/rfc/rfc9110#name-content-negotiation-fields + spec, commaPos, order := "", 0, 0 + acceptedTypes := make([]acceptedType, 0, 20) + for len(header) > 0 { + order++ + + // Skip spaces + header = utils.TrimLeft(header, ' ') + + // Get spec + commaPos = strings.IndexByte(header, ',') + if commaPos != -1 { + spec = utils.Trim(header[:commaPos], ' ') + } else { + spec = utils.TrimLeft(header, ' ') } - spec, commaPos := "", 0 - for len(header) > 0 && commaPos != -1 { - commaPos = strings.IndexByte(header, ',') - if commaPos != -1 { - spec = utils.Trim(header[:commaPos], ' ') - } else { - spec = utils.TrimLeft(header, ' ') - } - if factorSign := strings.IndexByte(spec, ';'); factorSign != -1 { - spec = spec[:factorSign] - } - // isAccepted if the current offer is accepted - if isAccepted(spec, offer) { - return offer + // Get quality + quality := 1.0 + if factorSign := strings.IndexByte(spec, ';'); factorSign != -1 { + factor := utils.Trim(spec[factorSign+1:], ' ') + if strings.HasPrefix(factor, "q=") { + if q, err := fasthttp.ParseUfloat(utils.UnsafeBytes(factor[2:])); err == nil { + quality = q + } } + spec = spec[:factorSign] + } + // Skip if quality is 0.0 + // See: https://www.rfc-editor.org/rfc/rfc9110#quality.values + if quality == 0.0 { if commaPos != -1 { header = header[commaPos+1:] + } else { + break + } + continue + } + + // Get specificity + specificity := 0 + // check for wildcard this could be a mime */* or a wildcard character * + if spec == "*/*" || spec == "*" { + specificity = 1 + } else if strings.HasSuffix(spec, "/*") { + specificity = 2 + } else if strings.IndexByte(spec, '/') != -1 { + specificity = 3 + } else { + specificity = 4 + } + + // Add to accepted types + acceptedTypes = append(acceptedTypes, acceptedType{spec, quality, specificity, order}) + + // Next + if commaPos != -1 { + header = header[commaPos+1:] + } else { + break + } + } + + if len(acceptedTypes) > 1 { + // Sort accepted types by quality and specificity, preserving order of equal elements + sortAcceptedTypes(&acceptedTypes) + } + + // Find the first offer that matches the accepted types + for _, acceptedType := range acceptedTypes { + for _, offer := range offers { + if len(offer) == 0 { + continue + } + if isAccepted(acceptedType.spec, offer) { + return offer } } } @@ -297,6 +363,35 @@ func getOffer(header string, isAccepted func(spec, offer string) bool, offers .. return "" } +// sortAcceptedTypes sorts accepted types by quality and specificity, preserving order of equal elements +// +// Parameters are not supported, they are ignored when sorting by specificity. +// +// See: https://www.rfc-editor.org/rfc/rfc9110#name-content-negotiation-fields +func sortAcceptedTypes(at *[]acceptedType) { + if at == nil || len(*at) < 2 { + return + } + acceptedTypes := *at + + for i := 1; i < len(acceptedTypes); i++ { + lo, hi := 0, i-1 + for lo <= hi { + mid := (lo + hi) / 2 + if acceptedTypes[i].quality < acceptedTypes[mid].quality || + (acceptedTypes[i].quality == acceptedTypes[mid].quality && acceptedTypes[i].specificity < acceptedTypes[mid].specificity) || + (acceptedTypes[i].quality == acceptedTypes[mid].quality && acceptedTypes[i].specificity == acceptedTypes[mid].specificity && acceptedTypes[i].order > acceptedTypes[mid].order) { + lo = mid + 1 + } else { + hi = mid - 1 + } + } + for j := i; j > lo; j-- { + acceptedTypes[j-1], acceptedTypes[j] = acceptedTypes[j], acceptedTypes[j-1] + } + } +} + func matchEtag(s, etag string) bool { if s == etag || s == "W/"+etag || "W/"+s == etag { return true diff --git a/vendor/github.com/gofiber/fiber/v2/listen.go b/vendor/github.com/gofiber/fiber/v2/listen.go index d212855c..74ec91d8 100644 --- a/vendor/github.com/gofiber/fiber/v2/listen.go +++ b/vendor/github.com/gofiber/fiber/v2/listen.go @@ -30,6 +30,9 @@ func (app *App) Listener(ln net.Listener) error { // prepare the server for the start app.startupProcess() + // run hooks + app.runOnListenHooks() + // Print startup message if !app.config.DisableStartupMessage { app.startupMessage(ln.Addr().String(), getTLSConfig(ln) != nil, "") @@ -68,6 +71,9 @@ func (app *App) Listen(addr string) error { // prepare the server for the start app.startupProcess() + // run hooks + app.runOnListenHooks() + // Print startup message if !app.config.DisableStartupMessage { app.startupMessage(ln.Addr().String(), false, "") @@ -130,6 +136,9 @@ func (app *App) ListenTLSWithCertificate(addr string, cert tls.Certificate) erro // prepare the server for the start app.startupProcess() + // run hooks + app.runOnListenHooks() + // Print startup message if !app.config.DisableStartupMessage { app.startupMessage(ln.Addr().String(), true, "") @@ -202,6 +211,9 @@ func (app *App) ListenMutualTLSWithCertificate(addr string, cert tls.Certificate // prepare the server for the start app.startupProcess() + // run hooks + app.runOnListenHooks() + // Print startup message if !app.config.DisableStartupMessage { app.startupMessage(ln.Addr().String(), true, "") @@ -457,10 +469,10 @@ func (app *App) printRoutesMessage() { return routes[i].path < routes[j].path }) - _, _ = fmt.Fprintf(w, "%smethod\t%s| %spath\t%s| %sname\t%s| %shandlers\n", colors.Blue, colors.White, colors.Green, colors.White, colors.Cyan, colors.White, colors.Yellow) - _, _ = fmt.Fprintf(w, "%s------\t%s| %s----\t%s| %s----\t%s| %s--------\n", colors.Blue, colors.White, colors.Green, colors.White, colors.Cyan, colors.White, colors.Yellow) + _, _ = fmt.Fprintf(w, "%smethod\t%s| %spath\t%s| %sname\t%s| %shandlers\t%s\n", colors.Blue, colors.White, colors.Green, colors.White, colors.Cyan, colors.White, colors.Yellow, colors.Reset) + _, _ = fmt.Fprintf(w, "%s------\t%s| %s----\t%s| %s----\t%s| %s--------\t%s\n", colors.Blue, colors.White, colors.Green, colors.White, colors.Cyan, colors.White, colors.Yellow, colors.Reset) for _, route := range routes { - _, _ = fmt.Fprintf(w, "%s%s\t%s| %s%s\t%s| %s%s\t%s| %s%s\n", colors.Blue, route.method, colors.White, colors.Green, route.path, colors.White, colors.Cyan, route.name, colors.White, colors.Yellow, route.handlers) + _, _ = fmt.Fprintf(w, "%s%s\t%s| %s%s\t%s| %s%s\t%s| %s%s%s\n", colors.Blue, route.method, colors.White, colors.Green, route.path, colors.White, colors.Cyan, route.name, colors.White, colors.Yellow, route.handlers, colors.Reset) } _ = w.Flush() //nolint:errcheck // It is fine to ignore the error here diff --git a/vendor/github.com/gofiber/fiber/v2/prefork.go b/vendor/github.com/gofiber/fiber/v2/prefork.go index 63dc6ce2..e2d505ff 100644 --- a/vendor/github.com/gofiber/fiber/v2/prefork.go +++ b/vendor/github.com/gofiber/fiber/v2/prefork.go @@ -126,6 +126,10 @@ func (app *App) prefork(network, addr string, tlsConfig *tls.Config) error { }() } + // Run onListen hooks + // Hooks have to be run here as different as non-prefork mode due to they should run as child or master + app.runOnListenHooks() + // Print startup message if !app.config.DisableStartupMessage { app.startupMessage(addr, tlsConfig != nil, ","+strings.Join(pids, ",")) diff --git a/vendor/github.com/gofiber/fiber/v2/router.go b/vendor/github.com/gofiber/fiber/v2/router.go index a5aac7f6..312e161e 100644 --- a/vendor/github.com/gofiber/fiber/v2/router.go +++ b/vendor/github.com/gofiber/fiber/v2/router.go @@ -225,7 +225,7 @@ func (*App) copyRoute(route *Route) *Route { } } -func (app *App) register(method, pathRaw string, group *Group, handlers ...Handler) Router { +func (app *App) register(method, pathRaw string, group *Group, handlers ...Handler) { // Uppercase HTTP methods method = utils.ToUpper(method) // Check if the HTTP method is valid unless it's USE @@ -302,10 +302,9 @@ func (app *App) register(method, pathRaw string, group *Group, handlers ...Handl // Add route to stack app.addRoute(method, &route, isMount) } - return app } -func (app *App) registerStatic(prefix, root string, config ...Static) Router { +func (app *App) registerStatic(prefix, root string, config ...Static) { // For security we want to restrict to the current work directory. if root == "" { root = "." @@ -441,7 +440,6 @@ func (app *App) registerStatic(prefix, root string, config ...Static) Router { app.addRoute(MethodGet, &route) // Add HEAD route app.addRoute(MethodHead, &route) - return app } func (app *App) addRoute(method string, route *Route, isMounted ...bool) { diff --git a/vendor/github.com/jackc/pgx/v5/CHANGELOG.md b/vendor/github.com/jackc/pgx/v5/CHANGELOG.md index ec90631c..cc090da4 100644 --- a/vendor/github.com/jackc/pgx/v5/CHANGELOG.md +++ b/vendor/github.com/jackc/pgx/v5/CHANGELOG.md @@ -1,3 +1,31 @@ +# 5.4.1 (June 18, 2023) + +* Fix: concurrency bug with pgtypeDefaultMap and simple protocol (Lev Zakharov) +* Add TxOptions.BeginQuery to allow overriding the default BEGIN query + +# 5.4.0 (June 14, 2023) + +* Replace platform specific syscalls for non-blocking IO with more traditional goroutines and deadlines. This returns to the v4 approach with some additional improvements and fixes. This restores the ability to use a pgx.Conn over an ssh.Conn as well as other non-TCP or Unix socket connections. In addition, it is a significantly simpler implementation that is less likely to have cross platform issues. +* Optimization: The default type registrations are now shared among all connections. This saves about 100KB of memory per connection. `pgtype.Type` and `pgtype.Codec` values are now required to be immutable after registration. This was already necessary in most cases but wasn't documented until now. (Lev Zakharov) +* Fix: Ensure pgxpool.Pool.QueryRow.Scan releases connection on panic +* CancelRequest: don't try to read the reply (Nicola Murino) +* Fix: correctly handle bool type aliases (Wichert Akkerman) +* Fix: pgconn.CancelRequest: Fix unix sockets: don't use RemoteAddr() +* Fix: pgx.Conn memory leak with prepared statement caching (Evan Jones) +* Add BeforeClose to pgxpool.Pool (Evan Cordell) +* Fix: various hstore fixes and optimizations (Evan Jones) +* Fix: RowToStructByPos with embedded unexported struct +* Support different bool string representations (Lev Zakharov) +* Fix: error when using BatchResults.Exec on a select that returns an error after some rows. +* Fix: pipelineBatchResults.Exec() not returning error from ResultReader +* Fix: pipeline batch results not closing pipeline when error occurs while reading directly from results instead of using + a callback. +* Fix: scanning a table type into a struct +* Fix: scan array of record to pointer to slice of struct +* Fix: handle null for json (Cemre Mengu) +* Batch Query callback is called even when there is an error +* Add RowTo(AddrOf)StructByNameLax (Audi P. Risa P) + # 5.3.1 (February 27, 2023) * Fix: Support v4 and v5 stdlib in same program (Tomáš Procházka) diff --git a/vendor/github.com/jackc/pgx/v5/README.md b/vendor/github.com/jackc/pgx/v5/README.md index 29d9521c..14327f2c 100644 --- a/vendor/github.com/jackc/pgx/v5/README.md +++ b/vendor/github.com/jackc/pgx/v5/README.md @@ -132,13 +132,24 @@ These adapters can be used with the tracelog package. * [github.com/jackc/pgx-logrus](https://github.com/jackc/pgx-logrus) * [github.com/jackc/pgx-zap](https://github.com/jackc/pgx-zap) * [github.com/jackc/pgx-zerolog](https://github.com/jackc/pgx-zerolog) +* [github.com/mcosta74/pgx-slog](https://github.com/mcosta74/pgx-slog) ## 3rd Party Libraries with PGX Support +### [github.com/pashagolub/pgxmock](https://github.com/pashagolub/pgxmock) + +pgxmock is a mock library implementing pgx interfaces. +pgxmock has one and only purpose - to simulate pgx behavior in tests, without needing a real database connection. + ### [github.com/georgysavva/scany](https://github.com/georgysavva/scany) Library for scanning data from a database into Go structs and more. +### [github.com/vingarcia/ksql](https://github.com/vingarcia/ksql) + +A carefully designed SQL client for making using SQL easier, +more productive, and less error-prone on Golang. + ### [https://github.com/otan/gopgkrb5](https://github.com/otan/gopgkrb5) Adds GSSAPI / Kerberos authentication support. diff --git a/vendor/github.com/jackc/pgx/v5/batch.go b/vendor/github.com/jackc/pgx/v5/batch.go index af62039f..8f6ea4f0 100644 --- a/vendor/github.com/jackc/pgx/v5/batch.go +++ b/vendor/github.com/jackc/pgx/v5/batch.go @@ -21,13 +21,10 @@ type batchItemFunc func(br BatchResults) error // Query sets fn to be called when the response to qq is received. func (qq *QueuedQuery) Query(fn func(rows Rows) error) { qq.fn = func(br BatchResults) error { - rows, err := br.Query() - if err != nil { - return err - } + rows, _ := br.Query() defer rows.Close() - err = fn(rows) + err := fn(rows) if err != nil { return err } @@ -142,7 +139,10 @@ func (br *batchResults) Exec() (pgconn.CommandTag, error) { } commandTag, err := br.mrr.ResultReader().Close() - br.err = err + if err != nil { + br.err = err + br.mrr.Close() + } if br.conn.batchTracer != nil { br.conn.batchTracer.TraceBatchQuery(br.ctx, br.conn, TraceBatchQueryData{ @@ -228,7 +228,7 @@ func (br *batchResults) Close() error { for br.err == nil && !br.closed && br.b != nil && br.qqIdx < len(br.b.queuedQueries) { if br.b.queuedQueries[br.qqIdx].fn != nil { err := br.b.queuedQueries[br.qqIdx].fn(br) - if err != nil && br.err == nil { + if err != nil { br.err = err } } else { @@ -290,7 +290,7 @@ func (br *pipelineBatchResults) Exec() (pgconn.CommandTag, error) { results, err := br.pipeline.GetResults() if err != nil { br.err = err - return pgconn.CommandTag{}, err + return pgconn.CommandTag{}, br.err } var commandTag pgconn.CommandTag switch results := results.(type) { @@ -309,7 +309,7 @@ func (br *pipelineBatchResults) Exec() (pgconn.CommandTag, error) { }) } - return commandTag, err + return commandTag, br.err } // Query reads the results from the next query in the batch as if the query has been sent with Query. @@ -384,24 +384,20 @@ func (br *pipelineBatchResults) Close() error { } }() - if br.err != nil { - return br.err - } - - if br.lastRows != nil && br.lastRows.err != nil { + if br.err == nil && br.lastRows != nil && br.lastRows.err != nil { br.err = br.lastRows.err return br.err } if br.closed { - return nil + return br.err } // Read and run fn for all remaining items for br.err == nil && !br.closed && br.b != nil && br.qqIdx < len(br.b.queuedQueries) { if br.b.queuedQueries[br.qqIdx].fn != nil { err := br.b.queuedQueries[br.qqIdx].fn(br) - if err != nil && br.err == nil { + if err != nil { br.err = err } } else { diff --git a/vendor/github.com/jackc/pgx/v5/conn.go b/vendor/github.com/jackc/pgx/v5/conn.go index 92b6f3e4..a609d100 100644 --- a/vendor/github.com/jackc/pgx/v5/conn.go +++ b/vendor/github.com/jackc/pgx/v5/conn.go @@ -178,7 +178,7 @@ func ParseConfigWithOptions(connString string, options ParseConfigOptions) (*Con case "simple_protocol": defaultQueryExecMode = QueryExecModeSimpleProtocol default: - return nil, fmt.Errorf("invalid default_query_exec_mode: %v", err) + return nil, fmt.Errorf("invalid default_query_exec_mode: %s", s) } } @@ -382,11 +382,9 @@ func quoteIdentifier(s string) string { return `"` + strings.ReplaceAll(s, `"`, `""`) + `"` } -// Ping executes an empty sql statement against the *Conn -// If the sql returns without error, the database Ping is considered successful, otherwise, the error is returned. +// Ping delegates to the underlying *pgconn.PgConn.Ping. func (c *Conn) Ping(ctx context.Context) error { - _, err := c.Exec(ctx, ";") - return err + return c.pgConn.Ping(ctx) } // PgConn returns the underlying *pgconn.PgConn. This is an escape hatch method that allows lower level access to the @@ -585,8 +583,10 @@ const ( QueryExecModeCacheDescribe // Get the statement description on every execution. This uses the extended protocol. Queries require two round trips - // to execute. It does not use prepared statements (allowing usage with most connection poolers) and is safe even - // when the the database schema is modified concurrently. + // to execute. It does not use named prepared statements. But it does use the unnamed prepared statement to get the + // statement description on the first round trip and then uses it to execute the query on the second round trip. This + // may cause problems with connection poolers that switch the underlying connection between round trips. It is safe + // even when the the database schema is modified concurrently. QueryExecModeDescribeExec // Assume the PostgreSQL query parameter types based on the Go type of the arguments. This uses the extended protocol @@ -648,6 +648,9 @@ type QueryRewriter interface { // returned Rows even if an error is returned. The error will be the available in rows.Err() after rows are closed. It // is allowed to ignore the error returned from Query and handle it in Rows. // +// It is possible for a call of FieldDescriptions on the returned Rows to return nil even if the Query call did not +// return an error. +// // It is possible for a query to return one or more rows before encountering an error. In most cases the rows should be // collected before processing rather than processed while receiving each row. This avoids the possibility of the // application processing rows from a query that the server rejected. The CollectRows function is useful here. @@ -975,7 +978,7 @@ func (c *Conn) sendBatchQueryExecModeExec(ctx context.Context, b *Batch) *batchR func (c *Conn) sendBatchQueryExecModeCacheStatement(ctx context.Context, b *Batch) (pbr *pipelineBatchResults) { if c.statementCache == nil { - return &pipelineBatchResults{ctx: ctx, conn: c, err: errDisabledStatementCache} + return &pipelineBatchResults{ctx: ctx, conn: c, err: errDisabledStatementCache, closed: true} } distinctNewQueries := []*pgconn.StatementDescription{} @@ -1007,7 +1010,7 @@ func (c *Conn) sendBatchQueryExecModeCacheStatement(ctx context.Context, b *Batc func (c *Conn) sendBatchQueryExecModeCacheDescribe(ctx context.Context, b *Batch) (pbr *pipelineBatchResults) { if c.descriptionCache == nil { - return &pipelineBatchResults{ctx: ctx, conn: c, err: errDisabledDescriptionCache} + return &pipelineBatchResults{ctx: ctx, conn: c, err: errDisabledDescriptionCache, closed: true} } distinctNewQueries := []*pgconn.StatementDescription{} @@ -1074,18 +1077,18 @@ func (c *Conn) sendBatchExtendedWithDescription(ctx context.Context, b *Batch, d err := pipeline.Sync() if err != nil { - return &pipelineBatchResults{ctx: ctx, conn: c, err: err} + return &pipelineBatchResults{ctx: ctx, conn: c, err: err, closed: true} } for _, sd := range distinctNewQueries { results, err := pipeline.GetResults() if err != nil { - return &pipelineBatchResults{ctx: ctx, conn: c, err: err} + return &pipelineBatchResults{ctx: ctx, conn: c, err: err, closed: true} } resultSD, ok := results.(*pgconn.StatementDescription) if !ok { - return &pipelineBatchResults{ctx: ctx, conn: c, err: fmt.Errorf("expected statement description, got %T", results)} + return &pipelineBatchResults{ctx: ctx, conn: c, err: fmt.Errorf("expected statement description, got %T", results), closed: true} } // Fill in the previously empty / pending statement descriptions. @@ -1095,12 +1098,12 @@ func (c *Conn) sendBatchExtendedWithDescription(ctx context.Context, b *Batch, d results, err := pipeline.GetResults() if err != nil { - return &pipelineBatchResults{ctx: ctx, conn: c, err: err} + return &pipelineBatchResults{ctx: ctx, conn: c, err: err, closed: true} } _, ok := results.(*pgconn.PipelineSync) if !ok { - return &pipelineBatchResults{ctx: ctx, conn: c, err: fmt.Errorf("expected sync, got %T", results)} + return &pipelineBatchResults{ctx: ctx, conn: c, err: fmt.Errorf("expected sync, got %T", results), closed: true} } } @@ -1117,7 +1120,7 @@ func (c *Conn) sendBatchExtendedWithDescription(ctx context.Context, b *Batch, d if err != nil { // we wrap the error so we the user can understand which query failed inside the batch err = fmt.Errorf("error building query %s: %w", bi.query, err) - return &pipelineBatchResults{ctx: ctx, conn: c, err: err} + return &pipelineBatchResults{ctx: ctx, conn: c, err: err, closed: true} } if bi.sd.Name == "" { @@ -1129,7 +1132,7 @@ func (c *Conn) sendBatchExtendedWithDescription(ctx context.Context, b *Batch, d err := pipeline.Sync() if err != nil { - return &pipelineBatchResults{ctx: ctx, conn: c, err: err} + return &pipelineBatchResults{ctx: ctx, conn: c, err: err, closed: true} } return &pipelineBatchResults{ @@ -1282,7 +1285,9 @@ func (c *Conn) getCompositeFields(ctx context.Context, oid uint32) ([]pgtype.Com var fieldOID uint32 rows, _ := c.Query(ctx, `select attname, atttypid from pg_attribute -where attrelid=$1 and not attisdropped +where attrelid=$1 + and not attisdropped + and attnum > 0 order by attnum`, typrelid, ) @@ -1324,6 +1329,7 @@ func (c *Conn) deallocateInvalidatedCachedStatements(ctx context.Context) error for _, sd := range invalidatedStatements { pipeline.SendDeallocate(sd.Name) + delete(c.preparedStatements, sd.Name) } err := pipeline.Sync() diff --git a/vendor/github.com/jackc/pgx/v5/internal/nbconn/bufferqueue.go b/vendor/github.com/jackc/pgx/v5/internal/nbconn/bufferqueue.go deleted file mode 100644 index 4bf25481..00000000 --- a/vendor/github.com/jackc/pgx/v5/internal/nbconn/bufferqueue.go +++ /dev/null @@ -1,70 +0,0 @@ -package nbconn - -import ( - "sync" -) - -const minBufferQueueLen = 8 - -type bufferQueue struct { - lock sync.Mutex - queue []*[]byte - r, w int -} - -func (bq *bufferQueue) pushBack(buf *[]byte) { - bq.lock.Lock() - defer bq.lock.Unlock() - - if bq.w >= len(bq.queue) { - bq.growQueue() - } - bq.queue[bq.w] = buf - bq.w++ -} - -func (bq *bufferQueue) pushFront(buf *[]byte) { - bq.lock.Lock() - defer bq.lock.Unlock() - - if bq.w >= len(bq.queue) { - bq.growQueue() - } - copy(bq.queue[bq.r+1:bq.w+1], bq.queue[bq.r:bq.w]) - bq.queue[bq.r] = buf - bq.w++ -} - -func (bq *bufferQueue) popFront() *[]byte { - bq.lock.Lock() - defer bq.lock.Unlock() - - if bq.r == bq.w { - return nil - } - - buf := bq.queue[bq.r] - bq.queue[bq.r] = nil // Clear reference so it can be garbage collected. - bq.r++ - - if bq.r == bq.w { - bq.r = 0 - bq.w = 0 - if len(bq.queue) > minBufferQueueLen { - bq.queue = make([]*[]byte, minBufferQueueLen) - } - } - - return buf -} - -func (bq *bufferQueue) growQueue() { - desiredLen := (len(bq.queue) + 1) * 3 / 2 - if desiredLen < minBufferQueueLen { - desiredLen = minBufferQueueLen - } - - newQueue := make([]*[]byte, desiredLen) - copy(newQueue, bq.queue) - bq.queue = newQueue -} diff --git a/vendor/github.com/jackc/pgx/v5/internal/nbconn/nbconn.go b/vendor/github.com/jackc/pgx/v5/internal/nbconn/nbconn.go deleted file mode 100644 index 7a38383f..00000000 --- a/vendor/github.com/jackc/pgx/v5/internal/nbconn/nbconn.go +++ /dev/null @@ -1,520 +0,0 @@ -// Package nbconn implements a non-blocking net.Conn wrapper. -// -// It is designed to solve three problems. -// -// The first is resolving the deadlock that can occur when both sides of a connection are blocked writing because all -// buffers between are full. See https://github.com/jackc/pgconn/issues/27 for discussion. -// -// The second is the inability to use a write deadline with a TLS.Conn without killing the connection. -// -// The third is to efficiently check if a connection has been closed via a non-blocking read. -package nbconn - -import ( - "crypto/tls" - "errors" - "net" - "os" - "sync" - "sync/atomic" - "syscall" - "time" - - "github.com/jackc/pgx/v5/internal/iobufpool" -) - -var errClosed = errors.New("closed") -var ErrWouldBlock = new(wouldBlockError) - -const fakeNonblockingWriteWaitDuration = 100 * time.Millisecond -const minNonblockingReadWaitDuration = time.Microsecond -const maxNonblockingReadWaitDuration = 100 * time.Millisecond - -// NonBlockingDeadline is a magic value that when passed to Set[Read]Deadline places the connection in non-blocking read -// mode. -var NonBlockingDeadline = time.Date(1900, 1, 1, 0, 0, 0, 608536336, time.UTC) - -// disableSetDeadlineDeadline is a magic value that when passed to Set[Read|Write]Deadline causes those methods to -// ignore all future calls. -var disableSetDeadlineDeadline = time.Date(1900, 1, 1, 0, 0, 0, 968549727, time.UTC) - -// wouldBlockError implements net.Error so tls.Conn will recognize ErrWouldBlock as a temporary error. -type wouldBlockError struct{} - -func (*wouldBlockError) Error() string { - return "would block" -} - -func (*wouldBlockError) Timeout() bool { return true } -func (*wouldBlockError) Temporary() bool { return true } - -// Conn is a net.Conn where Write never blocks and always succeeds. Flush or Read must be called to actually write to -// the underlying connection. -type Conn interface { - net.Conn - - // Flush flushes any buffered writes. - Flush() error - - // BufferReadUntilBlock reads and buffers any successfully read bytes until the read would block. - BufferReadUntilBlock() error -} - -// NetConn is a non-blocking net.Conn wrapper. It implements net.Conn. -type NetConn struct { - // 64 bit fields accessed with atomics must be at beginning of struct to guarantee alignment for certain 32-bit - // architectures. See BUGS section of https://pkg.go.dev/sync/atomic and https://github.com/jackc/pgx/issues/1288 and - // https://github.com/jackc/pgx/issues/1307. Only access with atomics - closed int64 // 0 = not closed, 1 = closed - - conn net.Conn - rawConn syscall.RawConn - - readQueue bufferQueue - writeQueue bufferQueue - - readFlushLock sync.Mutex - // non-blocking writes with syscall.RawConn are done with a callback function. By using these fields instead of the - // callback functions closure to pass the buf argument and receive the n and err results we avoid some allocations. - nonblockWriteFunc func(fd uintptr) (done bool) - nonblockWriteBuf []byte - nonblockWriteErr error - nonblockWriteN int - - // non-blocking reads with syscall.RawConn are done with a callback function. By using these fields instead of the - // callback functions closure to pass the buf argument and receive the n and err results we avoid some allocations. - nonblockReadFunc func(fd uintptr) (done bool) - nonblockReadBuf []byte - nonblockReadErr error - nonblockReadN int - - readDeadlineLock sync.Mutex - readDeadline time.Time - readNonblocking bool - fakeNonBlockingShortReadCount int - fakeNonblockingReadWaitDuration time.Duration - - writeDeadlineLock sync.Mutex - writeDeadline time.Time -} - -func NewNetConn(conn net.Conn, fakeNonBlockingIO bool) *NetConn { - nc := &NetConn{ - conn: conn, - fakeNonblockingReadWaitDuration: maxNonblockingReadWaitDuration, - } - - if !fakeNonBlockingIO { - if sc, ok := conn.(syscall.Conn); ok { - if rawConn, err := sc.SyscallConn(); err == nil { - nc.rawConn = rawConn - } - } - } - - return nc -} - -// Read implements io.Reader. -func (c *NetConn) Read(b []byte) (n int, err error) { - if c.isClosed() { - return 0, errClosed - } - - c.readFlushLock.Lock() - defer c.readFlushLock.Unlock() - - err = c.flush() - if err != nil { - return 0, err - } - - for n < len(b) { - buf := c.readQueue.popFront() - if buf == nil { - break - } - copiedN := copy(b[n:], *buf) - if copiedN < len(*buf) { - *buf = (*buf)[copiedN:] - c.readQueue.pushFront(buf) - } else { - iobufpool.Put(buf) - } - n += copiedN - } - - // If any bytes were already buffered return them without trying to do a Read. Otherwise, when the caller is trying to - // Read up to len(b) bytes but all available bytes have already been buffered the underlying Read would block. - if n > 0 { - return n, nil - } - - var readNonblocking bool - c.readDeadlineLock.Lock() - readNonblocking = c.readNonblocking - c.readDeadlineLock.Unlock() - - var readN int - if readNonblocking { - readN, err = c.nonblockingRead(b[n:]) - } else { - readN, err = c.conn.Read(b[n:]) - } - n += readN - return n, err -} - -// Write implements io.Writer. It never blocks due to buffering all writes. It will only return an error if the Conn is -// closed. Call Flush to actually write to the underlying connection. -func (c *NetConn) Write(b []byte) (n int, err error) { - if c.isClosed() { - return 0, errClosed - } - - buf := iobufpool.Get(len(b)) - copy(*buf, b) - c.writeQueue.pushBack(buf) - return len(b), nil -} - -func (c *NetConn) Close() (err error) { - swapped := atomic.CompareAndSwapInt64(&c.closed, 0, 1) - if !swapped { - return errClosed - } - - defer func() { - closeErr := c.conn.Close() - if err == nil { - err = closeErr - } - }() - - c.readFlushLock.Lock() - defer c.readFlushLock.Unlock() - err = c.flush() - if err != nil { - return err - } - - return nil -} - -func (c *NetConn) LocalAddr() net.Addr { - return c.conn.LocalAddr() -} - -func (c *NetConn) RemoteAddr() net.Addr { - return c.conn.RemoteAddr() -} - -// SetDeadline is the equivalent of calling SetReadDealine(t) and SetWriteDeadline(t). -func (c *NetConn) SetDeadline(t time.Time) error { - err := c.SetReadDeadline(t) - if err != nil { - return err - } - return c.SetWriteDeadline(t) -} - -// SetReadDeadline sets the read deadline as t. If t == NonBlockingDeadline then future reads will be non-blocking. -func (c *NetConn) SetReadDeadline(t time.Time) error { - if c.isClosed() { - return errClosed - } - - c.readDeadlineLock.Lock() - defer c.readDeadlineLock.Unlock() - if c.readDeadline == disableSetDeadlineDeadline { - return nil - } - if t == disableSetDeadlineDeadline { - c.readDeadline = t - return nil - } - - if t == NonBlockingDeadline { - c.readNonblocking = true - t = time.Time{} - } else { - c.readNonblocking = false - } - - c.readDeadline = t - - return c.conn.SetReadDeadline(t) -} - -func (c *NetConn) SetWriteDeadline(t time.Time) error { - if c.isClosed() { - return errClosed - } - - c.writeDeadlineLock.Lock() - defer c.writeDeadlineLock.Unlock() - if c.writeDeadline == disableSetDeadlineDeadline { - return nil - } - if t == disableSetDeadlineDeadline { - c.writeDeadline = t - return nil - } - - c.writeDeadline = t - - return c.conn.SetWriteDeadline(t) -} - -func (c *NetConn) Flush() error { - if c.isClosed() { - return errClosed - } - - c.readFlushLock.Lock() - defer c.readFlushLock.Unlock() - return c.flush() -} - -// flush does the actual work of flushing the writeQueue. readFlushLock must already be held. -func (c *NetConn) flush() error { - var stopChan chan struct{} - var errChan chan error - - defer func() { - if stopChan != nil { - select { - case stopChan <- struct{}{}: - case <-errChan: - } - } - }() - - for buf := c.writeQueue.popFront(); buf != nil; buf = c.writeQueue.popFront() { - remainingBuf := *buf - for len(remainingBuf) > 0 { - n, err := c.nonblockingWrite(remainingBuf) - remainingBuf = remainingBuf[n:] - if err != nil { - if !errors.Is(err, ErrWouldBlock) { - *buf = (*buf)[:len(remainingBuf)] - copy(*buf, remainingBuf) - c.writeQueue.pushFront(buf) - return err - } - - // Writing was blocked. Reading might unblock it. - if stopChan == nil { - stopChan, errChan = c.bufferNonblockingRead() - } - - select { - case err := <-errChan: - stopChan = nil - return err - default: - } - - } - } - iobufpool.Put(buf) - } - - return nil -} - -func (c *NetConn) BufferReadUntilBlock() error { - for { - buf := iobufpool.Get(8 * 1024) - n, err := c.nonblockingRead(*buf) - if n > 0 { - *buf = (*buf)[:n] - c.readQueue.pushBack(buf) - } else if n == 0 { - iobufpool.Put(buf) - } - - if err != nil { - if errors.Is(err, ErrWouldBlock) { - return nil - } else { - return err - } - } - } -} - -func (c *NetConn) bufferNonblockingRead() (stopChan chan struct{}, errChan chan error) { - stopChan = make(chan struct{}) - errChan = make(chan error, 1) - - go func() { - for { - err := c.BufferReadUntilBlock() - if err != nil { - errChan <- err - return - } - - select { - case <-stopChan: - return - default: - } - } - }() - - return stopChan, errChan -} - -func (c *NetConn) isClosed() bool { - closed := atomic.LoadInt64(&c.closed) - return closed == 1 -} - -func (c *NetConn) nonblockingWrite(b []byte) (n int, err error) { - if c.rawConn == nil { - return c.fakeNonblockingWrite(b) - } else { - return c.realNonblockingWrite(b) - } -} - -func (c *NetConn) fakeNonblockingWrite(b []byte) (n int, err error) { - c.writeDeadlineLock.Lock() - defer c.writeDeadlineLock.Unlock() - - deadline := time.Now().Add(fakeNonblockingWriteWaitDuration) - if c.writeDeadline.IsZero() || deadline.Before(c.writeDeadline) { - err = c.conn.SetWriteDeadline(deadline) - if err != nil { - return 0, err - } - defer func() { - // Ignoring error resetting deadline as there is nothing that can reasonably be done if it fails. - c.conn.SetWriteDeadline(c.writeDeadline) - - if err != nil { - if errors.Is(err, os.ErrDeadlineExceeded) { - err = ErrWouldBlock - } - } - }() - } - - return c.conn.Write(b) -} - -func (c *NetConn) nonblockingRead(b []byte) (n int, err error) { - if c.rawConn == nil { - return c.fakeNonblockingRead(b) - } else { - return c.realNonblockingRead(b) - } -} - -func (c *NetConn) fakeNonblockingRead(b []byte) (n int, err error) { - c.readDeadlineLock.Lock() - defer c.readDeadlineLock.Unlock() - - // The first 5 reads only read 1 byte at a time. This should give us 4 chances to read when we are sure the bytes are - // already in Go or the OS's receive buffer. - if c.fakeNonBlockingShortReadCount < 5 && len(b) > 0 && c.fakeNonblockingReadWaitDuration < minNonblockingReadWaitDuration { - b = b[:1] - } - - startTime := time.Now() - deadline := startTime.Add(c.fakeNonblockingReadWaitDuration) - if c.readDeadline.IsZero() || deadline.Before(c.readDeadline) { - err = c.conn.SetReadDeadline(deadline) - if err != nil { - return 0, err - } - defer func() { - // If the read was successful and the wait duration is not already the minimum - if err == nil && c.fakeNonblockingReadWaitDuration > minNonblockingReadWaitDuration { - endTime := time.Now() - - if n > 0 && c.fakeNonBlockingShortReadCount < 5 { - c.fakeNonBlockingShortReadCount++ - } - - // The wait duration should be 2x the fastest read that has occurred. This should give reasonable assurance that - // a Read deadline will not block a read before it has a chance to read data already in Go or the OS's receive - // buffer. - proposedWait := endTime.Sub(startTime) * 2 - if proposedWait < minNonblockingReadWaitDuration { - proposedWait = minNonblockingReadWaitDuration - } - if proposedWait < c.fakeNonblockingReadWaitDuration { - c.fakeNonblockingReadWaitDuration = proposedWait - } - } - - // Ignoring error resetting deadline as there is nothing that can reasonably be done if it fails. - c.conn.SetReadDeadline(c.readDeadline) - - if err != nil { - if errors.Is(err, os.ErrDeadlineExceeded) { - err = ErrWouldBlock - } - } - }() - } - - return c.conn.Read(b) -} - -// syscall.Conn is interface - -// TLSClient establishes a TLS connection as a client over conn using config. -// -// To avoid the first Read on the returned *TLSConn also triggering a Write due to the TLS handshake and thereby -// potentially causing a read and write deadlines to behave unexpectedly, Handshake is called explicitly before the -// *TLSConn is returned. -func TLSClient(conn *NetConn, config *tls.Config) (*TLSConn, error) { - tc := tls.Client(conn, config) - err := tc.Handshake() - if err != nil { - return nil, err - } - - // Ensure last written part of Handshake is actually sent. - err = conn.Flush() - if err != nil { - return nil, err - } - - return &TLSConn{ - tlsConn: tc, - nbConn: conn, - }, nil -} - -// TLSConn is a TLS wrapper around a *Conn. It works around a temporary write error (such as a timeout) being fatal to a -// tls.Conn. -type TLSConn struct { - tlsConn *tls.Conn - nbConn *NetConn -} - -func (tc *TLSConn) Read(b []byte) (n int, err error) { return tc.tlsConn.Read(b) } -func (tc *TLSConn) Write(b []byte) (n int, err error) { return tc.tlsConn.Write(b) } -func (tc *TLSConn) BufferReadUntilBlock() error { return tc.nbConn.BufferReadUntilBlock() } -func (tc *TLSConn) Flush() error { return tc.nbConn.Flush() } -func (tc *TLSConn) LocalAddr() net.Addr { return tc.tlsConn.LocalAddr() } -func (tc *TLSConn) RemoteAddr() net.Addr { return tc.tlsConn.RemoteAddr() } - -func (tc *TLSConn) Close() error { - // tls.Conn.closeNotify() sets a 5 second deadline to avoid blocking, sends a TLS alert close notification, and then - // sets the deadline to now. This causes NetConn's Close not to be able to flush the write buffer. Instead we set our - // own 5 second deadline then make all set deadlines no-op. - tc.tlsConn.SetDeadline(time.Now().Add(time.Second * 5)) - tc.tlsConn.SetDeadline(disableSetDeadlineDeadline) - - return tc.tlsConn.Close() -} - -func (tc *TLSConn) SetDeadline(t time.Time) error { return tc.tlsConn.SetDeadline(t) } -func (tc *TLSConn) SetReadDeadline(t time.Time) error { return tc.tlsConn.SetReadDeadline(t) } -func (tc *TLSConn) SetWriteDeadline(t time.Time) error { return tc.tlsConn.SetWriteDeadline(t) } diff --git a/vendor/github.com/jackc/pgx/v5/internal/nbconn/nbconn_fake_non_block.go b/vendor/github.com/jackc/pgx/v5/internal/nbconn/nbconn_fake_non_block.go deleted file mode 100644 index 4915c621..00000000 --- a/vendor/github.com/jackc/pgx/v5/internal/nbconn/nbconn_fake_non_block.go +++ /dev/null @@ -1,11 +0,0 @@ -//go:build !unix - -package nbconn - -func (c *NetConn) realNonblockingWrite(b []byte) (n int, err error) { - return c.fakeNonblockingWrite(b) -} - -func (c *NetConn) realNonblockingRead(b []byte) (n int, err error) { - return c.fakeNonblockingRead(b) -} diff --git a/vendor/github.com/jackc/pgx/v5/internal/nbconn/nbconn_real_non_block.go b/vendor/github.com/jackc/pgx/v5/internal/nbconn/nbconn_real_non_block.go deleted file mode 100644 index e93372f2..00000000 --- a/vendor/github.com/jackc/pgx/v5/internal/nbconn/nbconn_real_non_block.go +++ /dev/null @@ -1,81 +0,0 @@ -//go:build unix - -package nbconn - -import ( - "errors" - "io" - "syscall" -) - -// realNonblockingWrite does a non-blocking write. readFlushLock must already be held. -func (c *NetConn) realNonblockingWrite(b []byte) (n int, err error) { - if c.nonblockWriteFunc == nil { - c.nonblockWriteFunc = func(fd uintptr) (done bool) { - c.nonblockWriteN, c.nonblockWriteErr = syscall.Write(int(fd), c.nonblockWriteBuf) - return true - } - } - c.nonblockWriteBuf = b - c.nonblockWriteN = 0 - c.nonblockWriteErr = nil - - err = c.rawConn.Write(c.nonblockWriteFunc) - n = c.nonblockWriteN - c.nonblockWriteBuf = nil // ensure that no reference to b is kept. - if err == nil && c.nonblockWriteErr != nil { - if errors.Is(c.nonblockWriteErr, syscall.EWOULDBLOCK) { - err = ErrWouldBlock - } else { - err = c.nonblockWriteErr - } - } - if err != nil { - // n may be -1 when an error occurs. - if n < 0 { - n = 0 - } - - return n, err - } - - return n, nil -} - -func (c *NetConn) realNonblockingRead(b []byte) (n int, err error) { - if c.nonblockReadFunc == nil { - c.nonblockReadFunc = func(fd uintptr) (done bool) { - c.nonblockReadN, c.nonblockReadErr = syscall.Read(int(fd), c.nonblockReadBuf) - return true - } - } - c.nonblockReadBuf = b - c.nonblockReadN = 0 - c.nonblockReadErr = nil - - err = c.rawConn.Read(c.nonblockReadFunc) - n = c.nonblockReadN - c.nonblockReadBuf = nil // ensure that no reference to b is kept. - if err == nil && c.nonblockReadErr != nil { - if errors.Is(c.nonblockReadErr, syscall.EWOULDBLOCK) { - err = ErrWouldBlock - } else { - err = c.nonblockReadErr - } - } - if err != nil { - // n may be -1 when an error occurs. - if n < 0 { - n = 0 - } - - return n, err - } - - // syscall read did not return an error and 0 bytes were read means EOF. - if n == 0 { - return 0, io.EOF - } - - return n, nil -} diff --git a/vendor/github.com/jackc/pgx/v5/pgconn/auth_scram.go b/vendor/github.com/jackc/pgx/v5/pgconn/auth_scram.go index 6ca9e337..8c4b2de3 100644 --- a/vendor/github.com/jackc/pgx/v5/pgconn/auth_scram.go +++ b/vendor/github.com/jackc/pgx/v5/pgconn/auth_scram.go @@ -42,7 +42,7 @@ func (c *PgConn) scramAuth(serverAuthMechanisms []string) error { Data: sc.clientFirstMessage(), } c.frontend.Send(saslInitialResponse) - err = c.frontend.Flush() + err = c.flushWithPotentialWriteReadDeadlock() if err != nil { return err } @@ -62,7 +62,7 @@ func (c *PgConn) scramAuth(serverAuthMechanisms []string) error { Data: []byte(sc.clientFinalMessage()), } c.frontend.Send(saslResponse) - err = c.frontend.Flush() + err = c.flushWithPotentialWriteReadDeadlock() if err != nil { return err } diff --git a/vendor/github.com/jackc/pgx/v5/pgconn/internal/bgreader/bgreader.go b/vendor/github.com/jackc/pgx/v5/pgconn/internal/bgreader/bgreader.go new file mode 100644 index 00000000..aa1a3d39 --- /dev/null +++ b/vendor/github.com/jackc/pgx/v5/pgconn/internal/bgreader/bgreader.go @@ -0,0 +1,132 @@ +// Package bgreader provides a io.Reader that can optionally buffer reads in the background. +package bgreader + +import ( + "io" + "sync" + + "github.com/jackc/pgx/v5/internal/iobufpool" +) + +const ( + bgReaderStatusStopped = iota + bgReaderStatusRunning + bgReaderStatusStopping +) + +// BGReader is an io.Reader that can optionally buffer reads in the background. It is safe for concurrent use. +type BGReader struct { + r io.Reader + + cond *sync.Cond + bgReaderStatus int32 + readResults []readResult +} + +type readResult struct { + buf *[]byte + err error +} + +// Start starts the backgrounder reader. If the background reader is already running this is a no-op. The background +// reader will stop automatically when the underlying reader returns an error. +func (r *BGReader) Start() { + r.cond.L.Lock() + defer r.cond.L.Unlock() + + switch r.bgReaderStatus { + case bgReaderStatusStopped: + r.bgReaderStatus = bgReaderStatusRunning + go r.bgRead() + case bgReaderStatusRunning: + // no-op + case bgReaderStatusStopping: + r.bgReaderStatus = bgReaderStatusRunning + } +} + +// Stop tells the background reader to stop after the in progress Read returns. It is safe to call Stop when the +// background reader is not running. +func (r *BGReader) Stop() { + r.cond.L.Lock() + defer r.cond.L.Unlock() + + switch r.bgReaderStatus { + case bgReaderStatusStopped: + // no-op + case bgReaderStatusRunning: + r.bgReaderStatus = bgReaderStatusStopping + case bgReaderStatusStopping: + // no-op + } +} + +func (r *BGReader) bgRead() { + keepReading := true + for keepReading { + buf := iobufpool.Get(8192) + n, err := r.r.Read(*buf) + *buf = (*buf)[:n] + + r.cond.L.Lock() + r.readResults = append(r.readResults, readResult{buf: buf, err: err}) + if r.bgReaderStatus == bgReaderStatusStopping || err != nil { + r.bgReaderStatus = bgReaderStatusStopped + keepReading = false + } + r.cond.L.Unlock() + r.cond.Broadcast() + } +} + +// Read implements the io.Reader interface. +func (r *BGReader) Read(p []byte) (int, error) { + r.cond.L.Lock() + defer r.cond.L.Unlock() + + if len(r.readResults) > 0 { + return r.readFromReadResults(p) + } + + // There are no unread background read results and the background reader is stopped. + if r.bgReaderStatus == bgReaderStatusStopped { + return r.r.Read(p) + } + + // Wait for results from the background reader + for len(r.readResults) == 0 { + r.cond.Wait() + } + return r.readFromReadResults(p) +} + +// readBackgroundResults reads a result previously read by the background reader. r.cond.L must be held. +func (r *BGReader) readFromReadResults(p []byte) (int, error) { + buf := r.readResults[0].buf + var err error + + n := copy(p, *buf) + if n == len(*buf) { + err = r.readResults[0].err + iobufpool.Put(buf) + if len(r.readResults) == 1 { + r.readResults = nil + } else { + r.readResults = r.readResults[1:] + } + } else { + *buf = (*buf)[n:] + r.readResults[0].buf = buf + } + + return n, err +} + +func New(r io.Reader) *BGReader { + return &BGReader{ + r: r, + cond: &sync.Cond{ + L: &sync.Mutex{}, + }, + } +} diff --git a/vendor/github.com/jackc/pgx/v5/pgconn/krb5.go b/vendor/github.com/jackc/pgx/v5/pgconn/krb5.go index 969675fd..3c1af347 100644 --- a/vendor/github.com/jackc/pgx/v5/pgconn/krb5.go +++ b/vendor/github.com/jackc/pgx/v5/pgconn/krb5.go @@ -63,7 +63,7 @@ func (c *PgConn) gssAuth() error { Data: nextData, } c.frontend.Send(gssResponse) - err = c.frontend.Flush() + err = c.flushWithPotentialWriteReadDeadlock() if err != nil { return err } diff --git a/vendor/github.com/jackc/pgx/v5/pgconn/pgconn.go b/vendor/github.com/jackc/pgx/v5/pgconn/pgconn.go index 8656ea51..9f84605f 100644 --- a/vendor/github.com/jackc/pgx/v5/pgconn/pgconn.go +++ b/vendor/github.com/jackc/pgx/v5/pgconn/pgconn.go @@ -13,11 +13,12 @@ import ( "net" "strconv" "strings" + "sync" "time" "github.com/jackc/pgx/v5/internal/iobufpool" - "github.com/jackc/pgx/v5/internal/nbconn" "github.com/jackc/pgx/v5/internal/pgio" + "github.com/jackc/pgx/v5/pgconn/internal/bgreader" "github.com/jackc/pgx/v5/pgconn/internal/ctxwatch" "github.com/jackc/pgx/v5/pgproto3" ) @@ -65,17 +66,24 @@ type NotificationHandler func(*PgConn, *Notification) // PgConn is a low-level PostgreSQL connection handle. It is not safe for concurrent usage. type PgConn struct { - conn nbconn.Conn // the non-blocking wrapper for the underlying TCP or unix domain socket connection + conn net.Conn pid uint32 // backend pid secretKey uint32 // key to use to send a cancel query message to the server parameterStatuses map[string]string // parameters that have been reported by the server txStatus byte frontend *pgproto3.Frontend + bgReader *bgreader.BGReader + slowWriteTimer *time.Timer config *Config status byte // One of connStatus* constants + bufferingReceive bool + bufferingReceiveMux sync.Mutex + bufferingReceiveMsg pgproto3.BackendMessage + bufferingReceiveErr error + peekedMsg pgproto3.BackendMessage // Reusable / preallocated resources @@ -266,14 +274,13 @@ func connect(ctx context.Context, config *Config, fallbackConfig *FallbackConfig if err != nil { return nil, &connectError{config: config, msg: "dial error", err: normalizeTimeoutError(ctx, err)} } - nbNetConn := nbconn.NewNetConn(netConn, false) - pgConn.conn = nbNetConn - pgConn.contextWatcher = newContextWatcher(nbNetConn) + pgConn.conn = netConn + pgConn.contextWatcher = newContextWatcher(netConn) pgConn.contextWatcher.Watch(ctx) if fallbackConfig.TLSConfig != nil { - nbTLSConn, err := startTLS(nbNetConn, fallbackConfig.TLSConfig) + nbTLSConn, err := startTLS(netConn, fallbackConfig.TLSConfig) pgConn.contextWatcher.Unwatch() // Always unwatch `netConn` after TLS. if err != nil { netConn.Close() @@ -289,7 +296,9 @@ func connect(ctx context.Context, config *Config, fallbackConfig *FallbackConfig pgConn.parameterStatuses = make(map[string]string) pgConn.status = connStatusConnecting - pgConn.frontend = config.BuildFrontend(pgConn.conn, pgConn.conn) + pgConn.bgReader = bgreader.New(pgConn.conn) + pgConn.slowWriteTimer = time.AfterFunc(time.Duration(math.MaxInt64), pgConn.bgReader.Start) + pgConn.frontend = config.BuildFrontend(pgConn.bgReader, pgConn.conn) startupMsg := pgproto3.StartupMessage{ ProtocolVersion: pgproto3.ProtocolVersionNumber, @@ -307,9 +316,9 @@ func connect(ctx context.Context, config *Config, fallbackConfig *FallbackConfig } pgConn.frontend.Send(&startupMsg) - if err := pgConn.frontend.Flush(); err != nil { + if err := pgConn.flushWithPotentialWriteReadDeadlock(); err != nil { pgConn.conn.Close() - return nil, &connectError{config: config, msg: "failed to write startup message", err: err} + return nil, &connectError{config: config, msg: "failed to write startup message", err: normalizeTimeoutError(ctx, err)} } for { @@ -392,7 +401,7 @@ func newContextWatcher(conn net.Conn) *ctxwatch.ContextWatcher { ) } -func startTLS(conn *nbconn.NetConn, tlsConfig *tls.Config) (*nbconn.TLSConn, error) { +func startTLS(conn net.Conn, tlsConfig *tls.Config) (net.Conn, error) { err := binary.Write(conn, binary.BigEndian, []int32{8, 80877103}) if err != nil { return nil, err @@ -407,17 +416,12 @@ func startTLS(conn *nbconn.NetConn, tlsConfig *tls.Config) (*nbconn.TLSConn, err return nil, errors.New("server refused TLS connection") } - tlsConn, err := nbconn.TLSClient(conn, tlsConfig) - if err != nil { - return nil, err - } - - return tlsConn, nil + return tls.Client(conn, tlsConfig), nil } func (pgConn *PgConn) txPasswordMessage(password string) (err error) { pgConn.frontend.Send(&pgproto3.PasswordMessage{Password: password}) - return pgConn.frontend.Flush() + return pgConn.flushWithPotentialWriteReadDeadlock() } func hexMD5(s string) string { @@ -426,6 +430,24 @@ func hexMD5(s string) string { return hex.EncodeToString(hash.Sum(nil)) } +func (pgConn *PgConn) signalMessage() chan struct{} { + if pgConn.bufferingReceive { + panic("BUG: signalMessage when already in progress") + } + + pgConn.bufferingReceive = true + pgConn.bufferingReceiveMux.Lock() + + ch := make(chan struct{}) + go func() { + pgConn.bufferingReceiveMsg, pgConn.bufferingReceiveErr = pgConn.frontend.Receive() + pgConn.bufferingReceiveMux.Unlock() + close(ch) + }() + + return ch +} + // ReceiveMessage receives one wire protocol message from the PostgreSQL server. It must only be used when the // connection is not busy. e.g. It is an error to call ReceiveMessage while reading the result of a query. The messages // are still handled by the core pgconn message handling system so receiving a NotificationResponse will still trigger @@ -465,13 +487,25 @@ func (pgConn *PgConn) peekMessage() (pgproto3.BackendMessage, error) { return pgConn.peekedMsg, nil } - msg, err := pgConn.frontend.Receive() + var msg pgproto3.BackendMessage + var err error + if pgConn.bufferingReceive { + pgConn.bufferingReceiveMux.Lock() + msg = pgConn.bufferingReceiveMsg + err = pgConn.bufferingReceiveErr + pgConn.bufferingReceiveMux.Unlock() + pgConn.bufferingReceive = false + + // If a timeout error happened in the background try the read again. + var netErr net.Error + if errors.As(err, &netErr) && netErr.Timeout() { + msg, err = pgConn.frontend.Receive() + } + } else { + msg, err = pgConn.frontend.Receive() + } if err != nil { - if errors.Is(err, nbconn.ErrWouldBlock) { - return nil, err - } - // Close on anything other than timeout error - everything else is fatal var netErr net.Error isNetErr := errors.As(err, &netErr) @@ -582,7 +616,7 @@ func (pgConn *PgConn) Close(ctx context.Context) error { // // See https://github.com/jackc/pgx/issues/637 pgConn.frontend.Send(&pgproto3.Terminate{}) - pgConn.frontend.Flush() + pgConn.flushWithPotentialWriteReadDeadlock() return pgConn.conn.Close() } @@ -609,7 +643,7 @@ func (pgConn *PgConn) asyncClose() { pgConn.conn.SetDeadline(deadline) pgConn.frontend.Send(&pgproto3.Terminate{}) - pgConn.frontend.Flush() + pgConn.flushWithPotentialWriteReadDeadlock() }() } @@ -784,7 +818,7 @@ func (pgConn *PgConn) Prepare(ctx context.Context, name, sql string, paramOIDs [ pgConn.frontend.SendParse(&pgproto3.Parse{Name: name, Query: sql, ParameterOIDs: paramOIDs}) pgConn.frontend.SendDescribe(&pgproto3.Describe{ObjectType: 'S', Name: name}) pgConn.frontend.SendSync(&pgproto3.Sync{}) - err := pgConn.frontend.Flush() + err := pgConn.flushWithPotentialWriteReadDeadlock() if err != nil { pgConn.asyncClose() return nil, err @@ -857,9 +891,28 @@ func (pgConn *PgConn) CancelRequest(ctx context.Context) error { // the connection config. This is important in high availability configurations where fallback connections may be // specified or DNS may be used to load balance. serverAddr := pgConn.conn.RemoteAddr() - cancelConn, err := pgConn.config.DialFunc(ctx, serverAddr.Network(), serverAddr.String()) + var serverNetwork string + var serverAddress string + if serverAddr.Network() == "unix" { + // for unix sockets, RemoteAddr() calls getpeername() which returns the name the + // server passed to bind(). For Postgres, this is always a relative path "./.s.PGSQL.5432" + // so connecting to it will fail. Fall back to the config's value + serverNetwork, serverAddress = NetworkAddress(pgConn.config.Host, pgConn.config.Port) + } else { + serverNetwork, serverAddress = serverAddr.Network(), serverAddr.String() + } + cancelConn, err := pgConn.config.DialFunc(ctx, serverNetwork, serverAddress) if err != nil { - return err + // In case of unix sockets, RemoteAddr() returns only the file part of the path. If the + // first connect failed, try the config. + if serverAddr.Network() != "unix" { + return err + } + serverNetwork, serverAddr := NetworkAddress(pgConn.config.Host, pgConn.config.Port) + cancelConn, err = pgConn.config.DialFunc(ctx, serverNetwork, serverAddr) + if err != nil { + return err + } } defer cancelConn.Close() @@ -877,17 +930,11 @@ func (pgConn *PgConn) CancelRequest(ctx context.Context) error { binary.BigEndian.PutUint32(buf[4:8], 80877102) binary.BigEndian.PutUint32(buf[8:12], uint32(pgConn.pid)) binary.BigEndian.PutUint32(buf[12:16], uint32(pgConn.secretKey)) + // Postgres will process the request and close the connection + // so when don't need to read the reply + // https://www.postgresql.org/docs/current/protocol-flow.html#id-1.10.6.7.10 _, err = cancelConn.Write(buf) - if err != nil { - return err - } - - _, err = cancelConn.Read(buf) - if err != io.EOF { - return err - } - - return nil + return err } // WaitForNotification waits for a LISTON/NOTIFY message to be received. It returns an error if a notification was not @@ -953,7 +1000,7 @@ func (pgConn *PgConn) Exec(ctx context.Context, sql string) *MultiResultReader { } pgConn.frontend.SendQuery(&pgproto3.Query{String: sql}) - err := pgConn.frontend.Flush() + err := pgConn.flushWithPotentialWriteReadDeadlock() if err != nil { pgConn.asyncClose() pgConn.contextWatcher.Unwatch() @@ -1064,7 +1111,7 @@ func (pgConn *PgConn) execExtendedSuffix(result *ResultReader) { pgConn.frontend.SendExecute(&pgproto3.Execute{}) pgConn.frontend.SendSync(&pgproto3.Sync{}) - err := pgConn.frontend.Flush() + err := pgConn.flushWithPotentialWriteReadDeadlock() if err != nil { pgConn.asyncClose() result.concludeCommand(CommandTag{}, err) @@ -1097,7 +1144,7 @@ func (pgConn *PgConn) CopyTo(ctx context.Context, w io.Writer, sql string) (Comm // Send copy to command pgConn.frontend.SendQuery(&pgproto3.Query{String: sql}) - err := pgConn.frontend.Flush() + err := pgConn.flushWithPotentialWriteReadDeadlock() if err != nil { pgConn.asyncClose() pgConn.unlock() @@ -1153,85 +1200,91 @@ func (pgConn *PgConn) CopyFrom(ctx context.Context, r io.Reader, sql string) (Co defer pgConn.contextWatcher.Unwatch() } - // Send copy to command + // Send copy from query pgConn.frontend.SendQuery(&pgproto3.Query{String: sql}) - err := pgConn.frontend.Flush() + err := pgConn.flushWithPotentialWriteReadDeadlock() if err != nil { pgConn.asyncClose() return CommandTag{}, err } - err = pgConn.conn.SetReadDeadline(nbconn.NonBlockingDeadline) - if err != nil { - pgConn.asyncClose() - return CommandTag{}, err - } - nonblocking := true - defer func() { - if nonblocking { - pgConn.conn.SetReadDeadline(time.Time{}) + // Send copy data + abortCopyChan := make(chan struct{}) + copyErrChan := make(chan error, 1) + signalMessageChan := pgConn.signalMessage() + var wg sync.WaitGroup + wg.Add(1) + + go func() { + defer wg.Done() + buf := iobufpool.Get(65536) + defer iobufpool.Put(buf) + (*buf)[0] = 'd' + + for { + n, readErr := r.Read((*buf)[5:cap(*buf)]) + if n > 0 { + *buf = (*buf)[0 : n+5] + pgio.SetInt32((*buf)[1:], int32(n+4)) + + writeErr := pgConn.frontend.SendUnbufferedEncodedCopyData(*buf) + if writeErr != nil { + // Write errors are always fatal, but we can't use asyncClose because we are in a different goroutine. Not + // setting pgConn.status or closing pgConn.cleanupDone for the same reason. + pgConn.conn.Close() + + copyErrChan <- writeErr + return + } + } + if readErr != nil { + copyErrChan <- readErr + return + } + + select { + case <-abortCopyChan: + return + default: + } } }() - buf := iobufpool.Get(65536) - defer iobufpool.Put(buf) - (*buf)[0] = 'd' - - var readErr, pgErr error - for pgErr == nil { - // Read chunk from r. - var n int - n, readErr = r.Read((*buf)[5:cap(*buf)]) - - // Send chunk to PostgreSQL. - if n > 0 { - *buf = (*buf)[0 : n+5] - pgio.SetInt32((*buf)[1:], int32(n+4)) - - writeErr := pgConn.frontend.SendUnbufferedEncodedCopyData(*buf) - if writeErr != nil { - pgConn.asyncClose() - return CommandTag{}, err - } - } - - // Abort loop if there was a read error. - if readErr != nil { - break - } - - // Read messages until error or none available. - for pgErr == nil { - msg, err := pgConn.receiveMessage() - if err != nil { - if errors.Is(err, nbconn.ErrWouldBlock) { - break - } - pgConn.asyncClose() + var pgErr error + var copyErr error + for copyErr == nil && pgErr == nil { + select { + case copyErr = <-copyErrChan: + case <-signalMessageChan: + // If pgConn.receiveMessage encounters an error it will call pgConn.asyncClose. But that is a race condition with + // the goroutine. So instead check pgConn.bufferingReceiveErr which will have been set by the signalMessage. If an + // error is found then forcibly close the connection without sending the Terminate message. + if err := pgConn.bufferingReceiveErr; err != nil { + pgConn.status = connStatusClosed + pgConn.conn.Close() + close(pgConn.cleanupDone) return CommandTag{}, normalizeTimeoutError(ctx, err) } + msg, _ := pgConn.receiveMessage() switch msg := msg.(type) { case *pgproto3.ErrorResponse: pgErr = ErrorResponseToPgError(msg) - break + default: + signalMessageChan = pgConn.signalMessage() } } } + close(abortCopyChan) + // Make sure io goroutine finishes before writing. + wg.Wait() - err = pgConn.conn.SetReadDeadline(time.Time{}) - if err != nil { - pgConn.asyncClose() - return CommandTag{}, err - } - nonblocking = false - - if readErr == io.EOF || pgErr != nil { + if copyErr == io.EOF || pgErr != nil { pgConn.frontend.Send(&pgproto3.CopyDone{}) } else { - pgConn.frontend.Send(&pgproto3.CopyFail{Message: readErr.Error()}) + pgConn.frontend.Send(&pgproto3.CopyFail{Message: copyErr.Error()}) } - err = pgConn.frontend.Flush() + err = pgConn.flushWithPotentialWriteReadDeadlock() if err != nil { pgConn.asyncClose() return CommandTag{}, err @@ -1426,7 +1479,8 @@ func (rr *ResultReader) NextRow() bool { } // FieldDescriptions returns the field descriptions for the current result set. The returned slice is only valid until -// the ResultReader is closed. +// the ResultReader is closed. It may return nil (for example, if the query did not return a result set or an error was +// encountered.) func (rr *ResultReader) FieldDescriptions() []FieldDescription { return rr.fieldDescriptions } @@ -1592,7 +1646,9 @@ func (pgConn *PgConn) ExecBatch(ctx context.Context, batch *Batch) *MultiResultR batch.buf = (&pgproto3.Sync{}).Encode(batch.buf) + pgConn.enterPotentialWriteReadDeadlock() _, err := pgConn.conn.Write(batch.buf) + pgConn.exitPotentialWriteReadDeadlock() if err != nil { multiResult.closed = true multiResult.err = err @@ -1620,29 +1676,72 @@ func (pgConn *PgConn) EscapeString(s string) (string, error) { return strings.Replace(s, "'", "''", -1), nil } -// CheckConn checks the underlying connection without writing any bytes. This is currently implemented by reading and -// buffering until the read would block or an error occurs. This can be used to check if the server has closed the -// connection. If this is done immediately before sending a query it reduces the chances a query will be sent that fails +// CheckConn checks the underlying connection without writing any bytes. This is currently implemented by doing a read +// with a very short deadline. This can be useful because a TCP connection can be broken such that a write will appear +// to succeed even though it will never actually reach the server. Reading immediately before a write will detect this +// condition. If this is done immediately before sending a query it reduces the chances a query will be sent that fails // without the client knowing whether the server received it or not. +// +// Deprecated: CheckConn is deprecated in favor of Ping. CheckConn cannot detect all types of broken connections where +// the write would still appear to succeed. Prefer Ping unless on a high latency connection. func (pgConn *PgConn) CheckConn() error { - err := pgConn.conn.BufferReadUntilBlock() - if err != nil && !errors.Is(err, nbconn.ErrWouldBlock) { - return err + ctx, cancel := context.WithTimeout(context.Background(), 1*time.Millisecond) + defer cancel() + + _, err := pgConn.ReceiveMessage(ctx) + if err != nil { + if !Timeout(err) { + return err + } } + return nil } +// Ping pings the server. This can be useful because a TCP connection can be broken such that a write will appear to +// succeed even though it will never actually reach the server. Pinging immediately before sending a query reduces the +// chances a query will be sent that fails without the client knowing whether the server received it or not. +func (pgConn *PgConn) Ping(ctx context.Context) error { + return pgConn.Exec(ctx, "-- ping").Close() +} + // makeCommandTag makes a CommandTag. It does not retain a reference to buf or buf's underlying memory. func (pgConn *PgConn) makeCommandTag(buf []byte) CommandTag { return CommandTag{s: string(buf)} } +// enterPotentialWriteReadDeadlock must be called before a write that could deadlock if the server is simultaneously +// blocked writing to us. +func (pgConn *PgConn) enterPotentialWriteReadDeadlock() { + // The time to wait is somewhat arbitrary. A Write should only take as long as the syscall and memcpy to the OS + // outbound network buffer unless the buffer is full (which potentially is a block). It needs to be long enough for + // the normal case, but short enough not to kill performance if a block occurs. + // + // In addition, on Windows the default timer resolution is 15.6ms. So setting the timer to less than that is + // ineffective. + pgConn.slowWriteTimer.Reset(15 * time.Millisecond) +} + +// exitPotentialWriteReadDeadlock must be called after a call to enterPotentialWriteReadDeadlock. +func (pgConn *PgConn) exitPotentialWriteReadDeadlock() { + if !pgConn.slowWriteTimer.Reset(time.Duration(math.MaxInt64)) { + pgConn.slowWriteTimer.Stop() + } +} + +func (pgConn *PgConn) flushWithPotentialWriteReadDeadlock() error { + pgConn.enterPotentialWriteReadDeadlock() + err := pgConn.frontend.Flush() + pgConn.exitPotentialWriteReadDeadlock() + return err +} + // HijackedConn is the result of hijacking a connection. // // Due to the necessary exposure of internal implementation details, it is not covered by the semantic versioning // compatibility. type HijackedConn struct { - Conn nbconn.Conn // the non-blocking wrapper of the underlying TCP or unix domain socket connection + Conn net.Conn PID uint32 // backend pid SecretKey uint32 // key to use to send a cancel query message to the server ParameterStatuses map[string]string // parameters that have been reported by the server @@ -1695,6 +1794,8 @@ func Construct(hc *HijackedConn) (*PgConn, error) { } pgConn.contextWatcher = newContextWatcher(pgConn.conn) + pgConn.bgReader = bgreader.New(pgConn.conn) + pgConn.slowWriteTimer = time.AfterFunc(time.Duration(math.MaxInt64), pgConn.bgReader.Start) return pgConn, nil } @@ -1817,7 +1918,7 @@ func (p *Pipeline) Flush() error { return errors.New("pipeline closed") } - err := p.conn.frontend.Flush() + err := p.conn.flushWithPotentialWriteReadDeadlock() if err != nil { err = normalizeTimeoutError(p.ctx, err) diff --git a/vendor/github.com/jackc/pgx/v5/pgtype/array.go b/vendor/github.com/jackc/pgx/v5/pgtype/array.go index 0fa4c129..7dfee389 100644 --- a/vendor/github.com/jackc/pgx/v5/pgtype/array.go +++ b/vendor/github.com/jackc/pgx/v5/pgtype/array.go @@ -363,12 +363,13 @@ func quoteArrayElement(src string) string { } func isSpace(ch byte) bool { - // see https://github.com/postgres/postgres/blob/REL_12_STABLE/src/backend/parser/scansup.c#L224 - return ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r' || ch == '\f' + // see array_isspace: + // https://github.com/postgres/postgres/blob/master/src/backend/utils/adt/arrayfuncs.c + return ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r' || ch == '\v' || ch == '\f' } func quoteArrayElementIfNeeded(src string) string { - if src == "" || (len(src) == 4 && strings.ToLower(src) == "null") || isSpace(src[0]) || isSpace(src[len(src)-1]) || strings.ContainsAny(src, `{},"\`) { + if src == "" || (len(src) == 4 && strings.EqualFold(src, "null")) || isSpace(src[0]) || isSpace(src[len(src)-1]) || strings.ContainsAny(src, `{},"\`) { return quoteArrayElement(src) } return src diff --git a/vendor/github.com/jackc/pgx/v5/pgtype/bool.go b/vendor/github.com/jackc/pgx/v5/pgtype/bool.go index e7be27e2..71caffa7 100644 --- a/vendor/github.com/jackc/pgx/v5/pgtype/bool.go +++ b/vendor/github.com/jackc/pgx/v5/pgtype/bool.go @@ -1,10 +1,12 @@ package pgtype import ( + "bytes" "database/sql/driver" "encoding/json" "fmt" "strconv" + "strings" ) type BoolScanner interface { @@ -264,8 +266,8 @@ func (scanPlanTextAnyToBool) Scan(src []byte, dst any) error { return fmt.Errorf("cannot scan NULL into %T", dst) } - if len(src) != 1 { - return fmt.Errorf("invalid length for bool: %v", len(src)) + if len(src) == 0 { + return fmt.Errorf("cannot scan empty string into %T", dst) } p, ok := (dst).(*bool) @@ -273,7 +275,12 @@ func (scanPlanTextAnyToBool) Scan(src []byte, dst any) error { return ErrScanTargetTypeChanged } - *p = src[0] == 't' + v, err := planTextToBool(src) + if err != nil { + return err + } + + *p = v return nil } @@ -309,9 +316,28 @@ func (scanPlanTextAnyToBoolScanner) Scan(src []byte, dst any) error { return s.ScanBool(Bool{}) } - if len(src) != 1 { - return fmt.Errorf("invalid length for bool: %v", len(src)) + if len(src) == 0 { + return fmt.Errorf("cannot scan empty string into %T", dst) } - return s.ScanBool(Bool{Bool: src[0] == 't', Valid: true}) + v, err := planTextToBool(src) + if err != nil { + return err + } + + return s.ScanBool(Bool{Bool: v, Valid: true}) +} + +// https://www.postgresql.org/docs/11/datatype-boolean.html +func planTextToBool(src []byte) (bool, error) { + s := string(bytes.ToLower(bytes.TrimSpace(src))) + + switch { + case strings.HasPrefix("true", s), strings.HasPrefix("yes", s), s == "on", s == "1": + return true, nil + case strings.HasPrefix("false", s), strings.HasPrefix("no", s), strings.HasPrefix("off", s), s == "0": + return false, nil + default: + return false, fmt.Errorf("unknown boolean string representation %q", src) + } } diff --git a/vendor/github.com/jackc/pgx/v5/pgtype/convert.go b/vendor/github.com/jackc/pgx/v5/pgtype/convert.go index 8a2afbe1..7fddeaa8 100644 --- a/vendor/github.com/jackc/pgx/v5/pgtype/convert.go +++ b/vendor/github.com/jackc/pgx/v5/pgtype/convert.go @@ -64,6 +64,9 @@ func underlyingNumberType(val any) (any, bool) { case reflect.String: convVal := refVal.String() return convVal, reflect.TypeOf(convVal) != refVal.Type() + case reflect.Bool: + convVal := refVal.Bool() + return convVal, reflect.TypeOf(convVal) != refVal.Type() } return nil, false @@ -262,7 +265,7 @@ func int64AssignTo(srcVal int64, srcValid bool, dst any) error { *v = uint8(srcVal) case *uint16: if srcVal < 0 { - return fmt.Errorf("%d is less than zero for uint32", srcVal) + return fmt.Errorf("%d is less than zero for uint16", srcVal) } else if srcVal > math.MaxUint16 { return fmt.Errorf("%d is greater than maximum value for uint16", srcVal) } diff --git a/vendor/github.com/jackc/pgx/v5/pgtype/hstore.go b/vendor/github.com/jackc/pgx/v5/pgtype/hstore.go index 4743643e..9befabd0 100644 --- a/vendor/github.com/jackc/pgx/v5/pgtype/hstore.go +++ b/vendor/github.com/jackc/pgx/v5/pgtype/hstore.go @@ -1,14 +1,11 @@ package pgtype import ( - "bytes" "database/sql/driver" "encoding/binary" "errors" "fmt" "strings" - "unicode" - "unicode/utf8" "github.com/jackc/pgx/v5/internal/pgio" ) @@ -43,7 +40,7 @@ func (h *Hstore) Scan(src any) error { switch src := src.(type) { case string: - return scanPlanTextAnyToHstoreScanner{}.Scan([]byte(src), h) + return scanPlanTextAnyToHstoreScanner{}.scanString(src, h) } return fmt.Errorf("cannot scan %T", src) @@ -137,13 +134,20 @@ func (encodePlanHstoreCodecText) Encode(value any, buf []byte) (newBuf []byte, e buf = append(buf, ',') } - buf = append(buf, quoteHstoreElementIfNeeded(k)...) + // unconditionally quote hstore keys/values like Postgres does + // this avoids a Mac OS X Postgres hstore parsing bug: + // https://www.postgresql.org/message-id/CA%2BHWA9awUW0%2BRV_gO9r1ABZwGoZxPztcJxPy8vMFSTbTfi4jig%40mail.gmail.com + buf = append(buf, '"') + buf = append(buf, quoteArrayReplacer.Replace(k)...) + buf = append(buf, '"') buf = append(buf, "=>"...) if v == nil { buf = append(buf, "NULL"...) } else { - buf = append(buf, quoteHstoreElementIfNeeded(*v)...) + buf = append(buf, '"') + buf = append(buf, quoteArrayReplacer.Replace(*v)...) + buf = append(buf, '"') } } @@ -174,25 +178,28 @@ func (scanPlanBinaryHstoreToHstoreScanner) Scan(src []byte, dst any) error { scanner := (dst).(HstoreScanner) if src == nil { - return scanner.ScanHstore(Hstore{}) + return scanner.ScanHstore(Hstore(nil)) } rp := 0 - if len(src[rp:]) < 4 { + const uint32Len = 4 + if len(src[rp:]) < uint32Len { return fmt.Errorf("hstore incomplete %v", src) } pairCount := int(int32(binary.BigEndian.Uint32(src[rp:]))) - rp += 4 + rp += uint32Len hstore := make(Hstore, pairCount) + // one allocation for all *string, rather than one per string, just like text parsing + valueStrings := make([]string, pairCount) for i := 0; i < pairCount; i++ { - if len(src[rp:]) < 4 { + if len(src[rp:]) < uint32Len { return fmt.Errorf("hstore incomplete %v", src) } keyLen := int(int32(binary.BigEndian.Uint32(src[rp:]))) - rp += 4 + rp += uint32Len if len(src[rp:]) < keyLen { return fmt.Errorf("hstore incomplete %v", src) @@ -200,26 +207,17 @@ func (scanPlanBinaryHstoreToHstoreScanner) Scan(src []byte, dst any) error { key := string(src[rp : rp+keyLen]) rp += keyLen - if len(src[rp:]) < 4 { + if len(src[rp:]) < uint32Len { return fmt.Errorf("hstore incomplete %v", src) } valueLen := int(int32(binary.BigEndian.Uint32(src[rp:]))) rp += 4 - var valueBuf []byte if valueLen >= 0 { - valueBuf = src[rp : rp+valueLen] + valueStrings[i] = string(src[rp : rp+valueLen]) rp += valueLen - } - var value Text - err := scanPlanTextAnyToTextScanner{}.Scan(valueBuf, &value) - if err != nil { - return err - } - - if value.Valid { - hstore[key] = &value.String + hstore[key] = &valueStrings[i] } else { hstore[key] = nil } @@ -230,28 +228,22 @@ func (scanPlanBinaryHstoreToHstoreScanner) Scan(src []byte, dst any) error { type scanPlanTextAnyToHstoreScanner struct{} -func (scanPlanTextAnyToHstoreScanner) Scan(src []byte, dst any) error { +func (s scanPlanTextAnyToHstoreScanner) Scan(src []byte, dst any) error { scanner := (dst).(HstoreScanner) if src == nil { - return scanner.ScanHstore(Hstore{}) + return scanner.ScanHstore(Hstore(nil)) } + return s.scanString(string(src), scanner) +} - keys, values, err := parseHstore(string(src)) +// scanString does not return nil hstore values because string cannot be nil. +func (scanPlanTextAnyToHstoreScanner) scanString(src string, scanner HstoreScanner) error { + hstore, err := parseHstore(src) if err != nil { return err } - - m := make(Hstore, len(keys)) - for i := range keys { - if values[i].Valid { - m[keys[i]] = &values[i].String - } else { - m[keys[i]] = nil - } - } - - return scanner.ScanHstore(m) + return scanner.ScanHstore(hstore) } func (c HstoreCodec) DecodeDatabaseSQLValue(m *Map, oid uint32, format int16, src []byte) (driver.Value, error) { @@ -271,191 +263,217 @@ func (c HstoreCodec) DecodeValue(m *Map, oid uint32, format int16, src []byte) ( return hstore, nil } -var quoteHstoreReplacer = strings.NewReplacer(`\`, `\\`, `"`, `\"`) - -func quoteHstoreElement(src string) string { - return `"` + quoteArrayReplacer.Replace(src) + `"` -} - -func quoteHstoreElementIfNeeded(src string) string { - if src == "" || (len(src) == 4 && strings.ToLower(src) == "null") || strings.ContainsAny(src, ` {},"\=>`) { - return quoteArrayElement(src) - } - return src -} - -const ( - hsPre = iota - hsKey - hsSep - hsVal - hsNul - hsNext -) - type hstoreParser struct { - str string - pos int + str string + pos int + nextBackslash int } func newHSP(in string) *hstoreParser { return &hstoreParser{ - pos: 0, - str: in, + pos: 0, + str: in, + nextBackslash: strings.IndexByte(in, '\\'), } } -func (p *hstoreParser) Consume() (r rune, end bool) { +func (p *hstoreParser) atEnd() bool { + return p.pos >= len(p.str) +} + +// consume returns the next byte of the string, or end if the string is done. +func (p *hstoreParser) consume() (b byte, end bool) { if p.pos >= len(p.str) { - end = true - return + return 0, true } - r, w := utf8.DecodeRuneInString(p.str[p.pos:]) - p.pos += w - return + b = p.str[p.pos] + p.pos++ + return b, false } -func (p *hstoreParser) Peek() (r rune, end bool) { - if p.pos >= len(p.str) { - end = true - return - } - r, _ = utf8.DecodeRuneInString(p.str[p.pos:]) - return +func unexpectedByteErr(actualB byte, expectedB byte) error { + return fmt.Errorf("expected '%c' ('%#v'); found '%c' ('%#v')", expectedB, expectedB, actualB, actualB) } -// parseHstore parses the string representation of an hstore column (the same -// you would get from an ordinary SELECT) into two slices of keys and values. it -// is used internally in the default parsing of hstores. -func parseHstore(s string) (k []string, v []Text, err error) { - if s == "" { - return +// consumeExpectedByte consumes expectedB from the string, or returns an error. +func (p *hstoreParser) consumeExpectedByte(expectedB byte) error { + nextB, end := p.consume() + if end { + return fmt.Errorf("expected '%c' ('%#v'); found end", expectedB, expectedB) + } + if nextB != expectedB { + return unexpectedByteErr(nextB, expectedB) + } + return nil +} + +// consumeExpected2 consumes two expected bytes or returns an error. +// This was a bit faster than using a string argument (better inlining? Not sure). +func (p *hstoreParser) consumeExpected2(one byte, two byte) error { + if p.pos+2 > len(p.str) { + return errors.New("unexpected end of string") + } + if p.str[p.pos] != one { + return unexpectedByteErr(p.str[p.pos], one) + } + if p.str[p.pos+1] != two { + return unexpectedByteErr(p.str[p.pos+1], two) + } + p.pos += 2 + return nil +} + +var errEOSInQuoted = errors.New(`found end before closing double-quote ('"')`) + +// consumeDoubleQuoted consumes a double-quoted string from p. The double quote must have been +// parsed already. This copies the string from the backing string so it can be garbage collected. +func (p *hstoreParser) consumeDoubleQuoted() (string, error) { + // fast path: assume most keys/values do not contain escapes + nextDoubleQuote := strings.IndexByte(p.str[p.pos:], '"') + if nextDoubleQuote == -1 { + return "", errEOSInQuoted + } + nextDoubleQuote += p.pos + if p.nextBackslash == -1 || p.nextBackslash > nextDoubleQuote { + // clone the string from the source string to ensure it can be garbage collected separately + // TODO: use strings.Clone on Go 1.20; this could get optimized away + s := strings.Clone(p.str[p.pos:nextDoubleQuote]) + p.pos = nextDoubleQuote + 1 + return s, nil } - buf := bytes.Buffer{} - keys := []string{} - values := []Text{} + // slow path: string contains escapes + s, err := p.consumeDoubleQuotedWithEscapes(p.nextBackslash) + p.nextBackslash = strings.IndexByte(p.str[p.pos:], '\\') + if p.nextBackslash != -1 { + p.nextBackslash += p.pos + } + return s, err +} + +// consumeDoubleQuotedWithEscapes consumes a double-quoted string containing escapes, starting +// at p.pos, and with the first backslash at firstBackslash. This copies the string so it can be +// garbage collected separately. +func (p *hstoreParser) consumeDoubleQuotedWithEscapes(firstBackslash int) (string, error) { + // copy the prefix that does not contain backslashes + var builder strings.Builder + builder.WriteString(p.str[p.pos:firstBackslash]) + + // skip to the backslash + p.pos = firstBackslash + + // copy bytes until the end, unescaping backslashes + for { + nextB, end := p.consume() + if end { + return "", errEOSInQuoted + } else if nextB == '"' { + break + } else if nextB == '\\' { + // escape: skip the backslash and copy the char + nextB, end = p.consume() + if end { + return "", errEOSInQuoted + } + if !(nextB == '\\' || nextB == '"') { + return "", fmt.Errorf("unexpected escape in quoted string: found '%#v'", nextB) + } + builder.WriteByte(nextB) + } else { + // normal byte: copy it + builder.WriteByte(nextB) + } + } + return builder.String(), nil +} + +// consumePairSeparator consumes the Hstore pair separator ", " or returns an error. +func (p *hstoreParser) consumePairSeparator() error { + return p.consumeExpected2(',', ' ') +} + +// consumeKVSeparator consumes the Hstore key/value separator "=>" or returns an error. +func (p *hstoreParser) consumeKVSeparator() error { + return p.consumeExpected2('=', '>') +} + +// consumeDoubleQuotedOrNull consumes the Hstore key/value separator "=>" or returns an error. +func (p *hstoreParser) consumeDoubleQuotedOrNull() (Text, error) { + // peek at the next byte + if p.atEnd() { + return Text{}, errors.New("found end instead of value") + } + next := p.str[p.pos] + if next == 'N' { + // must be the exact string NULL: use consumeExpected2 twice + err := p.consumeExpected2('N', 'U') + if err != nil { + return Text{}, err + } + err = p.consumeExpected2('L', 'L') + if err != nil { + return Text{}, err + } + return Text{String: "", Valid: false}, nil + } else if next != '"' { + return Text{}, unexpectedByteErr(next, '"') + } + + // skip the double quote + p.pos += 1 + s, err := p.consumeDoubleQuoted() + if err != nil { + return Text{}, err + } + return Text{String: s, Valid: true}, nil +} + +func parseHstore(s string) (Hstore, error) { p := newHSP(s) - r, end := p.Consume() - state := hsPre - - for !end { - switch state { - case hsPre: - if r == '"' { - state = hsKey - } else { - err = errors.New("String does not begin with \"") - } - case hsKey: - switch r { - case '"': //End of the key - keys = append(keys, buf.String()) - buf = bytes.Buffer{} - state = hsSep - case '\\': //Potential escaped character - n, end := p.Consume() - switch { - case end: - err = errors.New("Found EOS in key, expecting character or \"") - case n == '"', n == '\\': - buf.WriteRune(n) - default: - buf.WriteRune(r) - buf.WriteRune(n) - } - default: //Any other character - buf.WriteRune(r) - } - case hsSep: - if r == '=' { - r, end = p.Consume() - switch { - case end: - err = errors.New("Found EOS after '=', expecting '>'") - case r == '>': - r, end = p.Consume() - switch { - case end: - err = errors.New("Found EOS after '=>', expecting '\"' or 'NULL'") - case r == '"': - state = hsVal - case r == 'N': - state = hsNul - default: - err = fmt.Errorf("Invalid character '%c' after '=>', expecting '\"' or 'NULL'", r) - } - default: - err = fmt.Errorf("Invalid character after '=', expecting '>'") - } - } else { - err = fmt.Errorf("Invalid character '%c' after value, expecting '='", r) - } - case hsVal: - switch r { - case '"': //End of the value - values = append(values, Text{String: buf.String(), Valid: true}) - buf = bytes.Buffer{} - state = hsNext - case '\\': //Potential escaped character - n, end := p.Consume() - switch { - case end: - err = errors.New("Found EOS in key, expecting character or \"") - case n == '"', n == '\\': - buf.WriteRune(n) - default: - buf.WriteRune(r) - buf.WriteRune(n) - } - default: //Any other character - buf.WriteRune(r) - } - case hsNul: - nulBuf := make([]rune, 3) - nulBuf[0] = r - for i := 1; i < 3; i++ { - r, end = p.Consume() - if end { - err = errors.New("Found EOS in NULL value") - return - } - nulBuf[i] = r - } - if nulBuf[0] == 'U' && nulBuf[1] == 'L' && nulBuf[2] == 'L' { - values = append(values, Text{}) - state = hsNext - } else { - err = fmt.Errorf("Invalid NULL value: 'N%s'", string(nulBuf)) - } - case hsNext: - if r == ',' { - r, end = p.Consume() - switch { - case end: - err = errors.New("Found EOS after ',', expcting space") - case (unicode.IsSpace(r)): - r, end = p.Consume() - state = hsKey - default: - err = fmt.Errorf("Invalid character '%c' after ', ', expecting \"", r) - } - } else { - err = fmt.Errorf("Invalid character '%c' after value, expecting ','", r) + // This is an over-estimate of the number of key/value pairs. Use '>' because I am guessing it + // is less likely to occur in keys/values than '=' or ','. + numPairsEstimate := strings.Count(s, ">") + // makes one allocation of strings for the entire Hstore, rather than one allocation per value. + valueStrings := make([]string, 0, numPairsEstimate) + result := make(Hstore, numPairsEstimate) + first := true + for !p.atEnd() { + if !first { + err := p.consumePairSeparator() + if err != nil { + return nil, err } + } else { + first = false } + err := p.consumeExpectedByte('"') if err != nil { - return + return nil, err + } + + key, err := p.consumeDoubleQuoted() + if err != nil { + return nil, err + } + + err = p.consumeKVSeparator() + if err != nil { + return nil, err + } + + value, err := p.consumeDoubleQuotedOrNull() + if err != nil { + return nil, err + } + if value.Valid { + valueStrings = append(valueStrings, value.String) + result[key] = &valueStrings[len(valueStrings)-1] + } else { + result[key] = nil } - r, end = p.Consume() } - if state != hsNext { - err = errors.New("Improperly formatted hstore") - return - } - k = keys - v = values - return + + return result, nil } diff --git a/vendor/github.com/jackc/pgx/v5/pgtype/json.go b/vendor/github.com/jackc/pgx/v5/pgtype/json.go index 69861bf8..753f2410 100644 --- a/vendor/github.com/jackc/pgx/v5/pgtype/json.go +++ b/vendor/github.com/jackc/pgx/v5/pgtype/json.go @@ -150,7 +150,7 @@ func (scanPlanJSONToJSONUnmarshal) Scan(src []byte, dst any) error { if dstValue.Kind() == reflect.Ptr { el := dstValue.Elem() switch el.Kind() { - case reflect.Ptr, reflect.Slice, reflect.Map: + case reflect.Ptr, reflect.Slice, reflect.Map, reflect.Interface: el.Set(reflect.Zero(el.Type())) return nil } diff --git a/vendor/github.com/jackc/pgx/v5/pgtype/pgtype.go b/vendor/github.com/jackc/pgx/v5/pgtype/pgtype.go index 83b349ce..b9cd7b41 100644 --- a/vendor/github.com/jackc/pgx/v5/pgtype/pgtype.go +++ b/vendor/github.com/jackc/pgx/v5/pgtype/pgtype.go @@ -147,7 +147,7 @@ const ( BinaryFormatCode = 1 ) -// A Codec converts between Go and PostgreSQL values. +// A Codec converts between Go and PostgreSQL values. A Codec must not be mutated after it is registered with a Map. type Codec interface { // FormatSupported returns true if the format is supported. FormatSupported(int16) bool @@ -178,6 +178,7 @@ func (e *nullAssignmentError) Error() string { return fmt.Sprintf("cannot assign NULL to %T", e.dst) } +// Type represents a PostgreSQL data type. It must not be mutated after it is registered with a Map. type Type struct { Codec Codec Name string @@ -211,7 +212,9 @@ type Map struct { } func NewMap() *Map { - m := &Map{ + defaultMapInitOnce.Do(initDefaultMap) + + return &Map{ oidToType: make(map[uint32]*Type), nameToType: make(map[string]*Type), reflectTypeToName: make(map[reflect.Type]string), @@ -240,184 +243,9 @@ func NewMap() *Map { TryWrapPtrArrayScanPlan, }, } - - // Base types - m.RegisterType(&Type{Name: "aclitem", OID: ACLItemOID, Codec: &TextFormatOnlyCodec{TextCodec{}}}) - m.RegisterType(&Type{Name: "bit", OID: BitOID, Codec: BitsCodec{}}) - m.RegisterType(&Type{Name: "bool", OID: BoolOID, Codec: BoolCodec{}}) - m.RegisterType(&Type{Name: "box", OID: BoxOID, Codec: BoxCodec{}}) - m.RegisterType(&Type{Name: "bpchar", OID: BPCharOID, Codec: TextCodec{}}) - m.RegisterType(&Type{Name: "bytea", OID: ByteaOID, Codec: ByteaCodec{}}) - m.RegisterType(&Type{Name: "char", OID: QCharOID, Codec: QCharCodec{}}) - m.RegisterType(&Type{Name: "cid", OID: CIDOID, Codec: Uint32Codec{}}) - m.RegisterType(&Type{Name: "cidr", OID: CIDROID, Codec: InetCodec{}}) - m.RegisterType(&Type{Name: "circle", OID: CircleOID, Codec: CircleCodec{}}) - m.RegisterType(&Type{Name: "date", OID: DateOID, Codec: DateCodec{}}) - m.RegisterType(&Type{Name: "float4", OID: Float4OID, Codec: Float4Codec{}}) - m.RegisterType(&Type{Name: "float8", OID: Float8OID, Codec: Float8Codec{}}) - m.RegisterType(&Type{Name: "inet", OID: InetOID, Codec: InetCodec{}}) - m.RegisterType(&Type{Name: "int2", OID: Int2OID, Codec: Int2Codec{}}) - m.RegisterType(&Type{Name: "int4", OID: Int4OID, Codec: Int4Codec{}}) - m.RegisterType(&Type{Name: "int8", OID: Int8OID, Codec: Int8Codec{}}) - m.RegisterType(&Type{Name: "interval", OID: IntervalOID, Codec: IntervalCodec{}}) - m.RegisterType(&Type{Name: "json", OID: JSONOID, Codec: JSONCodec{}}) - m.RegisterType(&Type{Name: "jsonb", OID: JSONBOID, Codec: JSONBCodec{}}) - m.RegisterType(&Type{Name: "jsonpath", OID: JSONPathOID, Codec: &TextFormatOnlyCodec{TextCodec{}}}) - m.RegisterType(&Type{Name: "line", OID: LineOID, Codec: LineCodec{}}) - m.RegisterType(&Type{Name: "lseg", OID: LsegOID, Codec: LsegCodec{}}) - m.RegisterType(&Type{Name: "macaddr", OID: MacaddrOID, Codec: MacaddrCodec{}}) - m.RegisterType(&Type{Name: "name", OID: NameOID, Codec: TextCodec{}}) - m.RegisterType(&Type{Name: "numeric", OID: NumericOID, Codec: NumericCodec{}}) - m.RegisterType(&Type{Name: "oid", OID: OIDOID, Codec: Uint32Codec{}}) - m.RegisterType(&Type{Name: "path", OID: PathOID, Codec: PathCodec{}}) - m.RegisterType(&Type{Name: "point", OID: PointOID, Codec: PointCodec{}}) - m.RegisterType(&Type{Name: "polygon", OID: PolygonOID, Codec: PolygonCodec{}}) - m.RegisterType(&Type{Name: "record", OID: RecordOID, Codec: RecordCodec{}}) - m.RegisterType(&Type{Name: "text", OID: TextOID, Codec: TextCodec{}}) - m.RegisterType(&Type{Name: "tid", OID: TIDOID, Codec: TIDCodec{}}) - m.RegisterType(&Type{Name: "time", OID: TimeOID, Codec: TimeCodec{}}) - m.RegisterType(&Type{Name: "timestamp", OID: TimestampOID, Codec: TimestampCodec{}}) - m.RegisterType(&Type{Name: "timestamptz", OID: TimestamptzOID, Codec: TimestamptzCodec{}}) - m.RegisterType(&Type{Name: "unknown", OID: UnknownOID, Codec: TextCodec{}}) - m.RegisterType(&Type{Name: "uuid", OID: UUIDOID, Codec: UUIDCodec{}}) - m.RegisterType(&Type{Name: "varbit", OID: VarbitOID, Codec: BitsCodec{}}) - m.RegisterType(&Type{Name: "varchar", OID: VarcharOID, Codec: TextCodec{}}) - m.RegisterType(&Type{Name: "xid", OID: XIDOID, Codec: Uint32Codec{}}) - - // Range types - m.RegisterType(&Type{Name: "daterange", OID: DaterangeOID, Codec: &RangeCodec{ElementType: m.oidToType[DateOID]}}) - m.RegisterType(&Type{Name: "int4range", OID: Int4rangeOID, Codec: &RangeCodec{ElementType: m.oidToType[Int4OID]}}) - m.RegisterType(&Type{Name: "int8range", OID: Int8rangeOID, Codec: &RangeCodec{ElementType: m.oidToType[Int8OID]}}) - m.RegisterType(&Type{Name: "numrange", OID: NumrangeOID, Codec: &RangeCodec{ElementType: m.oidToType[NumericOID]}}) - m.RegisterType(&Type{Name: "tsrange", OID: TsrangeOID, Codec: &RangeCodec{ElementType: m.oidToType[TimestampOID]}}) - m.RegisterType(&Type{Name: "tstzrange", OID: TstzrangeOID, Codec: &RangeCodec{ElementType: m.oidToType[TimestamptzOID]}}) - - // Multirange types - m.RegisterType(&Type{Name: "datemultirange", OID: DatemultirangeOID, Codec: &MultirangeCodec{ElementType: m.oidToType[DaterangeOID]}}) - m.RegisterType(&Type{Name: "int4multirange", OID: Int4multirangeOID, Codec: &MultirangeCodec{ElementType: m.oidToType[Int4rangeOID]}}) - m.RegisterType(&Type{Name: "int8multirange", OID: Int8multirangeOID, Codec: &MultirangeCodec{ElementType: m.oidToType[Int8rangeOID]}}) - m.RegisterType(&Type{Name: "nummultirange", OID: NummultirangeOID, Codec: &MultirangeCodec{ElementType: m.oidToType[NumrangeOID]}}) - m.RegisterType(&Type{Name: "tsmultirange", OID: TsmultirangeOID, Codec: &MultirangeCodec{ElementType: m.oidToType[TsrangeOID]}}) - m.RegisterType(&Type{Name: "tstzmultirange", OID: TstzmultirangeOID, Codec: &MultirangeCodec{ElementType: m.oidToType[TstzrangeOID]}}) - - // Array types - m.RegisterType(&Type{Name: "_aclitem", OID: ACLItemArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[ACLItemOID]}}) - m.RegisterType(&Type{Name: "_bit", OID: BitArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[BitOID]}}) - m.RegisterType(&Type{Name: "_bool", OID: BoolArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[BoolOID]}}) - m.RegisterType(&Type{Name: "_box", OID: BoxArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[BoxOID]}}) - m.RegisterType(&Type{Name: "_bpchar", OID: BPCharArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[BPCharOID]}}) - m.RegisterType(&Type{Name: "_bytea", OID: ByteaArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[ByteaOID]}}) - m.RegisterType(&Type{Name: "_char", OID: QCharArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[QCharOID]}}) - m.RegisterType(&Type{Name: "_cid", OID: CIDArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[CIDOID]}}) - m.RegisterType(&Type{Name: "_cidr", OID: CIDRArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[CIDROID]}}) - m.RegisterType(&Type{Name: "_circle", OID: CircleArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[CircleOID]}}) - m.RegisterType(&Type{Name: "_date", OID: DateArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[DateOID]}}) - m.RegisterType(&Type{Name: "_daterange", OID: DaterangeArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[DaterangeOID]}}) - m.RegisterType(&Type{Name: "_float4", OID: Float4ArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[Float4OID]}}) - m.RegisterType(&Type{Name: "_float8", OID: Float8ArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[Float8OID]}}) - m.RegisterType(&Type{Name: "_inet", OID: InetArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[InetOID]}}) - m.RegisterType(&Type{Name: "_int2", OID: Int2ArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[Int2OID]}}) - m.RegisterType(&Type{Name: "_int4", OID: Int4ArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[Int4OID]}}) - m.RegisterType(&Type{Name: "_int4range", OID: Int4rangeArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[Int4rangeOID]}}) - m.RegisterType(&Type{Name: "_int8", OID: Int8ArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[Int8OID]}}) - m.RegisterType(&Type{Name: "_int8range", OID: Int8rangeArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[Int8rangeOID]}}) - m.RegisterType(&Type{Name: "_interval", OID: IntervalArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[IntervalOID]}}) - m.RegisterType(&Type{Name: "_json", OID: JSONArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[JSONOID]}}) - m.RegisterType(&Type{Name: "_jsonb", OID: JSONBArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[JSONBOID]}}) - m.RegisterType(&Type{Name: "_jsonpath", OID: JSONPathArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[JSONPathOID]}}) - m.RegisterType(&Type{Name: "_line", OID: LineArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[LineOID]}}) - m.RegisterType(&Type{Name: "_lseg", OID: LsegArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[LsegOID]}}) - m.RegisterType(&Type{Name: "_macaddr", OID: MacaddrArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[MacaddrOID]}}) - m.RegisterType(&Type{Name: "_name", OID: NameArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[NameOID]}}) - m.RegisterType(&Type{Name: "_numeric", OID: NumericArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[NumericOID]}}) - m.RegisterType(&Type{Name: "_numrange", OID: NumrangeArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[NumrangeOID]}}) - m.RegisterType(&Type{Name: "_oid", OID: OIDArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[OIDOID]}}) - m.RegisterType(&Type{Name: "_path", OID: PathArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[PathOID]}}) - m.RegisterType(&Type{Name: "_point", OID: PointArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[PointOID]}}) - m.RegisterType(&Type{Name: "_polygon", OID: PolygonArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[PolygonOID]}}) - m.RegisterType(&Type{Name: "_record", OID: RecordArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[RecordOID]}}) - m.RegisterType(&Type{Name: "_text", OID: TextArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[TextOID]}}) - m.RegisterType(&Type{Name: "_tid", OID: TIDArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[TIDOID]}}) - m.RegisterType(&Type{Name: "_time", OID: TimeArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[TimeOID]}}) - m.RegisterType(&Type{Name: "_timestamp", OID: TimestampArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[TimestampOID]}}) - m.RegisterType(&Type{Name: "_timestamptz", OID: TimestamptzArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[TimestamptzOID]}}) - m.RegisterType(&Type{Name: "_tsrange", OID: TsrangeArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[TsrangeOID]}}) - m.RegisterType(&Type{Name: "_tstzrange", OID: TstzrangeArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[TstzrangeOID]}}) - m.RegisterType(&Type{Name: "_uuid", OID: UUIDArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[UUIDOID]}}) - m.RegisterType(&Type{Name: "_varbit", OID: VarbitArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[VarbitOID]}}) - m.RegisterType(&Type{Name: "_varchar", OID: VarcharArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[VarcharOID]}}) - m.RegisterType(&Type{Name: "_xid", OID: XIDArrayOID, Codec: &ArrayCodec{ElementType: m.oidToType[XIDOID]}}) - - // Integer types that directly map to a PostgreSQL type - registerDefaultPgTypeVariants[int16](m, "int2") - registerDefaultPgTypeVariants[int32](m, "int4") - registerDefaultPgTypeVariants[int64](m, "int8") - - // Integer types that do not have a direct match to a PostgreSQL type - registerDefaultPgTypeVariants[int8](m, "int8") - registerDefaultPgTypeVariants[int](m, "int8") - registerDefaultPgTypeVariants[uint8](m, "int8") - registerDefaultPgTypeVariants[uint16](m, "int8") - registerDefaultPgTypeVariants[uint32](m, "int8") - registerDefaultPgTypeVariants[uint64](m, "numeric") - registerDefaultPgTypeVariants[uint](m, "numeric") - - registerDefaultPgTypeVariants[float32](m, "float4") - registerDefaultPgTypeVariants[float64](m, "float8") - - registerDefaultPgTypeVariants[bool](m, "bool") - registerDefaultPgTypeVariants[time.Time](m, "timestamptz") - registerDefaultPgTypeVariants[time.Duration](m, "interval") - registerDefaultPgTypeVariants[string](m, "text") - registerDefaultPgTypeVariants[[]byte](m, "bytea") - - registerDefaultPgTypeVariants[net.IP](m, "inet") - registerDefaultPgTypeVariants[net.IPNet](m, "cidr") - registerDefaultPgTypeVariants[netip.Addr](m, "inet") - registerDefaultPgTypeVariants[netip.Prefix](m, "cidr") - - // pgtype provided structs - registerDefaultPgTypeVariants[Bits](m, "varbit") - registerDefaultPgTypeVariants[Bool](m, "bool") - registerDefaultPgTypeVariants[Box](m, "box") - registerDefaultPgTypeVariants[Circle](m, "circle") - registerDefaultPgTypeVariants[Date](m, "date") - registerDefaultPgTypeVariants[Range[Date]](m, "daterange") - registerDefaultPgTypeVariants[Multirange[Range[Date]]](m, "datemultirange") - registerDefaultPgTypeVariants[Float4](m, "float4") - registerDefaultPgTypeVariants[Float8](m, "float8") - registerDefaultPgTypeVariants[Range[Float8]](m, "numrange") // There is no PostgreSQL builtin float8range so map it to numrange. - registerDefaultPgTypeVariants[Multirange[Range[Float8]]](m, "nummultirange") // There is no PostgreSQL builtin float8multirange so map it to nummultirange. - registerDefaultPgTypeVariants[Int2](m, "int2") - registerDefaultPgTypeVariants[Int4](m, "int4") - registerDefaultPgTypeVariants[Range[Int4]](m, "int4range") - registerDefaultPgTypeVariants[Multirange[Range[Int4]]](m, "int4multirange") - registerDefaultPgTypeVariants[Int8](m, "int8") - registerDefaultPgTypeVariants[Range[Int8]](m, "int8range") - registerDefaultPgTypeVariants[Multirange[Range[Int8]]](m, "int8multirange") - registerDefaultPgTypeVariants[Interval](m, "interval") - registerDefaultPgTypeVariants[Line](m, "line") - registerDefaultPgTypeVariants[Lseg](m, "lseg") - registerDefaultPgTypeVariants[Numeric](m, "numeric") - registerDefaultPgTypeVariants[Range[Numeric]](m, "numrange") - registerDefaultPgTypeVariants[Multirange[Range[Numeric]]](m, "nummultirange") - registerDefaultPgTypeVariants[Path](m, "path") - registerDefaultPgTypeVariants[Point](m, "point") - registerDefaultPgTypeVariants[Polygon](m, "polygon") - registerDefaultPgTypeVariants[TID](m, "tid") - registerDefaultPgTypeVariants[Text](m, "text") - registerDefaultPgTypeVariants[Time](m, "time") - registerDefaultPgTypeVariants[Timestamp](m, "timestamp") - registerDefaultPgTypeVariants[Timestamptz](m, "timestamptz") - registerDefaultPgTypeVariants[Range[Timestamp]](m, "tsrange") - registerDefaultPgTypeVariants[Multirange[Range[Timestamp]]](m, "tsmultirange") - registerDefaultPgTypeVariants[Range[Timestamptz]](m, "tstzrange") - registerDefaultPgTypeVariants[Multirange[Range[Timestamptz]]](m, "tstzmultirange") - registerDefaultPgTypeVariants[UUID](m, "uuid") - - return m } +// RegisterType registers a data type with the Map. t must not be mutated after it is registered. func (m *Map) RegisterType(t *Type) { m.oidToType[t.OID] = t m.nameToType[t.Name] = t @@ -449,13 +277,22 @@ func (m *Map) RegisterDefaultPgType(value any, name string) { } } +// TypeForOID returns the Type registered for the given OID. The returned Type must not be mutated. func (m *Map) TypeForOID(oid uint32) (*Type, bool) { - dt, ok := m.oidToType[oid] + if dt, ok := m.oidToType[oid]; ok { + return dt, true + } + + dt, ok := defaultMap.oidToType[oid] return dt, ok } +// TypeForName returns the Type registered for the given name. The returned Type must not be mutated. func (m *Map) TypeForName(name string) (*Type, bool) { - dt, ok := m.nameToType[name] + if dt, ok := m.nameToType[name]; ok { + return dt, true + } + dt, ok := defaultMap.nameToType[name] return dt, ok } @@ -463,30 +300,39 @@ func (m *Map) buildReflectTypeToType() { m.reflectTypeToType = make(map[reflect.Type]*Type) for reflectType, name := range m.reflectTypeToName { - if dt, ok := m.nameToType[name]; ok { + if dt, ok := m.TypeForName(name); ok { m.reflectTypeToType[reflectType] = dt } } } // TypeForValue finds a data type suitable for v. Use RegisterType to register types that can encode and decode -// themselves. Use RegisterDefaultPgType to register that can be handled by a registered data type. +// themselves. Use RegisterDefaultPgType to register that can be handled by a registered data type. The returned Type +// must not be mutated. func (m *Map) TypeForValue(v any) (*Type, bool) { if m.reflectTypeToType == nil { m.buildReflectTypeToType() } - dt, ok := m.reflectTypeToType[reflect.TypeOf(v)] + if dt, ok := m.reflectTypeToType[reflect.TypeOf(v)]; ok { + return dt, true + } + + dt, ok := defaultMap.reflectTypeToType[reflect.TypeOf(v)] return dt, ok } // FormatCodeForOID returns the preferred format code for type oid. If the type is not registered it returns the text // format code. func (m *Map) FormatCodeForOID(oid uint32) int16 { - fc, ok := m.oidToFormatCode[oid] - if ok { + if fc, ok := m.oidToFormatCode[oid]; ok { return fc } + + if fc, ok := defaultMap.oidToFormatCode[oid]; ok { + return fc + } + return TextFormatCode } @@ -587,6 +433,14 @@ func (plan *scanPlanFail) Scan(src []byte, dst any) error { return plan.Scan(src, dst) } } + for oid := range defaultMap.oidToType { + if _, ok := plan.m.oidToType[oid]; !ok { + plan := plan.m.planScan(oid, plan.formatCode, dst) + if _, ok := plan.(*scanPlanFail); !ok { + return plan.Scan(src, dst) + } + } + } } var format string @@ -600,7 +454,7 @@ func (plan *scanPlanFail) Scan(src []byte, dst any) error { } var dataTypeName string - if t, ok := plan.m.oidToType[plan.oid]; ok { + if t, ok := plan.m.TypeForOID(plan.oid); ok { dataTypeName = t.Name } else { dataTypeName = "unknown type" @@ -666,6 +520,7 @@ var elemKindToPointerTypes map[reflect.Kind]reflect.Type = map[reflect.Kind]refl reflect.Float32: reflect.TypeOf(new(float32)), reflect.Float64: reflect.TypeOf(new(float64)), reflect.String: reflect.TypeOf(new(string)), + reflect.Bool: reflect.TypeOf(new(bool)), } type underlyingTypeScanPlan struct { @@ -1089,15 +944,16 @@ func TryWrapPtrSliceScanPlan(target any) (plan WrappedScanPlanNextSetter, nextVa return &wrapPtrSliceScanPlan[time.Time]{}, (*FlatArray[time.Time])(target), true } - targetValue := reflect.ValueOf(target) - if targetValue.Kind() != reflect.Ptr { + targetType := reflect.TypeOf(target) + if targetType.Kind() != reflect.Ptr { return nil, nil, false } - targetElemValue := targetValue.Elem() + targetElemType := targetType.Elem() - if targetElemValue.Kind() == reflect.Slice { - return &wrapPtrSliceReflectScanPlan{}, &anySliceArrayReflect{slice: targetElemValue}, true + if targetElemType.Kind() == reflect.Slice { + slice := reflect.New(targetElemType).Elem() + return &wrapPtrSliceReflectScanPlan{}, &anySliceArrayReflect{slice: slice}, true } return nil, nil, false } @@ -1198,6 +1054,10 @@ func (m *Map) PlanScan(oid uint32, formatCode int16, target any) ScanPlan { } func (m *Map) planScan(oid uint32, formatCode int16, target any) ScanPlan { + if target == nil { + return &scanPlanFail{m: m, oid: oid, formatCode: formatCode} + } + if _, ok := target.(*UndecodedBytes); ok { return scanPlanAnyToUndecodedBytes{} } @@ -1514,6 +1374,7 @@ var kindToTypes map[reflect.Kind]reflect.Type = map[reflect.Kind]reflect.Type{ reflect.Float32: reflect.TypeOf(float32(0)), reflect.Float64: reflect.TypeOf(float64(0)), reflect.String: reflect.TypeOf(""), + reflect.Bool: reflect.TypeOf(false), } type underlyingTypeEncodePlan struct { @@ -2039,13 +1900,13 @@ func newEncodeError(value any, m *Map, oid uint32, formatCode int16, err error) } var dataTypeName string - if t, ok := m.oidToType[oid]; ok { + if t, ok := m.TypeForOID(oid); ok { dataTypeName = t.Name } else { dataTypeName = "unknown type" } - return fmt.Errorf("unable to encode %#v into %s format for %s (OID %d): %s", value, format, dataTypeName, oid, err) + return fmt.Errorf("unable to encode %#v into %s format for %s (OID %d): %w", value, format, dataTypeName, oid, err) } // Encode appends the encoded bytes of value to buf. If value is the SQL value NULL then append nothing and return diff --git a/vendor/github.com/jackc/pgx/v5/pgtype/pgtype_default.go b/vendor/github.com/jackc/pgx/v5/pgtype/pgtype_default.go new file mode 100644 index 00000000..58f4b92c --- /dev/null +++ b/vendor/github.com/jackc/pgx/v5/pgtype/pgtype_default.go @@ -0,0 +1,223 @@ +package pgtype + +import ( + "net" + "net/netip" + "reflect" + "sync" + "time" +) + +var ( + // defaultMap contains default mappings between PostgreSQL server types and Go type handling logic. + defaultMap *Map + defaultMapInitOnce = sync.Once{} +) + +func initDefaultMap() { + defaultMap = &Map{ + oidToType: make(map[uint32]*Type), + nameToType: make(map[string]*Type), + reflectTypeToName: make(map[reflect.Type]string), + oidToFormatCode: make(map[uint32]int16), + + memoizedScanPlans: make(map[uint32]map[reflect.Type][2]ScanPlan), + memoizedEncodePlans: make(map[uint32]map[reflect.Type][2]EncodePlan), + + TryWrapEncodePlanFuncs: []TryWrapEncodePlanFunc{ + TryWrapDerefPointerEncodePlan, + TryWrapBuiltinTypeEncodePlan, + TryWrapFindUnderlyingTypeEncodePlan, + TryWrapStructEncodePlan, + TryWrapSliceEncodePlan, + TryWrapMultiDimSliceEncodePlan, + TryWrapArrayEncodePlan, + }, + + TryWrapScanPlanFuncs: []TryWrapScanPlanFunc{ + TryPointerPointerScanPlan, + TryWrapBuiltinTypeScanPlan, + TryFindUnderlyingTypeScanPlan, + TryWrapStructScanPlan, + TryWrapPtrSliceScanPlan, + TryWrapPtrMultiDimSliceScanPlan, + TryWrapPtrArrayScanPlan, + }, + } + + // Base types + defaultMap.RegisterType(&Type{Name: "aclitem", OID: ACLItemOID, Codec: &TextFormatOnlyCodec{TextCodec{}}}) + defaultMap.RegisterType(&Type{Name: "bit", OID: BitOID, Codec: BitsCodec{}}) + defaultMap.RegisterType(&Type{Name: "bool", OID: BoolOID, Codec: BoolCodec{}}) + defaultMap.RegisterType(&Type{Name: "box", OID: BoxOID, Codec: BoxCodec{}}) + defaultMap.RegisterType(&Type{Name: "bpchar", OID: BPCharOID, Codec: TextCodec{}}) + defaultMap.RegisterType(&Type{Name: "bytea", OID: ByteaOID, Codec: ByteaCodec{}}) + defaultMap.RegisterType(&Type{Name: "char", OID: QCharOID, Codec: QCharCodec{}}) + defaultMap.RegisterType(&Type{Name: "cid", OID: CIDOID, Codec: Uint32Codec{}}) + defaultMap.RegisterType(&Type{Name: "cidr", OID: CIDROID, Codec: InetCodec{}}) + defaultMap.RegisterType(&Type{Name: "circle", OID: CircleOID, Codec: CircleCodec{}}) + defaultMap.RegisterType(&Type{Name: "date", OID: DateOID, Codec: DateCodec{}}) + defaultMap.RegisterType(&Type{Name: "float4", OID: Float4OID, Codec: Float4Codec{}}) + defaultMap.RegisterType(&Type{Name: "float8", OID: Float8OID, Codec: Float8Codec{}}) + defaultMap.RegisterType(&Type{Name: "inet", OID: InetOID, Codec: InetCodec{}}) + defaultMap.RegisterType(&Type{Name: "int2", OID: Int2OID, Codec: Int2Codec{}}) + defaultMap.RegisterType(&Type{Name: "int4", OID: Int4OID, Codec: Int4Codec{}}) + defaultMap.RegisterType(&Type{Name: "int8", OID: Int8OID, Codec: Int8Codec{}}) + defaultMap.RegisterType(&Type{Name: "interval", OID: IntervalOID, Codec: IntervalCodec{}}) + defaultMap.RegisterType(&Type{Name: "json", OID: JSONOID, Codec: JSONCodec{}}) + defaultMap.RegisterType(&Type{Name: "jsonb", OID: JSONBOID, Codec: JSONBCodec{}}) + defaultMap.RegisterType(&Type{Name: "jsonpath", OID: JSONPathOID, Codec: &TextFormatOnlyCodec{TextCodec{}}}) + defaultMap.RegisterType(&Type{Name: "line", OID: LineOID, Codec: LineCodec{}}) + defaultMap.RegisterType(&Type{Name: "lseg", OID: LsegOID, Codec: LsegCodec{}}) + defaultMap.RegisterType(&Type{Name: "macaddr", OID: MacaddrOID, Codec: MacaddrCodec{}}) + defaultMap.RegisterType(&Type{Name: "name", OID: NameOID, Codec: TextCodec{}}) + defaultMap.RegisterType(&Type{Name: "numeric", OID: NumericOID, Codec: NumericCodec{}}) + defaultMap.RegisterType(&Type{Name: "oid", OID: OIDOID, Codec: Uint32Codec{}}) + defaultMap.RegisterType(&Type{Name: "path", OID: PathOID, Codec: PathCodec{}}) + defaultMap.RegisterType(&Type{Name: "point", OID: PointOID, Codec: PointCodec{}}) + defaultMap.RegisterType(&Type{Name: "polygon", OID: PolygonOID, Codec: PolygonCodec{}}) + defaultMap.RegisterType(&Type{Name: "record", OID: RecordOID, Codec: RecordCodec{}}) + defaultMap.RegisterType(&Type{Name: "text", OID: TextOID, Codec: TextCodec{}}) + defaultMap.RegisterType(&Type{Name: "tid", OID: TIDOID, Codec: TIDCodec{}}) + defaultMap.RegisterType(&Type{Name: "time", OID: TimeOID, Codec: TimeCodec{}}) + defaultMap.RegisterType(&Type{Name: "timestamp", OID: TimestampOID, Codec: TimestampCodec{}}) + defaultMap.RegisterType(&Type{Name: "timestamptz", OID: TimestamptzOID, Codec: TimestamptzCodec{}}) + defaultMap.RegisterType(&Type{Name: "unknown", OID: UnknownOID, Codec: TextCodec{}}) + defaultMap.RegisterType(&Type{Name: "uuid", OID: UUIDOID, Codec: UUIDCodec{}}) + defaultMap.RegisterType(&Type{Name: "varbit", OID: VarbitOID, Codec: BitsCodec{}}) + defaultMap.RegisterType(&Type{Name: "varchar", OID: VarcharOID, Codec: TextCodec{}}) + defaultMap.RegisterType(&Type{Name: "xid", OID: XIDOID, Codec: Uint32Codec{}}) + + // Range types + defaultMap.RegisterType(&Type{Name: "daterange", OID: DaterangeOID, Codec: &RangeCodec{ElementType: defaultMap.oidToType[DateOID]}}) + defaultMap.RegisterType(&Type{Name: "int4range", OID: Int4rangeOID, Codec: &RangeCodec{ElementType: defaultMap.oidToType[Int4OID]}}) + defaultMap.RegisterType(&Type{Name: "int8range", OID: Int8rangeOID, Codec: &RangeCodec{ElementType: defaultMap.oidToType[Int8OID]}}) + defaultMap.RegisterType(&Type{Name: "numrange", OID: NumrangeOID, Codec: &RangeCodec{ElementType: defaultMap.oidToType[NumericOID]}}) + defaultMap.RegisterType(&Type{Name: "tsrange", OID: TsrangeOID, Codec: &RangeCodec{ElementType: defaultMap.oidToType[TimestampOID]}}) + defaultMap.RegisterType(&Type{Name: "tstzrange", OID: TstzrangeOID, Codec: &RangeCodec{ElementType: defaultMap.oidToType[TimestamptzOID]}}) + + // Multirange types + defaultMap.RegisterType(&Type{Name: "datemultirange", OID: DatemultirangeOID, Codec: &MultirangeCodec{ElementType: defaultMap.oidToType[DaterangeOID]}}) + defaultMap.RegisterType(&Type{Name: "int4multirange", OID: Int4multirangeOID, Codec: &MultirangeCodec{ElementType: defaultMap.oidToType[Int4rangeOID]}}) + defaultMap.RegisterType(&Type{Name: "int8multirange", OID: Int8multirangeOID, Codec: &MultirangeCodec{ElementType: defaultMap.oidToType[Int8rangeOID]}}) + defaultMap.RegisterType(&Type{Name: "nummultirange", OID: NummultirangeOID, Codec: &MultirangeCodec{ElementType: defaultMap.oidToType[NumrangeOID]}}) + defaultMap.RegisterType(&Type{Name: "tsmultirange", OID: TsmultirangeOID, Codec: &MultirangeCodec{ElementType: defaultMap.oidToType[TsrangeOID]}}) + defaultMap.RegisterType(&Type{Name: "tstzmultirange", OID: TstzmultirangeOID, Codec: &MultirangeCodec{ElementType: defaultMap.oidToType[TstzrangeOID]}}) + + // Array types + defaultMap.RegisterType(&Type{Name: "_aclitem", OID: ACLItemArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[ACLItemOID]}}) + defaultMap.RegisterType(&Type{Name: "_bit", OID: BitArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[BitOID]}}) + defaultMap.RegisterType(&Type{Name: "_bool", OID: BoolArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[BoolOID]}}) + defaultMap.RegisterType(&Type{Name: "_box", OID: BoxArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[BoxOID]}}) + defaultMap.RegisterType(&Type{Name: "_bpchar", OID: BPCharArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[BPCharOID]}}) + defaultMap.RegisterType(&Type{Name: "_bytea", OID: ByteaArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[ByteaOID]}}) + defaultMap.RegisterType(&Type{Name: "_char", OID: QCharArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[QCharOID]}}) + defaultMap.RegisterType(&Type{Name: "_cid", OID: CIDArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[CIDOID]}}) + defaultMap.RegisterType(&Type{Name: "_cidr", OID: CIDRArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[CIDROID]}}) + defaultMap.RegisterType(&Type{Name: "_circle", OID: CircleArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[CircleOID]}}) + defaultMap.RegisterType(&Type{Name: "_date", OID: DateArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[DateOID]}}) + defaultMap.RegisterType(&Type{Name: "_daterange", OID: DaterangeArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[DaterangeOID]}}) + defaultMap.RegisterType(&Type{Name: "_float4", OID: Float4ArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[Float4OID]}}) + defaultMap.RegisterType(&Type{Name: "_float8", OID: Float8ArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[Float8OID]}}) + defaultMap.RegisterType(&Type{Name: "_inet", OID: InetArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[InetOID]}}) + defaultMap.RegisterType(&Type{Name: "_int2", OID: Int2ArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[Int2OID]}}) + defaultMap.RegisterType(&Type{Name: "_int4", OID: Int4ArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[Int4OID]}}) + defaultMap.RegisterType(&Type{Name: "_int4range", OID: Int4rangeArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[Int4rangeOID]}}) + defaultMap.RegisterType(&Type{Name: "_int8", OID: Int8ArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[Int8OID]}}) + defaultMap.RegisterType(&Type{Name: "_int8range", OID: Int8rangeArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[Int8rangeOID]}}) + defaultMap.RegisterType(&Type{Name: "_interval", OID: IntervalArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[IntervalOID]}}) + defaultMap.RegisterType(&Type{Name: "_json", OID: JSONArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[JSONOID]}}) + defaultMap.RegisterType(&Type{Name: "_jsonb", OID: JSONBArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[JSONBOID]}}) + defaultMap.RegisterType(&Type{Name: "_jsonpath", OID: JSONPathArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[JSONPathOID]}}) + defaultMap.RegisterType(&Type{Name: "_line", OID: LineArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[LineOID]}}) + defaultMap.RegisterType(&Type{Name: "_lseg", OID: LsegArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[LsegOID]}}) + defaultMap.RegisterType(&Type{Name: "_macaddr", OID: MacaddrArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[MacaddrOID]}}) + defaultMap.RegisterType(&Type{Name: "_name", OID: NameArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[NameOID]}}) + defaultMap.RegisterType(&Type{Name: "_numeric", OID: NumericArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[NumericOID]}}) + defaultMap.RegisterType(&Type{Name: "_numrange", OID: NumrangeArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[NumrangeOID]}}) + defaultMap.RegisterType(&Type{Name: "_oid", OID: OIDArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[OIDOID]}}) + defaultMap.RegisterType(&Type{Name: "_path", OID: PathArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[PathOID]}}) + defaultMap.RegisterType(&Type{Name: "_point", OID: PointArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[PointOID]}}) + defaultMap.RegisterType(&Type{Name: "_polygon", OID: PolygonArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[PolygonOID]}}) + defaultMap.RegisterType(&Type{Name: "_record", OID: RecordArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[RecordOID]}}) + defaultMap.RegisterType(&Type{Name: "_text", OID: TextArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[TextOID]}}) + defaultMap.RegisterType(&Type{Name: "_tid", OID: TIDArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[TIDOID]}}) + defaultMap.RegisterType(&Type{Name: "_time", OID: TimeArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[TimeOID]}}) + defaultMap.RegisterType(&Type{Name: "_timestamp", OID: TimestampArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[TimestampOID]}}) + defaultMap.RegisterType(&Type{Name: "_timestamptz", OID: TimestamptzArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[TimestamptzOID]}}) + defaultMap.RegisterType(&Type{Name: "_tsrange", OID: TsrangeArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[TsrangeOID]}}) + defaultMap.RegisterType(&Type{Name: "_tstzrange", OID: TstzrangeArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[TstzrangeOID]}}) + defaultMap.RegisterType(&Type{Name: "_uuid", OID: UUIDArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[UUIDOID]}}) + defaultMap.RegisterType(&Type{Name: "_varbit", OID: VarbitArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[VarbitOID]}}) + defaultMap.RegisterType(&Type{Name: "_varchar", OID: VarcharArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[VarcharOID]}}) + defaultMap.RegisterType(&Type{Name: "_xid", OID: XIDArrayOID, Codec: &ArrayCodec{ElementType: defaultMap.oidToType[XIDOID]}}) + + // Integer types that directly map to a PostgreSQL type + registerDefaultPgTypeVariants[int16](defaultMap, "int2") + registerDefaultPgTypeVariants[int32](defaultMap, "int4") + registerDefaultPgTypeVariants[int64](defaultMap, "int8") + + // Integer types that do not have a direct match to a PostgreSQL type + registerDefaultPgTypeVariants[int8](defaultMap, "int8") + registerDefaultPgTypeVariants[int](defaultMap, "int8") + registerDefaultPgTypeVariants[uint8](defaultMap, "int8") + registerDefaultPgTypeVariants[uint16](defaultMap, "int8") + registerDefaultPgTypeVariants[uint32](defaultMap, "int8") + registerDefaultPgTypeVariants[uint64](defaultMap, "numeric") + registerDefaultPgTypeVariants[uint](defaultMap, "numeric") + + registerDefaultPgTypeVariants[float32](defaultMap, "float4") + registerDefaultPgTypeVariants[float64](defaultMap, "float8") + + registerDefaultPgTypeVariants[bool](defaultMap, "bool") + registerDefaultPgTypeVariants[time.Time](defaultMap, "timestamptz") + registerDefaultPgTypeVariants[time.Duration](defaultMap, "interval") + registerDefaultPgTypeVariants[string](defaultMap, "text") + registerDefaultPgTypeVariants[[]byte](defaultMap, "bytea") + + registerDefaultPgTypeVariants[net.IP](defaultMap, "inet") + registerDefaultPgTypeVariants[net.IPNet](defaultMap, "cidr") + registerDefaultPgTypeVariants[netip.Addr](defaultMap, "inet") + registerDefaultPgTypeVariants[netip.Prefix](defaultMap, "cidr") + + // pgtype provided structs + registerDefaultPgTypeVariants[Bits](defaultMap, "varbit") + registerDefaultPgTypeVariants[Bool](defaultMap, "bool") + registerDefaultPgTypeVariants[Box](defaultMap, "box") + registerDefaultPgTypeVariants[Circle](defaultMap, "circle") + registerDefaultPgTypeVariants[Date](defaultMap, "date") + registerDefaultPgTypeVariants[Range[Date]](defaultMap, "daterange") + registerDefaultPgTypeVariants[Multirange[Range[Date]]](defaultMap, "datemultirange") + registerDefaultPgTypeVariants[Float4](defaultMap, "float4") + registerDefaultPgTypeVariants[Float8](defaultMap, "float8") + registerDefaultPgTypeVariants[Range[Float8]](defaultMap, "numrange") // There is no PostgreSQL builtin float8range so map it to numrange. + registerDefaultPgTypeVariants[Multirange[Range[Float8]]](defaultMap, "nummultirange") // There is no PostgreSQL builtin float8multirange so map it to nummultirange. + registerDefaultPgTypeVariants[Int2](defaultMap, "int2") + registerDefaultPgTypeVariants[Int4](defaultMap, "int4") + registerDefaultPgTypeVariants[Range[Int4]](defaultMap, "int4range") + registerDefaultPgTypeVariants[Multirange[Range[Int4]]](defaultMap, "int4multirange") + registerDefaultPgTypeVariants[Int8](defaultMap, "int8") + registerDefaultPgTypeVariants[Range[Int8]](defaultMap, "int8range") + registerDefaultPgTypeVariants[Multirange[Range[Int8]]](defaultMap, "int8multirange") + registerDefaultPgTypeVariants[Interval](defaultMap, "interval") + registerDefaultPgTypeVariants[Line](defaultMap, "line") + registerDefaultPgTypeVariants[Lseg](defaultMap, "lseg") + registerDefaultPgTypeVariants[Numeric](defaultMap, "numeric") + registerDefaultPgTypeVariants[Range[Numeric]](defaultMap, "numrange") + registerDefaultPgTypeVariants[Multirange[Range[Numeric]]](defaultMap, "nummultirange") + registerDefaultPgTypeVariants[Path](defaultMap, "path") + registerDefaultPgTypeVariants[Point](defaultMap, "point") + registerDefaultPgTypeVariants[Polygon](defaultMap, "polygon") + registerDefaultPgTypeVariants[TID](defaultMap, "tid") + registerDefaultPgTypeVariants[Text](defaultMap, "text") + registerDefaultPgTypeVariants[Time](defaultMap, "time") + registerDefaultPgTypeVariants[Timestamp](defaultMap, "timestamp") + registerDefaultPgTypeVariants[Timestamptz](defaultMap, "timestamptz") + registerDefaultPgTypeVariants[Range[Timestamp]](defaultMap, "tsrange") + registerDefaultPgTypeVariants[Multirange[Range[Timestamp]]](defaultMap, "tsmultirange") + registerDefaultPgTypeVariants[Range[Timestamptz]](defaultMap, "tstzrange") + registerDefaultPgTypeVariants[Multirange[Range[Timestamptz]]](defaultMap, "tstzmultirange") + registerDefaultPgTypeVariants[UUID](defaultMap, "uuid") + + defaultMap.buildReflectTypeToType() +} diff --git a/vendor/github.com/jackc/pgx/v5/pgtype/timestamp.go b/vendor/github.com/jackc/pgx/v5/pgtype/timestamp.go index 9f3de2c5..35d73956 100644 --- a/vendor/github.com/jackc/pgx/v5/pgtype/timestamp.go +++ b/vendor/github.com/jackc/pgx/v5/pgtype/timestamp.go @@ -3,6 +3,7 @@ package pgtype import ( "database/sql/driver" "encoding/binary" + "encoding/json" "fmt" "strings" "time" @@ -66,6 +67,55 @@ func (ts Timestamp) Value() (driver.Value, error) { return ts.Time, nil } +func (ts Timestamp) MarshalJSON() ([]byte, error) { + if !ts.Valid { + return []byte("null"), nil + } + + var s string + + switch ts.InfinityModifier { + case Finite: + s = ts.Time.Format(time.RFC3339Nano) + case Infinity: + s = "infinity" + case NegativeInfinity: + s = "-infinity" + } + + return json.Marshal(s) +} + +func (ts *Timestamp) UnmarshalJSON(b []byte) error { + var s *string + err := json.Unmarshal(b, &s) + if err != nil { + return err + } + + if s == nil { + *ts = Timestamp{} + return nil + } + + switch *s { + case "infinity": + *ts = Timestamp{Valid: true, InfinityModifier: Infinity} + case "-infinity": + *ts = Timestamp{Valid: true, InfinityModifier: -Infinity} + default: + // PostgreSQL uses ISO 8601 for to_json function and casting from a string to timestamptz + tim, err := time.Parse(time.RFC3339Nano, *s) + if err != nil { + return err + } + + *ts = Timestamp{Time: tim, Valid: true} + } + + return nil +} + type TimestampCodec struct{} func (TimestampCodec) FormatSupported(format int16) bool { diff --git a/vendor/github.com/jackc/pgx/v5/rows.go b/vendor/github.com/jackc/pgx/v5/rows.go index ffe739b0..cdd72a25 100644 --- a/vendor/github.com/jackc/pgx/v5/rows.go +++ b/vendor/github.com/jackc/pgx/v5/rows.go @@ -28,12 +28,16 @@ type Rows interface { // to call Close after rows is already closed. Close() - // Err returns any error that occurred while reading. + // Err returns any error that occurred while reading. Err must only be called after the Rows is closed (either by + // calling Close or by Next returning false). If it is called early it may return nil even if there was an error + // executing the query. Err() error // CommandTag returns the command tag from this query. It is only available after Rows is closed. CommandTag() pgconn.CommandTag + // FieldDescriptions returns the field descriptions of the columns. It may return nil. In particular this can occur + // when there was an error executing the query. FieldDescriptions() []pgconn.FieldDescription // Next prepares the next row for reading. It returns true if there is another @@ -533,13 +537,11 @@ func (rs *positionalStructRowScanner) appendScanTargets(dstElemValue reflect.Val for i := 0; i < dstElemType.NumField(); i++ { sf := dstElemType.Field(i) - if sf.PkgPath == "" { - // Handle anonymous struct embedding, but do not try to handle embedded pointers. - if sf.Anonymous && sf.Type.Kind() == reflect.Struct { - scanTargets = rs.appendScanTargets(dstElemValue.Field(i), scanTargets) - } else { - scanTargets = append(scanTargets, dstElemValue.Field(i).Addr().Interface()) - } + // Handle anonymous struct embedding, but do not try to handle embedded pointers. + if sf.Anonymous && sf.Type.Kind() == reflect.Struct { + scanTargets = rs.appendScanTargets(dstElemValue.Field(i), scanTargets) + } else if sf.PkgPath == "" { + scanTargets = append(scanTargets, dstElemValue.Field(i).Addr().Interface()) } } @@ -565,8 +567,28 @@ func RowToAddrOfStructByName[T any](row CollectableRow) (*T, error) { return &value, err } +// RowToStructByNameLax returns a T scanned from row. T must be a struct. T must have greater than or equal number of named public +// fields as row has fields. The row and T fields will by matched by name. The match is case-insensitive. The database +// column name can be overridden with a "db" struct tag. If the "db" struct tag is "-" then the field will be ignored. +func RowToStructByNameLax[T any](row CollectableRow) (T, error) { + var value T + err := row.Scan(&namedStructRowScanner{ptrToStruct: &value, lax: true}) + return value, err +} + +// RowToAddrOfStructByNameLax returns the address of a T scanned from row. T must be a struct. T must have greater than or +// equal number of named public fields as row has fields. The row and T fields will by matched by name. The match is +// case-insensitive. The database column name can be overridden with a "db" struct tag. If the "db" struct tag is "-" +// then the field will be ignored. +func RowToAddrOfStructByNameLax[T any](row CollectableRow) (*T, error) { + var value T + err := row.Scan(&namedStructRowScanner{ptrToStruct: &value, lax: true}) + return &value, err +} + type namedStructRowScanner struct { ptrToStruct any + lax bool } func (rs *namedStructRowScanner) ScanRow(rows Rows) error { @@ -578,7 +600,6 @@ func (rs *namedStructRowScanner) ScanRow(rows Rows) error { dstElemValue := dstValue.Elem() scanTargets, err := rs.appendScanTargets(dstElemValue, nil, rows.FieldDescriptions()) - if err != nil { return err } @@ -638,7 +659,13 @@ func (rs *namedStructRowScanner) appendScanTargets(dstElemValue reflect.Value, s colName = sf.Name } fpos := fieldPosByName(fldDescs, colName) - if fpos == -1 || fpos >= len(scanTargets) { + if fpos == -1 { + if rs.lax { + continue + } + return nil, fmt.Errorf("cannot find field %s in returned row", colName) + } + if fpos >= len(scanTargets) && !rs.lax { return nil, fmt.Errorf("cannot find field %s in returned row", colName) } scanTargets[fpos] = dstElemValue.Field(i).Addr().Interface() diff --git a/vendor/github.com/jackc/pgx/v5/tx.go b/vendor/github.com/jackc/pgx/v5/tx.go index e57142a6..575c17a7 100644 --- a/vendor/github.com/jackc/pgx/v5/tx.go +++ b/vendor/github.com/jackc/pgx/v5/tx.go @@ -44,6 +44,10 @@ type TxOptions struct { IsoLevel TxIsoLevel AccessMode TxAccessMode DeferrableMode TxDeferrableMode + + // BeginQuery is the SQL query that will be executed to begin the transaction. This allows using non-standard syntax + // such as BEGIN PRIORITY HIGH with CockroachDB. If set this will override the other settings. + BeginQuery string } var emptyTxOptions TxOptions @@ -53,6 +57,10 @@ func (txOptions TxOptions) beginSQL() string { return "begin" } + if txOptions.BeginQuery != "" { + return txOptions.BeginQuery + } + var buf strings.Builder buf.Grow(64) // 64 - maximum length of string with available options buf.WriteString("begin") diff --git a/vendor/github.com/klauspost/compress/README.md b/vendor/github.com/klauspost/compress/README.md index efab55e6..f710a34e 100644 --- a/vendor/github.com/klauspost/compress/README.md +++ b/vendor/github.com/klauspost/compress/README.md @@ -16,6 +16,10 @@ This package provides various compression algorithms. # changelog +* Apr 16, 2023 - [v1.16.5](https://github.com/klauspost/compress/releases/tag/v1.16.5) + * zstd: readByte needs to use io.ReadFull by @jnoxon in https://github.com/klauspost/compress/pull/802 + * gzip: Fix WriterTo after initial read https://github.com/klauspost/compress/pull/804 + * Apr 5, 2023 - [v1.16.4](https://github.com/klauspost/compress/releases/tag/v1.16.4) * zstd: Improve zstd best efficiency by @greatroar and @klauspost in https://github.com/klauspost/compress/pull/784 * zstd: Respect WithAllLitEntropyCompression https://github.com/klauspost/compress/pull/792 diff --git a/vendor/github.com/klauspost/compress/SECURITY.md b/vendor/github.com/klauspost/compress/SECURITY.md new file mode 100644 index 00000000..23a43387 --- /dev/null +++ b/vendor/github.com/klauspost/compress/SECURITY.md @@ -0,0 +1,25 @@ +# Security Policy + +## Supported Versions + +Security updates are applied only to the latest release. + +## Vulnerability Definition + +A security vulnerability is a bug that with certain input triggers a crash or an infinite loop. Most calls will have varying execution time and only in rare cases will slow operation be considered a security vulnerability. + +Corrupted output generally is not considered a security vulnerability, unless independent operations are able to affect each other. Note that not all functionality is re-entrant and safe to use concurrently. + +Out-of-memory crashes only applies if the en/decoder uses an abnormal amount of memory, with appropriate options applied, to limit maximum window size, concurrency, etc. However, if you are in doubt you are welcome to file a security issue. + +It is assumed that all callers are trusted, meaning internal data exposed through reflection or inspection of returned data structures is not considered a vulnerability. + +Vulnerabilities resulting from compiler/assembler errors should be reported upstream. Depending on the severity this package may or may not implement a workaround. + +## Reporting a Vulnerability + +If you have discovered a security vulnerability in this project, please report it privately. **Do not disclose it as a public issue.** This gives us time to work with you to fix the issue before public exposure, reducing the chance that the exploit will be used before a patch is released. + +Please disclose it at [security advisory](https://github.com/klaupost/compress/security/advisories/new). If possible please provide a minimal reproducer. If the issue only applies to a single platform, it would be helpful to provide access to that. + +This project is maintained by a team of volunteers on a reasonable-effort basis. As such, vulnerabilities will be disclosed in a best effort base. diff --git a/vendor/github.com/klauspost/compress/flate/deflate.go b/vendor/github.com/klauspost/compress/flate/deflate.go index 82882961..5faea0b2 100644 --- a/vendor/github.com/klauspost/compress/flate/deflate.go +++ b/vendor/github.com/klauspost/compress/flate/deflate.go @@ -90,9 +90,8 @@ type advancedState struct { ii uint16 // position of last match, intended to overflow to reset. // input window: unprocessed data is window[index:windowEnd] - index int - estBitsPerByte int - hashMatch [maxMatchLength + minMatchLength]uint32 + index int + hashMatch [maxMatchLength + minMatchLength]uint32 // Input hash chains // hashHead[hashValue] contains the largest inputIndex with the specified hash value diff --git a/vendor/github.com/klauspost/compress/flate/huffman_bit_writer.go b/vendor/github.com/klauspost/compress/flate/huffman_bit_writer.go index 89a5dd89..f70594c3 100644 --- a/vendor/github.com/klauspost/compress/flate/huffman_bit_writer.go +++ b/vendor/github.com/klauspost/compress/flate/huffman_bit_writer.go @@ -34,11 +34,6 @@ const ( // Should preferably be a multiple of 6, since // we accumulate 6 bytes between writes to the buffer. bufferFlushSize = 246 - - // bufferSize is the actual output byte buffer size. - // It must have additional headroom for a flush - // which can contain up to 8 bytes. - bufferSize = bufferFlushSize + 8 ) // Minimum length code that emits bits. diff --git a/vendor/github.com/klauspost/compress/flate/huffman_sortByFreq.go b/vendor/github.com/klauspost/compress/flate/huffman_sortByFreq.go index 20778029..6c05ba8c 100644 --- a/vendor/github.com/klauspost/compress/flate/huffman_sortByFreq.go +++ b/vendor/github.com/klauspost/compress/flate/huffman_sortByFreq.go @@ -42,25 +42,6 @@ func quickSortByFreq(data []literalNode, a, b, maxDepth int) { } } -// siftDownByFreq implements the heap property on data[lo, hi). -// first is an offset into the array where the root of the heap lies. -func siftDownByFreq(data []literalNode, lo, hi, first int) { - root := lo - for { - child := 2*root + 1 - if child >= hi { - break - } - if child+1 < hi && (data[first+child].freq == data[first+child+1].freq && data[first+child].literal < data[first+child+1].literal || data[first+child].freq < data[first+child+1].freq) { - child++ - } - if data[first+root].freq == data[first+child].freq && data[first+root].literal > data[first+child].literal || data[first+root].freq > data[first+child].freq { - return - } - data[first+root], data[first+child] = data[first+child], data[first+root] - root = child - } -} func doPivotByFreq(data []literalNode, lo, hi int) (midlo, midhi int) { m := int(uint(lo+hi) >> 1) // Written like this to avoid integer overflow. if hi-lo > 40 { diff --git a/vendor/github.com/klauspost/compress/huff0/bitwriter.go b/vendor/github.com/klauspost/compress/huff0/bitwriter.go index aed2347c..b4d7164e 100644 --- a/vendor/github.com/klauspost/compress/huff0/bitwriter.go +++ b/vendor/github.com/klauspost/compress/huff0/bitwriter.go @@ -13,14 +13,6 @@ type bitWriter struct { out []byte } -// bitMask16 is bitmasks. Has extra to avoid bounds check. -var bitMask16 = [32]uint16{ - 0, 1, 3, 7, 0xF, 0x1F, - 0x3F, 0x7F, 0xFF, 0x1FF, 0x3FF, 0x7FF, - 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF, 0xFFFF, - 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, - 0xFFFF, 0xFFFF} /* up to 16 bits */ - // addBits16Clean will add up to 16 bits. value may not contain more set bits than indicated. // It will not check if there is space for them, so the caller must ensure that it has flushed recently. func (b *bitWriter) addBits16Clean(value uint16, bits uint8) { diff --git a/vendor/github.com/klauspost/compress/huff0/decompress.go b/vendor/github.com/klauspost/compress/huff0/decompress.go index 3c0b398c..54bd08b2 100644 --- a/vendor/github.com/klauspost/compress/huff0/decompress.go +++ b/vendor/github.com/klauspost/compress/huff0/decompress.go @@ -253,7 +253,7 @@ func (d *Decoder) decompress1X8Bit(dst, src []byte) ([]byte, error) { switch d.actualTableLog { case 8: - const shift = 8 - 8 + const shift = 0 for br.off >= 4 { br.fillFast() v := dt[uint8(br.value>>(56+shift))] diff --git a/vendor/github.com/klauspost/compress/internal/snapref/encode_other.go b/vendor/github.com/klauspost/compress/internal/snapref/encode_other.go index 05db94d3..2aa6a95a 100644 --- a/vendor/github.com/klauspost/compress/internal/snapref/encode_other.go +++ b/vendor/github.com/klauspost/compress/internal/snapref/encode_other.go @@ -87,18 +87,6 @@ func emitCopy(dst []byte, offset, length int) int { return i + 2 } -// extendMatch returns the largest k such that k <= len(src) and that -// src[i:i+k-j] and src[j:k] have the same contents. -// -// It assumes that: -// -// 0 <= i && i < j && j <= len(src) -func extendMatch(src []byte, i, j int) int { - for ; j < len(src) && src[i] == src[j]; i, j = i+1, j+1 { - } - return j -} - func hash(u, shift uint32) uint32 { return (u * 0x1e35a7bd) >> shift } diff --git a/vendor/github.com/klauspost/compress/s2/encode_all.go b/vendor/github.com/klauspost/compress/s2/encode_all.go index 11657f09..5e57995d 100644 --- a/vendor/github.com/klauspost/compress/s2/encode_all.go +++ b/vendor/github.com/klauspost/compress/s2/encode_all.go @@ -742,7 +742,6 @@ searchDict: x := load64(src, s-2) m2Hash := hash6(x, tableBits) currHash := hash6(x>>8, tableBits) - candidate = int(table[currHash]) table[m2Hash] = uint32(s - 2) table[currHash] = uint32(s - 1) cv = load64(src, s) diff --git a/vendor/github.com/klauspost/compress/s2/encode_better.go b/vendor/github.com/klauspost/compress/s2/encode_better.go index f46adb41..544cb1e1 100644 --- a/vendor/github.com/klauspost/compress/s2/encode_better.go +++ b/vendor/github.com/klauspost/compress/s2/encode_better.go @@ -157,7 +157,6 @@ func encodeBlockBetterGo(dst, src []byte) (d int) { index0 := base + 1 index1 := s - 2 - cv = load64(src, s) for index0 < index1 { cv0 := load64(src, index0) cv1 := load64(src, index1) @@ -269,18 +268,21 @@ func encodeBlockBetterGo(dst, src []byte) (d int) { lTable[hash7(cv0, lTableBits)] = uint32(index0) sTable[hash4(cv0>>8, sTableBits)] = uint32(index0 + 1) + // lTable could be postponed, but very minor difference. lTable[hash7(cv1, lTableBits)] = uint32(index1) sTable[hash4(cv1>>8, sTableBits)] = uint32(index1 + 1) index0 += 1 index1 -= 1 cv = load64(src, s) - // index every second long in between. - for index0 < index1 { + // Index large values sparsely in between. + // We do two starting from different offsets for speed. + index2 := (index0 + index1 + 1) >> 1 + for index2 < index1 { lTable[hash7(load64(src, index0), lTableBits)] = uint32(index0) - lTable[hash7(load64(src, index1), lTableBits)] = uint32(index1) + lTable[hash7(load64(src, index2), lTableBits)] = uint32(index2) index0 += 2 - index1 -= 2 + index2 += 2 } } @@ -459,12 +461,14 @@ func encodeBlockBetterSnappyGo(dst, src []byte) (d int) { index1 -= 1 cv = load64(src, s) - // index every second long in between. - for index0 < index1 { + // Index large values sparsely in between. + // We do two starting from different offsets for speed. + index2 := (index0 + index1 + 1) >> 1 + for index2 < index1 { lTable[hash7(load64(src, index0), lTableBits)] = uint32(index0) - lTable[hash7(load64(src, index1), lTableBits)] = uint32(index1) + lTable[hash7(load64(src, index2), lTableBits)] = uint32(index2) index0 += 2 - index1 -= 2 + index2 += 2 } } @@ -599,7 +603,6 @@ searchDict: if s >= sLimit { break searchDict } - cv = load64(src, s) // Index in-between index0 := base + 1 index1 := s - 2 @@ -865,12 +868,14 @@ searchDict: index1 -= 1 cv = load64(src, s) - // index every second long in between. - for index0 < index1 { + // Index large values sparsely in between. + // We do two starting from different offsets for speed. + index2 := (index0 + index1 + 1) >> 1 + for index2 < index1 { lTable[hash7(load64(src, index0), lTableBits)] = uint32(index0) - lTable[hash7(load64(src, index1), lTableBits)] = uint32(index1) + lTable[hash7(load64(src, index2), lTableBits)] = uint32(index2) index0 += 2 - index1 -= 2 + index2 += 2 } } @@ -961,7 +966,6 @@ searchDict: index0 := base + 1 index1 := s - 2 - cv = load64(src, s) for index0 < index1 { cv0 := load64(src, index0) cv1 := load64(src, index1) @@ -1079,12 +1083,14 @@ searchDict: index1 -= 1 cv = load64(src, s) - // index every second long in between. - for index0 < index1 { + // Index large values sparsely in between. + // We do two starting from different offsets for speed. + index2 := (index0 + index1 + 1) >> 1 + for index2 < index1 { lTable[hash7(load64(src, index0), lTableBits)] = uint32(index0) - lTable[hash7(load64(src, index1), lTableBits)] = uint32(index1) + lTable[hash7(load64(src, index2), lTableBits)] = uint32(index2) index0 += 2 - index1 -= 2 + index2 += 2 } } diff --git a/vendor/github.com/klauspost/compress/s2/encodeblock_amd64.s b/vendor/github.com/klauspost/compress/s2/encodeblock_amd64.s index 9222d179..54031aa3 100644 --- a/vendor/github.com/klauspost/compress/s2/encodeblock_amd64.s +++ b/vendor/github.com/klauspost/compress/s2/encodeblock_amd64.s @@ -274,7 +274,6 @@ matchlen_loop_repeat_extend_encodeBlockAsm: LEAL 8(R11), R11 CMPL R8, $0x08 JAE matchlen_loopback_repeat_extend_encodeBlockAsm - JZ repeat_extend_forward_end_encodeBlockAsm matchlen_match4_repeat_extend_encodeBlockAsm: CMPL R8, $0x04 @@ -282,21 +281,21 @@ matchlen_match4_repeat_extend_encodeBlockAsm: MOVL (R9)(R11*1), R10 CMPL (BX)(R11*1), R10 JNE matchlen_match2_repeat_extend_encodeBlockAsm - SUBL $0x04, R8 + LEAL -4(R8), R8 LEAL 4(R11), R11 matchlen_match2_repeat_extend_encodeBlockAsm: - CMPL R8, $0x02 - JB matchlen_match1_repeat_extend_encodeBlockAsm + CMPL R8, $0x01 + JE matchlen_match1_repeat_extend_encodeBlockAsm + JB repeat_extend_forward_end_encodeBlockAsm MOVW (R9)(R11*1), R10 CMPW (BX)(R11*1), R10 JNE matchlen_match1_repeat_extend_encodeBlockAsm - SUBL $0x02, R8 LEAL 2(R11), R11 + SUBL $0x02, R8 + JZ repeat_extend_forward_end_encodeBlockAsm matchlen_match1_repeat_extend_encodeBlockAsm: - CMPL R8, $0x01 - JB repeat_extend_forward_end_encodeBlockAsm MOVB (R9)(R11*1), R10 CMPB (BX)(R11*1), R10 JNE repeat_extend_forward_end_encodeBlockAsm @@ -877,7 +876,6 @@ matchlen_loop_match_nolit_encodeBlockAsm: LEAL 8(R9), R9 CMPL SI, $0x08 JAE matchlen_loopback_match_nolit_encodeBlockAsm - JZ match_nolit_end_encodeBlockAsm matchlen_match4_match_nolit_encodeBlockAsm: CMPL SI, $0x04 @@ -885,21 +883,21 @@ matchlen_match4_match_nolit_encodeBlockAsm: MOVL (DI)(R9*1), R8 CMPL (BX)(R9*1), R8 JNE matchlen_match2_match_nolit_encodeBlockAsm - SUBL $0x04, SI + LEAL -4(SI), SI LEAL 4(R9), R9 matchlen_match2_match_nolit_encodeBlockAsm: - CMPL SI, $0x02 - JB matchlen_match1_match_nolit_encodeBlockAsm + CMPL SI, $0x01 + JE matchlen_match1_match_nolit_encodeBlockAsm + JB match_nolit_end_encodeBlockAsm MOVW (DI)(R9*1), R8 CMPW (BX)(R9*1), R8 JNE matchlen_match1_match_nolit_encodeBlockAsm - SUBL $0x02, SI LEAL 2(R9), R9 + SUBL $0x02, SI + JZ match_nolit_end_encodeBlockAsm matchlen_match1_match_nolit_encodeBlockAsm: - CMPL SI, $0x01 - JB match_nolit_end_encodeBlockAsm MOVB (DI)(R9*1), R8 CMPB (BX)(R9*1), R8 JNE match_nolit_end_encodeBlockAsm @@ -1637,7 +1635,6 @@ matchlen_loop_repeat_extend_encodeBlockAsm4MB: LEAL 8(R11), R11 CMPL R8, $0x08 JAE matchlen_loopback_repeat_extend_encodeBlockAsm4MB - JZ repeat_extend_forward_end_encodeBlockAsm4MB matchlen_match4_repeat_extend_encodeBlockAsm4MB: CMPL R8, $0x04 @@ -1645,21 +1642,21 @@ matchlen_match4_repeat_extend_encodeBlockAsm4MB: MOVL (R9)(R11*1), R10 CMPL (BX)(R11*1), R10 JNE matchlen_match2_repeat_extend_encodeBlockAsm4MB - SUBL $0x04, R8 + LEAL -4(R8), R8 LEAL 4(R11), R11 matchlen_match2_repeat_extend_encodeBlockAsm4MB: - CMPL R8, $0x02 - JB matchlen_match1_repeat_extend_encodeBlockAsm4MB + CMPL R8, $0x01 + JE matchlen_match1_repeat_extend_encodeBlockAsm4MB + JB repeat_extend_forward_end_encodeBlockAsm4MB MOVW (R9)(R11*1), R10 CMPW (BX)(R11*1), R10 JNE matchlen_match1_repeat_extend_encodeBlockAsm4MB - SUBL $0x02, R8 LEAL 2(R11), R11 + SUBL $0x02, R8 + JZ repeat_extend_forward_end_encodeBlockAsm4MB matchlen_match1_repeat_extend_encodeBlockAsm4MB: - CMPL R8, $0x01 - JB repeat_extend_forward_end_encodeBlockAsm4MB MOVB (R9)(R11*1), R10 CMPB (BX)(R11*1), R10 JNE repeat_extend_forward_end_encodeBlockAsm4MB @@ -2190,7 +2187,6 @@ matchlen_loop_match_nolit_encodeBlockAsm4MB: LEAL 8(R9), R9 CMPL SI, $0x08 JAE matchlen_loopback_match_nolit_encodeBlockAsm4MB - JZ match_nolit_end_encodeBlockAsm4MB matchlen_match4_match_nolit_encodeBlockAsm4MB: CMPL SI, $0x04 @@ -2198,21 +2194,21 @@ matchlen_match4_match_nolit_encodeBlockAsm4MB: MOVL (DI)(R9*1), R8 CMPL (BX)(R9*1), R8 JNE matchlen_match2_match_nolit_encodeBlockAsm4MB - SUBL $0x04, SI + LEAL -4(SI), SI LEAL 4(R9), R9 matchlen_match2_match_nolit_encodeBlockAsm4MB: - CMPL SI, $0x02 - JB matchlen_match1_match_nolit_encodeBlockAsm4MB + CMPL SI, $0x01 + JE matchlen_match1_match_nolit_encodeBlockAsm4MB + JB match_nolit_end_encodeBlockAsm4MB MOVW (DI)(R9*1), R8 CMPW (BX)(R9*1), R8 JNE matchlen_match1_match_nolit_encodeBlockAsm4MB - SUBL $0x02, SI LEAL 2(R9), R9 + SUBL $0x02, SI + JZ match_nolit_end_encodeBlockAsm4MB matchlen_match1_match_nolit_encodeBlockAsm4MB: - CMPL SI, $0x01 - JB match_nolit_end_encodeBlockAsm4MB MOVB (DI)(R9*1), R8 CMPB (BX)(R9*1), R8 JNE match_nolit_end_encodeBlockAsm4MB @@ -2902,7 +2898,6 @@ matchlen_loop_repeat_extend_encodeBlockAsm12B: LEAL 8(R11), R11 CMPL R8, $0x08 JAE matchlen_loopback_repeat_extend_encodeBlockAsm12B - JZ repeat_extend_forward_end_encodeBlockAsm12B matchlen_match4_repeat_extend_encodeBlockAsm12B: CMPL R8, $0x04 @@ -2910,21 +2905,21 @@ matchlen_match4_repeat_extend_encodeBlockAsm12B: MOVL (R9)(R11*1), R10 CMPL (BX)(R11*1), R10 JNE matchlen_match2_repeat_extend_encodeBlockAsm12B - SUBL $0x04, R8 + LEAL -4(R8), R8 LEAL 4(R11), R11 matchlen_match2_repeat_extend_encodeBlockAsm12B: - CMPL R8, $0x02 - JB matchlen_match1_repeat_extend_encodeBlockAsm12B + CMPL R8, $0x01 + JE matchlen_match1_repeat_extend_encodeBlockAsm12B + JB repeat_extend_forward_end_encodeBlockAsm12B MOVW (R9)(R11*1), R10 CMPW (BX)(R11*1), R10 JNE matchlen_match1_repeat_extend_encodeBlockAsm12B - SUBL $0x02, R8 LEAL 2(R11), R11 + SUBL $0x02, R8 + JZ repeat_extend_forward_end_encodeBlockAsm12B matchlen_match1_repeat_extend_encodeBlockAsm12B: - CMPL R8, $0x01 - JB repeat_extend_forward_end_encodeBlockAsm12B MOVB (R9)(R11*1), R10 CMPB (BX)(R11*1), R10 JNE repeat_extend_forward_end_encodeBlockAsm12B @@ -3333,7 +3328,6 @@ matchlen_loop_match_nolit_encodeBlockAsm12B: LEAL 8(R9), R9 CMPL SI, $0x08 JAE matchlen_loopback_match_nolit_encodeBlockAsm12B - JZ match_nolit_end_encodeBlockAsm12B matchlen_match4_match_nolit_encodeBlockAsm12B: CMPL SI, $0x04 @@ -3341,21 +3335,21 @@ matchlen_match4_match_nolit_encodeBlockAsm12B: MOVL (DI)(R9*1), R8 CMPL (BX)(R9*1), R8 JNE matchlen_match2_match_nolit_encodeBlockAsm12B - SUBL $0x04, SI + LEAL -4(SI), SI LEAL 4(R9), R9 matchlen_match2_match_nolit_encodeBlockAsm12B: - CMPL SI, $0x02 - JB matchlen_match1_match_nolit_encodeBlockAsm12B + CMPL SI, $0x01 + JE matchlen_match1_match_nolit_encodeBlockAsm12B + JB match_nolit_end_encodeBlockAsm12B MOVW (DI)(R9*1), R8 CMPW (BX)(R9*1), R8 JNE matchlen_match1_match_nolit_encodeBlockAsm12B - SUBL $0x02, SI LEAL 2(R9), R9 + SUBL $0x02, SI + JZ match_nolit_end_encodeBlockAsm12B matchlen_match1_match_nolit_encodeBlockAsm12B: - CMPL SI, $0x01 - JB match_nolit_end_encodeBlockAsm12B MOVB (DI)(R9*1), R8 CMPB (BX)(R9*1), R8 JNE match_nolit_end_encodeBlockAsm12B @@ -3935,7 +3929,6 @@ matchlen_loop_repeat_extend_encodeBlockAsm10B: LEAL 8(R11), R11 CMPL R8, $0x08 JAE matchlen_loopback_repeat_extend_encodeBlockAsm10B - JZ repeat_extend_forward_end_encodeBlockAsm10B matchlen_match4_repeat_extend_encodeBlockAsm10B: CMPL R8, $0x04 @@ -3943,21 +3936,21 @@ matchlen_match4_repeat_extend_encodeBlockAsm10B: MOVL (R9)(R11*1), R10 CMPL (BX)(R11*1), R10 JNE matchlen_match2_repeat_extend_encodeBlockAsm10B - SUBL $0x04, R8 + LEAL -4(R8), R8 LEAL 4(R11), R11 matchlen_match2_repeat_extend_encodeBlockAsm10B: - CMPL R8, $0x02 - JB matchlen_match1_repeat_extend_encodeBlockAsm10B + CMPL R8, $0x01 + JE matchlen_match1_repeat_extend_encodeBlockAsm10B + JB repeat_extend_forward_end_encodeBlockAsm10B MOVW (R9)(R11*1), R10 CMPW (BX)(R11*1), R10 JNE matchlen_match1_repeat_extend_encodeBlockAsm10B - SUBL $0x02, R8 LEAL 2(R11), R11 + SUBL $0x02, R8 + JZ repeat_extend_forward_end_encodeBlockAsm10B matchlen_match1_repeat_extend_encodeBlockAsm10B: - CMPL R8, $0x01 - JB repeat_extend_forward_end_encodeBlockAsm10B MOVB (R9)(R11*1), R10 CMPB (BX)(R11*1), R10 JNE repeat_extend_forward_end_encodeBlockAsm10B @@ -4366,7 +4359,6 @@ matchlen_loop_match_nolit_encodeBlockAsm10B: LEAL 8(R9), R9 CMPL SI, $0x08 JAE matchlen_loopback_match_nolit_encodeBlockAsm10B - JZ match_nolit_end_encodeBlockAsm10B matchlen_match4_match_nolit_encodeBlockAsm10B: CMPL SI, $0x04 @@ -4374,21 +4366,21 @@ matchlen_match4_match_nolit_encodeBlockAsm10B: MOVL (DI)(R9*1), R8 CMPL (BX)(R9*1), R8 JNE matchlen_match2_match_nolit_encodeBlockAsm10B - SUBL $0x04, SI + LEAL -4(SI), SI LEAL 4(R9), R9 matchlen_match2_match_nolit_encodeBlockAsm10B: - CMPL SI, $0x02 - JB matchlen_match1_match_nolit_encodeBlockAsm10B + CMPL SI, $0x01 + JE matchlen_match1_match_nolit_encodeBlockAsm10B + JB match_nolit_end_encodeBlockAsm10B MOVW (DI)(R9*1), R8 CMPW (BX)(R9*1), R8 JNE matchlen_match1_match_nolit_encodeBlockAsm10B - SUBL $0x02, SI LEAL 2(R9), R9 + SUBL $0x02, SI + JZ match_nolit_end_encodeBlockAsm10B matchlen_match1_match_nolit_encodeBlockAsm10B: - CMPL SI, $0x01 - JB match_nolit_end_encodeBlockAsm10B MOVB (DI)(R9*1), R8 CMPB (BX)(R9*1), R8 JNE match_nolit_end_encodeBlockAsm10B @@ -4968,7 +4960,6 @@ matchlen_loop_repeat_extend_encodeBlockAsm8B: LEAL 8(R11), R11 CMPL R8, $0x08 JAE matchlen_loopback_repeat_extend_encodeBlockAsm8B - JZ repeat_extend_forward_end_encodeBlockAsm8B matchlen_match4_repeat_extend_encodeBlockAsm8B: CMPL R8, $0x04 @@ -4976,21 +4967,21 @@ matchlen_match4_repeat_extend_encodeBlockAsm8B: MOVL (R9)(R11*1), R10 CMPL (BX)(R11*1), R10 JNE matchlen_match2_repeat_extend_encodeBlockAsm8B - SUBL $0x04, R8 + LEAL -4(R8), R8 LEAL 4(R11), R11 matchlen_match2_repeat_extend_encodeBlockAsm8B: - CMPL R8, $0x02 - JB matchlen_match1_repeat_extend_encodeBlockAsm8B + CMPL R8, $0x01 + JE matchlen_match1_repeat_extend_encodeBlockAsm8B + JB repeat_extend_forward_end_encodeBlockAsm8B MOVW (R9)(R11*1), R10 CMPW (BX)(R11*1), R10 JNE matchlen_match1_repeat_extend_encodeBlockAsm8B - SUBL $0x02, R8 LEAL 2(R11), R11 + SUBL $0x02, R8 + JZ repeat_extend_forward_end_encodeBlockAsm8B matchlen_match1_repeat_extend_encodeBlockAsm8B: - CMPL R8, $0x01 - JB repeat_extend_forward_end_encodeBlockAsm8B MOVB (R9)(R11*1), R10 CMPB (BX)(R11*1), R10 JNE repeat_extend_forward_end_encodeBlockAsm8B @@ -5385,7 +5376,6 @@ matchlen_loop_match_nolit_encodeBlockAsm8B: LEAL 8(R9), R9 CMPL SI, $0x08 JAE matchlen_loopback_match_nolit_encodeBlockAsm8B - JZ match_nolit_end_encodeBlockAsm8B matchlen_match4_match_nolit_encodeBlockAsm8B: CMPL SI, $0x04 @@ -5393,21 +5383,21 @@ matchlen_match4_match_nolit_encodeBlockAsm8B: MOVL (DI)(R9*1), R8 CMPL (BX)(R9*1), R8 JNE matchlen_match2_match_nolit_encodeBlockAsm8B - SUBL $0x04, SI + LEAL -4(SI), SI LEAL 4(R9), R9 matchlen_match2_match_nolit_encodeBlockAsm8B: - CMPL SI, $0x02 - JB matchlen_match1_match_nolit_encodeBlockAsm8B + CMPL SI, $0x01 + JE matchlen_match1_match_nolit_encodeBlockAsm8B + JB match_nolit_end_encodeBlockAsm8B MOVW (DI)(R9*1), R8 CMPW (BX)(R9*1), R8 JNE matchlen_match1_match_nolit_encodeBlockAsm8B - SUBL $0x02, SI LEAL 2(R9), R9 + SUBL $0x02, SI + JZ match_nolit_end_encodeBlockAsm8B matchlen_match1_match_nolit_encodeBlockAsm8B: - CMPL SI, $0x01 - JB match_nolit_end_encodeBlockAsm8B MOVB (DI)(R9*1), R8 CMPB (BX)(R9*1), R8 JNE match_nolit_end_encodeBlockAsm8B @@ -5889,7 +5879,6 @@ matchlen_loop_match_nolit_encodeBetterBlockAsm: LEAL 8(R11), R11 CMPL DI, $0x08 JAE matchlen_loopback_match_nolit_encodeBetterBlockAsm - JZ match_nolit_end_encodeBetterBlockAsm matchlen_match4_match_nolit_encodeBetterBlockAsm: CMPL DI, $0x04 @@ -5897,21 +5886,21 @@ matchlen_match4_match_nolit_encodeBetterBlockAsm: MOVL (R8)(R11*1), R10 CMPL (R9)(R11*1), R10 JNE matchlen_match2_match_nolit_encodeBetterBlockAsm - SUBL $0x04, DI + LEAL -4(DI), DI LEAL 4(R11), R11 matchlen_match2_match_nolit_encodeBetterBlockAsm: - CMPL DI, $0x02 - JB matchlen_match1_match_nolit_encodeBetterBlockAsm + CMPL DI, $0x01 + JE matchlen_match1_match_nolit_encodeBetterBlockAsm + JB match_nolit_end_encodeBetterBlockAsm MOVW (R8)(R11*1), R10 CMPW (R9)(R11*1), R10 JNE matchlen_match1_match_nolit_encodeBetterBlockAsm - SUBL $0x02, DI LEAL 2(R11), R11 + SUBL $0x02, DI + JZ match_nolit_end_encodeBetterBlockAsm matchlen_match1_match_nolit_encodeBetterBlockAsm: - CMPL DI, $0x01 - JB match_nolit_end_encodeBetterBlockAsm MOVB (R8)(R11*1), R10 CMPB (R9)(R11*1), R10 JNE match_nolit_end_encodeBetterBlockAsm @@ -6607,24 +6596,26 @@ match_nolit_dst_ok_encodeBetterBlockAsm: MOVL R8, 24(SP)(R11*4) MOVL DI, 524312(SP)(R10*4) MOVL R13, 524312(SP)(R12*4) + LEAQ 1(R8)(SI*1), DI + SHRQ $0x01, DI ADDQ $0x01, SI SUBQ $0x01, R8 index_loop_encodeBetterBlockAsm: - CMPQ SI, R8 + CMPQ DI, R8 JAE search_loop_encodeBetterBlockAsm - MOVQ (DX)(SI*1), DI - MOVQ (DX)(R8*1), R9 - SHLQ $0x08, DI - IMULQ BX, DI - SHRQ $0x2f, DI + MOVQ (DX)(SI*1), R9 + MOVQ (DX)(DI*1), R10 SHLQ $0x08, R9 IMULQ BX, R9 SHRQ $0x2f, R9 - MOVL SI, 24(SP)(DI*4) - MOVL R8, 24(SP)(R9*4) + SHLQ $0x08, R10 + IMULQ BX, R10 + SHRQ $0x2f, R10 + MOVL SI, 24(SP)(R9*4) + MOVL DI, 24(SP)(R10*4) ADDQ $0x02, SI - SUBQ $0x02, R8 + ADDQ $0x02, DI JMP index_loop_encodeBetterBlockAsm emit_remainder_encodeBetterBlockAsm: @@ -6960,7 +6951,6 @@ matchlen_loop_match_nolit_encodeBetterBlockAsm4MB: LEAL 8(R11), R11 CMPL DI, $0x08 JAE matchlen_loopback_match_nolit_encodeBetterBlockAsm4MB - JZ match_nolit_end_encodeBetterBlockAsm4MB matchlen_match4_match_nolit_encodeBetterBlockAsm4MB: CMPL DI, $0x04 @@ -6968,21 +6958,21 @@ matchlen_match4_match_nolit_encodeBetterBlockAsm4MB: MOVL (R8)(R11*1), R10 CMPL (R9)(R11*1), R10 JNE matchlen_match2_match_nolit_encodeBetterBlockAsm4MB - SUBL $0x04, DI + LEAL -4(DI), DI LEAL 4(R11), R11 matchlen_match2_match_nolit_encodeBetterBlockAsm4MB: - CMPL DI, $0x02 - JB matchlen_match1_match_nolit_encodeBetterBlockAsm4MB + CMPL DI, $0x01 + JE matchlen_match1_match_nolit_encodeBetterBlockAsm4MB + JB match_nolit_end_encodeBetterBlockAsm4MB MOVW (R8)(R11*1), R10 CMPW (R9)(R11*1), R10 JNE matchlen_match1_match_nolit_encodeBetterBlockAsm4MB - SUBL $0x02, DI LEAL 2(R11), R11 + SUBL $0x02, DI + JZ match_nolit_end_encodeBetterBlockAsm4MB matchlen_match1_match_nolit_encodeBetterBlockAsm4MB: - CMPL DI, $0x01 - JB match_nolit_end_encodeBetterBlockAsm4MB MOVB (R8)(R11*1), R10 CMPB (R9)(R11*1), R10 JNE match_nolit_end_encodeBetterBlockAsm4MB @@ -7620,24 +7610,26 @@ match_nolit_dst_ok_encodeBetterBlockAsm4MB: MOVL R8, 24(SP)(R11*4) MOVL DI, 524312(SP)(R10*4) MOVL R13, 524312(SP)(R12*4) + LEAQ 1(R8)(SI*1), DI + SHRQ $0x01, DI ADDQ $0x01, SI SUBQ $0x01, R8 index_loop_encodeBetterBlockAsm4MB: - CMPQ SI, R8 + CMPQ DI, R8 JAE search_loop_encodeBetterBlockAsm4MB - MOVQ (DX)(SI*1), DI - MOVQ (DX)(R8*1), R9 - SHLQ $0x08, DI - IMULQ BX, DI - SHRQ $0x2f, DI + MOVQ (DX)(SI*1), R9 + MOVQ (DX)(DI*1), R10 SHLQ $0x08, R9 IMULQ BX, R9 SHRQ $0x2f, R9 - MOVL SI, 24(SP)(DI*4) - MOVL R8, 24(SP)(R9*4) + SHLQ $0x08, R10 + IMULQ BX, R10 + SHRQ $0x2f, R10 + MOVL SI, 24(SP)(R9*4) + MOVL DI, 24(SP)(R10*4) ADDQ $0x02, SI - SUBQ $0x02, R8 + ADDQ $0x02, DI JMP index_loop_encodeBetterBlockAsm4MB emit_remainder_encodeBetterBlockAsm4MB: @@ -7957,7 +7949,6 @@ matchlen_loop_match_nolit_encodeBetterBlockAsm12B: LEAL 8(R11), R11 CMPL DI, $0x08 JAE matchlen_loopback_match_nolit_encodeBetterBlockAsm12B - JZ match_nolit_end_encodeBetterBlockAsm12B matchlen_match4_match_nolit_encodeBetterBlockAsm12B: CMPL DI, $0x04 @@ -7965,21 +7956,21 @@ matchlen_match4_match_nolit_encodeBetterBlockAsm12B: MOVL (R8)(R11*1), R10 CMPL (R9)(R11*1), R10 JNE matchlen_match2_match_nolit_encodeBetterBlockAsm12B - SUBL $0x04, DI + LEAL -4(DI), DI LEAL 4(R11), R11 matchlen_match2_match_nolit_encodeBetterBlockAsm12B: - CMPL DI, $0x02 - JB matchlen_match1_match_nolit_encodeBetterBlockAsm12B + CMPL DI, $0x01 + JE matchlen_match1_match_nolit_encodeBetterBlockAsm12B + JB match_nolit_end_encodeBetterBlockAsm12B MOVW (R8)(R11*1), R10 CMPW (R9)(R11*1), R10 JNE matchlen_match1_match_nolit_encodeBetterBlockAsm12B - SUBL $0x02, DI LEAL 2(R11), R11 + SUBL $0x02, DI + JZ match_nolit_end_encodeBetterBlockAsm12B matchlen_match1_match_nolit_encodeBetterBlockAsm12B: - CMPL DI, $0x01 - JB match_nolit_end_encodeBetterBlockAsm12B MOVB (R8)(R11*1), R10 CMPB (R9)(R11*1), R10 JNE match_nolit_end_encodeBetterBlockAsm12B @@ -8478,24 +8469,26 @@ match_nolit_dst_ok_encodeBetterBlockAsm12B: MOVL R8, 24(SP)(R11*4) MOVL DI, 65560(SP)(R10*4) MOVL R13, 65560(SP)(R12*4) + LEAQ 1(R8)(SI*1), DI + SHRQ $0x01, DI ADDQ $0x01, SI SUBQ $0x01, R8 index_loop_encodeBetterBlockAsm12B: - CMPQ SI, R8 + CMPQ DI, R8 JAE search_loop_encodeBetterBlockAsm12B - MOVQ (DX)(SI*1), DI - MOVQ (DX)(R8*1), R9 - SHLQ $0x10, DI - IMULQ BX, DI - SHRQ $0x32, DI + MOVQ (DX)(SI*1), R9 + MOVQ (DX)(DI*1), R10 SHLQ $0x10, R9 IMULQ BX, R9 SHRQ $0x32, R9 - MOVL SI, 24(SP)(DI*4) - MOVL R8, 24(SP)(R9*4) + SHLQ $0x10, R10 + IMULQ BX, R10 + SHRQ $0x32, R10 + MOVL SI, 24(SP)(R9*4) + MOVL DI, 24(SP)(R10*4) ADDQ $0x02, SI - SUBQ $0x02, R8 + ADDQ $0x02, DI JMP index_loop_encodeBetterBlockAsm12B emit_remainder_encodeBetterBlockAsm12B: @@ -8807,7 +8800,6 @@ matchlen_loop_match_nolit_encodeBetterBlockAsm10B: LEAL 8(R11), R11 CMPL DI, $0x08 JAE matchlen_loopback_match_nolit_encodeBetterBlockAsm10B - JZ match_nolit_end_encodeBetterBlockAsm10B matchlen_match4_match_nolit_encodeBetterBlockAsm10B: CMPL DI, $0x04 @@ -8815,21 +8807,21 @@ matchlen_match4_match_nolit_encodeBetterBlockAsm10B: MOVL (R8)(R11*1), R10 CMPL (R9)(R11*1), R10 JNE matchlen_match2_match_nolit_encodeBetterBlockAsm10B - SUBL $0x04, DI + LEAL -4(DI), DI LEAL 4(R11), R11 matchlen_match2_match_nolit_encodeBetterBlockAsm10B: - CMPL DI, $0x02 - JB matchlen_match1_match_nolit_encodeBetterBlockAsm10B + CMPL DI, $0x01 + JE matchlen_match1_match_nolit_encodeBetterBlockAsm10B + JB match_nolit_end_encodeBetterBlockAsm10B MOVW (R8)(R11*1), R10 CMPW (R9)(R11*1), R10 JNE matchlen_match1_match_nolit_encodeBetterBlockAsm10B - SUBL $0x02, DI LEAL 2(R11), R11 + SUBL $0x02, DI + JZ match_nolit_end_encodeBetterBlockAsm10B matchlen_match1_match_nolit_encodeBetterBlockAsm10B: - CMPL DI, $0x01 - JB match_nolit_end_encodeBetterBlockAsm10B MOVB (R8)(R11*1), R10 CMPB (R9)(R11*1), R10 JNE match_nolit_end_encodeBetterBlockAsm10B @@ -9328,24 +9320,26 @@ match_nolit_dst_ok_encodeBetterBlockAsm10B: MOVL R8, 24(SP)(R11*4) MOVL DI, 16408(SP)(R10*4) MOVL R13, 16408(SP)(R12*4) + LEAQ 1(R8)(SI*1), DI + SHRQ $0x01, DI ADDQ $0x01, SI SUBQ $0x01, R8 index_loop_encodeBetterBlockAsm10B: - CMPQ SI, R8 + CMPQ DI, R8 JAE search_loop_encodeBetterBlockAsm10B - MOVQ (DX)(SI*1), DI - MOVQ (DX)(R8*1), R9 - SHLQ $0x10, DI - IMULQ BX, DI - SHRQ $0x34, DI + MOVQ (DX)(SI*1), R9 + MOVQ (DX)(DI*1), R10 SHLQ $0x10, R9 IMULQ BX, R9 SHRQ $0x34, R9 - MOVL SI, 24(SP)(DI*4) - MOVL R8, 24(SP)(R9*4) + SHLQ $0x10, R10 + IMULQ BX, R10 + SHRQ $0x34, R10 + MOVL SI, 24(SP)(R9*4) + MOVL DI, 24(SP)(R10*4) ADDQ $0x02, SI - SUBQ $0x02, R8 + ADDQ $0x02, DI JMP index_loop_encodeBetterBlockAsm10B emit_remainder_encodeBetterBlockAsm10B: @@ -9657,7 +9651,6 @@ matchlen_loop_match_nolit_encodeBetterBlockAsm8B: LEAL 8(R11), R11 CMPL DI, $0x08 JAE matchlen_loopback_match_nolit_encodeBetterBlockAsm8B - JZ match_nolit_end_encodeBetterBlockAsm8B matchlen_match4_match_nolit_encodeBetterBlockAsm8B: CMPL DI, $0x04 @@ -9665,21 +9658,21 @@ matchlen_match4_match_nolit_encodeBetterBlockAsm8B: MOVL (R8)(R11*1), R10 CMPL (R9)(R11*1), R10 JNE matchlen_match2_match_nolit_encodeBetterBlockAsm8B - SUBL $0x04, DI + LEAL -4(DI), DI LEAL 4(R11), R11 matchlen_match2_match_nolit_encodeBetterBlockAsm8B: - CMPL DI, $0x02 - JB matchlen_match1_match_nolit_encodeBetterBlockAsm8B + CMPL DI, $0x01 + JE matchlen_match1_match_nolit_encodeBetterBlockAsm8B + JB match_nolit_end_encodeBetterBlockAsm8B MOVW (R8)(R11*1), R10 CMPW (R9)(R11*1), R10 JNE matchlen_match1_match_nolit_encodeBetterBlockAsm8B - SUBL $0x02, DI LEAL 2(R11), R11 + SUBL $0x02, DI + JZ match_nolit_end_encodeBetterBlockAsm8B matchlen_match1_match_nolit_encodeBetterBlockAsm8B: - CMPL DI, $0x01 - JB match_nolit_end_encodeBetterBlockAsm8B MOVB (R8)(R11*1), R10 CMPB (R9)(R11*1), R10 JNE match_nolit_end_encodeBetterBlockAsm8B @@ -10164,24 +10157,26 @@ match_nolit_dst_ok_encodeBetterBlockAsm8B: MOVL R8, 24(SP)(R11*4) MOVL DI, 4120(SP)(R10*4) MOVL R13, 4120(SP)(R12*4) + LEAQ 1(R8)(SI*1), DI + SHRQ $0x01, DI ADDQ $0x01, SI SUBQ $0x01, R8 index_loop_encodeBetterBlockAsm8B: - CMPQ SI, R8 + CMPQ DI, R8 JAE search_loop_encodeBetterBlockAsm8B - MOVQ (DX)(SI*1), DI - MOVQ (DX)(R8*1), R9 - SHLQ $0x10, DI - IMULQ BX, DI - SHRQ $0x36, DI + MOVQ (DX)(SI*1), R9 + MOVQ (DX)(DI*1), R10 SHLQ $0x10, R9 IMULQ BX, R9 SHRQ $0x36, R9 - MOVL SI, 24(SP)(DI*4) - MOVL R8, 24(SP)(R9*4) + SHLQ $0x10, R10 + IMULQ BX, R10 + SHRQ $0x36, R10 + MOVL SI, 24(SP)(R9*4) + MOVL DI, 24(SP)(R10*4) ADDQ $0x02, SI - SUBQ $0x02, R8 + ADDQ $0x02, DI JMP index_loop_encodeBetterBlockAsm8B emit_remainder_encodeBetterBlockAsm8B: @@ -10605,7 +10600,6 @@ matchlen_loop_repeat_extend_encodeSnappyBlockAsm: LEAL 8(R10), R10 CMPL DI, $0x08 JAE matchlen_loopback_repeat_extend_encodeSnappyBlockAsm - JZ repeat_extend_forward_end_encodeSnappyBlockAsm matchlen_match4_repeat_extend_encodeSnappyBlockAsm: CMPL DI, $0x04 @@ -10613,21 +10607,21 @@ matchlen_match4_repeat_extend_encodeSnappyBlockAsm: MOVL (R8)(R10*1), R9 CMPL (BX)(R10*1), R9 JNE matchlen_match2_repeat_extend_encodeSnappyBlockAsm - SUBL $0x04, DI + LEAL -4(DI), DI LEAL 4(R10), R10 matchlen_match2_repeat_extend_encodeSnappyBlockAsm: - CMPL DI, $0x02 - JB matchlen_match1_repeat_extend_encodeSnappyBlockAsm + CMPL DI, $0x01 + JE matchlen_match1_repeat_extend_encodeSnappyBlockAsm + JB repeat_extend_forward_end_encodeSnappyBlockAsm MOVW (R8)(R10*1), R9 CMPW (BX)(R10*1), R9 JNE matchlen_match1_repeat_extend_encodeSnappyBlockAsm - SUBL $0x02, DI LEAL 2(R10), R10 + SUBL $0x02, DI + JZ repeat_extend_forward_end_encodeSnappyBlockAsm matchlen_match1_repeat_extend_encodeSnappyBlockAsm: - CMPL DI, $0x01 - JB repeat_extend_forward_end_encodeSnappyBlockAsm MOVB (R8)(R10*1), R9 CMPB (BX)(R10*1), R9 JNE repeat_extend_forward_end_encodeSnappyBlockAsm @@ -10928,7 +10922,6 @@ matchlen_loop_match_nolit_encodeSnappyBlockAsm: LEAL 8(R9), R9 CMPL SI, $0x08 JAE matchlen_loopback_match_nolit_encodeSnappyBlockAsm - JZ match_nolit_end_encodeSnappyBlockAsm matchlen_match4_match_nolit_encodeSnappyBlockAsm: CMPL SI, $0x04 @@ -10936,21 +10929,21 @@ matchlen_match4_match_nolit_encodeSnappyBlockAsm: MOVL (DI)(R9*1), R8 CMPL (BX)(R9*1), R8 JNE matchlen_match2_match_nolit_encodeSnappyBlockAsm - SUBL $0x04, SI + LEAL -4(SI), SI LEAL 4(R9), R9 matchlen_match2_match_nolit_encodeSnappyBlockAsm: - CMPL SI, $0x02 - JB matchlen_match1_match_nolit_encodeSnappyBlockAsm + CMPL SI, $0x01 + JE matchlen_match1_match_nolit_encodeSnappyBlockAsm + JB match_nolit_end_encodeSnappyBlockAsm MOVW (DI)(R9*1), R8 CMPW (BX)(R9*1), R8 JNE matchlen_match1_match_nolit_encodeSnappyBlockAsm - SUBL $0x02, SI LEAL 2(R9), R9 + SUBL $0x02, SI + JZ match_nolit_end_encodeSnappyBlockAsm matchlen_match1_match_nolit_encodeSnappyBlockAsm: - CMPL SI, $0x01 - JB match_nolit_end_encodeSnappyBlockAsm MOVB (DI)(R9*1), R8 CMPB (BX)(R9*1), R8 JNE match_nolit_end_encodeSnappyBlockAsm @@ -11469,7 +11462,6 @@ matchlen_loop_repeat_extend_encodeSnappyBlockAsm64K: LEAL 8(R10), R10 CMPL DI, $0x08 JAE matchlen_loopback_repeat_extend_encodeSnappyBlockAsm64K - JZ repeat_extend_forward_end_encodeSnappyBlockAsm64K matchlen_match4_repeat_extend_encodeSnappyBlockAsm64K: CMPL DI, $0x04 @@ -11477,21 +11469,21 @@ matchlen_match4_repeat_extend_encodeSnappyBlockAsm64K: MOVL (R8)(R10*1), R9 CMPL (BX)(R10*1), R9 JNE matchlen_match2_repeat_extend_encodeSnappyBlockAsm64K - SUBL $0x04, DI + LEAL -4(DI), DI LEAL 4(R10), R10 matchlen_match2_repeat_extend_encodeSnappyBlockAsm64K: - CMPL DI, $0x02 - JB matchlen_match1_repeat_extend_encodeSnappyBlockAsm64K + CMPL DI, $0x01 + JE matchlen_match1_repeat_extend_encodeSnappyBlockAsm64K + JB repeat_extend_forward_end_encodeSnappyBlockAsm64K MOVW (R8)(R10*1), R9 CMPW (BX)(R10*1), R9 JNE matchlen_match1_repeat_extend_encodeSnappyBlockAsm64K - SUBL $0x02, DI LEAL 2(R10), R10 + SUBL $0x02, DI + JZ repeat_extend_forward_end_encodeSnappyBlockAsm64K matchlen_match1_repeat_extend_encodeSnappyBlockAsm64K: - CMPL DI, $0x01 - JB repeat_extend_forward_end_encodeSnappyBlockAsm64K MOVB (R8)(R10*1), R9 CMPB (BX)(R10*1), R9 JNE repeat_extend_forward_end_encodeSnappyBlockAsm64K @@ -11752,7 +11744,6 @@ matchlen_loop_match_nolit_encodeSnappyBlockAsm64K: LEAL 8(R9), R9 CMPL SI, $0x08 JAE matchlen_loopback_match_nolit_encodeSnappyBlockAsm64K - JZ match_nolit_end_encodeSnappyBlockAsm64K matchlen_match4_match_nolit_encodeSnappyBlockAsm64K: CMPL SI, $0x04 @@ -11760,21 +11751,21 @@ matchlen_match4_match_nolit_encodeSnappyBlockAsm64K: MOVL (DI)(R9*1), R8 CMPL (BX)(R9*1), R8 JNE matchlen_match2_match_nolit_encodeSnappyBlockAsm64K - SUBL $0x04, SI + LEAL -4(SI), SI LEAL 4(R9), R9 matchlen_match2_match_nolit_encodeSnappyBlockAsm64K: - CMPL SI, $0x02 - JB matchlen_match1_match_nolit_encodeSnappyBlockAsm64K + CMPL SI, $0x01 + JE matchlen_match1_match_nolit_encodeSnappyBlockAsm64K + JB match_nolit_end_encodeSnappyBlockAsm64K MOVW (DI)(R9*1), R8 CMPW (BX)(R9*1), R8 JNE matchlen_match1_match_nolit_encodeSnappyBlockAsm64K - SUBL $0x02, SI LEAL 2(R9), R9 + SUBL $0x02, SI + JZ match_nolit_end_encodeSnappyBlockAsm64K matchlen_match1_match_nolit_encodeSnappyBlockAsm64K: - CMPL SI, $0x01 - JB match_nolit_end_encodeSnappyBlockAsm64K MOVB (DI)(R9*1), R8 CMPB (BX)(R9*1), R8 JNE match_nolit_end_encodeSnappyBlockAsm64K @@ -12253,7 +12244,6 @@ matchlen_loop_repeat_extend_encodeSnappyBlockAsm12B: LEAL 8(R10), R10 CMPL DI, $0x08 JAE matchlen_loopback_repeat_extend_encodeSnappyBlockAsm12B - JZ repeat_extend_forward_end_encodeSnappyBlockAsm12B matchlen_match4_repeat_extend_encodeSnappyBlockAsm12B: CMPL DI, $0x04 @@ -12261,21 +12251,21 @@ matchlen_match4_repeat_extend_encodeSnappyBlockAsm12B: MOVL (R8)(R10*1), R9 CMPL (BX)(R10*1), R9 JNE matchlen_match2_repeat_extend_encodeSnappyBlockAsm12B - SUBL $0x04, DI + LEAL -4(DI), DI LEAL 4(R10), R10 matchlen_match2_repeat_extend_encodeSnappyBlockAsm12B: - CMPL DI, $0x02 - JB matchlen_match1_repeat_extend_encodeSnappyBlockAsm12B + CMPL DI, $0x01 + JE matchlen_match1_repeat_extend_encodeSnappyBlockAsm12B + JB repeat_extend_forward_end_encodeSnappyBlockAsm12B MOVW (R8)(R10*1), R9 CMPW (BX)(R10*1), R9 JNE matchlen_match1_repeat_extend_encodeSnappyBlockAsm12B - SUBL $0x02, DI LEAL 2(R10), R10 + SUBL $0x02, DI + JZ repeat_extend_forward_end_encodeSnappyBlockAsm12B matchlen_match1_repeat_extend_encodeSnappyBlockAsm12B: - CMPL DI, $0x01 - JB repeat_extend_forward_end_encodeSnappyBlockAsm12B MOVB (R8)(R10*1), R9 CMPB (BX)(R10*1), R9 JNE repeat_extend_forward_end_encodeSnappyBlockAsm12B @@ -12536,7 +12526,6 @@ matchlen_loop_match_nolit_encodeSnappyBlockAsm12B: LEAL 8(R9), R9 CMPL SI, $0x08 JAE matchlen_loopback_match_nolit_encodeSnappyBlockAsm12B - JZ match_nolit_end_encodeSnappyBlockAsm12B matchlen_match4_match_nolit_encodeSnappyBlockAsm12B: CMPL SI, $0x04 @@ -12544,21 +12533,21 @@ matchlen_match4_match_nolit_encodeSnappyBlockAsm12B: MOVL (DI)(R9*1), R8 CMPL (BX)(R9*1), R8 JNE matchlen_match2_match_nolit_encodeSnappyBlockAsm12B - SUBL $0x04, SI + LEAL -4(SI), SI LEAL 4(R9), R9 matchlen_match2_match_nolit_encodeSnappyBlockAsm12B: - CMPL SI, $0x02 - JB matchlen_match1_match_nolit_encodeSnappyBlockAsm12B + CMPL SI, $0x01 + JE matchlen_match1_match_nolit_encodeSnappyBlockAsm12B + JB match_nolit_end_encodeSnappyBlockAsm12B MOVW (DI)(R9*1), R8 CMPW (BX)(R9*1), R8 JNE matchlen_match1_match_nolit_encodeSnappyBlockAsm12B - SUBL $0x02, SI LEAL 2(R9), R9 + SUBL $0x02, SI + JZ match_nolit_end_encodeSnappyBlockAsm12B matchlen_match1_match_nolit_encodeSnappyBlockAsm12B: - CMPL SI, $0x01 - JB match_nolit_end_encodeSnappyBlockAsm12B MOVB (DI)(R9*1), R8 CMPB (BX)(R9*1), R8 JNE match_nolit_end_encodeSnappyBlockAsm12B @@ -13037,7 +13026,6 @@ matchlen_loop_repeat_extend_encodeSnappyBlockAsm10B: LEAL 8(R10), R10 CMPL DI, $0x08 JAE matchlen_loopback_repeat_extend_encodeSnappyBlockAsm10B - JZ repeat_extend_forward_end_encodeSnappyBlockAsm10B matchlen_match4_repeat_extend_encodeSnappyBlockAsm10B: CMPL DI, $0x04 @@ -13045,21 +13033,21 @@ matchlen_match4_repeat_extend_encodeSnappyBlockAsm10B: MOVL (R8)(R10*1), R9 CMPL (BX)(R10*1), R9 JNE matchlen_match2_repeat_extend_encodeSnappyBlockAsm10B - SUBL $0x04, DI + LEAL -4(DI), DI LEAL 4(R10), R10 matchlen_match2_repeat_extend_encodeSnappyBlockAsm10B: - CMPL DI, $0x02 - JB matchlen_match1_repeat_extend_encodeSnappyBlockAsm10B + CMPL DI, $0x01 + JE matchlen_match1_repeat_extend_encodeSnappyBlockAsm10B + JB repeat_extend_forward_end_encodeSnappyBlockAsm10B MOVW (R8)(R10*1), R9 CMPW (BX)(R10*1), R9 JNE matchlen_match1_repeat_extend_encodeSnappyBlockAsm10B - SUBL $0x02, DI LEAL 2(R10), R10 + SUBL $0x02, DI + JZ repeat_extend_forward_end_encodeSnappyBlockAsm10B matchlen_match1_repeat_extend_encodeSnappyBlockAsm10B: - CMPL DI, $0x01 - JB repeat_extend_forward_end_encodeSnappyBlockAsm10B MOVB (R8)(R10*1), R9 CMPB (BX)(R10*1), R9 JNE repeat_extend_forward_end_encodeSnappyBlockAsm10B @@ -13320,7 +13308,6 @@ matchlen_loop_match_nolit_encodeSnappyBlockAsm10B: LEAL 8(R9), R9 CMPL SI, $0x08 JAE matchlen_loopback_match_nolit_encodeSnappyBlockAsm10B - JZ match_nolit_end_encodeSnappyBlockAsm10B matchlen_match4_match_nolit_encodeSnappyBlockAsm10B: CMPL SI, $0x04 @@ -13328,21 +13315,21 @@ matchlen_match4_match_nolit_encodeSnappyBlockAsm10B: MOVL (DI)(R9*1), R8 CMPL (BX)(R9*1), R8 JNE matchlen_match2_match_nolit_encodeSnappyBlockAsm10B - SUBL $0x04, SI + LEAL -4(SI), SI LEAL 4(R9), R9 matchlen_match2_match_nolit_encodeSnappyBlockAsm10B: - CMPL SI, $0x02 - JB matchlen_match1_match_nolit_encodeSnappyBlockAsm10B + CMPL SI, $0x01 + JE matchlen_match1_match_nolit_encodeSnappyBlockAsm10B + JB match_nolit_end_encodeSnappyBlockAsm10B MOVW (DI)(R9*1), R8 CMPW (BX)(R9*1), R8 JNE matchlen_match1_match_nolit_encodeSnappyBlockAsm10B - SUBL $0x02, SI LEAL 2(R9), R9 + SUBL $0x02, SI + JZ match_nolit_end_encodeSnappyBlockAsm10B matchlen_match1_match_nolit_encodeSnappyBlockAsm10B: - CMPL SI, $0x01 - JB match_nolit_end_encodeSnappyBlockAsm10B MOVB (DI)(R9*1), R8 CMPB (BX)(R9*1), R8 JNE match_nolit_end_encodeSnappyBlockAsm10B @@ -13821,7 +13808,6 @@ matchlen_loop_repeat_extend_encodeSnappyBlockAsm8B: LEAL 8(R10), R10 CMPL DI, $0x08 JAE matchlen_loopback_repeat_extend_encodeSnappyBlockAsm8B - JZ repeat_extend_forward_end_encodeSnappyBlockAsm8B matchlen_match4_repeat_extend_encodeSnappyBlockAsm8B: CMPL DI, $0x04 @@ -13829,21 +13815,21 @@ matchlen_match4_repeat_extend_encodeSnappyBlockAsm8B: MOVL (R8)(R10*1), R9 CMPL (BX)(R10*1), R9 JNE matchlen_match2_repeat_extend_encodeSnappyBlockAsm8B - SUBL $0x04, DI + LEAL -4(DI), DI LEAL 4(R10), R10 matchlen_match2_repeat_extend_encodeSnappyBlockAsm8B: - CMPL DI, $0x02 - JB matchlen_match1_repeat_extend_encodeSnappyBlockAsm8B + CMPL DI, $0x01 + JE matchlen_match1_repeat_extend_encodeSnappyBlockAsm8B + JB repeat_extend_forward_end_encodeSnappyBlockAsm8B MOVW (R8)(R10*1), R9 CMPW (BX)(R10*1), R9 JNE matchlen_match1_repeat_extend_encodeSnappyBlockAsm8B - SUBL $0x02, DI LEAL 2(R10), R10 + SUBL $0x02, DI + JZ repeat_extend_forward_end_encodeSnappyBlockAsm8B matchlen_match1_repeat_extend_encodeSnappyBlockAsm8B: - CMPL DI, $0x01 - JB repeat_extend_forward_end_encodeSnappyBlockAsm8B MOVB (R8)(R10*1), R9 CMPB (BX)(R10*1), R9 JNE repeat_extend_forward_end_encodeSnappyBlockAsm8B @@ -14102,7 +14088,6 @@ matchlen_loop_match_nolit_encodeSnappyBlockAsm8B: LEAL 8(R9), R9 CMPL SI, $0x08 JAE matchlen_loopback_match_nolit_encodeSnappyBlockAsm8B - JZ match_nolit_end_encodeSnappyBlockAsm8B matchlen_match4_match_nolit_encodeSnappyBlockAsm8B: CMPL SI, $0x04 @@ -14110,21 +14095,21 @@ matchlen_match4_match_nolit_encodeSnappyBlockAsm8B: MOVL (DI)(R9*1), R8 CMPL (BX)(R9*1), R8 JNE matchlen_match2_match_nolit_encodeSnappyBlockAsm8B - SUBL $0x04, SI + LEAL -4(SI), SI LEAL 4(R9), R9 matchlen_match2_match_nolit_encodeSnappyBlockAsm8B: - CMPL SI, $0x02 - JB matchlen_match1_match_nolit_encodeSnappyBlockAsm8B + CMPL SI, $0x01 + JE matchlen_match1_match_nolit_encodeSnappyBlockAsm8B + JB match_nolit_end_encodeSnappyBlockAsm8B MOVW (DI)(R9*1), R8 CMPW (BX)(R9*1), R8 JNE matchlen_match1_match_nolit_encodeSnappyBlockAsm8B - SUBL $0x02, SI LEAL 2(R9), R9 + SUBL $0x02, SI + JZ match_nolit_end_encodeSnappyBlockAsm8B matchlen_match1_match_nolit_encodeSnappyBlockAsm8B: - CMPL SI, $0x01 - JB match_nolit_end_encodeSnappyBlockAsm8B MOVB (DI)(R9*1), R8 CMPB (BX)(R9*1), R8 JNE match_nolit_end_encodeSnappyBlockAsm8B @@ -14513,7 +14498,6 @@ matchlen_loop_match_nolit_encodeSnappyBetterBlockAsm: LEAL 8(R11), R11 CMPL DI, $0x08 JAE matchlen_loopback_match_nolit_encodeSnappyBetterBlockAsm - JZ match_nolit_end_encodeSnappyBetterBlockAsm matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm: CMPL DI, $0x04 @@ -14521,21 +14505,21 @@ matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm: MOVL (R8)(R11*1), R10 CMPL (R9)(R11*1), R10 JNE matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm - SUBL $0x04, DI + LEAL -4(DI), DI LEAL 4(R11), R11 matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm: - CMPL DI, $0x02 - JB matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm + CMPL DI, $0x01 + JE matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm + JB match_nolit_end_encodeSnappyBetterBlockAsm MOVW (R8)(R11*1), R10 CMPW (R9)(R11*1), R10 JNE matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm - SUBL $0x02, DI LEAL 2(R11), R11 + SUBL $0x02, DI + JZ match_nolit_end_encodeSnappyBetterBlockAsm matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm: - CMPL DI, $0x01 - JB match_nolit_end_encodeSnappyBetterBlockAsm MOVB (R8)(R11*1), R10 CMPB (R9)(R11*1), R10 JNE match_nolit_end_encodeSnappyBetterBlockAsm @@ -14790,24 +14774,26 @@ match_nolit_dst_ok_encodeSnappyBetterBlockAsm: MOVL R8, 24(SP)(R11*4) MOVL DI, 524312(SP)(R10*4) MOVL R13, 524312(SP)(R12*4) + LEAQ 1(R8)(SI*1), DI + SHRQ $0x01, DI ADDQ $0x01, SI SUBQ $0x01, R8 index_loop_encodeSnappyBetterBlockAsm: - CMPQ SI, R8 + CMPQ DI, R8 JAE search_loop_encodeSnappyBetterBlockAsm - MOVQ (DX)(SI*1), DI - MOVQ (DX)(R8*1), R9 - SHLQ $0x08, DI - IMULQ BX, DI - SHRQ $0x2f, DI + MOVQ (DX)(SI*1), R9 + MOVQ (DX)(DI*1), R10 SHLQ $0x08, R9 IMULQ BX, R9 SHRQ $0x2f, R9 - MOVL SI, 24(SP)(DI*4) - MOVL R8, 24(SP)(R9*4) + SHLQ $0x08, R10 + IMULQ BX, R10 + SHRQ $0x2f, R10 + MOVL SI, 24(SP)(R9*4) + MOVL DI, 24(SP)(R10*4) ADDQ $0x02, SI - SUBQ $0x02, R8 + ADDQ $0x02, DI JMP index_loop_encodeSnappyBetterBlockAsm emit_remainder_encodeSnappyBetterBlockAsm: @@ -15135,7 +15121,6 @@ matchlen_loop_match_nolit_encodeSnappyBetterBlockAsm64K: LEAL 8(R11), R11 CMPL DI, $0x08 JAE matchlen_loopback_match_nolit_encodeSnappyBetterBlockAsm64K - JZ match_nolit_end_encodeSnappyBetterBlockAsm64K matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm64K: CMPL DI, $0x04 @@ -15143,21 +15128,21 @@ matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm64K: MOVL (R8)(R11*1), R10 CMPL (R9)(R11*1), R10 JNE matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm64K - SUBL $0x04, DI + LEAL -4(DI), DI LEAL 4(R11), R11 matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm64K: - CMPL DI, $0x02 - JB matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm64K + CMPL DI, $0x01 + JE matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm64K + JB match_nolit_end_encodeSnappyBetterBlockAsm64K MOVW (R8)(R11*1), R10 CMPW (R9)(R11*1), R10 JNE matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm64K - SUBL $0x02, DI LEAL 2(R11), R11 + SUBL $0x02, DI + JZ match_nolit_end_encodeSnappyBetterBlockAsm64K matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm64K: - CMPL DI, $0x01 - JB match_nolit_end_encodeSnappyBetterBlockAsm64K MOVB (R8)(R11*1), R10 CMPB (R9)(R11*1), R10 JNE match_nolit_end_encodeSnappyBetterBlockAsm64K @@ -15363,24 +15348,26 @@ match_nolit_dst_ok_encodeSnappyBetterBlockAsm64K: MOVL R8, 24(SP)(R11*4) MOVL DI, 262168(SP)(R10*4) MOVL R13, 262168(SP)(R12*4) + LEAQ 1(R8)(SI*1), DI + SHRQ $0x01, DI ADDQ $0x01, SI SUBQ $0x01, R8 index_loop_encodeSnappyBetterBlockAsm64K: - CMPQ SI, R8 + CMPQ DI, R8 JAE search_loop_encodeSnappyBetterBlockAsm64K - MOVQ (DX)(SI*1), DI - MOVQ (DX)(R8*1), R9 - SHLQ $0x08, DI - IMULQ BX, DI - SHRQ $0x30, DI + MOVQ (DX)(SI*1), R9 + MOVQ (DX)(DI*1), R10 SHLQ $0x08, R9 IMULQ BX, R9 SHRQ $0x30, R9 - MOVL SI, 24(SP)(DI*4) - MOVL R8, 24(SP)(R9*4) + SHLQ $0x08, R10 + IMULQ BX, R10 + SHRQ $0x30, R10 + MOVL SI, 24(SP)(R9*4) + MOVL DI, 24(SP)(R10*4) ADDQ $0x02, SI - SUBQ $0x02, R8 + ADDQ $0x02, DI JMP index_loop_encodeSnappyBetterBlockAsm64K emit_remainder_encodeSnappyBetterBlockAsm64K: @@ -15692,7 +15679,6 @@ matchlen_loop_match_nolit_encodeSnappyBetterBlockAsm12B: LEAL 8(R11), R11 CMPL DI, $0x08 JAE matchlen_loopback_match_nolit_encodeSnappyBetterBlockAsm12B - JZ match_nolit_end_encodeSnappyBetterBlockAsm12B matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm12B: CMPL DI, $0x04 @@ -15700,21 +15686,21 @@ matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm12B: MOVL (R8)(R11*1), R10 CMPL (R9)(R11*1), R10 JNE matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm12B - SUBL $0x04, DI + LEAL -4(DI), DI LEAL 4(R11), R11 matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm12B: - CMPL DI, $0x02 - JB matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm12B + CMPL DI, $0x01 + JE matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm12B + JB match_nolit_end_encodeSnappyBetterBlockAsm12B MOVW (R8)(R11*1), R10 CMPW (R9)(R11*1), R10 JNE matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm12B - SUBL $0x02, DI LEAL 2(R11), R11 + SUBL $0x02, DI + JZ match_nolit_end_encodeSnappyBetterBlockAsm12B matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm12B: - CMPL DI, $0x01 - JB match_nolit_end_encodeSnappyBetterBlockAsm12B MOVB (R8)(R11*1), R10 CMPB (R9)(R11*1), R10 JNE match_nolit_end_encodeSnappyBetterBlockAsm12B @@ -15920,24 +15906,26 @@ match_nolit_dst_ok_encodeSnappyBetterBlockAsm12B: MOVL R8, 24(SP)(R11*4) MOVL DI, 65560(SP)(R10*4) MOVL R13, 65560(SP)(R12*4) + LEAQ 1(R8)(SI*1), DI + SHRQ $0x01, DI ADDQ $0x01, SI SUBQ $0x01, R8 index_loop_encodeSnappyBetterBlockAsm12B: - CMPQ SI, R8 + CMPQ DI, R8 JAE search_loop_encodeSnappyBetterBlockAsm12B - MOVQ (DX)(SI*1), DI - MOVQ (DX)(R8*1), R9 - SHLQ $0x10, DI - IMULQ BX, DI - SHRQ $0x32, DI + MOVQ (DX)(SI*1), R9 + MOVQ (DX)(DI*1), R10 SHLQ $0x10, R9 IMULQ BX, R9 SHRQ $0x32, R9 - MOVL SI, 24(SP)(DI*4) - MOVL R8, 24(SP)(R9*4) + SHLQ $0x10, R10 + IMULQ BX, R10 + SHRQ $0x32, R10 + MOVL SI, 24(SP)(R9*4) + MOVL DI, 24(SP)(R10*4) ADDQ $0x02, SI - SUBQ $0x02, R8 + ADDQ $0x02, DI JMP index_loop_encodeSnappyBetterBlockAsm12B emit_remainder_encodeSnappyBetterBlockAsm12B: @@ -16249,7 +16237,6 @@ matchlen_loop_match_nolit_encodeSnappyBetterBlockAsm10B: LEAL 8(R11), R11 CMPL DI, $0x08 JAE matchlen_loopback_match_nolit_encodeSnappyBetterBlockAsm10B - JZ match_nolit_end_encodeSnappyBetterBlockAsm10B matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm10B: CMPL DI, $0x04 @@ -16257,21 +16244,21 @@ matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm10B: MOVL (R8)(R11*1), R10 CMPL (R9)(R11*1), R10 JNE matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm10B - SUBL $0x04, DI + LEAL -4(DI), DI LEAL 4(R11), R11 matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm10B: - CMPL DI, $0x02 - JB matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm10B + CMPL DI, $0x01 + JE matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm10B + JB match_nolit_end_encodeSnappyBetterBlockAsm10B MOVW (R8)(R11*1), R10 CMPW (R9)(R11*1), R10 JNE matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm10B - SUBL $0x02, DI LEAL 2(R11), R11 + SUBL $0x02, DI + JZ match_nolit_end_encodeSnappyBetterBlockAsm10B matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm10B: - CMPL DI, $0x01 - JB match_nolit_end_encodeSnappyBetterBlockAsm10B MOVB (R8)(R11*1), R10 CMPB (R9)(R11*1), R10 JNE match_nolit_end_encodeSnappyBetterBlockAsm10B @@ -16477,24 +16464,26 @@ match_nolit_dst_ok_encodeSnappyBetterBlockAsm10B: MOVL R8, 24(SP)(R11*4) MOVL DI, 16408(SP)(R10*4) MOVL R13, 16408(SP)(R12*4) + LEAQ 1(R8)(SI*1), DI + SHRQ $0x01, DI ADDQ $0x01, SI SUBQ $0x01, R8 index_loop_encodeSnappyBetterBlockAsm10B: - CMPQ SI, R8 + CMPQ DI, R8 JAE search_loop_encodeSnappyBetterBlockAsm10B - MOVQ (DX)(SI*1), DI - MOVQ (DX)(R8*1), R9 - SHLQ $0x10, DI - IMULQ BX, DI - SHRQ $0x34, DI + MOVQ (DX)(SI*1), R9 + MOVQ (DX)(DI*1), R10 SHLQ $0x10, R9 IMULQ BX, R9 SHRQ $0x34, R9 - MOVL SI, 24(SP)(DI*4) - MOVL R8, 24(SP)(R9*4) + SHLQ $0x10, R10 + IMULQ BX, R10 + SHRQ $0x34, R10 + MOVL SI, 24(SP)(R9*4) + MOVL DI, 24(SP)(R10*4) ADDQ $0x02, SI - SUBQ $0x02, R8 + ADDQ $0x02, DI JMP index_loop_encodeSnappyBetterBlockAsm10B emit_remainder_encodeSnappyBetterBlockAsm10B: @@ -16806,7 +16795,6 @@ matchlen_loop_match_nolit_encodeSnappyBetterBlockAsm8B: LEAL 8(R11), R11 CMPL DI, $0x08 JAE matchlen_loopback_match_nolit_encodeSnappyBetterBlockAsm8B - JZ match_nolit_end_encodeSnappyBetterBlockAsm8B matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm8B: CMPL DI, $0x04 @@ -16814,21 +16802,21 @@ matchlen_match4_match_nolit_encodeSnappyBetterBlockAsm8B: MOVL (R8)(R11*1), R10 CMPL (R9)(R11*1), R10 JNE matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm8B - SUBL $0x04, DI + LEAL -4(DI), DI LEAL 4(R11), R11 matchlen_match2_match_nolit_encodeSnappyBetterBlockAsm8B: - CMPL DI, $0x02 - JB matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm8B + CMPL DI, $0x01 + JE matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm8B + JB match_nolit_end_encodeSnappyBetterBlockAsm8B MOVW (R8)(R11*1), R10 CMPW (R9)(R11*1), R10 JNE matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm8B - SUBL $0x02, DI LEAL 2(R11), R11 + SUBL $0x02, DI + JZ match_nolit_end_encodeSnappyBetterBlockAsm8B matchlen_match1_match_nolit_encodeSnappyBetterBlockAsm8B: - CMPL DI, $0x01 - JB match_nolit_end_encodeSnappyBetterBlockAsm8B MOVB (R8)(R11*1), R10 CMPB (R9)(R11*1), R10 JNE match_nolit_end_encodeSnappyBetterBlockAsm8B @@ -17032,24 +17020,26 @@ match_nolit_dst_ok_encodeSnappyBetterBlockAsm8B: MOVL R8, 24(SP)(R11*4) MOVL DI, 4120(SP)(R10*4) MOVL R13, 4120(SP)(R12*4) + LEAQ 1(R8)(SI*1), DI + SHRQ $0x01, DI ADDQ $0x01, SI SUBQ $0x01, R8 index_loop_encodeSnappyBetterBlockAsm8B: - CMPQ SI, R8 + CMPQ DI, R8 JAE search_loop_encodeSnappyBetterBlockAsm8B - MOVQ (DX)(SI*1), DI - MOVQ (DX)(R8*1), R9 - SHLQ $0x10, DI - IMULQ BX, DI - SHRQ $0x36, DI + MOVQ (DX)(SI*1), R9 + MOVQ (DX)(DI*1), R10 SHLQ $0x10, R9 IMULQ BX, R9 SHRQ $0x36, R9 - MOVL SI, 24(SP)(DI*4) - MOVL R8, 24(SP)(R9*4) + SHLQ $0x10, R10 + IMULQ BX, R10 + SHRQ $0x36, R10 + MOVL SI, 24(SP)(R9*4) + MOVL DI, 24(SP)(R10*4) ADDQ $0x02, SI - SUBQ $0x02, R8 + ADDQ $0x02, DI JMP index_loop_encodeSnappyBetterBlockAsm8B emit_remainder_encodeSnappyBetterBlockAsm8B: @@ -17378,7 +17368,6 @@ matchlen_loop_repeat_extend_calcBlockSize: LEAL 8(R10), R10 CMPL DI, $0x08 JAE matchlen_loopback_repeat_extend_calcBlockSize - JZ repeat_extend_forward_end_calcBlockSize matchlen_match4_repeat_extend_calcBlockSize: CMPL DI, $0x04 @@ -17386,21 +17375,21 @@ matchlen_match4_repeat_extend_calcBlockSize: MOVL (R8)(R10*1), R9 CMPL (BX)(R10*1), R9 JNE matchlen_match2_repeat_extend_calcBlockSize - SUBL $0x04, DI + LEAL -4(DI), DI LEAL 4(R10), R10 matchlen_match2_repeat_extend_calcBlockSize: - CMPL DI, $0x02 - JB matchlen_match1_repeat_extend_calcBlockSize + CMPL DI, $0x01 + JE matchlen_match1_repeat_extend_calcBlockSize + JB repeat_extend_forward_end_calcBlockSize MOVW (R8)(R10*1), R9 CMPW (BX)(R10*1), R9 JNE matchlen_match1_repeat_extend_calcBlockSize - SUBL $0x02, DI LEAL 2(R10), R10 + SUBL $0x02, DI + JZ repeat_extend_forward_end_calcBlockSize matchlen_match1_repeat_extend_calcBlockSize: - CMPL DI, $0x01 - JB repeat_extend_forward_end_calcBlockSize MOVB (R8)(R10*1), R9 CMPB (BX)(R10*1), R9 JNE repeat_extend_forward_end_calcBlockSize @@ -17590,7 +17579,6 @@ matchlen_loop_match_nolit_calcBlockSize: LEAL 8(R9), R9 CMPL SI, $0x08 JAE matchlen_loopback_match_nolit_calcBlockSize - JZ match_nolit_end_calcBlockSize matchlen_match4_match_nolit_calcBlockSize: CMPL SI, $0x04 @@ -17598,21 +17586,21 @@ matchlen_match4_match_nolit_calcBlockSize: MOVL (DI)(R9*1), R8 CMPL (BX)(R9*1), R8 JNE matchlen_match2_match_nolit_calcBlockSize - SUBL $0x04, SI + LEAL -4(SI), SI LEAL 4(R9), R9 matchlen_match2_match_nolit_calcBlockSize: - CMPL SI, $0x02 - JB matchlen_match1_match_nolit_calcBlockSize + CMPL SI, $0x01 + JE matchlen_match1_match_nolit_calcBlockSize + JB match_nolit_end_calcBlockSize MOVW (DI)(R9*1), R8 CMPW (BX)(R9*1), R8 JNE matchlen_match1_match_nolit_calcBlockSize - SUBL $0x02, SI LEAL 2(R9), R9 + SUBL $0x02, SI + JZ match_nolit_end_calcBlockSize matchlen_match1_match_nolit_calcBlockSize: - CMPL SI, $0x01 - JB match_nolit_end_calcBlockSize MOVB (DI)(R9*1), R8 CMPB (BX)(R9*1), R8 JNE match_nolit_end_calcBlockSize @@ -17909,7 +17897,6 @@ matchlen_loop_repeat_extend_calcBlockSizeSmall: LEAL 8(R10), R10 CMPL DI, $0x08 JAE matchlen_loopback_repeat_extend_calcBlockSizeSmall - JZ repeat_extend_forward_end_calcBlockSizeSmall matchlen_match4_repeat_extend_calcBlockSizeSmall: CMPL DI, $0x04 @@ -17917,21 +17904,21 @@ matchlen_match4_repeat_extend_calcBlockSizeSmall: MOVL (R8)(R10*1), R9 CMPL (BX)(R10*1), R9 JNE matchlen_match2_repeat_extend_calcBlockSizeSmall - SUBL $0x04, DI + LEAL -4(DI), DI LEAL 4(R10), R10 matchlen_match2_repeat_extend_calcBlockSizeSmall: - CMPL DI, $0x02 - JB matchlen_match1_repeat_extend_calcBlockSizeSmall + CMPL DI, $0x01 + JE matchlen_match1_repeat_extend_calcBlockSizeSmall + JB repeat_extend_forward_end_calcBlockSizeSmall MOVW (R8)(R10*1), R9 CMPW (BX)(R10*1), R9 JNE matchlen_match1_repeat_extend_calcBlockSizeSmall - SUBL $0x02, DI LEAL 2(R10), R10 + SUBL $0x02, DI + JZ repeat_extend_forward_end_calcBlockSizeSmall matchlen_match1_repeat_extend_calcBlockSizeSmall: - CMPL DI, $0x01 - JB repeat_extend_forward_end_calcBlockSizeSmall MOVB (R8)(R10*1), R9 CMPB (BX)(R10*1), R9 JNE repeat_extend_forward_end_calcBlockSizeSmall @@ -18091,7 +18078,6 @@ matchlen_loop_match_nolit_calcBlockSizeSmall: LEAL 8(R9), R9 CMPL SI, $0x08 JAE matchlen_loopback_match_nolit_calcBlockSizeSmall - JZ match_nolit_end_calcBlockSizeSmall matchlen_match4_match_nolit_calcBlockSizeSmall: CMPL SI, $0x04 @@ -18099,21 +18085,21 @@ matchlen_match4_match_nolit_calcBlockSizeSmall: MOVL (DI)(R9*1), R8 CMPL (BX)(R9*1), R8 JNE matchlen_match2_match_nolit_calcBlockSizeSmall - SUBL $0x04, SI + LEAL -4(SI), SI LEAL 4(R9), R9 matchlen_match2_match_nolit_calcBlockSizeSmall: - CMPL SI, $0x02 - JB matchlen_match1_match_nolit_calcBlockSizeSmall + CMPL SI, $0x01 + JE matchlen_match1_match_nolit_calcBlockSizeSmall + JB match_nolit_end_calcBlockSizeSmall MOVW (DI)(R9*1), R8 CMPW (BX)(R9*1), R8 JNE matchlen_match1_match_nolit_calcBlockSizeSmall - SUBL $0x02, SI LEAL 2(R9), R9 + SUBL $0x02, SI + JZ match_nolit_end_calcBlockSizeSmall matchlen_match1_match_nolit_calcBlockSizeSmall: - CMPL SI, $0x01 - JB match_nolit_end_calcBlockSizeSmall MOVB (DI)(R9*1), R8 CMPB (BX)(R9*1), R8 JNE match_nolit_end_calcBlockSizeSmall @@ -18879,7 +18865,6 @@ matchlen_loop_standalone: LEAL 8(SI), SI CMPL DX, $0x08 JAE matchlen_loopback_standalone - JZ gen_match_len_end matchlen_match4_standalone: CMPL DX, $0x04 @@ -18887,21 +18872,21 @@ matchlen_match4_standalone: MOVL (AX)(SI*1), BX CMPL (CX)(SI*1), BX JNE matchlen_match2_standalone - SUBL $0x04, DX + LEAL -4(DX), DX LEAL 4(SI), SI matchlen_match2_standalone: - CMPL DX, $0x02 - JB matchlen_match1_standalone + CMPL DX, $0x01 + JE matchlen_match1_standalone + JB gen_match_len_end MOVW (AX)(SI*1), BX CMPW (CX)(SI*1), BX JNE matchlen_match1_standalone - SUBL $0x02, DX LEAL 2(SI), SI + SUBL $0x02, DX + JZ gen_match_len_end matchlen_match1_standalone: - CMPL DX, $0x01 - JB gen_match_len_end MOVB (AX)(SI*1), BL CMPB (CX)(SI*1), BL JNE gen_match_len_end diff --git a/vendor/github.com/klauspost/compress/s2/writer.go b/vendor/github.com/klauspost/compress/s2/writer.go index 5a944068..089cd36d 100644 --- a/vendor/github.com/klauspost/compress/s2/writer.go +++ b/vendor/github.com/klauspost/compress/s2/writer.go @@ -771,7 +771,7 @@ func (w *Writer) closeIndex(idx bool) ([]byte, error) { } var index []byte - if w.err(nil) == nil && w.writer != nil { + if w.err(err) == nil && w.writer != nil { // Create index. if idx { compSize := int64(-1) diff --git a/vendor/github.com/klauspost/compress/zstd/README.md b/vendor/github.com/klauspost/compress/zstd/README.md index 65b38abe..bdd49c8b 100644 --- a/vendor/github.com/klauspost/compress/zstd/README.md +++ b/vendor/github.com/klauspost/compress/zstd/README.md @@ -304,7 +304,7 @@ import "github.com/klauspost/compress/zstd" // Create a reader that caches decompressors. // For this operation type we supply a nil Reader. -var decoder, _ = zstd.NewReader(nil, WithDecoderConcurrency(0)) +var decoder, _ = zstd.NewReader(nil, zstd.WithDecoderConcurrency(0)) // Decompress a buffer. We don't supply a destination buffer, // so it will be allocated by the decoder. diff --git a/vendor/github.com/klauspost/compress/zstd/blockdec.go b/vendor/github.com/klauspost/compress/zstd/blockdec.go index 5f272d87..9f17ce60 100644 --- a/vendor/github.com/klauspost/compress/zstd/blockdec.go +++ b/vendor/github.com/klauspost/compress/zstd/blockdec.go @@ -592,7 +592,7 @@ func (b *blockDec) prepareSequences(in []byte, hist *history) (err error) { } seq.fse.setRLE(symb) if debugDecoder { - printf("RLE set to %+v, code: %v", symb, v) + printf("RLE set to 0x%x, code: %v", symb, v) } case compModeFSE: println("Reading table for", tableIndex(i)) diff --git a/vendor/github.com/klauspost/compress/zstd/decoder_options.go b/vendor/github.com/klauspost/compress/zstd/decoder_options.go index 07a90dd7..774c5f00 100644 --- a/vendor/github.com/klauspost/compress/zstd/decoder_options.go +++ b/vendor/github.com/klauspost/compress/zstd/decoder_options.go @@ -107,7 +107,7 @@ func WithDecoderDicts(dicts ...[]byte) DOption { } } -// WithEncoderDictRaw registers a dictionary that may be used by the decoder. +// WithDecoderDictRaw registers a dictionary that may be used by the decoder. // The slice content can be arbitrary data. func WithDecoderDictRaw(id uint32, content []byte) DOption { return func(o *decoderOptions) error { diff --git a/vendor/github.com/klauspost/compress/zstd/enc_fast.go b/vendor/github.com/klauspost/compress/zstd/enc_fast.go index 315b1a8f..cbc626ee 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_fast.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_fast.go @@ -133,8 +133,7 @@ encodeLoop: if canRepeat && repIndex >= 0 && load3232(src, repIndex) == uint32(cv>>16) { // Consider history as well. var seq seq - var length int32 - length = 4 + e.matchlen(s+6, repIndex+4, src) + length := 4 + e.matchlen(s+6, repIndex+4, src) seq.matchLen = uint32(length - zstdMinMatch) // We might be able to match backwards. @@ -645,8 +644,7 @@ encodeLoop: if canRepeat && repIndex >= 0 && load3232(src, repIndex) == uint32(cv>>16) { // Consider history as well. var seq seq - var length int32 - length = 4 + e.matchlen(s+6, repIndex+4, src) + length := 4 + e.matchlen(s+6, repIndex+4, src) seq.matchLen = uint32(length - zstdMinMatch) diff --git a/vendor/github.com/klauspost/compress/zstd/encoder_options.go b/vendor/github.com/klauspost/compress/zstd/encoder_options.go index 50f70533..faaf8192 100644 --- a/vendor/github.com/klauspost/compress/zstd/encoder_options.go +++ b/vendor/github.com/klauspost/compress/zstd/encoder_options.go @@ -129,7 +129,7 @@ func WithEncoderPadding(n int) EOption { } // No need to waste our time. if n == 1 { - o.pad = 0 + n = 0 } if n > 1<<30 { return fmt.Errorf("padding must less than 1GB (1<<30 bytes) ") diff --git a/vendor/github.com/klauspost/compress/zstd/framedec.go b/vendor/github.com/klauspost/compress/zstd/framedec.go index cc0aa227..53e160f7 100644 --- a/vendor/github.com/klauspost/compress/zstd/framedec.go +++ b/vendor/github.com/klauspost/compress/zstd/framedec.go @@ -73,20 +73,20 @@ func (d *frameDec) reset(br byteBuffer) error { switch err { case io.EOF, io.ErrUnexpectedEOF: return io.EOF - default: - return err case nil: signature[0] = b[0] + default: + return err } // Read the rest, don't allow io.ErrUnexpectedEOF b, err = br.readSmall(3) switch err { case io.EOF: return io.EOF - default: - return err case nil: copy(signature[1:], b) + default: + return err } if string(signature[1:4]) != skippableFrameMagic || signature[0]&0xf0 != 0x50 { diff --git a/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.go b/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.go new file mode 100644 index 00000000..f41932b7 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.go @@ -0,0 +1,16 @@ +//go:build amd64 && !appengine && !noasm && gc +// +build amd64,!appengine,!noasm,gc + +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. + +package zstd + +// matchLen returns how many bytes match in a and b +// +// It assumes that: +// +// len(a) <= len(b) and len(a) > 0 +// +//go:noescape +func matchLen(a []byte, b []byte) int diff --git a/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.s b/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.s new file mode 100644 index 00000000..9a7655c0 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.s @@ -0,0 +1,68 @@ +// Copied from S2 implementation. + +//go:build !appengine && !noasm && gc && !noasm + +#include "textflag.h" + +// func matchLen(a []byte, b []byte) int +// Requires: BMI +TEXT ·matchLen(SB), NOSPLIT, $0-56 + MOVQ a_base+0(FP), AX + MOVQ b_base+24(FP), CX + MOVQ a_len+8(FP), DX + + // matchLen + XORL SI, SI + CMPL DX, $0x08 + JB matchlen_match4_standalone + +matchlen_loopback_standalone: + MOVQ (AX)(SI*1), BX + XORQ (CX)(SI*1), BX + TESTQ BX, BX + JZ matchlen_loop_standalone + +#ifdef GOAMD64_v3 + TZCNTQ BX, BX +#else + BSFQ BX, BX +#endif + SARQ $0x03, BX + LEAL (SI)(BX*1), SI + JMP gen_match_len_end + +matchlen_loop_standalone: + LEAL -8(DX), DX + LEAL 8(SI), SI + CMPL DX, $0x08 + JAE matchlen_loopback_standalone + +matchlen_match4_standalone: + CMPL DX, $0x04 + JB matchlen_match2_standalone + MOVL (AX)(SI*1), BX + CMPL (CX)(SI*1), BX + JNE matchlen_match2_standalone + LEAL -4(DX), DX + LEAL 4(SI), SI + +matchlen_match2_standalone: + CMPL DX, $0x02 + JB matchlen_match1_standalone + MOVW (AX)(SI*1), BX + CMPW (CX)(SI*1), BX + JNE matchlen_match1_standalone + LEAL -2(DX), DX + LEAL 2(SI), SI + +matchlen_match1_standalone: + CMPL DX, $0x01 + JB gen_match_len_end + MOVB (AX)(SI*1), BL + CMPB (CX)(SI*1), BL + JNE gen_match_len_end + INCL SI + +gen_match_len_end: + MOVQ SI, ret+48(FP) + RET diff --git a/vendor/github.com/klauspost/compress/zstd/matchlen_generic.go b/vendor/github.com/klauspost/compress/zstd/matchlen_generic.go new file mode 100644 index 00000000..57b9c31c --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/matchlen_generic.go @@ -0,0 +1,33 @@ +//go:build !amd64 || appengine || !gc || noasm +// +build !amd64 appengine !gc noasm + +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. + +package zstd + +import ( + "encoding/binary" + "math/bits" +) + +// matchLen returns the maximum common prefix length of a and b. +// a must be the shortest of the two. +func matchLen(a, b []byte) (n int) { + for ; len(a) >= 8 && len(b) >= 8; a, b = a[8:], b[8:] { + diff := binary.LittleEndian.Uint64(a) ^ binary.LittleEndian.Uint64(b) + if diff != 0 { + return n + bits.TrailingZeros64(diff)>>3 + } + n += 8 + } + + for i := range a { + if a[i] != b[i] { + break + } + n++ + } + return n + +} diff --git a/vendor/github.com/klauspost/compress/zstd/zstd.go b/vendor/github.com/klauspost/compress/zstd/zstd.go index 89396673..4be7cc73 100644 --- a/vendor/github.com/klauspost/compress/zstd/zstd.go +++ b/vendor/github.com/klauspost/compress/zstd/zstd.go @@ -9,7 +9,6 @@ import ( "errors" "log" "math" - "math/bits" ) // enable debug printing @@ -106,27 +105,6 @@ func printf(format string, a ...interface{}) { } } -// matchLen returns the maximum common prefix length of a and b. -// a must be the shortest of the two. -func matchLen(a, b []byte) (n int) { - for ; len(a) >= 8 && len(b) >= 8; a, b = a[8:], b[8:] { - diff := binary.LittleEndian.Uint64(a) ^ binary.LittleEndian.Uint64(b) - if diff != 0 { - return n + bits.TrailingZeros64(diff)>>3 - } - n += 8 - } - - for i := range a { - if a[i] != b[i] { - break - } - n++ - } - return n - -} - func load3232(b []byte, i int32) uint32 { return binary.LittleEndian.Uint32(b[:len(b):len(b)][i:]) } diff --git a/vendor/github.com/klauspost/cpuid/v2/README.md b/vendor/github.com/klauspost/cpuid/v2/README.md index 37b5167d..accd7aba 100644 --- a/vendor/github.com/klauspost/cpuid/v2/README.md +++ b/vendor/github.com/klauspost/cpuid/v2/README.md @@ -435,6 +435,7 @@ Exit Code 1 | SYSCALL | System-Call Extension (SCE): SYSCALL and SYSRET instructions. | | SYSEE | SYSENTER and SYSEXIT instructions | | TBM | AMD Trailing Bit Manipulation | +| TDX_GUEST | Intel Trust Domain Extensions Guest | | TLB_FLUSH_NESTED | AMD: Flushing includes all the nested translations for guest translations | | TME | Intel Total Memory Encryption. The following MSRs are supported: IA32_TME_CAPABILITY, IA32_TME_ACTIVATE, IA32_TME_EXCLUDE_MASK, and IA32_TME_EXCLUDE_BASE. | | TOPEXT | TopologyExtensions: topology extensions support. Indicates support for CPUID Fn8000_001D_EAX_x[N:0]-CPUID Fn8000_001E_EDX. | diff --git a/vendor/github.com/klauspost/cpuid/v2/cpuid.go b/vendor/github.com/klauspost/cpuid/v2/cpuid.go index 89a861d4..d015c744 100644 --- a/vendor/github.com/klauspost/cpuid/v2/cpuid.go +++ b/vendor/github.com/klauspost/cpuid/v2/cpuid.go @@ -226,6 +226,7 @@ const ( SYSCALL // System-Call Extension (SCE): SYSCALL and SYSRET instructions. SYSEE // SYSENTER and SYSEXIT instructions TBM // AMD Trailing Bit Manipulation + TDX_GUEST // Intel Trust Domain Extensions Guest TLB_FLUSH_NESTED // AMD: Flushing includes all the nested translations for guest translations TME // Intel Total Memory Encryption. The following MSRs are supported: IA32_TME_CAPABILITY, IA32_TME_ACTIVATE, IA32_TME_EXCLUDE_MASK, and IA32_TME_EXCLUDE_BASE. TOPEXT // TopologyExtensions: topology extensions support. Indicates support for CPUID Fn8000_001D_EAX_x[N:0]-CPUID Fn8000_001E_EDX. @@ -1186,13 +1187,8 @@ func support() flagSet { fs.setIf(edx&(1<<30) != 0, IA32_CORE_CAP) fs.setIf(edx&(1<<31) != 0, SPEC_CTRL_SSBD) - // CPUID.(EAX=7, ECX=1).EDX - fs.setIf(edx&(1<<4) != 0, AVXVNNIINT8) - fs.setIf(edx&(1<<5) != 0, AVXNECONVERT) - fs.setIf(edx&(1<<14) != 0, PREFETCHI) - // CPUID.(EAX=7, ECX=1).EAX - eax1, _, _, _ := cpuidex(7, 1) + eax1, _, _, edx1 := cpuidex(7, 1) fs.setIf(fs.inSet(AVX) && eax1&(1<<4) != 0, AVXVNNI) fs.setIf(eax1&(1<<7) != 0, CMPCCXADD) fs.setIf(eax1&(1<<10) != 0, MOVSB_ZL) @@ -1202,6 +1198,11 @@ func support() flagSet { fs.setIf(eax1&(1<<23) != 0, AVXIFMA) fs.setIf(eax1&(1<<26) != 0, LAM) + // CPUID.(EAX=7, ECX=1).EDX + fs.setIf(edx1&(1<<4) != 0, AVXVNNIINT8) + fs.setIf(edx1&(1<<5) != 0, AVXNECONVERT) + fs.setIf(edx1&(1<<14) != 0, PREFETCHI) + // Only detect AVX-512 features if XGETBV is supported if c&((1<<26)|(1<<27)) == (1<<26)|(1<<27) { // Check for OS support @@ -1393,6 +1394,13 @@ func support() flagSet { fs.setIf((a>>24)&1 == 1, VMSA_REGPROT) } + if mfi >= 0x21 { + // Intel Trusted Domain Extensions Guests have their own cpuid leaf (0x21). + _, ebx, ecx, edx := cpuid(0x21) + identity := string(valAsString(ebx, edx, ecx)) + fs.setIf(identity == "IntelTDX ", TDX_GUEST) + } + return fs } diff --git a/vendor/github.com/klauspost/cpuid/v2/featureid_string.go b/vendor/github.com/klauspost/cpuid/v2/featureid_string.go index 2a27f44d..024c706a 100644 --- a/vendor/github.com/klauspost/cpuid/v2/featureid_string.go +++ b/vendor/github.com/klauspost/cpuid/v2/featureid_string.go @@ -166,59 +166,60 @@ func _() { _ = x[SYSCALL-156] _ = x[SYSEE-157] _ = x[TBM-158] - _ = x[TLB_FLUSH_NESTED-159] - _ = x[TME-160] - _ = x[TOPEXT-161] - _ = x[TSCRATEMSR-162] - _ = x[TSXLDTRK-163] - _ = x[VAES-164] - _ = x[VMCBCLEAN-165] - _ = x[VMPL-166] - _ = x[VMSA_REGPROT-167] - _ = x[VMX-168] - _ = x[VPCLMULQDQ-169] - _ = x[VTE-170] - _ = x[WAITPKG-171] - _ = x[WBNOINVD-172] - _ = x[WRMSRNS-173] - _ = x[X87-174] - _ = x[XGETBV1-175] - _ = x[XOP-176] - _ = x[XSAVE-177] - _ = x[XSAVEC-178] - _ = x[XSAVEOPT-179] - _ = x[XSAVES-180] - _ = x[AESARM-181] - _ = x[ARMCPUID-182] - _ = x[ASIMD-183] - _ = x[ASIMDDP-184] - _ = x[ASIMDHP-185] - _ = x[ASIMDRDM-186] - _ = x[ATOMICS-187] - _ = x[CRC32-188] - _ = x[DCPOP-189] - _ = x[EVTSTRM-190] - _ = x[FCMA-191] - _ = x[FP-192] - _ = x[FPHP-193] - _ = x[GPA-194] - _ = x[JSCVT-195] - _ = x[LRCPC-196] - _ = x[PMULL-197] - _ = x[SHA1-198] - _ = x[SHA2-199] - _ = x[SHA3-200] - _ = x[SHA512-201] - _ = x[SM3-202] - _ = x[SM4-203] - _ = x[SVE-204] - _ = x[lastID-205] + _ = x[TDX_GUEST-159] + _ = x[TLB_FLUSH_NESTED-160] + _ = x[TME-161] + _ = x[TOPEXT-162] + _ = x[TSCRATEMSR-163] + _ = x[TSXLDTRK-164] + _ = x[VAES-165] + _ = x[VMCBCLEAN-166] + _ = x[VMPL-167] + _ = x[VMSA_REGPROT-168] + _ = x[VMX-169] + _ = x[VPCLMULQDQ-170] + _ = x[VTE-171] + _ = x[WAITPKG-172] + _ = x[WBNOINVD-173] + _ = x[WRMSRNS-174] + _ = x[X87-175] + _ = x[XGETBV1-176] + _ = x[XOP-177] + _ = x[XSAVE-178] + _ = x[XSAVEC-179] + _ = x[XSAVEOPT-180] + _ = x[XSAVES-181] + _ = x[AESARM-182] + _ = x[ARMCPUID-183] + _ = x[ASIMD-184] + _ = x[ASIMDDP-185] + _ = x[ASIMDHP-186] + _ = x[ASIMDRDM-187] + _ = x[ATOMICS-188] + _ = x[CRC32-189] + _ = x[DCPOP-190] + _ = x[EVTSTRM-191] + _ = x[FCMA-192] + _ = x[FP-193] + _ = x[FPHP-194] + _ = x[GPA-195] + _ = x[JSCVT-196] + _ = x[LRCPC-197] + _ = x[PMULL-198] + _ = x[SHA1-199] + _ = x[SHA2-200] + _ = x[SHA3-201] + _ = x[SHA512-202] + _ = x[SM3-203] + _ = x[SM4-204] + _ = x[SVE-205] + _ = x[lastID-206] _ = x[firstID-0] } -const _FeatureID_name = "firstIDADXAESNIAMD3DNOWAMD3DNOWEXTAMXBF16AMXFP16AMXINT8AMXTILEAVXAVX2AVX512BF16AVX512BITALGAVX512BWAVX512CDAVX512DQAVX512ERAVX512FAVX512FP16AVX512IFMAAVX512PFAVX512VBMIAVX512VBMI2AVX512VLAVX512VNNIAVX512VP2INTERSECTAVX512VPOPCNTDQAVXIFMAAVXNECONVERTAVXSLOWAVXVNNIAVXVNNIINT8BHI_CTRLBMI1BMI2CETIBTCETSSCLDEMOTECLMULCLZEROCMOVCMPCCXADDCMPSB_SCADBS_SHORTCMPXCHG8CPBOOSTCPPCCX16EFER_LMSLE_UNSENQCMDERMSF16CFLUSH_L1DFMA3FMA4FP128FP256FSRMFXSRFXSROPTGFNIHLEHRESETHTTHWAHYBRID_CPUHYPERVISORIA32_ARCH_CAPIA32_CORE_CAPIBPBIBRSIBRS_PREFERREDIBRS_PROVIDES_SMPIBSIBSBRNTRGTIBSFETCHSAMIBSFFVIBSOPCNTIBSOPCNTEXTIBSOPSAMIBSRDWROPCNTIBSRIPINVALIDCHKIBS_FETCH_CTLXIBS_OPDATA4IBS_OPFUSEIBS_PREVENTHOSTIBS_ZEN4IDPRED_CTRLINT_WBINVDINVLPGBLAHFLAMLBRVIRTLZCNTMCAOVERFLOWMCDT_NOMCOMMITMD_CLEARMMXMMXEXTMOVBEMOVDIR64BMOVDIRIMOVSB_ZLMOVUMPXMSRIRCMSRLISTMSR_PAGEFLUSHNRIPSNXOSXSAVEPCONFIGPOPCNTPPINPREFETCHIPSFDRDPRURDRANDRDSEEDRDTSCPRRSBA_CTRLRTMRTM_ALWAYS_ABORTSERIALIZESEVSEV_64BITSEV_ALTERNATIVESEV_DEBUGSWAPSEV_ESSEV_RESTRICTEDSEV_SNPSGXSGXLCSHASMESME_COHERENTSPEC_CTRL_SSBDSRBDS_CTRLSSESSE2SSE3SSE4SSE42SSE4ASSSE3STIBPSTIBP_ALWAYSONSTOSB_SHORTSUCCORSVMSVMDASVMFBASIDSVMLSVMNPSVMPFSVMPFTSYSCALLSYSEETBMTLB_FLUSH_NESTEDTMETOPEXTTSCRATEMSRTSXLDTRKVAESVMCBCLEANVMPLVMSA_REGPROTVMXVPCLMULQDQVTEWAITPKGWBNOINVDWRMSRNSX87XGETBV1XOPXSAVEXSAVECXSAVEOPTXSAVESAESARMARMCPUIDASIMDASIMDDPASIMDHPASIMDRDMATOMICSCRC32DCPOPEVTSTRMFCMAFPFPHPGPAJSCVTLRCPCPMULLSHA1SHA2SHA3SHA512SM3SM4SVElastID" +const _FeatureID_name = "firstIDADXAESNIAMD3DNOWAMD3DNOWEXTAMXBF16AMXFP16AMXINT8AMXTILEAVXAVX2AVX512BF16AVX512BITALGAVX512BWAVX512CDAVX512DQAVX512ERAVX512FAVX512FP16AVX512IFMAAVX512PFAVX512VBMIAVX512VBMI2AVX512VLAVX512VNNIAVX512VP2INTERSECTAVX512VPOPCNTDQAVXIFMAAVXNECONVERTAVXSLOWAVXVNNIAVXVNNIINT8BHI_CTRLBMI1BMI2CETIBTCETSSCLDEMOTECLMULCLZEROCMOVCMPCCXADDCMPSB_SCADBS_SHORTCMPXCHG8CPBOOSTCPPCCX16EFER_LMSLE_UNSENQCMDERMSF16CFLUSH_L1DFMA3FMA4FP128FP256FSRMFXSRFXSROPTGFNIHLEHRESETHTTHWAHYBRID_CPUHYPERVISORIA32_ARCH_CAPIA32_CORE_CAPIBPBIBRSIBRS_PREFERREDIBRS_PROVIDES_SMPIBSIBSBRNTRGTIBSFETCHSAMIBSFFVIBSOPCNTIBSOPCNTEXTIBSOPSAMIBSRDWROPCNTIBSRIPINVALIDCHKIBS_FETCH_CTLXIBS_OPDATA4IBS_OPFUSEIBS_PREVENTHOSTIBS_ZEN4IDPRED_CTRLINT_WBINVDINVLPGBLAHFLAMLBRVIRTLZCNTMCAOVERFLOWMCDT_NOMCOMMITMD_CLEARMMXMMXEXTMOVBEMOVDIR64BMOVDIRIMOVSB_ZLMOVUMPXMSRIRCMSRLISTMSR_PAGEFLUSHNRIPSNXOSXSAVEPCONFIGPOPCNTPPINPREFETCHIPSFDRDPRURDRANDRDSEEDRDTSCPRRSBA_CTRLRTMRTM_ALWAYS_ABORTSERIALIZESEVSEV_64BITSEV_ALTERNATIVESEV_DEBUGSWAPSEV_ESSEV_RESTRICTEDSEV_SNPSGXSGXLCSHASMESME_COHERENTSPEC_CTRL_SSBDSRBDS_CTRLSSESSE2SSE3SSE4SSE42SSE4ASSSE3STIBPSTIBP_ALWAYSONSTOSB_SHORTSUCCORSVMSVMDASVMFBASIDSVMLSVMNPSVMPFSVMPFTSYSCALLSYSEETBMTDX_GUESTTLB_FLUSH_NESTEDTMETOPEXTTSCRATEMSRTSXLDTRKVAESVMCBCLEANVMPLVMSA_REGPROTVMXVPCLMULQDQVTEWAITPKGWBNOINVDWRMSRNSX87XGETBV1XOPXSAVEXSAVECXSAVEOPTXSAVESAESARMARMCPUIDASIMDASIMDDPASIMDHPASIMDRDMATOMICSCRC32DCPOPEVTSTRMFCMAFPFPHPGPAJSCVTLRCPCPMULLSHA1SHA2SHA3SHA512SM3SM4SVElastID" -var _FeatureID_index = [...]uint16{0, 7, 10, 15, 23, 34, 41, 48, 55, 62, 65, 69, 79, 91, 99, 107, 115, 123, 130, 140, 150, 158, 168, 179, 187, 197, 215, 230, 237, 249, 256, 263, 274, 282, 286, 290, 296, 301, 309, 314, 320, 324, 333, 351, 359, 366, 370, 374, 388, 394, 398, 402, 411, 415, 419, 424, 429, 433, 437, 444, 448, 451, 457, 460, 463, 473, 483, 496, 509, 513, 517, 531, 548, 551, 561, 572, 578, 586, 597, 605, 617, 633, 647, 658, 668, 683, 691, 702, 712, 719, 723, 726, 733, 738, 749, 756, 763, 771, 774, 780, 785, 794, 801, 809, 813, 816, 822, 829, 842, 847, 849, 856, 863, 869, 873, 882, 886, 891, 897, 903, 909, 919, 922, 938, 947, 950, 959, 974, 987, 993, 1007, 1014, 1017, 1022, 1025, 1028, 1040, 1054, 1064, 1067, 1071, 1075, 1079, 1084, 1089, 1094, 1099, 1113, 1124, 1130, 1133, 1138, 1147, 1151, 1156, 1161, 1167, 1174, 1179, 1182, 1198, 1201, 1207, 1217, 1225, 1229, 1238, 1242, 1254, 1257, 1267, 1270, 1277, 1285, 1292, 1295, 1302, 1305, 1310, 1316, 1324, 1330, 1336, 1344, 1349, 1356, 1363, 1371, 1378, 1383, 1388, 1395, 1399, 1401, 1405, 1408, 1413, 1418, 1423, 1427, 1431, 1435, 1441, 1444, 1447, 1450, 1456} +var _FeatureID_index = [...]uint16{0, 7, 10, 15, 23, 34, 41, 48, 55, 62, 65, 69, 79, 91, 99, 107, 115, 123, 130, 140, 150, 158, 168, 179, 187, 197, 215, 230, 237, 249, 256, 263, 274, 282, 286, 290, 296, 301, 309, 314, 320, 324, 333, 351, 359, 366, 370, 374, 388, 394, 398, 402, 411, 415, 419, 424, 429, 433, 437, 444, 448, 451, 457, 460, 463, 473, 483, 496, 509, 513, 517, 531, 548, 551, 561, 572, 578, 586, 597, 605, 617, 633, 647, 658, 668, 683, 691, 702, 712, 719, 723, 726, 733, 738, 749, 756, 763, 771, 774, 780, 785, 794, 801, 809, 813, 816, 822, 829, 842, 847, 849, 856, 863, 869, 873, 882, 886, 891, 897, 903, 909, 919, 922, 938, 947, 950, 959, 974, 987, 993, 1007, 1014, 1017, 1022, 1025, 1028, 1040, 1054, 1064, 1067, 1071, 1075, 1079, 1084, 1089, 1094, 1099, 1113, 1124, 1130, 1133, 1138, 1147, 1151, 1156, 1161, 1167, 1174, 1179, 1182, 1191, 1207, 1210, 1216, 1226, 1234, 1238, 1247, 1251, 1263, 1266, 1276, 1279, 1286, 1294, 1301, 1304, 1311, 1314, 1319, 1325, 1333, 1339, 1345, 1353, 1358, 1365, 1372, 1380, 1387, 1392, 1397, 1404, 1408, 1410, 1414, 1417, 1422, 1427, 1432, 1436, 1440, 1444, 1450, 1453, 1456, 1459, 1465} func (i FeatureID) String() string { if i < 0 || i >= FeatureID(len(_FeatureID_index)-1) { diff --git a/vendor/github.com/minio/minio-go/v7/api-put-object-fan-out.go b/vendor/github.com/minio/minio-go/v7/api-put-object-fan-out.go index 9016ec4b..0ae9142e 100644 --- a/vendor/github.com/minio/minio-go/v7/api-put-object-fan-out.go +++ b/vendor/github.com/minio/minio-go/v7/api-put-object-fan-out.go @@ -62,7 +62,7 @@ type PutObjectFanOutResponse struct { ETag string `json:"etag,omitempty"` VersionID string `json:"versionId,omitempty"` LastModified *time.Time `json:"lastModified,omitempty"` - Error error `json:"error,omitempty"` + Error string `json:"error,omitempty"` } // PutObjectFanOut - is a variant of PutObject instead of writing a single object from a single diff --git a/vendor/github.com/minio/minio-go/v7/api-put-object-multipart.go b/vendor/github.com/minio/minio-go/v7/api-put-object-multipart.go index 85d6c70a..5f117afa 100644 --- a/vendor/github.com/minio/minio-go/v7/api-put-object-multipart.go +++ b/vendor/github.com/minio/minio-go/v7/api-put-object-multipart.go @@ -389,8 +389,9 @@ func (c *Client) completeMultipartUpload(ctx context.Context, bucketName, object headers := opts.Header() if s3utils.IsAmazonEndpoint(*c.endpointURL) { - headers.Del(encrypt.SseKmsKeyID) // Remove X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id not supported in CompleteMultipartUpload - headers.Del(encrypt.SseGenericHeader) // Remove X-Amz-Server-Side-Encryption not supported in CompleteMultipartUpload + headers.Del(encrypt.SseKmsKeyID) // Remove X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id not supported in CompleteMultipartUpload + headers.Del(encrypt.SseGenericHeader) // Remove X-Amz-Server-Side-Encryption not supported in CompleteMultipartUpload + headers.Del(encrypt.SseEncryptionContext) // Remove X-Amz-Server-Side-Encryption-Context not supported in CompleteMultipartUpload } // Instantiate all the complete multipart buffer. diff --git a/vendor/github.com/minio/minio-go/v7/api.go b/vendor/github.com/minio/minio-go/v7/api.go index 749be8d5..712fe2fd 100644 --- a/vendor/github.com/minio/minio-go/v7/api.go +++ b/vendor/github.com/minio/minio-go/v7/api.go @@ -124,7 +124,7 @@ type Options struct { // Global constants. const ( libraryName = "minio-go" - libraryVersion = "v7.0.56" + libraryVersion = "v7.0.57" ) // User Agent should always following the below style. diff --git a/vendor/github.com/minio/minio-go/v7/functional_tests.go b/vendor/github.com/minio/minio-go/v7/functional_tests.go index b8a96e3f..2bc6b864 100644 --- a/vendor/github.com/minio/minio-go/v7/functional_tests.go +++ b/vendor/github.com/minio/minio-go/v7/functional_tests.go @@ -4821,6 +4821,11 @@ func testPresignedPostPolicy() { policy.SetContentType("binary/octet-stream") policy.SetContentLengthRange(10, 1024*1024) policy.SetUserMetadata(metadataKey, metadataValue) + + // Add CRC32C + checksum := minio.ChecksumCRC32C.ChecksumBytes(buf) + policy.SetChecksum(checksum) + args["policy"] = policy.String() presignedPostPolicyURL, formData, err := c.PresignedPostPolicy(context.Background(), policy) @@ -4888,6 +4893,7 @@ func testPresignedPostPolicy() { Timeout: 30 * time.Second, Transport: transport, } + args["url"] = presignedPostPolicyURL.String() req, err := http.NewRequest(http.MethodPost, presignedPostPolicyURL.String(), bytes.NewReader(formBuf.Bytes())) if err != nil { @@ -4920,13 +4926,21 @@ func testPresignedPostPolicy() { expectedLocation := scheme + os.Getenv(serverEndpoint) + "/" + bucketName + "/" + objectName expectedLocationBucketDNS := scheme + bucketName + "." + os.Getenv(serverEndpoint) + "/" + objectName - if val, ok := res.Header["Location"]; ok { - if val[0] != expectedLocation && val[0] != expectedLocationBucketDNS { - logError(testName, function, args, startTime, "", "Location in header response is incorrect", err) + if !strings.Contains(expectedLocation, "s3.amazonaws.com/") { + // Test when not against AWS S3. + if val, ok := res.Header["Location"]; ok { + if val[0] != expectedLocation && val[0] != expectedLocationBucketDNS { + logError(testName, function, args, startTime, "", fmt.Sprintf("Location in header response is incorrect. Want %q or %q, got %q", expectedLocation, expectedLocationBucketDNS, val[0]), err) + return + } + } else { + logError(testName, function, args, startTime, "", "Location not found in header response", err) return } - } else { - logError(testName, function, args, startTime, "", "Location not found in header response", err) + } + want := checksum.Encoded() + if got := res.Header.Get("X-Amz-Checksum-Crc32c"); got != want { + logError(testName, function, args, startTime, "", fmt.Sprintf("Want checksum %q, got %q", want, got), nil) return } diff --git a/vendor/github.com/nats-io/nats.go/README.md b/vendor/github.com/nats-io/nats.go/README.md index 1582f5a1..02e3d4ef 100644 --- a/vendor/github.com/nats-io/nats.go/README.md +++ b/vendor/github.com/nats-io/nats.go/README.md @@ -29,7 +29,7 @@ When using or transitioning to Go modules support: ```bash # Go client latest or explicit version go get github.com/nats-io/nats.go/@latest -go get github.com/nats-io/nats.go/@v1.26.0 +go get github.com/nats-io/nats.go/@v1.27.0 # For latest NATS Server, add /v2 at the end go get github.com/nats-io/nats-server/v2 @@ -92,6 +92,13 @@ nc.Close() ## JetStream Basic Usage +> __NOTE__ +> +> We encourage you to try out a new, simplified version on JetStream API. +> The new API is currently in preview and is available under `jetstream` package. +> +> You can find more information on the new API [here](https://github.com/nats-io/nats.go/blob/main/jetstream/README.md) + ```go import "github.com/nats-io/nats.go" diff --git a/vendor/github.com/nats-io/nats.go/js.go b/vendor/github.com/nats-io/nats.go/js.go index 9ec99d77..76a55d46 100644 --- a/vendor/github.com/nats-io/nats.go/js.go +++ b/vendor/github.com/nats-io/nats.go/js.go @@ -679,6 +679,15 @@ func (js *js) newAsyncReply() string { return sb.String() } +func (js *js) cleanupReplySub() { + js.mu.Lock() + if js.rsub != nil { + js.rsub.Unsubscribe() + js.rsub = nil + } + js.mu.Unlock() +} + // registerPAF will register for a PubAckFuture. func (js *js) registerPAF(id string, paf *pubAckFuture) (int, int) { js.mu.Lock() diff --git a/vendor/github.com/nats-io/nats.go/nats.go b/vendor/github.com/nats-io/nats.go/nats.go index 307baf6a..00ec369d 100644 --- a/vendor/github.com/nats-io/nats.go/nats.go +++ b/vendor/github.com/nats-io/nats.go/nats.go @@ -47,7 +47,7 @@ import ( // Default Constants const ( - Version = "1.26.0" + Version = "1.27.0" DefaultURL = "nats://127.0.0.1:4222" DefaultPort = 4222 DefaultMaxReconnect = 60 diff --git a/vendor/github.com/nats-io/nats.go/object.go b/vendor/github.com/nats-io/nats.go/object.go index e5137682..6bce6057 100644 --- a/vendor/github.com/nats-io/nats.go/object.go +++ b/vendor/github.com/nats-io/nats.go/object.go @@ -370,14 +370,17 @@ func (obs *obs) Put(meta *ObjectMeta, r io.Reader, opts ...ObjectOpt) (*ObjectIn } // Create our own JS context to handle errors etc. - js, err := obs.js.nc.JetStream(PublishAsyncErrHandler(func(js JetStream, _ *Msg, err error) { setErr(err) })) + jetStream, err := obs.js.nc.JetStream(PublishAsyncErrHandler(func(js JetStream, _ *Msg, err error) { setErr(err) })) if err != nil { return nil, err } + + defer jetStream.(*js).cleanupReplySub() + purgePartial := func() { // wait until all pubs are complete or up to default timeout before attempting purge select { - case <-js.PublishAsyncComplete(): + case <-jetStream.PublishAsyncComplete(): case <-time.After(obs.js.opts.wait): } obs.js.purgeStream(obs.stream, &StreamPurgeRequest{Subject: chunkSubj}) @@ -423,7 +426,7 @@ func (obs *obs) Put(meta *ObjectMeta, r io.Reader, opts ...ObjectOpt) (*ObjectIn h.Write(m.Data) // Send msg itself. - if _, err := js.PublishMsgAsync(m); err != nil { + if _, err := jetStream.PublishMsgAsync(m); err != nil { purgePartial() return nil, err } @@ -458,7 +461,7 @@ func (obs *obs) Put(meta *ObjectMeta, r io.Reader, opts ...ObjectOpt) (*ObjectIn } // Publish the meta message. - _, err = js.PublishMsgAsync(mm) + _, err = jetStream.PublishMsgAsync(mm) if err != nil { if r != nil { purgePartial() @@ -468,7 +471,7 @@ func (obs *obs) Put(meta *ObjectMeta, r io.Reader, opts ...ObjectOpt) (*ObjectIn // Wait for all to be processed. select { - case <-js.PublishAsyncComplete(): + case <-jetStream.PublishAsyncComplete(): if err := getErr(); err != nil { if r != nil { purgePartial() diff --git a/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_arm64.s b/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_arm64.s index c43e8a8d..d2fe11b8 100644 --- a/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_arm64.s +++ b/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_arm64.s @@ -185,7 +185,7 @@ copyMatchTry8: // A 16-at-a-time loop doesn't provide a further speedup. CMP $8, len CCMP HS, offset, $8, $0 - BLO copyMatchLoop1 + BLO copyMatchTry4 AND $7, len, lenRem SUB $8, len @@ -201,8 +201,19 @@ copyMatchLoop8: MOVD tmp2, -8(dst) B copyMatchDone +copyMatchTry4: + // Copy words if both len and offset are at least four. + CMP $4, len + CCMP HS, offset, $4, $0 + BLO copyMatchLoop1 + + MOVWU.P 4(match), tmp2 + MOVWU.P tmp2, 4(dst) + SUBS $4, len + BEQ copyMatchDone + copyMatchLoop1: - // Byte-at-a-time copy for small offsets. + // Byte-at-a-time copy for small offsets <= 3. MOVBU.P 1(match), tmp2 MOVB.P tmp2, 1(dst) SUBS $1, len diff --git a/vendor/github.com/sashabaranov/go-openai/audio.go b/vendor/github.com/sashabaranov/go-openai/audio.go index bf236539..adfc5276 100644 --- a/vendor/github.com/sashabaranov/go-openai/audio.go +++ b/vendor/github.com/sashabaranov/go-openai/audio.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "fmt" + "io" "net/http" "os" @@ -19,16 +20,24 @@ const ( type AudioResponseFormat string const ( - AudioResponseFormatJSON AudioResponseFormat = "json" - AudioResponseFormatSRT AudioResponseFormat = "srt" - AudioResponseFormatVTT AudioResponseFormat = "vtt" + AudioResponseFormatJSON AudioResponseFormat = "json" + AudioResponseFormatText AudioResponseFormat = "text" + AudioResponseFormatSRT AudioResponseFormat = "srt" + AudioResponseFormatVerboseJSON AudioResponseFormat = "verbose_json" + AudioResponseFormatVTT AudioResponseFormat = "vtt" ) // AudioRequest represents a request structure for audio API. // ResponseFormat is not supported for now. We only return JSON text, which may be sufficient. type AudioRequest struct { - Model string - FilePath string + Model string + + // FilePath is either an existing file in your filesystem or a filename representing the contents of Reader. + FilePath string + + // Reader is an optional io.Reader when you do not want to use an existing file. + Reader io.Reader + Prompt string // For translation, it should be in English Temperature float32 Language string // For translation, just do not use it. It seems "en" works, not confirmed... @@ -37,6 +46,22 @@ type AudioRequest struct { // AudioResponse represents a response structure for audio API. type AudioResponse struct { + Task string `json:"task"` + Language string `json:"language"` + Duration float64 `json:"duration"` + Segments []struct { + ID int `json:"id"` + Seek int `json:"seek"` + Start float64 `json:"start"` + End float64 `json:"end"` + Text string `json:"text"` + Tokens []int `json:"tokens"` + Temperature float64 `json:"temperature"` + AvgLogprob float64 `json:"avg_logprob"` + CompressionRatio float64 `json:"compression_ratio"` + NoSpeechProb float64 `json:"no_speech_prob"` + Transient bool `json:"transient"` + } `json:"segments"` Text string `json:"text"` } @@ -89,21 +114,15 @@ func (c *Client) callAudioAPI( // HasJSONResponse returns true if the response format is JSON. func (r AudioRequest) HasJSONResponse() bool { - return r.Format == "" || r.Format == AudioResponseFormatJSON + return r.Format == "" || r.Format == AudioResponseFormatJSON || r.Format == AudioResponseFormatVerboseJSON } // audioMultipartForm creates a form with audio file contents and the name of the model to use for // audio processing. func audioMultipartForm(request AudioRequest, b utils.FormBuilder) error { - f, err := os.Open(request.FilePath) + err := createFileField(request, b) if err != nil { - return fmt.Errorf("opening audio file: %w", err) - } - defer f.Close() - - err = b.CreateFormFile("file", f) - if err != nil { - return fmt.Errorf("creating form file: %w", err) + return err } err = b.WriteField("model", request.Model) @@ -146,3 +165,27 @@ func audioMultipartForm(request AudioRequest, b utils.FormBuilder) error { // Close the multipart writer return b.Close() } + +// createFileField creates the "file" form field from either an existing file or by using the reader. +func createFileField(request AudioRequest, b utils.FormBuilder) error { + if request.Reader != nil { + err := b.CreateFormFileReader("file", request.Reader, request.FilePath) + if err != nil { + return fmt.Errorf("creating form using reader: %w", err) + } + return nil + } + + f, err := os.Open(request.FilePath) + if err != nil { + return fmt.Errorf("opening audio file: %w", err) + } + defer f.Close() + + err = b.CreateFormFile("file", f) + if err != nil { + return fmt.Errorf("creating form file: %w", err) + } + + return nil +} diff --git a/vendor/github.com/sashabaranov/go-openai/chat.go b/vendor/github.com/sashabaranov/go-openai/chat.go index 312ef8e2..4764e36b 100644 --- a/vendor/github.com/sashabaranov/go-openai/chat.go +++ b/vendor/github.com/sashabaranov/go-openai/chat.go @@ -11,8 +11,11 @@ const ( ChatMessageRoleSystem = "system" ChatMessageRoleUser = "user" ChatMessageRoleAssistant = "assistant" + ChatMessageRoleFunction = "function" ) +const chatCompletionsSuffix = "/chat/completions" + var ( ErrChatCompletionInvalidModel = errors.New("this model is not supported with this method, please use CreateCompletion client method instead") //nolint:lll ErrChatCompletionStreamNotSupported = errors.New("streaming is not supported with this method, please use CreateChatCompletionStream") //nolint:lll @@ -27,6 +30,14 @@ type ChatCompletionMessage struct { // - https://github.com/openai/openai-python/blob/main/chatml.md // - https://github.com/openai/openai-cookbook/blob/main/examples/How_to_count_tokens_with_tiktoken.ipynb Name string `json:"name,omitempty"` + + FunctionCall *FunctionCall `json:"function_call,omitempty"` +} + +type FunctionCall struct { + Name string `json:"name,omitempty"` + // call function with arguments in JSON format + Arguments string `json:"arguments,omitempty"` } // ChatCompletionRequest represents a request structure for chat completion API. @@ -43,12 +54,72 @@ type ChatCompletionRequest struct { FrequencyPenalty float32 `json:"frequency_penalty,omitempty"` LogitBias map[string]int `json:"logit_bias,omitempty"` User string `json:"user,omitempty"` + Functions []*FunctionDefine `json:"functions,omitempty"` + FunctionCall string `json:"function_call,omitempty"` } +type FunctionDefine struct { + Name string `json:"name"` + Description string `json:"description,omitempty"` + // it's required in function call + Parameters *FunctionParams `json:"parameters"` +} + +type FunctionParams struct { + // the Type must be JSONSchemaTypeObject + Type JSONSchemaType `json:"type"` + Properties map[string]*JSONSchemaDefine `json:"properties,omitempty"` + Required []string `json:"required,omitempty"` +} + +type JSONSchemaType string + +const ( + JSONSchemaTypeObject JSONSchemaType = "object" + JSONSchemaTypeNumber JSONSchemaType = "number" + JSONSchemaTypeString JSONSchemaType = "string" + JSONSchemaTypeArray JSONSchemaType = "array" + JSONSchemaTypeNull JSONSchemaType = "null" + JSONSchemaTypeBoolean JSONSchemaType = "boolean" +) + +// JSONSchemaDefine is a struct for JSON Schema. +type JSONSchemaDefine struct { + // Type is a type of JSON Schema. + Type JSONSchemaType `json:"type,omitempty"` + // Description is a description of JSON Schema. + Description string `json:"description,omitempty"` + // Enum is a enum of JSON Schema. It used if Type is JSONSchemaTypeString. + Enum []string `json:"enum,omitempty"` + // Properties is a properties of JSON Schema. It used if Type is JSONSchemaTypeObject. + Properties map[string]*JSONSchemaDefine `json:"properties,omitempty"` + // Required is a required of JSON Schema. It used if Type is JSONSchemaTypeObject. + Required []string `json:"required,omitempty"` + // Items is a property of JSON Schema. It used if Type is JSONSchemaTypeArray. + Items *JSONSchemaDefine `json:"items,omitempty"` +} + +type FinishReason string + +const ( + FinishReasonStop FinishReason = "stop" + FinishReasonLength FinishReason = "length" + FinishReasonFunctionCall FinishReason = "function_call" + FinishReasonContentFilter FinishReason = "content_filter" + FinishReasonNull FinishReason = "null" +) + type ChatCompletionChoice struct { - Index int `json:"index"` - Message ChatCompletionMessage `json:"message"` - FinishReason string `json:"finish_reason"` + Index int `json:"index"` + Message ChatCompletionMessage `json:"message"` + // FinishReason + // stop: API returned complete message, + // or a message terminated by one of the stop sequences provided via the stop parameter + // length: Incomplete model output due to max_tokens parameter or token limit + // function_call: The model decided to call a function + // content_filter: Omitted content due to a flag from our content filters + // null: API response still in progress or incomplete + FinishReason FinishReason `json:"finish_reason"` } // ChatCompletionResponse represents a response structure for chat completion API. @@ -71,13 +142,13 @@ func (c *Client) CreateChatCompletion( return } - urlSuffix := "/chat/completions" + urlSuffix := chatCompletionsSuffix if !checkEndpointSupportsModel(urlSuffix, request.Model) { err = ErrChatCompletionInvalidModel return } - req, err := c.requestBuilder.build(ctx, http.MethodPost, c.fullURL(urlSuffix, request.Model), request) + req, err := c.requestBuilder.Build(ctx, http.MethodPost, c.fullURL(urlSuffix, request.Model), request) if err != nil { return } diff --git a/vendor/github.com/sashabaranov/go-openai/chat_stream.go b/vendor/github.com/sashabaranov/go-openai/chat_stream.go index 842835e1..9093bde9 100644 --- a/vendor/github.com/sashabaranov/go-openai/chat_stream.go +++ b/vendor/github.com/sashabaranov/go-openai/chat_stream.go @@ -3,7 +3,6 @@ package openai import ( "bufio" "context" - "net/http" utils "github.com/sashabaranov/go-openai/internal" ) @@ -16,7 +15,7 @@ type ChatCompletionStreamChoiceDelta struct { type ChatCompletionStreamChoice struct { Index int `json:"index"` Delta ChatCompletionStreamChoiceDelta `json:"delta"` - FinishReason string `json:"finish_reason"` + FinishReason FinishReason `json:"finish_reason"` } type ChatCompletionStreamResponse struct { @@ -41,7 +40,7 @@ func (c *Client) CreateChatCompletionStream( ctx context.Context, request ChatCompletionRequest, ) (stream *ChatCompletionStream, err error) { - urlSuffix := "/chat/completions" + urlSuffix := chatCompletionsSuffix if !checkEndpointSupportsModel(urlSuffix, request.Model) { err = ErrChatCompletionInvalidModel return @@ -57,7 +56,7 @@ func (c *Client) CreateChatCompletionStream( if err != nil { return } - if resp.StatusCode < http.StatusOK || resp.StatusCode >= http.StatusBadRequest { + if isFailureStatusCode(resp) { return nil, c.handleErrorResp(resp) } @@ -66,7 +65,7 @@ func (c *Client) CreateChatCompletionStream( emptyMessagesLimit: c.config.EmptyMessagesLimit, reader: bufio.NewReader(resp.Body), response: resp, - errAccumulator: newErrorAccumulator(), + errAccumulator: utils.NewErrorAccumulator(), unmarshaler: &utils.JSONUnmarshaler{}, }, } diff --git a/vendor/github.com/sashabaranov/go-openai/client.go b/vendor/github.com/sashabaranov/go-openai/client.go index c55166aa..f38c1dfc 100644 --- a/vendor/github.com/sashabaranov/go-openai/client.go +++ b/vendor/github.com/sashabaranov/go-openai/client.go @@ -15,7 +15,7 @@ import ( type Client struct { config ClientConfig - requestBuilder requestBuilder + requestBuilder utils.RequestBuilder createFormBuilder func(io.Writer) utils.FormBuilder } @@ -29,7 +29,7 @@ func NewClient(authToken string) *Client { func NewClientWithConfig(config ClientConfig) *Client { return &Client{ config: config, - requestBuilder: newRequestBuilder(), + requestBuilder: utils.NewRequestBuilder(), createFormBuilder: func(body io.Writer) utils.FormBuilder { return utils.NewFormBuilder(body) }, @@ -47,13 +47,6 @@ func NewOrgClient(authToken, org string) *Client { func (c *Client) sendRequest(req *http.Request, v any) error { req.Header.Set("Accept", "application/json; charset=utf-8") - // Azure API Key authentication - if c.config.APIType == APITypeAzure { - req.Header.Set(AzureAPIKeyHeader, c.config.authToken) - } else { - // OpenAI or Azure AD authentication - req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", c.config.authToken)) - } // Check whether Content-Type is already set, Upload Files API requires // Content-Type == multipart/form-data @@ -62,9 +55,7 @@ func (c *Client) sendRequest(req *http.Request, v any) error { req.Header.Set("Content-Type", "application/json; charset=utf-8") } - if len(c.config.OrgID) > 0 { - req.Header.Set("OpenAI-Organization", c.config.OrgID) - } + c.setCommonHeaders(req) res, err := c.config.HTTPClient.Do(req) if err != nil { @@ -73,13 +64,31 @@ func (c *Client) sendRequest(req *http.Request, v any) error { defer res.Body.Close() - if res.StatusCode < http.StatusOK || res.StatusCode >= http.StatusBadRequest { + if isFailureStatusCode(res) { return c.handleErrorResp(res) } return decodeResponse(res.Body, v) } +func (c *Client) setCommonHeaders(req *http.Request) { + // https://learn.microsoft.com/en-us/azure/cognitive-services/openai/reference#authentication + // Azure API Key authentication + if c.config.APIType == APITypeAzure { + req.Header.Set(AzureAPIKeyHeader, c.config.authToken) + } else { + // OpenAI or Azure AD authentication + req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", c.config.authToken)) + } + if c.config.OrgID != "" { + req.Header.Set("OpenAI-Organization", c.config.OrgID) + } +} + +func isFailureStatusCode(resp *http.Response) bool { + return resp.StatusCode < http.StatusOK || resp.StatusCode >= http.StatusBadRequest +} + func decodeResponse(body io.Reader, v any) error { if v == nil { return nil @@ -135,7 +144,7 @@ func (c *Client) newStreamRequest( urlSuffix string, body any, model string) (*http.Request, error) { - req, err := c.requestBuilder.build(ctx, method, c.fullURL(urlSuffix, model), body) + req, err := c.requestBuilder.Build(ctx, method, c.fullURL(urlSuffix, model), body) if err != nil { return nil, err } @@ -145,17 +154,7 @@ func (c *Client) newStreamRequest( req.Header.Set("Cache-Control", "no-cache") req.Header.Set("Connection", "keep-alive") - // https://learn.microsoft.com/en-us/azure/cognitive-services/openai/reference#authentication - // Azure API Key authentication - if c.config.APIType == APITypeAzure { - req.Header.Set(AzureAPIKeyHeader, c.config.authToken) - } else { - // OpenAI or Azure AD authentication - req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", c.config.authToken)) - } - if c.config.OrgID != "" { - req.Header.Set("OpenAI-Organization", c.config.OrgID) - } + c.setCommonHeaders(req) return req, nil } diff --git a/vendor/github.com/sashabaranov/go-openai/completion.go b/vendor/github.com/sashabaranov/go-openai/completion.go index e3d1b85e..e0571b00 100644 --- a/vendor/github.com/sashabaranov/go-openai/completion.go +++ b/vendor/github.com/sashabaranov/go-openai/completion.go @@ -17,11 +17,16 @@ var ( // GPT3 Models are designed for text-based tasks. For code-specific // tasks, please refer to the Codex series of models. const ( + GPT432K0613 = "gpt-4-32k-0613" GPT432K0314 = "gpt-4-32k-0314" GPT432K = "gpt-4-32k" + GPT40613 = "gpt-4-0613" GPT40314 = "gpt-4-0314" GPT4 = "gpt-4" + GPT3Dot5Turbo0613 = "gpt-3.5-turbo-0613" GPT3Dot5Turbo0301 = "gpt-3.5-turbo-0301" + GPT3Dot5Turbo16K = "gpt-3.5-turbo-16k" + GPT3Dot5Turbo16K0613 = "gpt-3.5-turbo-16k-0613" GPT3Dot5Turbo = "gpt-3.5-turbo" GPT3TextDavinci003 = "text-davinci-003" GPT3TextDavinci002 = "text-davinci-002" @@ -48,14 +53,19 @@ const ( var disabledModelsForEndpoints = map[string]map[string]bool{ "/completions": { - GPT3Dot5Turbo: true, - GPT3Dot5Turbo0301: true, - GPT4: true, - GPT40314: true, - GPT432K: true, - GPT432K0314: true, + GPT3Dot5Turbo: true, + GPT3Dot5Turbo0301: true, + GPT3Dot5Turbo0613: true, + GPT3Dot5Turbo16K: true, + GPT3Dot5Turbo16K0613: true, + GPT4: true, + GPT40314: true, + GPT40613: true, + GPT432K: true, + GPT432K0314: true, + GPT432K0613: true, }, - "/chat/completions": { + chatCompletionsSuffix: { CodexCodeDavinci002: true, CodexCodeCushman001: true, CodexCodeDavinci001: true, @@ -155,7 +165,7 @@ func (c *Client) CreateCompletion( return } - req, err := c.requestBuilder.build(ctx, http.MethodPost, c.fullURL(urlSuffix, request.Model), request) + req, err := c.requestBuilder.Build(ctx, http.MethodPost, c.fullURL(urlSuffix, request.Model), request) if err != nil { return } diff --git a/vendor/github.com/sashabaranov/go-openai/edits.go b/vendor/github.com/sashabaranov/go-openai/edits.go index c2c8db79..23b1a64f 100644 --- a/vendor/github.com/sashabaranov/go-openai/edits.go +++ b/vendor/github.com/sashabaranov/go-openai/edits.go @@ -32,7 +32,7 @@ type EditsResponse struct { // Perform an API call to the Edits endpoint. func (c *Client) Edits(ctx context.Context, request EditsRequest) (response EditsResponse, err error) { - req, err := c.requestBuilder.build(ctx, http.MethodPost, c.fullURL("/edits", fmt.Sprint(request.Model)), request) + req, err := c.requestBuilder.Build(ctx, http.MethodPost, c.fullURL("/edits", fmt.Sprint(request.Model)), request) if err != nil { return } diff --git a/vendor/github.com/sashabaranov/go-openai/embeddings.go b/vendor/github.com/sashabaranov/go-openai/embeddings.go index 7fb432ea..942f3ea3 100644 --- a/vendor/github.com/sashabaranov/go-openai/embeddings.go +++ b/vendor/github.com/sashabaranov/go-openai/embeddings.go @@ -132,7 +132,7 @@ type EmbeddingRequest struct { // CreateEmbeddings returns an EmbeddingResponse which will contain an Embedding for every item in |request.Input|. // https://beta.openai.com/docs/api-reference/embeddings/create func (c *Client) CreateEmbeddings(ctx context.Context, request EmbeddingRequest) (resp EmbeddingResponse, err error) { - req, err := c.requestBuilder.build(ctx, http.MethodPost, c.fullURL("/embeddings", request.Model.String()), request) + req, err := c.requestBuilder.Build(ctx, http.MethodPost, c.fullURL("/embeddings", request.Model.String()), request) if err != nil { return } diff --git a/vendor/github.com/sashabaranov/go-openai/engines.go b/vendor/github.com/sashabaranov/go-openai/engines.go index bb6a66ce..ac01a00e 100644 --- a/vendor/github.com/sashabaranov/go-openai/engines.go +++ b/vendor/github.com/sashabaranov/go-openai/engines.go @@ -22,7 +22,7 @@ type EnginesList struct { // ListEngines Lists the currently available engines, and provides basic // information about each option such as the owner and availability. func (c *Client) ListEngines(ctx context.Context) (engines EnginesList, err error) { - req, err := c.requestBuilder.build(ctx, http.MethodGet, c.fullURL("/engines"), nil) + req, err := c.requestBuilder.Build(ctx, http.MethodGet, c.fullURL("/engines"), nil) if err != nil { return } @@ -38,7 +38,7 @@ func (c *Client) GetEngine( engineID string, ) (engine Engine, err error) { urlSuffix := fmt.Sprintf("/engines/%s", engineID) - req, err := c.requestBuilder.build(ctx, http.MethodGet, c.fullURL(urlSuffix), nil) + req, err := c.requestBuilder.Build(ctx, http.MethodGet, c.fullURL(urlSuffix), nil) if err != nil { return } diff --git a/vendor/github.com/sashabaranov/go-openai/error.go b/vendor/github.com/sashabaranov/go-openai/error.go index 6354f43b..b789ed7d 100644 --- a/vendor/github.com/sashabaranov/go-openai/error.go +++ b/vendor/github.com/sashabaranov/go-openai/error.go @@ -44,9 +44,13 @@ func (e *APIError) UnmarshalJSON(data []byte) (err error) { return } - err = json.Unmarshal(rawMap["type"], &e.Type) - if err != nil { - return + // optional fields for azure openai + // refs: https://github.com/sashabaranov/go-openai/issues/343 + if _, ok := rawMap["type"]; ok { + err = json.Unmarshal(rawMap["type"], &e.Type) + if err != nil { + return + } } // optional fields diff --git a/vendor/github.com/sashabaranov/go-openai/error_accumulator.go b/vendor/github.com/sashabaranov/go-openai/error_accumulator.go deleted file mode 100644 index 568afdbc..00000000 --- a/vendor/github.com/sashabaranov/go-openai/error_accumulator.go +++ /dev/null @@ -1,53 +0,0 @@ -package openai - -import ( - "bytes" - "fmt" - "io" - - utils "github.com/sashabaranov/go-openai/internal" -) - -type errorAccumulator interface { - write(p []byte) error - unmarshalError() *ErrorResponse -} - -type errorBuffer interface { - io.Writer - Len() int - Bytes() []byte -} - -type defaultErrorAccumulator struct { - buffer errorBuffer - unmarshaler utils.Unmarshaler -} - -func newErrorAccumulator() errorAccumulator { - return &defaultErrorAccumulator{ - buffer: &bytes.Buffer{}, - unmarshaler: &utils.JSONUnmarshaler{}, - } -} - -func (e *defaultErrorAccumulator) write(p []byte) error { - _, err := e.buffer.Write(p) - if err != nil { - return fmt.Errorf("error accumulator write error, %w", err) - } - return nil -} - -func (e *defaultErrorAccumulator) unmarshalError() (errResp *ErrorResponse) { - if e.buffer.Len() == 0 { - return - } - - err := e.unmarshaler.Unmarshal(e.buffer.Bytes(), &errResp) - if err != nil { - errResp = nil - } - - return -} diff --git a/vendor/github.com/sashabaranov/go-openai/files.go b/vendor/github.com/sashabaranov/go-openai/files.go index 5667ec86..fb9937be 100644 --- a/vendor/github.com/sashabaranov/go-openai/files.go +++ b/vendor/github.com/sashabaranov/go-openai/files.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "fmt" + "io" "net/http" "os" ) @@ -70,7 +71,7 @@ func (c *Client) CreateFile(ctx context.Context, request FileRequest) (file File // DeleteFile deletes an existing file. func (c *Client) DeleteFile(ctx context.Context, fileID string) (err error) { - req, err := c.requestBuilder.build(ctx, http.MethodDelete, c.fullURL("/files/"+fileID), nil) + req, err := c.requestBuilder.Build(ctx, http.MethodDelete, c.fullURL("/files/"+fileID), nil) if err != nil { return } @@ -82,7 +83,7 @@ func (c *Client) DeleteFile(ctx context.Context, fileID string) (err error) { // ListFiles Lists the currently available files, // and provides basic information about each file such as the file name and purpose. func (c *Client) ListFiles(ctx context.Context) (files FilesList, err error) { - req, err := c.requestBuilder.build(ctx, http.MethodGet, c.fullURL("/files"), nil) + req, err := c.requestBuilder.Build(ctx, http.MethodGet, c.fullURL("/files"), nil) if err != nil { return } @@ -95,7 +96,7 @@ func (c *Client) ListFiles(ctx context.Context) (files FilesList, err error) { // such as the file name and purpose. func (c *Client) GetFile(ctx context.Context, fileID string) (file File, err error) { urlSuffix := fmt.Sprintf("/files/%s", fileID) - req, err := c.requestBuilder.build(ctx, http.MethodGet, c.fullURL(urlSuffix), nil) + req, err := c.requestBuilder.Build(ctx, http.MethodGet, c.fullURL(urlSuffix), nil) if err != nil { return } @@ -103,3 +104,26 @@ func (c *Client) GetFile(ctx context.Context, fileID string) (file File, err err err = c.sendRequest(req, &file) return } + +func (c *Client) GetFileContent(ctx context.Context, fileID string) (content io.ReadCloser, err error) { + urlSuffix := fmt.Sprintf("/files/%s/content", fileID) + req, err := c.requestBuilder.Build(ctx, http.MethodGet, c.fullURL(urlSuffix), nil) + if err != nil { + return + } + + c.setCommonHeaders(req) + + res, err := c.config.HTTPClient.Do(req) + if err != nil { + return + } + + if isFailureStatusCode(res) { + err = c.handleErrorResp(res) + return + } + + content = res.Body + return +} diff --git a/vendor/github.com/sashabaranov/go-openai/fine_tunes.go b/vendor/github.com/sashabaranov/go-openai/fine_tunes.go index a1218670..069ddccf 100644 --- a/vendor/github.com/sashabaranov/go-openai/fine_tunes.go +++ b/vendor/github.com/sashabaranov/go-openai/fine_tunes.go @@ -68,7 +68,7 @@ type FineTuneDeleteResponse struct { func (c *Client) CreateFineTune(ctx context.Context, request FineTuneRequest) (response FineTune, err error) { urlSuffix := "/fine-tunes" - req, err := c.requestBuilder.build(ctx, http.MethodPost, c.fullURL(urlSuffix), request) + req, err := c.requestBuilder.Build(ctx, http.MethodPost, c.fullURL(urlSuffix), request) if err != nil { return } @@ -79,7 +79,7 @@ func (c *Client) CreateFineTune(ctx context.Context, request FineTuneRequest) (r // CancelFineTune cancel a fine-tune job. func (c *Client) CancelFineTune(ctx context.Context, fineTuneID string) (response FineTune, err error) { - req, err := c.requestBuilder.build(ctx, http.MethodPost, c.fullURL("/fine-tunes/"+fineTuneID+"/cancel"), nil) + req, err := c.requestBuilder.Build(ctx, http.MethodPost, c.fullURL("/fine-tunes/"+fineTuneID+"/cancel"), nil) if err != nil { return } @@ -89,7 +89,7 @@ func (c *Client) CancelFineTune(ctx context.Context, fineTuneID string) (respons } func (c *Client) ListFineTunes(ctx context.Context) (response FineTuneList, err error) { - req, err := c.requestBuilder.build(ctx, http.MethodGet, c.fullURL("/fine-tunes"), nil) + req, err := c.requestBuilder.Build(ctx, http.MethodGet, c.fullURL("/fine-tunes"), nil) if err != nil { return } @@ -100,7 +100,7 @@ func (c *Client) ListFineTunes(ctx context.Context) (response FineTuneList, err func (c *Client) GetFineTune(ctx context.Context, fineTuneID string) (response FineTune, err error) { urlSuffix := fmt.Sprintf("/fine-tunes/%s", fineTuneID) - req, err := c.requestBuilder.build(ctx, http.MethodGet, c.fullURL(urlSuffix), nil) + req, err := c.requestBuilder.Build(ctx, http.MethodGet, c.fullURL(urlSuffix), nil) if err != nil { return } @@ -110,7 +110,7 @@ func (c *Client) GetFineTune(ctx context.Context, fineTuneID string) (response F } func (c *Client) DeleteFineTune(ctx context.Context, fineTuneID string) (response FineTuneDeleteResponse, err error) { - req, err := c.requestBuilder.build(ctx, http.MethodDelete, c.fullURL("/fine-tunes/"+fineTuneID), nil) + req, err := c.requestBuilder.Build(ctx, http.MethodDelete, c.fullURL("/fine-tunes/"+fineTuneID), nil) if err != nil { return } @@ -120,7 +120,7 @@ func (c *Client) DeleteFineTune(ctx context.Context, fineTuneID string) (respons } func (c *Client) ListFineTuneEvents(ctx context.Context, fineTuneID string) (response FineTuneEventList, err error) { - req, err := c.requestBuilder.build(ctx, http.MethodGet, c.fullURL("/fine-tunes/"+fineTuneID+"/events"), nil) + req, err := c.requestBuilder.Build(ctx, http.MethodGet, c.fullURL("/fine-tunes/"+fineTuneID+"/events"), nil) if err != nil { return } diff --git a/vendor/github.com/sashabaranov/go-openai/image.go b/vendor/github.com/sashabaranov/go-openai/image.go index 87ffea25..df736386 100644 --- a/vendor/github.com/sashabaranov/go-openai/image.go +++ b/vendor/github.com/sashabaranov/go-openai/image.go @@ -44,7 +44,7 @@ type ImageResponseDataInner struct { // CreateImage - API call to create an image. This is the main endpoint of the DALL-E API. func (c *Client) CreateImage(ctx context.Context, request ImageRequest) (response ImageResponse, err error) { urlSuffix := "/images/generations" - req, err := c.requestBuilder.build(ctx, http.MethodPost, c.fullURL(urlSuffix), request) + req, err := c.requestBuilder.Build(ctx, http.MethodPost, c.fullURL(urlSuffix), request) if err != nil { return } diff --git a/vendor/github.com/sashabaranov/go-openai/internal/error_accumulator.go b/vendor/github.com/sashabaranov/go-openai/internal/error_accumulator.go new file mode 100644 index 00000000..3d3e805f --- /dev/null +++ b/vendor/github.com/sashabaranov/go-openai/internal/error_accumulator.go @@ -0,0 +1,44 @@ +package openai + +import ( + "bytes" + "fmt" + "io" +) + +type ErrorAccumulator interface { + Write(p []byte) error + Bytes() []byte +} + +type errorBuffer interface { + io.Writer + Len() int + Bytes() []byte +} + +type DefaultErrorAccumulator struct { + Buffer errorBuffer +} + +func NewErrorAccumulator() ErrorAccumulator { + return &DefaultErrorAccumulator{ + Buffer: &bytes.Buffer{}, + } +} + +func (e *DefaultErrorAccumulator) Write(p []byte) error { + _, err := e.Buffer.Write(p) + if err != nil { + return fmt.Errorf("error accumulator write error, %w", err) + } + return nil +} + +func (e *DefaultErrorAccumulator) Bytes() (errBytes []byte) { + if e.Buffer.Len() == 0 { + return + } + errBytes = e.Buffer.Bytes() + return +} diff --git a/vendor/github.com/sashabaranov/go-openai/internal/form_builder.go b/vendor/github.com/sashabaranov/go-openai/internal/form_builder.go index 359dd7e2..2224fad4 100644 --- a/vendor/github.com/sashabaranov/go-openai/internal/form_builder.go +++ b/vendor/github.com/sashabaranov/go-openai/internal/form_builder.go @@ -1,13 +1,16 @@ package openai import ( + "fmt" "io" "mime/multipart" "os" + "path" ) type FormBuilder interface { CreateFormFile(fieldname string, file *os.File) error + CreateFormFileReader(fieldname string, r io.Reader, filename string) error WriteField(fieldname, value string) error Close() error FormDataContentType() string @@ -24,15 +27,28 @@ func NewFormBuilder(body io.Writer) *DefaultFormBuilder { } func (fb *DefaultFormBuilder) CreateFormFile(fieldname string, file *os.File) error { - fieldWriter, err := fb.writer.CreateFormFile(fieldname, file.Name()) + return fb.createFormFile(fieldname, file, file.Name()) +} + +func (fb *DefaultFormBuilder) CreateFormFileReader(fieldname string, r io.Reader, filename string) error { + return fb.createFormFile(fieldname, r, path.Base(filename)) +} + +func (fb *DefaultFormBuilder) createFormFile(fieldname string, r io.Reader, filename string) error { + if filename == "" { + return fmt.Errorf("filename cannot be empty") + } + + fieldWriter, err := fb.writer.CreateFormFile(fieldname, filename) if err != nil { return err } - _, err = io.Copy(fieldWriter, file) + _, err = io.Copy(fieldWriter, r) if err != nil { return err } + return nil } diff --git a/vendor/github.com/sashabaranov/go-openai/request_builder.go b/vendor/github.com/sashabaranov/go-openai/internal/request_builder.go similarity index 52% rename from vendor/github.com/sashabaranov/go-openai/request_builder.go rename to vendor/github.com/sashabaranov/go-openai/internal/request_builder.go index b4db07c2..0a9eabfd 100644 --- a/vendor/github.com/sashabaranov/go-openai/request_builder.go +++ b/vendor/github.com/sashabaranov/go-openai/internal/request_builder.go @@ -4,25 +4,23 @@ import ( "bytes" "context" "net/http" - - utils "github.com/sashabaranov/go-openai/internal" ) -type requestBuilder interface { - build(ctx context.Context, method, url string, request any) (*http.Request, error) +type RequestBuilder interface { + Build(ctx context.Context, method, url string, request any) (*http.Request, error) } -type httpRequestBuilder struct { - marshaller utils.Marshaller +type HTTPRequestBuilder struct { + marshaller Marshaller } -func newRequestBuilder() *httpRequestBuilder { - return &httpRequestBuilder{ - marshaller: &utils.JSONMarshaller{}, +func NewRequestBuilder() *HTTPRequestBuilder { + return &HTTPRequestBuilder{ + marshaller: &JSONMarshaller{}, } } -func (b *httpRequestBuilder) build(ctx context.Context, method, url string, request any) (*http.Request, error) { +func (b *HTTPRequestBuilder) Build(ctx context.Context, method, url string, request any) (*http.Request, error) { if request == nil { return http.NewRequestWithContext(ctx, method, url, nil) } diff --git a/vendor/github.com/sashabaranov/go-openai/models.go b/vendor/github.com/sashabaranov/go-openai/models.go index 2be91aad..b3d45836 100644 --- a/vendor/github.com/sashabaranov/go-openai/models.go +++ b/vendor/github.com/sashabaranov/go-openai/models.go @@ -2,6 +2,7 @@ package openai import ( "context" + "fmt" "net/http" ) @@ -40,7 +41,7 @@ type ModelsList struct { // ListModels Lists the currently available models, // and provides basic information about each model such as the model id and parent. func (c *Client) ListModels(ctx context.Context) (models ModelsList, err error) { - req, err := c.requestBuilder.build(ctx, http.MethodGet, c.fullURL("/models"), nil) + req, err := c.requestBuilder.Build(ctx, http.MethodGet, c.fullURL("/models"), nil) if err != nil { return } @@ -48,3 +49,16 @@ func (c *Client) ListModels(ctx context.Context) (models ModelsList, err error) err = c.sendRequest(req, &models) return } + +// GetModel Retrieves a model instance, providing basic information about +// the model such as the owner and permissioning. +func (c *Client) GetModel(ctx context.Context, modelID string) (model Model, err error) { + urlSuffix := fmt.Sprintf("/models/%s", modelID) + req, err := c.requestBuilder.Build(ctx, http.MethodGet, c.fullURL(urlSuffix), nil) + if err != nil { + return + } + + err = c.sendRequest(req, &model) + return +} diff --git a/vendor/github.com/sashabaranov/go-openai/moderation.go b/vendor/github.com/sashabaranov/go-openai/moderation.go index ebd66afb..bae78803 100644 --- a/vendor/github.com/sashabaranov/go-openai/moderation.go +++ b/vendor/github.com/sashabaranov/go-openai/moderation.go @@ -63,7 +63,7 @@ type ModerationResponse struct { // Moderations — perform a moderation api call over a string. // Input can be an array or slice but a string will reduce the complexity. func (c *Client) Moderations(ctx context.Context, request ModerationRequest) (response ModerationResponse, err error) { - req, err := c.requestBuilder.build(ctx, http.MethodPost, c.fullURL("/moderations", request.Model), request) + req, err := c.requestBuilder.Build(ctx, http.MethodPost, c.fullURL("/moderations", request.Model), request) if err != nil { return } diff --git a/vendor/github.com/sashabaranov/go-openai/stream.go b/vendor/github.com/sashabaranov/go-openai/stream.go index b9e784ac..94cc0a0a 100644 --- a/vendor/github.com/sashabaranov/go-openai/stream.go +++ b/vendor/github.com/sashabaranov/go-openai/stream.go @@ -4,7 +4,6 @@ import ( "bufio" "context" "errors" - "net/http" utils "github.com/sashabaranov/go-openai/internal" ) @@ -46,7 +45,7 @@ func (c *Client) CreateCompletionStream( if err != nil { return } - if resp.StatusCode < http.StatusOK || resp.StatusCode >= http.StatusBadRequest { + if isFailureStatusCode(resp) { return nil, c.handleErrorResp(resp) } @@ -55,7 +54,7 @@ func (c *Client) CreateCompletionStream( emptyMessagesLimit: c.config.EmptyMessagesLimit, reader: bufio.NewReader(resp.Body), response: resp, - errAccumulator: newErrorAccumulator(), + errAccumulator: utils.NewErrorAccumulator(), unmarshaler: &utils.JSONUnmarshaler{}, }, } diff --git a/vendor/github.com/sashabaranov/go-openai/stream_reader.go b/vendor/github.com/sashabaranov/go-openai/stream_reader.go index 5eb6df7b..34161986 100644 --- a/vendor/github.com/sashabaranov/go-openai/stream_reader.go +++ b/vendor/github.com/sashabaranov/go-openai/stream_reader.go @@ -20,7 +20,7 @@ type streamReader[T streamable] struct { reader *bufio.Reader response *http.Response - errAccumulator errorAccumulator + errAccumulator utils.ErrorAccumulator unmarshaler utils.Unmarshaler } @@ -30,42 +30,65 @@ func (stream *streamReader[T]) Recv() (response T, err error) { return } + response, err = stream.processLines() + return +} + +func (stream *streamReader[T]) processLines() (T, error) { var emptyMessagesCount uint -waitForData: - line, err := stream.reader.ReadBytes('\n') + for { + rawLine, readErr := stream.reader.ReadBytes('\n') + if readErr != nil { + respErr := stream.unmarshalError() + if respErr != nil { + return *new(T), fmt.Errorf("error, %w", respErr.Error) + } + return *new(T), readErr + } + + var headerData = []byte("data: ") + noSpaceLine := bytes.TrimSpace(rawLine) + if !bytes.HasPrefix(noSpaceLine, headerData) { + writeErr := stream.errAccumulator.Write(noSpaceLine) + if writeErr != nil { + return *new(T), writeErr + } + emptyMessagesCount++ + if emptyMessagesCount > stream.emptyMessagesLimit { + return *new(T), ErrTooManyEmptyStreamMessages + } + + continue + } + + noPrefixLine := bytes.TrimPrefix(noSpaceLine, headerData) + if string(noPrefixLine) == "[DONE]" { + stream.isFinished = true + return *new(T), io.EOF + } + + var response T + unmarshalErr := stream.unmarshaler.Unmarshal(noPrefixLine, &response) + if unmarshalErr != nil { + return *new(T), unmarshalErr + } + + return response, nil + } +} + +func (stream *streamReader[T]) unmarshalError() (errResp *ErrorResponse) { + errBytes := stream.errAccumulator.Bytes() + if len(errBytes) == 0 { + return + } + + err := stream.unmarshaler.Unmarshal(errBytes, &errResp) if err != nil { - respErr := stream.errAccumulator.unmarshalError() - if respErr != nil { - err = fmt.Errorf("error, %w", respErr.Error) - } - return + errResp = nil } - var headerData = []byte("data: ") - line = bytes.TrimSpace(line) - if !bytes.HasPrefix(line, headerData) { - if writeErr := stream.errAccumulator.write(line); writeErr != nil { - err = writeErr - return - } - emptyMessagesCount++ - if emptyMessagesCount > stream.emptyMessagesLimit { - err = ErrTooManyEmptyStreamMessages - return - } - - goto waitForData - } - - line = bytes.TrimPrefix(line, headerData) - if string(line) == "[DONE]" { - stream.isFinished = true - err = io.EOF - return - } - - err = stream.unmarshaler.Unmarshal(line, &response) return } diff --git a/vendor/github.com/sirupsen/logrus/writer.go b/vendor/github.com/sirupsen/logrus/writer.go index 72e8e3a1..074fd4b8 100644 --- a/vendor/github.com/sirupsen/logrus/writer.go +++ b/vendor/github.com/sirupsen/logrus/writer.go @@ -4,6 +4,7 @@ import ( "bufio" "io" "runtime" + "strings" ) // Writer at INFO level. See WriterLevel for details. @@ -20,15 +21,18 @@ func (logger *Logger) WriterLevel(level Level) *io.PipeWriter { return NewEntry(logger).WriterLevel(level) } +// Writer returns an io.Writer that writes to the logger at the info log level func (entry *Entry) Writer() *io.PipeWriter { return entry.WriterLevel(InfoLevel) } +// WriterLevel returns an io.Writer that writes to the logger at the given log level func (entry *Entry) WriterLevel(level Level) *io.PipeWriter { reader, writer := io.Pipe() var printFunc func(args ...interface{}) + // Determine which log function to use based on the specified log level switch level { case TraceLevel: printFunc = entry.Trace @@ -48,23 +52,51 @@ func (entry *Entry) WriterLevel(level Level) *io.PipeWriter { printFunc = entry.Print } + // Start a new goroutine to scan the input and write it to the logger using the specified print function. + // It splits the input into chunks of up to 64KB to avoid buffer overflows. go entry.writerScanner(reader, printFunc) + + // Set a finalizer function to close the writer when it is garbage collected runtime.SetFinalizer(writer, writerFinalizer) return writer } +// writerScanner scans the input from the reader and writes it to the logger func (entry *Entry) writerScanner(reader *io.PipeReader, printFunc func(args ...interface{})) { scanner := bufio.NewScanner(reader) - for scanner.Scan() { - printFunc(scanner.Text()) + + // Set the buffer size to the maximum token size to avoid buffer overflows + scanner.Buffer(make([]byte, bufio.MaxScanTokenSize), bufio.MaxScanTokenSize) + + // Define a split function to split the input into chunks of up to 64KB + chunkSize := bufio.MaxScanTokenSize // 64KB + splitFunc := func(data []byte, atEOF bool) (int, []byte, error) { + if len(data) >= chunkSize { + return chunkSize, data[:chunkSize], nil + } + + return bufio.ScanLines(data, atEOF) } + + // Use the custom split function to split the input + scanner.Split(splitFunc) + + // Scan the input and write it to the logger using the specified print function + for scanner.Scan() { + printFunc(strings.TrimRight(scanner.Text(), "\r\n")) + } + + // If there was an error while scanning the input, log an error if err := scanner.Err(); err != nil { entry.Errorf("Error while reading from Writer: %s", err) } + + // Close the reader when we are done reader.Close() } +// WriterFinalizer is a finalizer function that closes then given writer when it is garbage collected func writerFinalizer(writer *io.PipeWriter) { writer.Close() } diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/Makefile b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/Makefile index 0272f8da..dd08e39a 100644 --- a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/Makefile +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/Makefile @@ -1,5 +1,5 @@ -## run.test -run.test: +## test.run +test.run: clear go fmt ./... go test -coverprofile cover.out -covermode atomic ./ ./object_storage/... ./object_view/... @@ -8,7 +8,7 @@ run.test: ## mod mod: clear - go mod tidy -compat=1.17 + go mod tidy -compat=1.20 go mod vendor go fmt ./... diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/account.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/account.go new file mode 100644 index 00000000..72c0d81c --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/account.go @@ -0,0 +1,9 @@ +package object_model + +// Account Лицевой счёт +type Account struct { + CommonStruct + Bank Bank `json:"bank" gorm:"-:all"` + BankID int64 `json:"bank_id" gorm:"column:bank_id;default:null"` + Number string `json:"number" gorm:"column:number;default:\"\""` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/accounting_area.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/accounting_area.go new file mode 100644 index 00000000..4ecfb099 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/accounting_area.go @@ -0,0 +1,9 @@ +package object_model + +// AccountingArea Области учёта +type AccountingArea struct { + CommonStruct + NameStruct + ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` + Code int `json:"code" gorm:"column:code;default:null"` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/alias/alias.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/alias/alias.go new file mode 100644 index 00000000..4201b30b --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/alias/alias.go @@ -0,0 +1,32 @@ +// package alias -- специальные типы РАПИРы +package alias + +// PaymentId -- ID платёжки +type PaymentId int64 + +// InvoiceId -- ID счёт-фактуры +type InvoiceId int64 + +// LawsuitId -- ID претензии +type LawsuitId int64 + +// LawsuitNumber -- номер претензии +type LawsuitNumber string + +// ClaimNumber -- Номер дела +type ClaimNumber string + +// ContractNumber -- Номер договора +type ContractNumber string + +// FrontDate -- специальный тип даты для фронта +type FrontDate string + +// FrontTime -- специальный тип даты-времени для фронта +type FrontTime string + +// PaymentRegisteredAt -- тип даты времени при регистрации в системе +type PaymentRegisteredAt string + +// IsAfterNotify -- признак регистрации документа после уведомления +type IsAfterNotify bool diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/balance.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/balance.go new file mode 100644 index 00000000..f8d0fe74 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/balance.go @@ -0,0 +1,18 @@ +package object_model + +import ( + "time" +) + +// Balance Сальдо договора. +type Balance struct { + CommonStruct + BillingMonth time.Time `json:"billing_month" gorm:"column:billing_month;default:null"` + ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` + ContractID int64 `json:"contract_id" gorm:"column:contract_id;default:null"` + DebtTypeID int64 `json:"debt_type_id" gorm:"column:debt_type_id;default:null"` + DocumentAt time.Time `json:"document_at" gorm:"column:document_at;default:null"` + DocumentInvoiceID int64 `json:"document_invoice_id" gorm:"column:document_invoice_id;default:null"` + DocumentPaymentID int64 `json:"document_payment_id" gorm:"column:document_payment_id;default:null"` + Sum float64 `json:"sum" gorm:"column:sum;default:null"` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/bank.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/bank.go new file mode 100644 index 00000000..5d12fc49 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/bank.go @@ -0,0 +1,13 @@ +package object_model + +// Bank Банки (справочник). +type Bank struct { + CommonStruct + GroupStruct + NameStruct + OrganizationID int64 `json:"organization_id" gorm:"column:organization_id;default:null"` + City string `json:"city_name" gorm:"column:city_name;default:\"\""` + BIK string `json:"bik" gorm:"column:bik;default:\"\""` + CorrespondentAccount string `json:"correspondent_account" gorm:"column:correspondent_account;default:\"\""` + ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/bank_account_organization.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/bank_account_organization.go new file mode 100644 index 00000000..a9492641 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/bank_account_organization.go @@ -0,0 +1,12 @@ +package object_model + +// BankAccountOrganization Соответствие банка - лицевого счёта - организации. +type BankAccountOrganization struct { + CommonStruct + Bank Bank `json:"bank" gorm:"-:all"` + BankID int64 `json:"bank_id" gorm:"column:bank_id;default:null"` + ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` + AccountNumber string `json:"account_number" gorm:"column:account_number;default:\"\""` + Organization Organization `json:"organization" gorm:"-:all"` + OrganizationID int64 `json:"organization_id" gorm:"column:organization_id;default:null"` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/bill_kind_type.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/bill_kind_type.go new file mode 100644 index 00000000..8e3bb660 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/bill_kind_type.go @@ -0,0 +1,8 @@ +package object_model + +// BillKindType Вид платежа +type BillKindType struct { + CommonStruct + NameStruct + Code int `json:"code" gorm:"column:code;default:null"` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/branch.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/branch.go new file mode 100644 index 00000000..c433e781 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/branch.go @@ -0,0 +1,11 @@ +package object_model + +// Branch Филиалы (справочник). +type Branch struct { + CommonStruct + GroupStruct + NameStruct + Code int64 `json:"code" gorm:"column:code;default:null"` + OrganizationID int64 `json:"organization_id" gorm:"column:organization_id;default:null"` + PersonalAreaLink string `json:"personal_area_link" gorm:"personal_area_link:tag;default:\"\""` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/brief_case.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/brief_case.go new file mode 100644 index 00000000..6a689455 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/brief_case.go @@ -0,0 +1,1500 @@ +package object_model + +import ( + "fmt" + "regexp" + "strconv" + "strings" + "time" + + "github.com/vmihailenco/msgpack/v5" + + "gitlab.aescorp.ru/dsp_dev/claim/common/object_model/front/front_format" + // "gitlab.aescorp.ru/dsp_dev/claim/common/object_model/front/front_payment" +) + +// BriefCase -- набор данных для конкретного портфеля +type BriefCase struct { + Lawsuit Lawsuit // Дело + ChangeItems []ChangeItem `json:"change_items"` // 3. История изменений + Comments []Comment `json:"comments"` // 4. Комментарии + Files []File `json:"files"` // 7. Файлы + Invoices []LawsuitInvoice `json:"invoices"` // 8. Счета фактуры + Messages []Message `json:"messages"` // 9. Сообщения + Payments []LawsuitPayment `json:"payments"` // 10. Платежи + StateDuties []StateDuty `json:"state_duties"` // 11. Гос.пошлина + StatusStates []LawsuitStatusState `json:"status_states"` // 12. История статусов дела + Hashtags []Hashtag `json:"hashtags"` // 13. Хештеги портфеля + // TODO Добавить период претензии +} + +// NewBriefCase Новый объект портфеля +func NewBriefCase() BriefCase { + return BriefCase{} +} + +// AsBriefCase -- попытка распаковать байты в объект +func AsBriefCase(b []byte) (BriefCase, error) { + c := NewBriefCase() + err := msgpack.Unmarshal(b, &c) + if err != nil { + return NewBriefCase(), err + } + return c, nil +} + +// BriefCaseAsBytes -- упаковать объект в байты +func BriefCaseAsBytes(c *BriefCase) ([]byte, error) { + b, err := msgpack.Marshal(c) + if err != nil { + return nil, err + } + return b, nil +} + +// MailTemplateView -- возвращает параметры шаблона для письма +func MailTemplateView(bc *BriefCase) (map[string]interface{}, error) { + result := make(map[string]interface{}) + + if bc == nil { + return result, fmt.Errorf("MailTemplateView, BriefCase is nil") + } + + // {"cmdType":"mailing","mailing":{"head":{"protVer":"1.0.1","sysId":"RAPIRA","sourceSystem":"BS012","created":"2023-01-23 13:03:59","minProcVer":"1.0.1","senderVer":"1.0.1"},"command":"init","mailingList":[{"mailingCode":"TEST5_CLAIMDEBT20230119T132742","mailingPhaseCode":"1/1","startAt":"","timezone":"0","endAt":""}]}} + // {"cmdType":"customerTemplateMessage","customerTemplateMessage":{"head":{"protVer":"1.0.1","sysId":"RAPIRA","sourceSystem":"BS012","created":"2023-01-23 13:03:59","minProcVer":"1.0.1","senderVer":"1.0.1"},"mailingCode":"TEST5_CLAIMDEBT20230119T132742","mailingPhaseCode":"1/1","templateCode":"CLAIMPRETRIAL","channelCode":"1401","fieldList":[{"contactInfo":"nechaevaa@atomsbt.ru","userId":"","userAddress":"183039, г. Мурманск, ул. Новое Плато, д.5, кв.60","persAcc":"5140145126","isOrganisationAcc":"1","header":"Досудебная претензия","dbtDate":"2022-09-30","dbtSum":"12 372,12","infoPhone":"9021356077","claimDate":"25.12.2022","claimPretrialDate":"28.12.2022","contractDate":"15.11.2018","contractNumber":"5140145126","dbtSumPeriod":"12 372,12","dbtSumFull":"14 460,29","lkLink":"https://lkul-murmansk.atomsbt.ru/","organisation":"","attachment":""}]}} + + dbtSumFull := bc.Lawsuit.DebtSum + + bc.Lawsuit.Penny + + bc.Lawsuit.Penalty + + bc.Lawsuit.StateDuty + + subject := "Уведомление о задолженности" + template := "CLAIMDEBT" + channel := "1401" // электронная почта + mailingCode := bc.Lawsuit.NotifyClaimMailingCode + inBlackList := false // TODO Добавить проверку на наличие в чёрном списке + if bc.Lawsuit.Status.Code != "1" || bc.Lawsuit.Contract.Email == "" || inBlackList { + subject = "Досудебная претензия" + template = "CLAIMPRETRIAL" + if bc.Lawsuit.Contract.Email == "" || !bc.Lawsuit.Contract.IsValidEmail { + channel = "1406" // Почта России + } + mailingCode = bc.Lawsuit.NotifyPretrialMailingCode + + attachments := make([]interface{}, 0) + for i := 0; i < len(bc.Files); i++ { + if !strings.Contains(bc.Files[i].Name, "Претензия") { + continue + } + tmp := map[string]interface{}{ + "bucketName": "claim", + // "fileName": bc.Files[i].FileName, // Тут название без с расширением + "fileName": bc.Files[i].Name, // Тут название без расширения + "fileExtension": bc.Files[i].Extension, + "fileSizeByte": bc.Files[i].Size, + "pathToFile": bc.Files[i].FullName, + "eTag": bc.Files[i].FileID, + } + attachments = append(attachments, tmp) + // Получаем только первый файл, поскольку их вообще по БП не должно быть больше + break + } + result["attachments"] = attachments // Вложения + } + + // Курск - https://lkul-kursk.atomsbt.ru/ + // Мурманск – https://lkul-murmansk.atomsbt.ru/ + // Тверь - https://lkul-tver.atomsbt.ru/ + // Смоленск - https://lkul-smolensk.atomsbt.ru/ + // Хакасия - https://lkul-khakasia.atomsbt.ru/ + lkLink := bc.Lawsuit.Branch.PersonalAreaLink + + result["StageCode"] = bc.Lawsuit.Stage.Code // Этап + result["StatusCode"] = bc.Lawsuit.Status.Code // Статус + result["mailingCode"] = mailingCode // TODO Код рассылка "CLAIM20221004T112001" Обязательно в таком формате + result["templateCode"] = template // TODO Код шаблона (имя-строка на стороне уведомлений) + result["channelCode"] = channel // TODO Канал доставки + result["lkLink"] = lkLink // Ссылка на Личный кабинет + result["claimDate"] = front_format.FrontDate(bc.Lawsuit.ClaimAt) // Дата формирования претензии+3 к.д. + result["claimPretrialDate"] = front_format.FrontDate(bc.Lawsuit.PretrialAt) // Дата формирования досудебной претензии+5 к.д. + result["contactInfo"] = bc.Lawsuit.Contract.Email // Endpoint абонента + result["contractDate"] = front_format.FrontDate(bc.Lawsuit.Contract.SignAt) // Дата договора + result["contractNumber"] = bc.Lawsuit.Contract.Number // Номер договора + result["dbtDate"] = bc.Lawsuit.DateFrom.Format("2006-01-02") // Период + result["dbtDateStr"] = russianDate(bc.Lawsuit.DateFrom, true) // TODO Переделать на строку Период строкой + result["dbtSum"] = front_format.Currency(bc.Lawsuit.DebtSum) // TODO Сумма образовавшейся задолженности + result["dbtSumFull"] = front_format.Currency(dbtSumFull) // Общая сумма долга + result["dbtSumPeriod"] = front_format.Currency(bc.Lawsuit.DebtSum) // Сумма долга за период + result["mailingSubject"] = subject // Заголовок письма + result["infoPhone"] = bc.Lawsuit.Contract.Organization.Phone // Телефон абонента + result["isOrganisationAcc"] = "1" // Если организация + // Организация + if strings.Trim(bc.Lawsuit.Contract.Organization.FullName, " ") == "" { + result["organisation"] = bc.Lawsuit.Contract.Organization.Name + } else { + result["organisation"] = bc.Lawsuit.Contract.Organization.FullName + } + result["persAcc"] = bc.Lawsuit.Contract.Number // Лицевой счёт / номер договора + result["userAddress"] = bc.Lawsuit.Contract.Organization.PostAddress // Почтовый адрес абонента + + return result, nil +} + +/* +// BriefCaseView выборка +func BriefCaseView(bc *BriefCase, c *CommonRef, t *TypeRef, useFormat bool) (map[string]interface{}, error) { + result := make(map[string]interface{}) + + if bc == nil { + return result, fmt.Errorf("MailTemplateView, BriefCase is nil") + } + if c == nil { + return result, fmt.Errorf("MailTemplateView, CommonRef is nil") + } + if t == nil { + return result, fmt.Errorf("MailTemplateView, TypeRef is nil") + } + + lawSuit := bc.Lawsuit + + // ID + result["Lawsuit_ID"] = lawSuit.ID + // Дата претензии + if useFormat { + result["Lawsuit_CreatedAt"] = formatDate(lawSuit.CreatedAt) + } else { + result["Lawsuit_CreatedAt"] = lawSuit.CreatedAt + } + // Номер претензии + result["Lawsuit_Number"] = lawSuit.Number + result["Lawsuit_NumberClaim"] = lawSuit.NumberClaim + result["Lawsuit_NumberTrial"] = lawSuit.NumberTrial + + // TODO View LawsuitStageTypes Улучшить поиск + stage := LawsuitStageType{} + for i := 0; i < len(t.LawsuitStageTypes); i++ { + if t.LawsuitStageTypes[i].ID == lawSuit.StageID { + stage = t.LawsuitStageTypes[i] + break + } + } + // Этап - для фильтрации + result["Lawsuit_StageID"] = lawSuit.StageID + // Этап - для вариантов отображения + result["Lawsuit_StageCode"] = stage.Code + // Этап - для вывода в таблицу + result["Lawsuit_Stage"] = stage.Name + // Дата установки этапа + if useFormat { + result["Lawsuit_StageAt"] = formatDate(lawSuit.StageAt) + } else { + result["Lawsuit_StageAt"] = lawSuit.StageAt + } + + // TODO View LawsuitStatusTypes Улучшить поиск + status := LawsuitStatusType{} + for i := 0; i < len(t.LawsuitStatusTypes); i++ { + if t.LawsuitStatusTypes[i].ID == lawSuit.StatusID { + status = t.LawsuitStatusTypes[i] + break + } + } + // Статус - для фильтрации + result["Lawsuit_StatusID"] = lawSuit.StatusID + // Статус - для вариантов отображения + result["Lawsuit_StatusCode"] = status.Code + // Статус - для вывода в таблицу + result["Lawsuit_Status"] = status.Name + // Дата установки статуса + if useFormat { + result["Lawsuit_StatusAt"] = formatDate(lawSuit.StatusAt) + } else { + result["Lawsuit_StatusAt"] = lawSuit.StatusAt + } + + // TODO View LawsuitReasonTypes Улучшить поиск + reason := "Неизвестно" + for i := 0; i < len(t.LawsuitReasonTypes); i++ { + if t.LawsuitReasonTypes[i].ID == lawSuit.ReasonID { + reason = t.LawsuitReasonTypes[i].Name + break + } + } + // Статус - для фильтрации + result["Lawsuit_ReasonID"] = lawSuit.ReasonID + // Статус - для вывода в таблицу + result["Lawsuit_Reason"] = reason + + // TODO View ClaimTypes Улучшить поиск + claimType := "Неизвестно" + for i := 0; i < len(t.ClaimTypes); i++ { + if t.ClaimTypes[i].ID == lawSuit.ClaimTypeID { + claimType = t.ClaimTypes[i].Name + break + } + } + // Статус - для фильтрации + result["Lawsuit_ClaimTypeID"] = lawSuit.ClaimTypeID + // Статус - для вывода в таблицу + result["Lawsuit_ClaimType"] = claimType + + // TODO View ClaimTypes Улучшить поиск + branch := "" + for i := 0; i < len(c.Branches); i++ { + if c.Branches[i].ID == lawSuit.BranchID { + branch = c.Branches[i].Name + break + } + } + // Отделение - для фильтрации + result["Lawsuit_BranchID"] = lawSuit.BranchID + // Отделение - для вывода в таблицу + result["Lawsuit_Branch"] = branch + + dbtSumFull := bc.Lawsuit.DebtSum + + bc.Lawsuit.Penny + + bc.Lawsuit.Penalty + + bc.Lawsuit.StateDuty + + // Сумма процентов по 395 ГК РФ (руб.) + if useFormat { + result["Lawsuit_Percent_395"] = Currency(bc.Lawsuit.Percent395) + } else { + result["Lawsuit_Percent_395"] = bc.Lawsuit.Percent395 + } + // Сумма процентов по 317.1 ГК РФ (руб.) + if useFormat { + result["Lawsuit_Percent_317"] = Currency(bc.Lawsuit.Percent317) + } else { + result["Lawsuit_Percent_317"] = bc.Lawsuit.Percent317 + } + // Сумма договорной/законной неустойки (руб.) + if useFormat { + result["Lawsuit_Penalty"] = Currency(bc.Lawsuit.Penalty) + } else { + result["Lawsuit_Penalty"] = bc.Lawsuit.Penalty + } + // Пени по день фактической оплаты долга (руб.) + if useFormat { + result["Lawsuit_Penny"] = Currency(bc.Lawsuit.Penny) + } else { + result["Lawsuit_Penny"] = bc.Lawsuit.Penny + } + // Сумма госпошлины (руб.) + if useFormat { + result["Lawsuit_StateDuty"] = Currency(bc.Lawsuit.StateDuty) + } else { + result["Lawsuit_StateDuty"] = bc.Lawsuit.StateDuty + } + // Поступило денежных средств + if useFormat { + result["Lawsuit_ReceivedFunds"] = Currency(lawSuit.PaySum) + } else { + result["Lawsuit_ReceivedFunds"] = lawSuit.PaySum + } + // TODO Поле "Общий долг": Полная сумма долга + if useFormat { + result["Lawsuit_TotalDebt"] = Currency(dbtSumFull) + } else { + result["Lawsuit_TotalDebt"] = dbtSumFull + } + // TODO Поле "Основной долг": По счёт фактурам + if useFormat { + result["Lawsuit_MainDebt"] = Currency(lawSuit.InvoiceSum) + } else { + result["Lawsuit_MainDebt"] = lawSuit.InvoiceSum + } + // TODO Поле "Остаток долга": "Основной долг" - Поступило денежных средств + if useFormat { + result["Lawsuit_Balance"] = Currency(lawSuit.DebtSum) + } else { + result["Lawsuit_Balance"] = lawSuit.DebtSum + } + // TODO Колонка уведомление + if useFormat { + //result["Lawsuit_Claim"] = Currency(lawSuit.InvoiceSum - lawSuit.PaySum) + result["Lawsuit_Claim"] = Currency(lawSuit.InvoiceSum) + } else { + //result["Lawsuit_Claim"] = lawSuit.InvoiceSum - lawSuit.PaySum + result["Lawsuit_Claim"] = lawSuit.InvoiceSum + } + // TODO Колонка претензия + if useFormat { + result["Lawsuit_Pretrial"] = "-" // Currency(lawSuit.InvoiceSum) + } else { + result["Lawsuit_Pretrial"] = "-" // lawSuit.InvoiceSum + } + + if lawSuit.UnknownPayments { + result["Lawsuit_UnknownPayments"] = 1 + } else { + result["Lawsuit_UnknownPayments"] = 0 + } + + changes := make([]interface{}, 0) + for i := 0; i < len(bc.ChangeItems); i++ { + // TODO Костыль, нужно по-быстрому решить, чтобы не парсить в веб + actionCode := 0 + newValueCode := 0 + prevValueCode := 0 + if bc.ChangeItems[i].Key == "Обновление статуса" { + actionCode = 1 + // "Сформировано уведомление (2)" + value := regexp.MustCompile(`\d`).FindStringSubmatch(bc.ChangeItems[i].Value) + if len(value) == 1 { + newValueCode, _ = strconv.Atoi(value[0]) + } + } + tmp := map[string]interface{}{ + "ID": bc.ChangeItems[i].ID, + "CreatedAt": formatTime(bc.ChangeItems[i].CreatedAt), + "Action": bc.ChangeItems[i].Key, + "NewValue": bc.ChangeItems[i].Value, + "PrevValue": bc.ChangeItems[i].Prev, + "ActionCode": actionCode, + "NewValueCode": newValueCode, + "PrevValueCode": prevValueCode, + } + changes = append(changes, tmp) + } + result["Lawsuit_Changes"] = changes + + contract := &lawSuit.Contract + // ID + result["Contract_ID"] = contract.ID + // № Договор + result["Contract_Number"] = contract.Number + // Дата договора + if useFormat { + result["Contract_SignAt"] = formatDate(contract.SignAt) + } else { + result["Contract_SignAt"] = contract.SignAt + } + // Категория договора + category := "Неизвестно" + for i := 0; i < len(t.ContractCategoryTypes); i++ { + if t.ContractCategoryTypes[i].ID == contract.CategoryID { + category = t.ContractCategoryTypes[i].Name + break + } + } + result["Contract_Category"] = category + result["Contract_CategoryID"] = contract.CategoryID + // Статус + if contract.Status == "" { + result["Contract_Status"] = "Активен" + } else { + result["Contract_Status"] = contract.Status + } + // Почтовый адрес + if contract.PostAddress == "" { + result["Contract_PostAddress"] = "Не указан" + } else { + result["Contract_PostAddress"] = contract.PostAddress + } + // E-mail + if contract.Email == "" { + result["Contract_Email"] = "Не указан" + } else { + result["Contract_Email"] = contract.Email + } + // Валидность E-mail + if contract.IsValidEmail { + result["Contract_EmailValid"] = 1 + } else { + result["Contract_EmailValid"] = 0 + } + + // Судебный отдел + result["Contract_CuratorLegal"] = fmt.Sprintf("%v %v", contract.CuratorLegal.SecondName, contract.CuratorLegal.Name) + result["Contract_CuratorLegal_Email"] = contract.CuratorLegal.Email + result["Contract_CuratorLegal_Phone"] = contract.CuratorLegal.Phone + // Расчётный отдел + result["Contract_CuratorPayment"] = fmt.Sprintf("%v %v", contract.CuratorPayment.SecondName, contract.CuratorPayment.Name) + result["Contract_CuratorPayment_Email"] = contract.CuratorPayment.Email + result["Contract_CuratorPayment_Phone"] = contract.CuratorPayment.Phone + // Договорной отдел + result["Contract_CuratorContract"] = fmt.Sprintf("%v %v", contract.CuratorContract.SecondName, contract.CuratorContract.Name) + result["Contract_CuratorContract_Email"] = contract.CuratorContract.Email + result["Contract_CuratorContract_Phone"] = contract.CuratorContract.Phone + // Отдел тех. аудита + result["Contract_CuratorTechAudit"] = fmt.Sprintf("%v %v", contract.CuratorTechAudit.SecondName, contract.CuratorTechAudit.Name) + result["Contract_CuratorTechAudit_Email"] = contract.CuratorTechAudit.Email + result["Contract_CuratorTechAudit_Phone"] = contract.CuratorTechAudit.Phone + // Куратор претензии + result["Contract_CuratorClaim"] = fmt.Sprintf("%v %v", contract.CuratorClaim.SecondName, contract.CuratorClaim.Name) + result["Contract_CuratorClaim_Email"] = contract.CuratorClaim.Email + result["Contract_CuratorClaim_Phone"] = contract.CuratorClaim.Phone + + result["Contract_DaysToResolveClaim"] = contract.DaysToResolveClaim + + result["Contract_PaymentDay"] = 18 + for i := 0; i < len(contract.PaymentDays); i++ { + if time.Now().After(contract.PaymentDays[i].DateFrom) && + time.Now().Before(contract.PaymentDays[i].DateTo) { + result["Contract_PaymentDay"] = contract.PaymentDays[i].Day + break + } + } + + paymentSchedules := make([]interface{}, 0) + for i := 0; i < len(contract.PaymentSchedules); i++ { + if contract.PaymentSchedules[i].ContractID == contract.ID { + if useFormat { + tmp := map[string]interface{}{ + "Day": fmt.Sprintf("%d число", contract.PaymentSchedules[i].Day), + "Percent": fmt.Sprintf("%d %%", contract.PaymentSchedules[i].Percent), + } + paymentSchedules = append(paymentSchedules, tmp) + } else { + tmp := map[string]interface{}{ + "Day": fmt.Sprintf("%d", contract.PaymentSchedules[i].Day), + "Percent": fmt.Sprintf("%d", contract.PaymentSchedules[i].Percent), + } + paymentSchedules = append(paymentSchedules, tmp) + } + } + } + if len(paymentSchedules) == 0 { + tmp := map[string]interface{}{ + "Day": "18", + "Percent": fmt.Sprintf("100 %%"), + } + paymentSchedules = append(paymentSchedules, tmp) + } + // Срок оплаты по договору + result["Contract_PaymentSchedules"] = paymentSchedules + + invoices := make([]interface{}, 0) + totalSum := 0.0 + totalCorrectionSum := 0.0 + totalDebtSum := 0.0 + totalPayment := 0.0 + totalBalance := 0.0 + for i := 0; i < len(bc.Invoices); i++ { + // TODO Пока аналитики вообще скрываю + if strings.Trim(bc.Invoices[i].Document.Analytics, " ") != "" { + continue + } + + paymentSum := 0.0 + correctionSum := 0.0 + for j := 0; j < len(bc.Payments); j++ { + if bc.Invoices[i].ID == bc.Payments[j].InvoiceID { + if bc.Payments[j].IsCorrective { + correctionSum += bc.Payments[j].Sum + } else { + paymentSum += bc.Payments[j].Sum + } + + } + } + + note := bc.Invoices[i].Document.Note + if note == "" { + note = "Не задано" + } + + number := "СФ:" + bc.Invoices[i].Document.Number + numberFull := bc.Invoices[i].Document.NumberFull + sum := Currency(bc.Invoices[i].Sum) + if bc.Invoices[i].IsCorrective { + number = "К" + number + sum = "" + } + + tmp := map[string]interface{}{ + "ID": bc.Invoices[i].ID, + "ClaimNumber": lawSuit.NumberClaim, // Поле "Претензия" + "Date": formatDate(bc.Invoices[i].Document.DocumentAt), // Поле "Дата С/Ф" + "Number": number, // Поле "Номер С/Ф" + "NumberFull": numberFull, // Поле "Номер С/Ф" полный + "Type": bc.Invoices[i].Document.Analytics, // Поле "Тип начисления" + "Count": bc.Invoices[i].Count, // Кол-во кВт + "Sum": sum, // Поле "Начислено" + "Correction": Currency(correctionSum), // Поле "Корректировка" + "DebtSum": Currency(bc.Invoices[i].Sum - paymentSum), // Поле "Долг в претензии" + "Payment": Currency(paymentSum), // Поле "Оплачено" + "Balance": Currency(bc.Invoices[i].Sum - paymentSum), // Поле "Остаток" + "Note": note, // Поле "Примечание" + } + + // TODO Аналитики нужно считать отдельно + if strings.Trim(bc.Invoices[i].Document.Analytics, " ") == "" { + totalSum += bc.Invoices[i].Sum + totalCorrectionSum += correctionSum + totalPayment += paymentSum + + totalDebtSum += bc.Invoices[i].Sum - paymentSum - correctionSum + totalBalance += bc.Invoices[i].Sum - paymentSum - correctionSum + } + + invoices = append(invoices, tmp) + } + // Счета фактуры по данному договору + result["Contract_Invoices"] = invoices + // Суммы счетов фактур по данному договору + result["Contract_TotalInvoices"] = map[string]interface{}{ + "Sum": Currency(totalSum), // Поле "Начислено" + "CorSum": Currency(totalCorrectionSum), // Поле "Корректировка" + "DebtSum": Currency(totalDebtSum), // Поле "Долг в претензии" + "Payment": Currency(totalPayment), // Поле "Оплачено" + "Balance": Currency(totalBalance), // Поле "Остаток" + } + + result["Lawsuit_Period"] = bc.Lawsuit.ClaimPeriodStr + + payments := make([]interface{}, 0) + totalSum = 0.0 + totalCorrectionSum = 0.0 + totalDebtSum = 0.0 + totalPayment = 0.0 + totalBalance = 0.0 + totalUnknownPayment := 0.0 + totalPaymentsBeforeClaim := 0.0 // сумма всех платежей с момента выставления с/ф + totalPaymentsAllClaim := 0.0 // сумма всех платежей с момента формирования претензии + for i := 0; i < len(bc.Payments); i++ { // Перебираем платежи в конкретной претензии + // TODO Пока аналитики вообще скрываю + if strings.Trim(bc.Payments[i].Document.Analytics, " ") != "" { + continue + } + + note := bc.Payments[i].Document.Note + if note == "" { + note = "Не задано" + } + + invoiceSum := 0.0 + for j := 0; j < len(bc.Invoices); j++ { + if bc.Payments[i].InvoiceID == bc.Invoices[j].ID { + invoiceSum += bc.Invoices[j].Sum + break + } + } + + number := "ПП:" + bc.Payments[i].Document.Number + isInvoiceOut := false // если текущий документ с/ф + correction := "" + payment := Currency(bc.Payments[i].Sum) + if bc.Payments[i].Document.DocumentTypeID == 35 { + number = "СФ:" + bc.Payments[i].Document.Number + correction = Currency(bc.Payments[i].Sum) + payment = "" + isInvoiceOut = true + } + if bc.Payments[i].IsCorrective { + number = "К" + number + } + + paymentDoc := bc.Payments[i].Sum + + if !isInvoiceOut { + controlDate := lawSuit.CreatedAt + strControlDate := controlDate.Local().Format("2006-01-02") + docDate := bc.Payments[i].Document.DocumentAt + strDocDate := docDate.Local().Format("2006-01-02") + if strControlDate > strDocDate { + totalPaymentsBeforeClaim += paymentDoc // Считаем сумму платежей до формирования претензии + } + totalPaymentsAllClaim += paymentDoc // Считаем сумму всех платежей + } + + tmp := map[string]interface{}{ + "ID": bc.Payments[i].ID, + "InvoiceID": bc.Payments[i].InvoiceID, // Ссылка на С/Ф + "ClaimNumber": lawSuit.NumberClaim, // Поле "Претензия" + "Date": formatDate(bc.Payments[i].Document.DocumentAt), // Поле "Дата С/Ф" + "DistributionDate": formatTime(bc.Payments[i].CreatedAt), // Поле "Дата разнесения" + "Number": number, // Поле "Номер С/Ф" + "Type": bc.Payments[i].Document.Analytics, // Поле "Тип начисления" + "Sum": "", // Поле "Начислено" + "Correction": correction, // Поле "Корректировка" + "DebtSum": "", // Поле "Долг в претензии" + "Payment": payment, // Поле "Оплачено" + "Balance": "", // Поле "Остаток" + "Note": note, // Поле "Примечание" + } + + // TODO Аналитики нужно считать отдельно + if strings.Trim(bc.Payments[i].Document.Analytics, " ") == "" { + // Платежи без фактур + if bc.Payments[i].InvoiceID == 0 { + totalUnknownPayment += bc.Payments[i].Sum + } else { + totalDebtSum += invoiceSum - bc.Payments[i].Sum + totalPayment += bc.Payments[i].Sum + totalBalance += invoiceSum - bc.Payments[i].Sum + + if bc.Payments[i].IsCorrective { + totalCorrectionSum += bc.Payments[i].Sum + } else { + totalSum += invoiceSum + } + } + } + + payments = append(payments, tmp) + } + + // TODO Колонка уведомление + notificationSumm := lawSuit.InvoiceSum - totalPaymentsBeforeClaim + if useFormat { + //result["Lawsuit_Claim"] = Currency(lawSuit.InvoiceSum - lawSuit.PaySum) + result["Lawsuit_Claim"] = Currency(notificationSumm) + } else { + //result["Lawsuit_Claim"] = lawSuit.InvoiceSum - lawSuit.PaySum + result["Lawsuit_Claim"] = notificationSumm + } + if !isIncludedStage(bc.ChangeItems, 2) { + result["Lawsuit_Claim"] = "-" + } + // TODO Колонка претензия + claimDebtSumm := lawSuit.InvoiceSum - totalPaymentsAllClaim + if useFormat { + // result["Lawsuit_Pretrial"] = "-" // Currency(lawSuit.InvoiceSum) + result["Lawsuit_Pretrial"] = Currency(claimDebtSumm) + } else { + //result["Lawsuit_Pretrial"] = "-" // lawSuit.InvoiceSum + result["Lawsuit_Pretrial"] = claimDebtSumm + } + if !isIncludedStage(bc.ChangeItems, 4) { + result["Lawsuit_Pretrial"] = "-" + } + + // Платёжные документы по данному договору + result["Contract_Payments"] = payments + // Суммы платёжных документов по данному договору + result["Contract_TotalPayments"] = map[string]interface{}{ + "Sum": Currency(totalSum), // Поле "Начислено" + "CorSum": Currency(totalCorrectionSum), // Поле "Корректировка" + "DebtSum": Currency(totalDebtSum), // Поле "Долг в претензии" + "Payment": Currency(totalPayment), // Поле "Оплачено" + "Balance": Currency(totalBalance), // Поле "Остаток" + } + // Суммы нераспознанных платёжных документов по данному договору + result["Contract_TotalUnknownPayments"] = map[string]interface{}{ + "Payment": Currency(totalUnknownPayment), // Поле "Сумма" + } + + organization := &contract.Organization + // ID + result["Organization_ID"] = organization.ID + // Email ЮЛ + if organization.Email == "" { + result["Organization_Email"] = "Не указан" + } else { + result["Organization_Email"] = organization.Email + } + // Наименование ЮЛ + result["Organization_Name"] = organization.Name + result["Organization_FullName"] = organization.FullName + // ИНН ЮЛ + result["Organization_INN"] = organization.INN + // КПП ЮЛ + result["Organization_KPP"] = organization.KPP + // Юридический адрес ЮЛ + result["Organization_LegalAddress"] = organization.LegalAddress + // Категория организации + category = "Неизвестно" + for i := 0; i < len(t.OrganizationCategoryTypes); i++ { + if t.OrganizationCategoryTypes[i].ID == organization.CategoryID { + category = t.OrganizationCategoryTypes[i].Name + break + } + } + result["Organization_CategoryID"] = organization.CategoryID + result["Organization_Category"] = category + // Состояние организации + state := "Действующее" + code := "1" + color := "green" + for i := 0; i < len(t.OrganizationStateTypes); i++ { + if t.OrganizationStateTypes[i].ID == organization.StateID { + state = t.OrganizationStateTypes[i].Name + code = t.OrganizationStateTypes[i].Code + color = t.OrganizationStateTypes[i].Color + break + } + } + result["Organization_State"] = state + result["Organization_StateCode"] = code + result["Organization_StateColor"] = color + result["Organization_StateID"] = organization.StateID + + // Ликвидность организации - deprecated + // if organization.IsLiquidated { + // result["Organization_Liquidity"] = "Ликвидирован" + // } else { + // result["Organization_Liquidity"] = "Действующий" + // } + // Банкротство организации - deprecated + // if organization.IsBankrupt { + // result["Organization_Bankrupt"] = "Банкрот" + // } else { + // result["Organization_Bankrupt"] = "Действующий" + // } + + FileMail := "" + FileMailName := "" + FileClaim := "" + FileClaimName := "" + FileClaimDetail := "" + FileClaimDetailName := "" + for i := 0; i < len(bc.Files); i++ { + if strings.Contains(bc.Files[i].Name, "Письмо") { + FileMail = bc.Files[i].FileID + FileMailName = bc.Files[i].FullName + } + + if strings.Contains(bc.Files[i].Name, "Претензия") { + FileClaim = bc.Files[i].FileID + FileClaimName = bc.Files[i].FullName + } + + if strings.Contains(bc.Files[i].Name, "Реестр") { + FileClaimDetail = bc.Files[i].FileID + FileClaimDetailName = bc.Files[i].FullName + } + } + result["File_Mail"] = FileMail + result["File_MailName"] = FileMailName + result["File_Claim"] = FileClaim + result["File_ClaimName"] = FileClaimName + result["File_ClaimDetail"] = FileClaimDetail + result["File_ClaimDetailName"] = FileClaimDetailName + + // TODO Переделать под нормальные статусы + if lawSuit.NotifyClaimDone { + result["Notify_ClaimStatus"] = fmt.Sprintf("%v", "Доставлено успешно") + } else if lawSuit.NotifyClaimAt.Before(time.Now().AddDate(-10, 1, 1)) { + result["Notify_ClaimStatus"] = fmt.Sprintf("%v", "Ожидание") + } else if !contract.IsValidEmail { + result["Notify_ClaimStatus"] = fmt.Sprintf("%v", "Не доставлено (недоступен канал)") + } else if contract.Email == "" { + result["Notify_ClaimStatus"] = fmt.Sprintf("%v", "Не доставлено (отсутствует канал)") + } else { + result["Notify_ClaimStatus"] = fmt.Sprintf("%v", contract.Email) + } + if lawSuit.NotifyPretrialDone { + result["Notify_PretrialStatus"] = fmt.Sprintf("%v", "Доставлено успешно") + } else if lawSuit.NotifyPretrialAt.Before(time.Now().AddDate(-10, 1, 1)) { + result["Notify_PretrialStatus"] = fmt.Sprintf("%v", "Ожидание") + } else if !contract.IsValidEmail { + result["Notify_StatusPretrial"] = fmt.Sprintf("%v", "Не доставлено (недоступен канал)") + } else if contract.Email == "" { + result["Notify_PretrialStatus"] = fmt.Sprintf("%v", "Не доставлено (отсутствует канал)") + } else { + result["Notify_PretrialStatus"] = fmt.Sprintf("%v", contract.Email) + } + result["Notify_ClaimChannel"] = lawSuit.NotifyClaimChannel + result["Notify_ClaimCode"] = lawSuit.NotifyClaimCode + result["Notify_ClaimDone"] = lawSuit.NotifyClaimDone + result["Notify_ClaimMailingCode"] = lawSuit.NotifyClaimMailingCode + result["Notify_PretrialChannel"] = lawSuit.NotifyPretrialChannel + result["Notify_PretrialCode"] = lawSuit.NotifyPretrialCode + result["Notify_PretrialDone"] = lawSuit.NotifyPretrialDone + result["Notify_PretrialMailingCode"] = lawSuit.NotifyPretrialMailingCode + if useFormat { + result["Notify_ClaimAt"] = formatDate(lawSuit.NotifyClaimAt) + result["Notify_PretrialAt"] = formatDate(lawSuit.NotifyPretrialAt) + } else { + result["Notify_ClaimAt"] = lawSuit.NotifyClaimAt + result["Notify_PretrialAt"] = lawSuit.NotifyPretrialAt + } + + hashtags := make([]interface{}, 0) + for i := 0; i < len(bc.Hashtags); i++ { + tmp := map[string]interface{}{ + "ID": bc.Hashtags[i].ID, + "Name": bc.Hashtags[i].Name, + "Description": bc.Hashtags[i].Description, + } + hashtags = append(hashtags, tmp) + } + result["Lawsuit_Hashtags"] = hashtags + + return result, nil +} +*/ + +// BriefCaseView -- выборка данных из претензии для отображения в веб-морде +func BriefCaseView(bc *BriefCase, c *CommonRef, t *TypeRef, useFormat bool) (map[string]interface{}, error) { + result := make(map[string]interface{}) + + if bc == nil { + return result, fmt.Errorf("MailTemplateView, BriefCase is nil") + } + if c == nil { + return result, fmt.Errorf("MailTemplateView, CommonRef is nil") + } + if t == nil { + return result, fmt.Errorf("MailTemplateView, TypeRef is nil") + } + + lawSuit := bc.Lawsuit + + // ID + result["Lawsuit_ID"] = lawSuit.ID + // Дата претензии + if useFormat { + result["Lawsuit_CreatedAt"] = formatDate(lawSuit.CreatedAt) + } else { + result["Lawsuit_CreatedAt"] = lawSuit.CreatedAt + } + // Номер претензии + result["Lawsuit_Number"] = lawSuit.Number + result["Lawsuit_NumberClaim"] = lawSuit.NumberClaim + result["Lawsuit_NumberTrial"] = lawSuit.NumberTrial + + // TODO View LawsuitStageTypes Улучшить поиск + stage := LawsuitStageType{} + for i := 0; i < len(t.LawsuitStageTypes); i++ { + if t.LawsuitStageTypes[i].ID == lawSuit.StageID { + stage = t.LawsuitStageTypes[i] + break + } + } + // Этап - для фильтрации + result["Lawsuit_StageID"] = lawSuit.StageID + // Этап - для вариантов отображения + result["Lawsuit_StageCode"] = stage.Code + // Этап - для вывода в таблицу + result["Lawsuit_Stage"] = stage.Name + // Дата установки этапа + if useFormat { + result["Lawsuit_StageAt"] = formatDate(lawSuit.StageAt) + } else { + result["Lawsuit_StageAt"] = lawSuit.StageAt + } + + // TODO View LawsuitStatusTypes Улучшить поиск + status := LawsuitStatusType{} + for i := 0; i < len(t.LawsuitStatusTypes); i++ { + if t.LawsuitStatusTypes[i].ID == lawSuit.StatusID { + status = t.LawsuitStatusTypes[i] + break + } + } + // Статус - для фильтрации + result["Lawsuit_StatusID"] = lawSuit.StatusID + // Статус - для вариантов отображения + result["Lawsuit_StatusCode"] = status.Code + // Статус - для вывода в таблицу + result["Lawsuit_Status"] = status.Name + // Дата установки статуса + if useFormat { + result["Lawsuit_StatusAt"] = formatDate(lawSuit.StatusAt) + } else { + result["Lawsuit_StatusAt"] = lawSuit.StatusAt + } + + // TODO View LawsuitReasonTypes Улучшить поиск + reason := "Неизвестно" + for i := 0; i < len(t.LawsuitReasonTypes); i++ { + if t.LawsuitReasonTypes[i].ID == lawSuit.ReasonID { + reason = t.LawsuitReasonTypes[i].Name + break + } + } + // Статус - для фильтрации + result["Lawsuit_ReasonID"] = lawSuit.ReasonID + // Статус - для вывода в таблицу + result["Lawsuit_Reason"] = reason + + // TODO View ClaimTypes Улучшить поиск + claimType := "Неизвестно" + for i := 0; i < len(t.ClaimTypes); i++ { + if t.ClaimTypes[i].ID == lawSuit.ClaimTypeID { + claimType = t.ClaimTypes[i].Name + break + } + } + // Статус - для фильтрации + result["Lawsuit_ClaimTypeID"] = lawSuit.ClaimTypeID + // Статус - для вывода в таблицу + result["Lawsuit_ClaimType"] = claimType + + // TODO View ClaimTypes Улучшить поиск + branch := "" + for i := 0; i < len(c.Branches); i++ { + if c.Branches[i].ID == lawSuit.BranchID { + branch = c.Branches[i].Name + break + } + } + // Отделение - для фильтрации + result["Lawsuit_BranchID"] = lawSuit.BranchID + // Отделение - для вывода в таблицу + result["Lawsuit_Branch"] = branch + + dbtSumFull := bc.Lawsuit.DebtSum + + bc.Lawsuit.Penny + + bc.Lawsuit.Penalty + + bc.Lawsuit.StateDuty + + // Сумма процентов по 395 ГК РФ (руб.) + if useFormat { + result["Lawsuit_Percent_395"] = Currency(bc.Lawsuit.Percent395) + } else { + result["Lawsuit_Percent_395"] = bc.Lawsuit.Percent395 + } + // Сумма процентов по 317.1 ГК РФ (руб.) + if useFormat { + result["Lawsuit_Percent_317"] = Currency(bc.Lawsuit.Percent317) + } else { + result["Lawsuit_Percent_317"] = bc.Lawsuit.Percent317 + } + // Сумма договорной/законной неустойки (руб.) + if useFormat { + result["Lawsuit_Penalty"] = Currency(bc.Lawsuit.Penalty) + } else { + result["Lawsuit_Penalty"] = bc.Lawsuit.Penalty + } + // Пени по день фактической оплаты долга (руб.) + if useFormat { + result["Lawsuit_Penny"] = Currency(bc.Lawsuit.Penny) + } else { + result["Lawsuit_Penny"] = bc.Lawsuit.Penny + } + // Сумма госпошлины (руб.) + if useFormat { + result["Lawsuit_StateDuty"] = Currency(bc.Lawsuit.StateDuty) + } else { + result["Lawsuit_StateDuty"] = bc.Lawsuit.StateDuty + } + // Поступило денежных средств + if useFormat { + result["Lawsuit_ReceivedFunds"] = Currency(lawSuit.PaySum) + } else { + result["Lawsuit_ReceivedFunds"] = lawSuit.PaySum + } + // TODO Поле "Общий долг": Полная сумма долга + if useFormat { + result["Lawsuit_TotalDebt"] = Currency(dbtSumFull) + } else { + result["Lawsuit_TotalDebt"] = dbtSumFull + } + // TODO Поле "Основной долг": По счёт фактурам + if useFormat { + result["Lawsuit_MainDebt"] = Currency(lawSuit.InvoiceSum) + } else { + result["Lawsuit_MainDebt"] = lawSuit.InvoiceSum + } + // TODO Поле "Остаток долга": "Основной долг" - Поступило денежных средств + if useFormat { + result["Lawsuit_Balance"] = Currency(lawSuit.DebtSum) + } else { + result["Lawsuit_Balance"] = lawSuit.DebtSum + } + // TODO Колонка уведомление + if useFormat { + //result["Lawsuit_Claim"] = Currency(lawSuit.InvoiceSum - lawSuit.PaySum) + result["Lawsuit_Claim"] = Currency(lawSuit.InvoiceSum) + } else { + //result["Lawsuit_Claim"] = lawSuit.InvoiceSum - lawSuit.PaySum + result["Lawsuit_Claim"] = lawSuit.InvoiceSum + } + // TODO Колонка претензия + if useFormat { + result["Lawsuit_Pretrial"] = "-" // Currency(lawSuit.InvoiceSum) + } else { + result["Lawsuit_Pretrial"] = "-" // lawSuit.InvoiceSum + } + + if lawSuit.UnknownPayments { + result["Lawsuit_UnknownPayments"] = 1 + } else { + result["Lawsuit_UnknownPayments"] = 0 + } + + changes := make([]interface{}, 0) + for i := 0; i < len(bc.ChangeItems); i++ { + // TODO Костыль, нужно по-быстрому решить, чтобы не парсить в веб + actionCode := 0 + newValueCode := 0 + prevValueCode := 0 + if bc.ChangeItems[i].Key == "Обновление статуса" { + actionCode = 1 + // "Сформировано уведомление (2)" + value := regexp.MustCompile(`\d`).FindStringSubmatch(bc.ChangeItems[i].Value) + if len(value) == 1 { + newValueCode, _ = strconv.Atoi(value[0]) + } + } + tmp := map[string]interface{}{ + "ID": bc.ChangeItems[i].ID, + "CreatedAt": formatTime(bc.ChangeItems[i].CreatedAt), + "Action": bc.ChangeItems[i].Key, + "NewValue": bc.ChangeItems[i].Value, + "PrevValue": bc.ChangeItems[i].Prev, + "ActionCode": actionCode, + "NewValueCode": newValueCode, + "PrevValueCode": prevValueCode, + } + changes = append(changes, tmp) + } + result["Lawsuit_Changes"] = changes + + contract := &lawSuit.Contract + // ID + result["Contract_ID"] = contract.ID + // № Договор + result["Contract_Number"] = contract.Number + // Дата договора + if useFormat { + result["Contract_SignAt"] = formatDate(contract.SignAt) + } else { + result["Contract_SignAt"] = contract.SignAt + } + // Категория договора + category := "Неизвестно" + for i := 0; i < len(t.ContractCategoryTypes); i++ { + if t.ContractCategoryTypes[i].ID == contract.CategoryID { + category = t.ContractCategoryTypes[i].Name + break + } + } + result["Contract_Category"] = category + result["Contract_CategoryID"] = contract.CategoryID + // Статус + if contract.Status == "" { + result["Contract_Status"] = "Активен" + } else { + result["Contract_Status"] = contract.Status + } + // Почтовый адрес + if contract.PostAddress == "" { + result["Contract_PostAddress"] = "Не указан" + } else { + result["Contract_PostAddress"] = contract.PostAddress + } + // E-mail + if contract.Email == "" { + result["Contract_Email"] = "Не указан" + } else { + result["Contract_Email"] = contract.Email + } + // Валидность E-mail + if contract.IsValidEmail { + result["Contract_EmailValid"] = 1 + } else { + result["Contract_EmailValid"] = 0 + } + + // Судебный отдел + result["Contract_CuratorLegal"] = fmt.Sprintf("%v %v", contract.CuratorLegal.SecondName, contract.CuratorLegal.Name) + result["Contract_CuratorLegal_Email"] = contract.CuratorLegal.Email + result["Contract_CuratorLegal_Phone"] = contract.CuratorLegal.Phone + // Расчётный отдел + result["Contract_CuratorPayment"] = fmt.Sprintf("%v %v", contract.CuratorPayment.SecondName, contract.CuratorPayment.Name) + result["Contract_CuratorPayment_Email"] = contract.CuratorPayment.Email + result["Contract_CuratorPayment_Phone"] = contract.CuratorPayment.Phone + // Договорной отдел + result["Contract_CuratorContract"] = fmt.Sprintf("%v %v", contract.CuratorContract.SecondName, contract.CuratorContract.Name) + result["Contract_CuratorContract_Email"] = contract.CuratorContract.Email + result["Contract_CuratorContract_Phone"] = contract.CuratorContract.Phone + // Отдел тех. аудита + result["Contract_CuratorTechAudit"] = fmt.Sprintf("%v %v", contract.CuratorTechAudit.SecondName, contract.CuratorTechAudit.Name) + result["Contract_CuratorTechAudit_Email"] = contract.CuratorTechAudit.Email + result["Contract_CuratorTechAudit_Phone"] = contract.CuratorTechAudit.Phone + // Куратор претензии + result["Contract_CuratorClaim"] = fmt.Sprintf("%v %v", contract.CuratorClaim.SecondName, contract.CuratorClaim.Name) + result["Contract_CuratorClaim_Email"] = contract.CuratorClaim.Email + result["Contract_CuratorClaim_Phone"] = contract.CuratorClaim.Phone + result["Contract_CuratorClaim_FullName"] = fmt.Sprintf("%v %v %v", contract.CuratorClaim.SecondName, contract.CuratorClaim.Name, contract.CuratorClaim.ParentName) + + result["Contract_DaysToResolveClaim"] = contract.DaysToResolveClaim + + result["Contract_PaymentDay"] = 18 + for i := 0; i < len(contract.PaymentDays); i++ { + if time.Now().After(contract.PaymentDays[i].DateFrom) && + time.Now().Before(contract.PaymentDays[i].DateTo) { + result["Contract_PaymentDay"] = contract.PaymentDays[i].Day + break + } + } + + paymentSchedules := make([]interface{}, 0) + for i := 0; i < len(contract.PaymentSchedules); i++ { + if contract.PaymentSchedules[i].ContractID == contract.ID { + if useFormat { + tmp := map[string]interface{}{ + "Day": fmt.Sprintf("%d число", contract.PaymentSchedules[i].Day), + "Percent": fmt.Sprintf("%d %%", contract.PaymentSchedules[i].Percent), + } + paymentSchedules = append(paymentSchedules, tmp) + } else { + tmp := map[string]interface{}{ + "Day": fmt.Sprintf("%d", contract.PaymentSchedules[i].Day), + "Percent": fmt.Sprintf("%d", contract.PaymentSchedules[i].Percent), + } + paymentSchedules = append(paymentSchedules, tmp) + } + } + } + if len(paymentSchedules) == 0 { + tmp := map[string]interface{}{ + "Day": "18", + "Percent": "100 %", + } + paymentSchedules = append(paymentSchedules, tmp) + } + // Срок оплаты по договору + result["Contract_PaymentSchedules"] = paymentSchedules + + invoices := make([]interface{}, 0) + totalSum := 0.0 + totalCorrectionSum := 0.0 + totalDebtSum := 0.0 + totalPayment := 0.0 + totalBalance := 0.0 + for i := 0; i < len(bc.Invoices); i++ { + // TODO Пока аналитики вообще скрываю + if strings.Trim(bc.Invoices[i].Document.Analytics, " ") != "" { + continue + } + + paymentSum := 0.0 + correctionSum := 0.0 + for j := 0; j < len(bc.Payments); j++ { + if bc.Invoices[i].ID == bc.Payments[j].InvoiceID { + if bc.Payments[j].IsCorrective { + correctionSum += bc.Payments[j].Sum + } else { + paymentSum += bc.Payments[j].Sum + } + + } + } + + note := bc.Invoices[i].Document.Note + if note == "" { + note = "Не задано" + } + + number := "СФ:" + bc.Invoices[i].Document.Number + numberFull := bc.Invoices[i].Document.NumberFull + sum := Currency(bc.Invoices[i].Sum) + if bc.Invoices[i].IsCorrective { + number = "К" + number + sum = "" + } + + tmp := map[string]interface{}{ + "ID": bc.Invoices[i].ID, + "ClaimNumber": lawSuit.NumberClaim, // Поле "Претензия" + "Date": formatDate(bc.Invoices[i].Document.DocumentAt), // Поле "Дата С/Ф" + "Number": number, // Поле "Номер С/Ф" + "NumberFull": numberFull, // Поле "Номер С/Ф" полный + "Type": bc.Invoices[i].Document.Analytics, // Поле "Тип начисления" + "Count": bc.Invoices[i].Count, // Кол-во кВт + "Sum": sum, // Поле "Начислено" + "Correction": Currency(correctionSum), // Поле "Корректировка" + "DebtSum": Currency(bc.Invoices[i].Sum - paymentSum), // Поле "Долг в претензии" + "Payment": Currency(paymentSum), // Поле "Оплачено" + "Balance": Currency(bc.Invoices[i].Sum - paymentSum), // Поле "Остаток" + "Note": note, // Поле "Примечание" + } + + // TODO Аналитики нужно считать отдельно + if strings.Trim(bc.Invoices[i].Document.Analytics, " ") == "" { + totalSum += bc.Invoices[i].Sum + totalCorrectionSum += correctionSum + totalPayment += paymentSum + + totalDebtSum += bc.Invoices[i].Sum - paymentSum - correctionSum + totalBalance += bc.Invoices[i].Sum - paymentSum - correctionSum + } + + invoices = append(invoices, tmp) + } + totalDebtSumState := fmt.Sprintf("%.2f", totalDebtSum) >= fmt.Sprintf("%.2f", 0.0) + // Счета фактуры по данному договору + result["Contract_Invoices"] = invoices + // Суммы счетов фактур по данному договору + result["Contract_TotalInvoices"] = map[string]interface{}{ + "Sum": Currency(totalSum), // Поле "Начислено" + "CorSum": Currency(totalCorrectionSum), // Поле "Корректировка" + "DebtSum": Currency(totalDebtSum), // Поле "Долг в претензии" + "DebtSumState": totalDebtSumState, // Поля признак для регулирования состояния Долг/Переплата на фронте + "Payment": Currency(totalPayment), // Поле "Оплачено" + "Balance": Currency(totalBalance), // Поле "Остаток" + } + + result["Lawsuit_Period"] = bc.Lawsuit.ClaimPeriodStr + + payments := make([]interface{}, 0) + totalSum = 0.0 + totalCorrectionSum = 0.0 + totalDebtSum = 0.0 + totalPayment = 0.0 + totalBalance = 0.0 + totalUnknownPayment := 0.0 + //totalPaymentsBeforeClaim := 0.0 // сумма всех платежей с момента выставления с/ф + //totalPaymentsAllClaim := 0.0 // сумма всех платежей с момента формирования претензии + for i := 0; i < len(bc.Payments); i++ { // Перебираем платежи в конкретной претензии + // TODO Пока аналитики вообще скрываю + if strings.Trim(bc.Payments[i].Document.Analytics, " ") != "" { + continue + } + + note := bc.Payments[i].Document.Note + if note == "" { + note = "Не задано" + } + + number := "ПП:" + bc.Payments[i].Document.Number + isInvoiceOut := false // если текущий документ с/ф + correction := "" + payment := Currency(bc.Payments[i].Sum) + if bc.Payments[i].Document.DocumentTypeID == 35 { + number = "СФ:" + bc.Payments[i].Document.Number + correction = Currency(bc.Payments[i].Sum) + payment = "" + isInvoiceOut = true + if !bc.Payments[i].IsCorrective { + number = "И" + number + } + } + if bc.Payments[i].IsCorrective { + number = "К" + number + } + + //paymentDoc := bc.Payments[i].Sum + + isPaymentAfterCreated := true + + invoiceSum := 0.0 + for j := 0; j < len(bc.Invoices); j++ { + if bc.Payments[i].InvoiceID == bc.Invoices[j].ID { + invoiceSum += bc.Invoices[j].Sum + if !isInvoiceOut { + controlDate := lawSuit.CreatedAt + strControlDate := controlDate.Local().Format("2006-01-02 15:04:05") + docDate := bc.Payments[i].CreatedAt + strDocDate := docDate.Local().Format("2006-01-02 15:04:05") + if strControlDate >= strDocDate { + //totalPaymentsBeforeClaim += paymentDoc // Считаем сумму платежей до формирования претензии + isPaymentAfterCreated = false + } + //totalPaymentsAllClaim += paymentDoc // Считаем сумму всех платежей + } + break + } + } + + tmp := map[string]interface{}{ + "ID": bc.Payments[i].ID, + "InvoiceID": bc.Payments[i].InvoiceID, // Ссылка на С/Ф + "ClaimNumber": lawSuit.NumberClaim, // Поле "Претензия" + "Date": formatDate(bc.Payments[i].Document.DocumentAt), // Поле "Дата С/Ф" + "DistributionDate": formatTime(bc.Payments[i].CreatedAt), // Поле "Дата разнесения" + "isPaymentAfterCreated": isPaymentAfterCreated, // Поле для подскарски в голубой + "Number": number, // Поле "Номер С/Ф" + "Type": bc.Payments[i].Document.Analytics, // Поле "Тип начисления" + "Sum": "", // Поле "Начислено" + "Correction": correction, // Поле "Корректировка" + "DebtSum": "", // Поле "Долг в претензии" + "Payment": payment, // Поле "Оплачено" + "Balance": "", // Поле "Остаток" + "Note": note, // Поле "Примечание" + } + + // TODO Аналитики нужно считать отдельно + if strings.Trim(bc.Payments[i].Document.Analytics, " ") == "" { + // Платежи без фактур + if bc.Payments[i].InvoiceID == 0 { + totalUnknownPayment += bc.Payments[i].Sum + } else { + totalDebtSum += invoiceSum - bc.Payments[i].Sum + totalPayment += bc.Payments[i].Sum + totalBalance += invoiceSum - bc.Payments[i].Sum + + if bc.Payments[i].IsCorrective { + totalCorrectionSum += bc.Payments[i].Sum + } else { + totalSum += invoiceSum + } + } + } + + payments = append(payments, tmp) + } + + // TODO Колонка уведомление + if useFormat { + //result["Lawsuit_Claim"] = Currency(lawSuit.InvoiceSum - lawSuit.PaySum) + result["Lawsuit_Claim"] = Currency(lawSuit.DebtSumSentNotify) + } else { + //result["Lawsuit_Claim"] = lawSuit.InvoiceSum - lawSuit.PaySum + result["Lawsuit_Claim"] = lawSuit.DebtSumSentNotify + } + if !lawSuit.NotifyClaimDone { + result["Lawsuit_Claim"] = "-" + } + // TODO Колонка претензия + if useFormat { + // result["Lawsuit_Pretrial"] = "-" // Currency(lawSuit.InvoiceSum) + result["Lawsuit_Pretrial"] = Currency(lawSuit.DebtSumSentClaim) + } else { + //result["Lawsuit_Pretrial"] = "-" // lawSuit.InvoiceSum + result["Lawsuit_Pretrial"] = lawSuit.DebtSumSentClaim + } + if !lawSuit.NotifyPretrialDone { + result["Lawsuit_Pretrial"] = "-" + } + + // Платёжные документы по данному договору + result["Contract_Payments"] = payments + // Суммы платёжных документов по данному договору + result["Contract_TotalPayments"] = map[string]interface{}{ + "Sum": Currency(totalSum), // Поле "Начислено" + "CorSum": Currency(totalCorrectionSum), // Поле "Корректировка" + "DebtSum": Currency(totalDebtSum), // Поле "Долг в претензии" + "Payment": Currency(totalPayment), // Поле "Оплачено" + "Balance": Currency(totalBalance), // Поле "Остаток" + } + // Суммы нераспознанных платёжных документов по данному договору + result["Contract_TotalUnknownPayments"] = map[string]interface{}{ + "Payment": Currency(totalUnknownPayment), // Поле "Сумма" + } + + organization := &contract.Organization + // ID + result["Organization_ID"] = organization.ID + // Email ЮЛ + if organization.Email == "" { + result["Organization_Email"] = "Не указан" + } else { + result["Organization_Email"] = organization.Email + } + // Наименование ЮЛ + result["Organization_Name"] = organization.Name + result["Organization_FullName"] = organization.FullName + // ИНН ЮЛ + result["Organization_INN"] = organization.INN + // КПП ЮЛ + result["Organization_KPP"] = organization.KPP + // Юридический адрес ЮЛ + result["Organization_LegalAddress"] = organization.LegalAddress + // Категория организации + category = "Неизвестно" + for i := 0; i < len(t.OrganizationCategoryTypes); i++ { + if t.OrganizationCategoryTypes[i].ID == organization.CategoryID { + category = t.OrganizationCategoryTypes[i].Name + break + } + } + result["Organization_CategoryID"] = organization.CategoryID + result["Organization_Category"] = category + // Состояние организации + state := "Действующее" + code := "1" + color := "green" + for i := 0; i < len(t.OrganizationStateTypes); i++ { + if t.OrganizationStateTypes[i].ID == organization.StateID { + state = t.OrganizationStateTypes[i].Name + code = t.OrganizationStateTypes[i].Code + color = t.OrganizationStateTypes[i].Color + break + } + } + result["Organization_State"] = state + result["Organization_StateCode"] = code + result["Organization_StateColor"] = color + result["Organization_StateID"] = organization.StateID + + // Ликвидность организации - deprecated + // if organization.IsLiquidated { + // result["Organization_Liquidity"] = "Ликвидирован" + // } else { + // result["Organization_Liquidity"] = "Действующий" + // } + // Банкротство организации - deprecated + // if organization.IsBankrupt { + // result["Organization_Bankrupt"] = "Банкрот" + // } else { + // result["Organization_Bankrupt"] = "Действующий" + // } + + FileMail := "" + FileMailName := "" + FileClaim := "" + FileClaimName := "" + FileClaimDetail := "" + FileClaimDetailName := "" + for i := 0; i < len(bc.Files); i++ { + if strings.Contains(bc.Files[i].Name, "Письмо") { + FileMail = bc.Files[i].FileID + FileMailName = bc.Files[i].FullName + } + + if strings.Contains(bc.Files[i].Name, "Претензия") { + FileClaim = bc.Files[i].FileID + FileClaimName = bc.Files[i].FullName + } + + if strings.Contains(bc.Files[i].Name, "Реестр") { + FileClaimDetail = bc.Files[i].FileID + FileClaimDetailName = bc.Files[i].FullName + } + } + result["File_Mail"] = FileMail + result["File_MailName"] = FileMailName + result["File_Claim"] = FileClaim + result["File_ClaimName"] = FileClaimName + result["File_ClaimDetail"] = FileClaimDetail + result["File_ClaimDetailName"] = FileClaimDetailName + + // TODO Переделать под нормальные статусы + if lawSuit.NotifyClaimDone { + result["Notify_ClaimStatus"] = fmt.Sprintf("%v", "Доставлено успешно") + } else if lawSuit.NotifyClaimAt.Before(time.Now().AddDate(-10, 1, 1)) { + result["Notify_ClaimStatus"] = fmt.Sprintf("%v", "Ожидание") + } else if !contract.IsValidEmail { + result["Notify_ClaimStatus"] = fmt.Sprintf("%v", "Не доставлено (недоступен канал)") + } else if contract.Email == "" { + result["Notify_ClaimStatus"] = fmt.Sprintf("%v", "Не доставлено (отсутствует канал)") + } else { + result["Notify_ClaimStatus"] = fmt.Sprintf("%v", contract.Email) + } + if lawSuit.NotifyPretrialDone { + result["Notify_PretrialStatus"] = fmt.Sprintf("%v", "Доставлено успешно") + } else if lawSuit.NotifyPretrialAt.Before(time.Now().AddDate(-10, 1, 1)) { + result["Notify_PretrialStatus"] = fmt.Sprintf("%v", "Ожидание") + } else if !contract.IsValidEmail { + result["Notify_StatusPretrial"] = fmt.Sprintf("%v", "Не доставлено (недоступен канал)") + } else if contract.Email == "" { + result["Notify_PretrialStatus"] = fmt.Sprintf("%v", "Не доставлено (отсутствует канал)") + } else { + result["Notify_PretrialStatus"] = fmt.Sprintf("%v", contract.Email) + } + result["Notify_ClaimChannel"] = lawSuit.NotifyClaimChannel + result["Notify_ClaimCode"] = lawSuit.NotifyClaimCode + result["Notify_ClaimDone"] = lawSuit.NotifyClaimDone + result["Notify_ClaimMailingCode"] = lawSuit.NotifyClaimMailingCode + result["Notify_PretrialChannel"] = lawSuit.NotifyPretrialChannel + result["Notify_PretrialCode"] = lawSuit.NotifyPretrialCode + result["Notify_PretrialDone"] = lawSuit.NotifyPretrialDone + result["Notify_PretrialMailingCode"] = lawSuit.NotifyPretrialMailingCode + if useFormat { + result["Notify_ClaimAt"] = formatDate(lawSuit.NotifyClaimAt) + result["Notify_PretrialAt"] = formatDate(lawSuit.NotifyPretrialAt) + } else { + result["Notify_ClaimAt"] = lawSuit.NotifyClaimAt + result["Notify_PretrialAt"] = lawSuit.NotifyPretrialAt + } + + hashtags := make([]interface{}, 0) + for i := 0; i < len(bc.Hashtags); i++ { + tmp := map[string]interface{}{ + "ID": bc.Hashtags[i].ID, + "Name": bc.Hashtags[i].Name, + "Description": bc.Hashtags[i].Description, + } + hashtags = append(hashtags, tmp) + } + result["Lawsuit_Hashtags"] = hashtags + + return result, nil +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/calendar.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/calendar.go new file mode 100644 index 00000000..824ffb63 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/calendar.go @@ -0,0 +1,15 @@ +package object_model + +import ( + "time" +) + +// Calendar - список выходных +type Calendar struct { + CommonStruct + Date time.Time `json:"date" gorm:"column:date;default:null"` + Hours int `json:"hours" gorm:"column:hours;default:0"` + Days int `json:"days" gorm:"column:days;default:0"` + DayTypeID int64 `json:"day_type_id" gorm:"column:day_type_id;default:null"` + Comment string `json:"comment" gorm:"column:comment;default:\"\""` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/change_item.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/change_item.go new file mode 100644 index 00000000..59200440 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/change_item.go @@ -0,0 +1,38 @@ +package object_model + +import ( +// "regexp" +// "strconv" +) + +// ChangeItem Изменения +// Key - изменённое поле +// Value - новое значение +// Prev - прежнее значение +type ChangeItem struct { + CommonStruct + ExtLinkStruct + // TODO UserID + // TODO Action + // TODO Table + // TODO Field + Key string `json:"key" gorm:"column:key;default:\"\""` + Value string `json:"value" gorm:"column:value;default:\"\""` + Prev string `json:"prev" gorm:"column:prev;default:\"\""` +} + +// FIXME: не используется. Поиск по истории дела обновление статуса на определенный код +// func isIncludedStage(briefCaseChanges []ChangeItem, desiredValue int) bool { +// for i := 0; i < len(briefCaseChanges); i++ { +// if briefCaseChanges[i].Key == "Обновление статуса" { +// value := regexp.MustCompile(`\d`).FindStringSubmatch(briefCaseChanges[i].Value) +// if len(value) == 1 { +// valueCode, _ := strconv.Atoi(value[0]) +// if desiredValue == valueCode { +// return true +// } +// } +// } +// } +// return false +// } diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/channel_type.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/channel_type.go new file mode 100644 index 00000000..0f88da6f --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/channel_type.go @@ -0,0 +1,7 @@ +package object_model + +// ChannelType Тип канала (справочник). +type ChannelType struct { + CommonStruct + NameStruct +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/claim_type.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/claim_type.go new file mode 100644 index 00000000..b22b6aaf --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/claim_type.go @@ -0,0 +1,8 @@ +package object_model + +// ClaimType Типы исков (справочник). +type ClaimType struct { + CommonStruct + NameStruct + Code string `json:"code" gorm:"column:code;default:\"\""` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/claim_work.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/claim_work.go new file mode 100644 index 00000000..61963aa8 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/claim_work.go @@ -0,0 +1,57 @@ +package object_model + +import ( + "fmt" + + "github.com/vmihailenco/msgpack/v5" + "gitlab.aescorp.ru/dsp_dev/claim/common/object_model/object_view" +) + +// ClaimWork ПИР +type ClaimWork struct { + BriefCases []BriefCase `json:"brief_cases"` +} + +// NewClaimWork Новый объект верхнего уровня, по сути содержит список портфелей. +func NewClaimWork() ClaimWork { + return ClaimWork{} +} + +func AsClaimWork(b []byte) (ClaimWork, error) { + c := NewClaimWork() + err := msgpack.Unmarshal(b, &c) + if err != nil { + return NewClaimWork(), err + } + return c, nil +} + +func ClaimWorkAsBytes(c *ClaimWork) ([]byte, error) { + b, err := msgpack.Marshal(c) + if err != nil { + return nil, err + } + return b, nil +} + +// ClaimWorkView выборка +func ClaimWorkView(cw *ClaimWork, c *CommonRef, t *TypeRef, useFormat bool) (object_view.ViewMap, error) { + result := make(object_view.ViewMap, 0) + + if c == nil { + return result, nil + } + if len(cw.BriefCases) == 0 { + return result, nil + } + + for i := 0; i < len(cw.BriefCases); i++ { + v, err := BriefCaseView(&cw.BriefCases[i], c, t, useFormat) + if err != nil { + return result, fmt.Errorf("ClaimWorkView, BriefCaseView[%v], Error: %v", i, err) + } + result.Append(fmt.Sprintf("%v", i), v) + } + + return result, nil +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/comment.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/comment.go new file mode 100644 index 00000000..574d8e09 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/comment.go @@ -0,0 +1,8 @@ +package object_model + +// Comment Комментарии. +type Comment struct { + CommonStruct + ExtLinkStruct + Message string `json:"message" gorm:"column:message;default:\"\""` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/common_ref.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/common_ref.go new file mode 100644 index 00000000..5a5362f4 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/common_ref.go @@ -0,0 +1,38 @@ +package object_model + +import ( + "github.com/vmihailenco/msgpack/v5" +) + +// CommonRef Справочники +type CommonRef struct { + Banks []Bank `json:"banks"` // 1. Банки + Branches []Branch `json:"branches"` // 2. Отделения + Courts []Court `json:"courts"` // 3. Суды + FileTemplates []FileTemplate `json:"file_templates"` // 4. Шаблоны документов + ServiceProviders []ServiceProvider `json:"service_providers"` // 5. Поставщики услуг + UserRoles []UserRole `json:"user_roles"` // 6. Роли сотрудников + WhiteList []ContractWhiteItem `json:"white_list"` // 7. Белый список + BlackList []ContractBlackItem `json:"black_list"` // 8. Чёрный список +} + +// NewCommonRef Новый набор глобальных справочников +func NewCommonRef() CommonRef { + return CommonRef{} +} +func AsCommonRef(b []byte) (CommonRef, error) { + c := NewCommonRef() + err := msgpack.Unmarshal(b, &c) + if err != nil { + return NewCommonRef(), err + } + return c, nil +} + +func CommonRefAsBytes(c *CommonRef) ([]byte, error) { + b, err := msgpack.Marshal(c) + if err != nil { + return nil, err + } + return b, nil +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/common_struct.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/common_struct.go new file mode 100644 index 00000000..d691c124 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/common_struct.go @@ -0,0 +1,18 @@ +package object_model + +import ( + "time" +) + +// =========================================================================== +// ===== Объекты ===== +// =========================================================================== + +type CommonStruct struct { + ID int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement:true"` + ExtID int64 `json:"ext_id" gorm:"column:ext_id;default:null"` + CreatedAt time.Time `json:"created_at" gorm:"column:created_at;autoCreateTime"` + ModifiedAt time.Time `json:"modified_at" gorm:"column:modified_at;autoUpdateTime"` + DeletedAt time.Time `json:"deleted_at" gorm:"column:deleted_at;default:null"` + IsDeleted bool `json:"is_deleted" gorm:"column:is_deleted;default:false"` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/completed_month.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/completed_month.go new file mode 100644 index 00000000..c06fb104 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/completed_month.go @@ -0,0 +1,13 @@ +package object_model + +import ( + "time" +) + +// CompletedMonth Закрытые месяцы +type CompletedMonth struct { + CommonStruct + ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` + AccountingAreaID int64 `json:"accounting_area_id" gorm:"column:accounting_area_id;default:null"` + BillingMonth time.Time `json:"billing_month" gorm:"column:billing_month;default:null"` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/connection.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/connection.go new file mode 100644 index 00000000..e64a2897 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/connection.go @@ -0,0 +1,14 @@ +package object_model + +type Connection struct { + ID int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement:true"` + Name string `json:"name" gorm:"column:name;default:\"\""` + IsLegal bool `json:"is_legal" gorm:"column:is_legal;default:false"` + BranchId int64 `json:"branch_id" gorm:"column:branch_id;default:0"` + Server string `json:"server" gorm:"column:server;default:\"\""` + Port string `json:"port" gorm:"column:port;default:\"\""` + DbName string `json:"db_name" gorm:"column:db_name;default:\"\""` + DbScheme string `json:"db_scheme" gorm:"column:db_scheme;default:\"\""` + Login string `json:"login" gorm:"column:login;default:\"\""` + Password string `json:"password" gorm:"column:password;default:\"\""` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/constante.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/constante.go new file mode 100644 index 00000000..694b9cff --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/constante.go @@ -0,0 +1,6 @@ +package object_model + +const ( + // DocTypeInvoice -- тип платежного документа С/Ф + DocTypeInvoice = 35 +) diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/contract.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/contract.go new file mode 100644 index 00000000..1c6b05ff --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/contract.go @@ -0,0 +1,70 @@ +package object_model + +import ( + "time" + + "github.com/vmihailenco/msgpack/v5" + "gitlab.aescorp.ru/dsp_dev/claim/common/object_model/alias" +) + +// Contract Договоры. +type Contract struct { + CommonStruct + GroupStruct + BeginAt time.Time `json:"begin_at" gorm:"column:begin_at"` + BranchID int64 `json:"branch_id" gorm:"column:branch_id;default:null"` + CategoryID int64 `json:"category_id" gorm:"column:category_id;default:null"` + Category ContractCategoryType `json:"category" gorm:"-:all"` + ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` + CuratorClaim Employee `json:"curator_claim" gorm:"-:all"` + CuratorClaimID int64 `json:"curator_claim_id" gorm:"column:curator_claim_id;default:null"` + CuratorContract Employee `json:"curator_contract" gorm:"-:all"` + CuratorContractID int64 `json:"curator_contract_id" gorm:"column:curator_contract_id;default:null"` + CuratorLegal Employee `json:"curator_legal" gorm:"-:all"` + CuratorLegalID int64 `json:"curator_legal_id" gorm:"column:curator_legal_id;default:null"` + CuratorPayment Employee `json:"curator_payment" gorm:"-:all"` + CuratorPaymentID int64 `json:"curator_payment_id" gorm:"column:curator_payment_id;default:null"` + CuratorTechAudit Employee `json:"curator_tech_audit" gorm:"-:all"` + CuratorTechAuditID int64 `json:"curator_tech_audit_id" gorm:"column:curator_tech_audit_id;default:null"` + DaysToResolveClaim int `json:"days_to_resolve_claim" gorm:"column:days_to_resolve_claim"` + Description string `json:"description" gorm:"column:description;default:\"\""` + Email string `json:"email" gorm:"column:email;default:\"\""` + EndAt time.Time `json:"end_at" gorm:"column:end_at"` + IndividualID int64 `json:"individual_id" gorm:"column:individual_id;default:null"` + IsIndOrganization bool `json:"is_ind_organization" gorm:"column:is_ind_organization;default:false"` + IsOrganization bool `json:"is_organization" gorm:"column:is_organization;default:false"` + IsValidEmail bool `json:"is_valid_email" gorm:"column:is_valid_email;default:true"` + Number alias.ContractNumber `json:"number" gorm:"column:number;default:\"\""` + Organization Organization `json:"organization" gorm:"-:all"` + OrganizationID int64 `json:"organization_id" gorm:"column:organization_id;default:null"` + PostAddress string `json:"post_address" gorm:"column:post_address;default:\"\""` + SignAt time.Time `json:"sign_at" gorm:"column:sign_at"` + Status string `json:"status" gorm:"column:status;default:\"\""` + TerminateAt time.Time `json:"terminate_at" gorm:"column:terminate_at"` + IsErrorFromStack bool `json:"is_error_from_stack" gorm:"column:is_error_from_stack;default:false"` + ErrorFromStackAt time.Time `json:"error_from_stack_at" gorm:"column:error_from_stack_at"` + PaymentDays []PaymentDay `json:"payment_days"` // Дни платежей + PaymentSchedules []PaymentSchedule `json:"payment_schedules"` // Графики платежей +} + +// NewContract Договор +func NewContract() Contract { + return Contract{} +} + +func AsContract(b []byte) (Contract, error) { + c := NewContract() + err := msgpack.Unmarshal(b, &c) + if err != nil { + return NewContract(), err + } + return c, nil +} + +func ContractAsBytes(c *Contract) ([]byte, error) { + b, err := msgpack.Marshal(c) + if err != nil { + return nil, err + } + return b, nil +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/contract_black_item.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/contract_black_item.go new file mode 100644 index 00000000..721af509 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/contract_black_item.go @@ -0,0 +1,47 @@ +package object_model + +import ( + "time" + + "github.com/vmihailenco/msgpack/v5" + "gitlab.aescorp.ru/dsp_dev/claim/common/object_model/alias" +) + +// ContractBlackItem "Чёрный" список договоров. Кому предъявляется претензия без ожидания. +type ContractBlackItem struct { + CommonStruct + Contract Contract `json:"contract" gorm:"-:all"` + ContractID int64 `json:"contract_id" gorm:"column:contract_id;default:null"` + ContractNumber alias.ContractNumber `json:"contract_number" gorm:"column:contract_number;default:null"` + CreatedBy Employee `json:"created_by" gorm:"-:all"` + CreatedByID int64 `json:"created_by_id" gorm:"column:created_by_id;default:null"` + DateFrom time.Time `json:"date_from" gorm:"column:date_from;default:null"` + DateTo time.Time `json:"date_to" gorm:"column:date_to;default:null"` + EDMSLink string `json:"edms_link" gorm:"column:edms_link;default:\"\""` + ModifiedBy Employee `json:"modified_by" gorm:"-:all"` + ModifiedByID int64 `json:"modified_by_id" gorm:"column:modified_by_id;default:null"` + Note string `json:"note" gorm:"column:note;default:\"\""` + Reason string `json:"reason" gorm:"column:reason;default:\"\""` +} + +// NewBlackListItem -- Новая запись чёрного списка +func NewBlackListItem() ContractBlackItem { + return ContractBlackItem{} +} + +func AsBlackListItem(b []byte) (ContractBlackItem, error) { + c := NewBlackListItem() + err := msgpack.Unmarshal(b, &c) + if err != nil { + return NewBlackListItem(), err + } + return c, nil +} + +func BlackListItemAsBytes(c *ContractBlackItem) ([]byte, error) { + b, err := msgpack.Marshal(c) + if err != nil { + return nil, err + } + return b, nil +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/contract_black_list.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/contract_black_list.go new file mode 100644 index 00000000..03b04b56 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/contract_black_list.go @@ -0,0 +1,77 @@ +package object_model + +import ( + "fmt" + + "github.com/vmihailenco/msgpack/v5" + "gitlab.aescorp.ru/dsp_dev/claim/common/object_model/object_view" + + "gitlab.aescorp.ru/dsp_dev/claim/common/object_model/front/front_format" +) + +type ContractBlackList []ContractBlackItem + +// NewContractBlackList -- Новый объект чёрного списка +func NewContractBlackList() ContractBlackList { + return ContractBlackList{} +} + +func AsContractBlackList(b []byte) (ContractBlackList, error) { + c := NewContractBlackList() + err := msgpack.Unmarshal(b, &c) + if err != nil { + return NewContractBlackList(), err + } + return c, nil +} + +func ContractBlackListAsBytes(c *ContractBlackList) ([]byte, error) { + b, err := msgpack.Marshal(c) + if err != nil { + return nil, err + } + return b, nil +} + +// BlackListView Белый список договоров +func BlackListView(cbl *ContractBlackList) (object_view.ViewMap, error) { + result := object_view.ViewMap{} + + for i := 0; i < len(*cbl); i++ { + item := (*cbl)[i] + + dateFrom := front_format.FrontDate(item.DateFrom) + dateTo := front_format.FrontDate(item.DateTo) + + if item.DateFrom.Year() <= 2000 { + dateFrom = "" + } + if item.DateTo.Year() >= 2100 { + dateTo = "" + } + + tmp := map[string]interface{}{ + "ID": item.ID, + "ContractNumber": item.Contract.Number, + "CreatedAt": front_format.FrontDate(item.CreatedAt), + "CreatedBy": item.CreatedBy.Name, + "DateFrom": dateFrom, + "DateFromDatePicker": item.DateFrom.Format("2006-01-02"), + "DateTo": dateTo, + "DateToDatePicker": item.DateTo.Format("2006-01-02"), + "EDMSLink": item.EDMSLink, + "ModifiedAt": front_format.FrontDate(item.ModifiedAt), + "ModifiedBy": item.ModifiedBy.Name, + "OrganizationCategory": item.Contract.Category.Name, + "OrganizationINN": item.Contract.Organization.INN, + "OrganizationKPP": item.Contract.Organization.KPP, + "OrganizationName": item.Contract.Organization.Name, + "Reason": item.Reason, + "IsDeleted": item.IsDeleted, + "DeletedAt": front_format.FrontDate(item.DeletedAt), + } + result.Append(fmt.Sprintf("%v", i), tmp) + } + + return result, nil +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/contract_category_type.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/contract_category_type.go new file mode 100644 index 00000000..745867c6 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/contract_category_type.go @@ -0,0 +1,10 @@ +package object_model + +// ContractCategoryType Категория договоров (справочник). +type ContractCategoryType struct { + CommonStruct + NameStruct + GroupStruct + Code string `json:"code" gorm:"column:code;default:\"\""` + ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/contract_white_item.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/contract_white_item.go new file mode 100644 index 00000000..a7fc54c7 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/contract_white_item.go @@ -0,0 +1,47 @@ +package object_model + +import ( + "time" + + "github.com/vmihailenco/msgpack/v5" + "gitlab.aescorp.ru/dsp_dev/claim/common/object_model/alias" +) + +// ContractWhiteItem "Белый" список договоров. Кому не предъявляется претензия. +type ContractWhiteItem struct { + CommonStruct + Contract Contract `json:"contract" gorm:"-:all"` + ContractID int64 `json:"contract_id" gorm:"column:contract_id;default:null"` + ContractNumber alias.ContractNumber `json:"contract_number" gorm:"column:contract_number;default:null"` + CreatedBy Employee `json:"created_by" gorm:"-:all"` + CreatedByID int64 `json:"created_by_id" gorm:"column:created_by_id;default:null"` + DateFrom time.Time `json:"date_from" gorm:"column:date_from;default:null"` + DateTo time.Time `json:"date_to" gorm:"column:date_to;default:null"` + EDMSLink string `json:"edms_link" gorm:"column:edms_link;default:\"\""` + ModifiedBy Employee `json:"modified_by" gorm:"-:all"` + ModifiedByID int64 `json:"modified_by_id" gorm:"column:modified_by_id;default:null"` + Note string `json:"note" gorm:"column:note;default:\"\""` + Reason string `json:"reason" gorm:"column:reason;default:\"\""` +} + +// NewWhiteListItem -- Новая запись белого списка +func NewWhiteListItem() ContractWhiteItem { + return ContractWhiteItem{} +} + +func AsWhiteListItem(b []byte) (ContractWhiteItem, error) { + c := NewWhiteListItem() + err := msgpack.Unmarshal(b, &c) + if err != nil { + return NewWhiteListItem(), err + } + return c, nil +} + +func WhiteListItemAsBytes(c *ContractWhiteItem) ([]byte, error) { + b, err := msgpack.Marshal(c) + if err != nil { + return nil, err + } + return b, nil +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/contract_white_list.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/contract_white_list.go new file mode 100644 index 00000000..5632392e --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/contract_white_list.go @@ -0,0 +1,77 @@ +package object_model + +import ( + "fmt" + + "github.com/vmihailenco/msgpack/v5" + "gitlab.aescorp.ru/dsp_dev/claim/common/object_model/object_view" + + "gitlab.aescorp.ru/dsp_dev/claim/common/object_model/front/front_format" +) + +type ContractWhiteList []ContractWhiteItem + +// NewContractWhiteList Новый объект белого списка +func NewContractWhiteList() ContractWhiteList { + return ContractWhiteList{} +} + +func AsContractWhiteList(b []byte) (ContractWhiteList, error) { + c := NewContractWhiteList() + err := msgpack.Unmarshal(b, &c) + if err != nil { + return NewContractWhiteList(), err + } + return c, nil +} + +func ContractWhiteListAsBytes(c *ContractWhiteList) ([]byte, error) { + b, err := msgpack.Marshal(c) + if err != nil { + return nil, err + } + return b, nil +} + +// WhiteListView Белый список договоров +func WhiteListView(cwl *ContractWhiteList) (object_view.ViewMap, error) { + result := object_view.ViewMap{} + + for i := 0; i < len(*cwl); i++ { + item := (*cwl)[i] + + dateFrom := front_format.FrontDate(item.DateFrom) + dateTo := front_format.FrontDate(item.DateTo) + + if item.DateFrom.Year() <= 2000 { + dateFrom = "" + } + if item.DateTo.Year() >= 2100 { + dateTo = "" + } + + tmp := map[string]interface{}{ + "ID": item.ID, + "ContractNumber": item.Contract.Number, + "CreatedAt": front_format.FrontDate(item.CreatedAt), + "CreatedBy": item.CreatedBy.Name, + "DateFrom": dateFrom, + "DateFromDatePicker": item.DateFrom.Format("2006-01-02"), + "DateTo": dateTo, + "DateToDatePicker": item.DateTo.Format("2006-01-02"), + "EDMSLink": item.EDMSLink, + "ModifiedAt": front_format.FrontDate(item.ModifiedAt), + "ModifiedBy": item.ModifiedBy.Name, + "OrganizationCategory": item.Contract.Category.Name, + "OrganizationINN": item.Contract.Organization.INN, + "OrganizationKPP": item.Contract.Organization.KPP, + "OrganizationName": item.Contract.Organization.Name, + "Reason": item.Reason, + "IsDeleted": item.IsDeleted, + "DeletedAt": front_format.FrontDate(item.DeletedAt), + } + result.Append(fmt.Sprintf("%v", i), tmp) + } + + return result, nil +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/court.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/court.go new file mode 100644 index 00000000..54d9884c --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/court.go @@ -0,0 +1,10 @@ +package object_model + +// Court Суды (справочник). +type Court struct { + CommonStruct + GroupStruct + NameStruct + OrganizationID int64 `json:"organization_id" gorm:"column:organization_id;default:null"` + City string `json:"city_name" gorm:"column:city_name;default:\"\""` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/day_type.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/day_type.go new file mode 100644 index 00000000..2d3bbd19 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/day_type.go @@ -0,0 +1,9 @@ +package object_model + +// DayType - тип рабочего дня +type DayType struct { + CommonStruct + NameStruct + ShortName string `json:"short_name" gorm:"column:short_name;default:\"\""` + IsWorkDay bool `json:"is_work_day" gorm:"column:is_work_day;default:false"` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/debt_type.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/debt_type.go new file mode 100644 index 00000000..b9e71712 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/debt_type.go @@ -0,0 +1,11 @@ +package object_model + +// DebtType Виды задолженности +type DebtType struct { + CommonStruct + GroupStruct + NameStruct + CodeNSI int `json:"code_nsi" gorm:"column:code_nsi;default:0"` + ExtCode int `json:"ext_code" gorm:"column:ext_code;default:0"` + ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/direction_type.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/direction_type.go new file mode 100644 index 00000000..43408304 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/direction_type.go @@ -0,0 +1,7 @@ +package object_model + +// DirectionType Направление передачи сообщения (справочник). +type DirectionType struct { + CommonStruct + NameStruct +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/document.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/document.go new file mode 100644 index 00000000..2c32b1e2 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/document.go @@ -0,0 +1,31 @@ +package object_model + +import ( + "time" +) + +// Document Документ. +type Document struct { + CommonStruct // Id с/ф в СТЕК; Дата формирования + GroupStruct + Analytics string `json:"analytics" gorm:"column:analytics;default:\"\""` // Тип начисления (окончательный, пени, ограничения, по суду); + Balance float64 `json:"balance" gorm:"column:balance;default:null"` // Неоплаченный остаток С/ф + BillKindID int64 `json:"bill_kind_id" gorm:"column:bill_kind_id;default:null"` // + BillingMonth time.Time `json:"billing_month" gorm:"column:billing_month;default:null"` + ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` + ContractID int64 `json:"contract_id" gorm:"column:contract_id;default:null"` // Номер договора; + Count int64 `json:"count" gorm:"column:count;not null"` // Квт.ч в С/ф; + DebtSum float64 `json:"debt_sum" gorm:"column:debt_sum;default:null"` // Долг в претензии + DocumentAt time.Time `json:"document_at" gorm:"column:document_at;default:null"` // Дата С/ф; + DocumentSum float64 `json:"document_sum" gorm:"column:document_sum;not null"` // Начислено по С/ф + DocumentTypeID int64 `json:"document_type_id" gorm:"column:document_type_id;default:null"` + Note string `json:"note" gorm:"column:note;default:\"\""` // Примечание, в частности назначение платежа + Number string `json:"number" gorm:"column:number;default:\"\""` // Номер С/ф; + NumberFull string `json:"number_full" gorm:"column:number_full;default:\"\""` // Полный номер С/ф; + PayDeadline time.Time `json:"pay_deadline" gorm:"column:pay_deadline;default:null"` // День когда уже пошла просрочка + PayFrom time.Time `json:"pay_from" gorm:"column:pay_from;default:null"` // Период С/ф; с + PayTo time.Time `json:"pay_to" gorm:"column:pay_to;default:null"` // Период С/ф; по + Payment float64 `json:"payment" gorm:"column:payment;default:null"` // Оплата по С/ф + Reason string `json:"reason" gorm:"column:reason;default:\"\""` + ReversalID int64 `json:"reversal_id" gorm:"column:reversal_id;default:null"` // Указатель на исправленный документ +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/document_link.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/document_link.go new file mode 100644 index 00000000..8c2d3c39 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/document_link.go @@ -0,0 +1,12 @@ +package object_model + +// DocumentLink Связи документов +type DocumentLink struct { + CommonStruct + ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` + ContractID int64 `json:"contract_id" gorm:"column:contract_id;default:null"` + CorrectionSum float64 `json:"correction_sum" gorm:"column:correction_sum;not null;default:0"` + Document1ID int64 `json:"document1_id" gorm:"column:document1_id;default:null"` + Document2ID int64 `json:"document2_id" gorm:"column:document2_id;default:null"` + LinkTypeID int64 `json:"link_type_id" gorm:"column:link_type_id;default:null"` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/document_link_type.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/document_link_type.go new file mode 100644 index 00000000..63a5181c --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/document_link_type.go @@ -0,0 +1,8 @@ +package object_model + +// DocumentLinkType Тип связи документов +type DocumentLinkType struct { + CommonStruct + NameStruct + Code int `json:"code" gorm:"column:code;default:null"` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/document_type.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/document_type.go new file mode 100644 index 00000000..7a3ba291 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/document_type.go @@ -0,0 +1,13 @@ +package object_model + +// DocumentType Тип документов (справочник). +type DocumentType struct { + CommonStruct + NameStruct + IsService bool `json:"is_service" gorm:"column:is_service;default:false"` + IsVisible bool `json:"is_visible" gorm:"column:is_visible;default:false"` + ShortName string `json:"short_name" gorm:"column:short_name;default:\"\""` + Type int `json:"type" gorm:"column:type;default:0"` + IncomeExpense int `json:"income_expense" gorm:"column:income_expense;default:null"` + ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/employee.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/employee.go new file mode 100644 index 00000000..a8cc5f9d --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/employee.go @@ -0,0 +1,45 @@ +package object_model + +import ( + "github.com/vmihailenco/msgpack/v5" +) + +// Employee Сотрудники (Справочник). +type Employee struct { + CommonStruct + NameStruct + GroupStruct + BranchID int64 `json:"branch_id" gorm:"column:branch_id;default:null"` + Email string `json:"email" gorm:"column:email;default:\"\""` + IsActive bool `json:"is_active" gorm:"column:is_active;default:false"` + Login string `json:"login" gorm:"column:login;default:\"\""` + ParentName string `json:"parent_name" gorm:"column:parent_name;default:\"\""` + Phone string `json:"phone" gorm:"column:phone;default:\"\""` + Photo string `json:"photo" gorm:"column:photo;default:\"\""` + Position string `json:"position" gorm:"column:position;default:\"\""` + SecondName string `json:"second_name" gorm:"column:second_name;default:\"\""` + Tag string `json:"tag" gorm:"column:tag;default:\"\""` + ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` +} + +// NewEmployee Сотрудник +func NewEmployee() Employee { + return Employee{} +} + +func AsEmployee(b []byte) (Employee, error) { + e := NewEmployee() + err := msgpack.Unmarshal(b, &e) + if err != nil { + return NewEmployee(), err + } + return e, nil +} + +func EmployeeAsBytes(e *Employee) ([]byte, error) { + b, err := msgpack.Marshal(e) + if err != nil { + return nil, err + } + return b, nil +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/facsimile.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/facsimile.go new file mode 100644 index 00000000..f795678f --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/facsimile.go @@ -0,0 +1,36 @@ +package object_model + +import ( + "github.com/vmihailenco/msgpack/v5" +) + +// Facsimile Соответствие участков ответственных и договоров +type Facsimile struct { + CommonStruct + Branch string `json:"branch" gorm:"column:branch;default:\"\""` + Department string `json:"department" gorm:"column:department;default:\"\""` + Responsible string `json:"responsible" gorm:"column:responsible;default:\"\""` + Contract string `json:"contract" gorm:"column:contract;default:\"\""` +} + +// NewFacsimile Данные факсимиле +func NewFacsimile() Facsimile { + return Facsimile{} +} + +func AsFacsimile(b []byte) (Facsimile, error) { + c := NewFacsimile() + err := msgpack.Unmarshal(b, &c) + if err != nil { + return NewFacsimile(), err + } + return c, nil +} + +func FacsimileAsBytes(c *Facsimile) ([]byte, error) { + b, err := msgpack.Marshal(c) + if err != nil { + return nil, err + } + return b, nil +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/file.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/file.go new file mode 100644 index 00000000..1226d884 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/file.go @@ -0,0 +1,45 @@ +package object_model + +import ( + "github.com/vmihailenco/msgpack/v5" +) + +// File Файлы. +type File struct { + CommonStruct + GroupStruct + NameStruct + ExtLinkStruct + BranchID int64 `json:"branch_id" gorm:"column:branch_id;default:null"` + EmployeeID int64 `json:"employee_id" gorm:"column:employee_id;default:null"` + Extension string `json:"extension" gorm:"column:extension;default:\"\""` + FileID string `json:"file_id" gorm:"column:file_id;default:\"\""` + FileName string `json:"file_name" gorm:"column:file_name;default:\"\""` + FileTypeID int64 `json:"file_type_id" gorm:"column:file_type_id;default:null"` + FullName string `json:"full_name" gorm:"column:full_name;default:\"\""` + Size int64 `json:"size" gorm:"column:size;default:null"` + TemplateID int64 `json:"template_id" gorm:"column:template_id;default:null"` + Version int `json:"version" gorm:"column:version;default:0"` +} + +// NewFile Файл, который физически хранится в файловом хранилище +func NewFile() File { + return File{} +} + +func AsFile(b []byte) (File, error) { + f := NewFile() + err := msgpack.Unmarshal(b, &f) + if err != nil { + return NewFile(), err + } + return f, nil +} + +func FileAsBytes(f *File) ([]byte, error) { + b, err := msgpack.Marshal(f) + if err != nil { + return nil, err + } + return b, nil +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/file_template.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/file_template.go new file mode 100644 index 00000000..0f729857 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/file_template.go @@ -0,0 +1,8 @@ +package object_model + +// FileTemplate Шаблоны файлов (справочник). +type FileTemplate struct { + CommonStruct + NameStruct + FileID string `json:"file_id" gorm:"column:file_id;default:\"\""` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/file_type.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/file_type.go new file mode 100644 index 00000000..85fe0817 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/file_type.go @@ -0,0 +1,7 @@ +package object_model + +// FileType Тип файла (справочник). +type FileType struct { + CommonStruct + NameStruct +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/format_float.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/format_float.go new file mode 100644 index 00000000..68bcce17 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/format_float.go @@ -0,0 +1,38 @@ +package object_model + +import ( + "fmt" + "strings" +) + +// FormatFloat -- представление вещественных чисел в разных +type FormatFloat struct { + val float64 +} + +// String -- возвращает специальное строковое представление для фронта +func (sf *FormatFloat) String() string { + tmp := fmt.Sprintf("%d", int64(sf.val)) + res := "" + j := 0 + for i := len(tmp) - 1; i >= 0; i-- { + j++ + res = string(tmp[i]) + res + if j > 0 && j%3 == 0 { + res = " " + res + } + } + + tmp1 := fmt.Sprintf("%.2f", sf.val) + tmp2 := strings.Split(tmp1, ".") + res = res + "." + tmp2[1] + + // fmt.Println(res) + res = strings.Trim(res, " ") + return strings.ReplaceAll(res, ".", ",") +} + +// Get -- возвращает хранимое значение +func (sf *FormatFloat) Get() float64 { + return sf.val +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/front/front_format/front_format.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/front/front_format/front_format.go new file mode 100644 index 00000000..0aa4d914 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/front/front_format/front_format.go @@ -0,0 +1,44 @@ +// package front_format -- форматирование данных для фронта +package front_format + +import ( + "fmt" + "strings" + "time" + + "gitlab.aescorp.ru/dsp_dev/claim/common/object_model/alias" +) + +// FrontDate -- форматирует дату в виде "02.01.2006" для фронта +func FrontDate(date time.Time) alias.FrontDate { + strDate := date.Format("02.01.2006") + return alias.FrontDate(strDate) +} + +// FrontTime -- форматирует время в виде "02.01.2006 15:04:05" для фронта +func FrontTime(date time.Time) alias.FrontTime { + strTime := date.Format("02.01.2006 15:04:05") + return alias.FrontTime(strTime) +} + +// Currency -- форматирует деньги для отображения +func Currency(number float64) string { + tmp := fmt.Sprintf("%d", int64(number)) + res := "" + j := 0 + for i := len(tmp) - 1; i >= 0; i-- { + j++ + res = string(tmp[i]) + res + if j > 0 && j%3 == 0 { + res = " " + res + } + } + + tmp1 := fmt.Sprintf("%.2f", number) + tmp2 := strings.Split(tmp1, ".") + res = res + "." + tmp2[1] + + // fmt.Println(res) + res = strings.Trim(res, " ") + return strings.ReplaceAll(res, ".", ",") +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/func.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/func.go new file mode 100644 index 00000000..3f907623 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/func.go @@ -0,0 +1,42 @@ +package object_model + +import ( + "fmt" + "time" +) + +func russianDate(date time.Time, long bool) string { + months := make(map[int]string, 0) + if long { + months[1] = "январь" + months[2] = "февраль" + months[3] = "март" + months[4] = "апрель" + months[5] = "май" + months[6] = "июнь" + months[7] = "июль" + months[8] = "август" + months[9] = "сентябрь" + months[10] = "октябрь" + months[11] = "ноябрь" + months[12] = "декабрь" + } else { + months[1] = "янв" + months[2] = "февр" + months[3] = "март" + months[4] = "апр" + months[5] = "май" + months[6] = "июнь" + months[7] = "июль" + months[8] = "авг" + months[9] = "сент" + months[10] = "окт" + months[11] = "нояб" + months[12] = "дек" + } + + m := date.Month() + y := date.Year() + + return fmt.Sprintf("%v %v", months[int(m)], y) +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/gender_type.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/gender_type.go new file mode 100644 index 00000000..034dcf08 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/gender_type.go @@ -0,0 +1,7 @@ +package object_model + +// GenderType Пол (справочник). +type GenderType struct { + CommonStruct + Name string `json:"name" gorm:"column:name;default:\"\""` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/group_struct.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/group_struct.go new file mode 100644 index 00000000..3f1b73b2 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/group_struct.go @@ -0,0 +1,6 @@ +package object_model + +type GroupStruct struct { + IsGroup bool `json:"is_group" gorm:"column:is_group;default:false"` + ParentID int64 `json:"parent_id" gorm:"column:parent_id;default:null"` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/hashtag.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/hashtag.go new file mode 100644 index 00000000..4869d76b --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/hashtag.go @@ -0,0 +1,32 @@ +package object_model + +import ( + "github.com/vmihailenco/msgpack/v5" +) + +type Hashtag struct { + CommonStruct + NameStruct +} + +// NewHashtag Новый объект хештег +func NewHashtag() Hashtag { + return Hashtag{} +} + +func AsHashtag(b []byte) (Hashtag, error) { + h := NewHashtag() + err := msgpack.Unmarshal(b, &h) + if err != nil { + return NewHashtag(), err + } + return h, nil +} + +func HashtagAsBytes(h *Hashtag) ([]byte, error) { + b, err := msgpack.Marshal(h) + if err != nil { + return nil, err + } + return b, nil +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/hashtag_link.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/hashtag_link.go new file mode 100644 index 00000000..ca4b7452 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/hashtag_link.go @@ -0,0 +1,33 @@ +package object_model + +import ( + "github.com/vmihailenco/msgpack/v5" +) + +type HashtagLink struct { + CommonStruct + ExtLinkStruct + HashtagID int64 `json:"hashtag_id" gorm:"column:hashtag_id;default:null"` +} + +// NewHashtagLink Новый объект связи хештега +func NewHashtagLink() HashtagLink { + return HashtagLink{} +} + +func AsHashtagLink(b []byte) (HashtagLink, error) { + hl := NewHashtagLink() + err := msgpack.Unmarshal(b, &hl) + if err != nil { + return NewHashtagLink(), err + } + return hl, nil +} + +func HashtagLinkAsBytes(hl *HashtagLink) ([]byte, error) { + b, err := msgpack.Marshal(hl) + if err != nil { + return nil, err + } + return b, nil +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/hashtag_list.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/hashtag_list.go new file mode 100644 index 00000000..31f648e4 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/hashtag_list.go @@ -0,0 +1,49 @@ +package object_model + +import ( + "fmt" + + "github.com/vmihailenco/msgpack/v5" + "gitlab.aescorp.ru/dsp_dev/claim/common/object_model/object_view" +) + +type HashtagList []Hashtag + +// NewHashtagList Новый объект хештег +func NewHashtagList() HashtagList { + return HashtagList{} +} + +func AsHashtagList(b []byte) (HashtagList, error) { + h := NewHashtagList() + err := msgpack.Unmarshal(b, &h) + if err != nil { + return NewHashtagList(), err + } + return h, nil +} + +func HashtagListAsBytes(h *HashtagList) ([]byte, error) { + b, err := msgpack.Marshal(h) + if err != nil { + return nil, err + } + return b, nil +} + +// HashtagListView Список хештегов +func HashtagListView(hl *HashtagList) (object_view.ViewMap, error) { + result := object_view.ViewMap{} + + for i := 0; i < len(*hl); i++ { + item := (*hl)[i] + + tmp := map[string]interface{}{ + "ID": item.ID, + "Name": item.Name, + } + result.Append(fmt.Sprintf("%v", i), tmp) + } + + return result, nil +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/individual.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/individual.go new file mode 100644 index 00000000..177bd639 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/individual.go @@ -0,0 +1,21 @@ +package object_model + +import ( + "time" +) + +// Individual Физическое лицо (справочник). +type Individual struct { + CommonStruct + NameStruct + BirthDate time.Time `json:"birth_date" gorm:"column:birth_date;default:null"` + DeathDate time.Time `json:"death_date" gorm:"column:death_date;default:null"` + Email string `json:"email" gorm:"column:email;default:\"\""` + GenderID int64 `json:"gender_id" gorm:"column:gender_id;default:null"` + INN string `json:"inn" gorm:"column:inn;default:\"\""` + ParentName string `json:"parent_name" gorm:"column:parent_name;default:\"\""` + Phone string `json:"phone" gorm:"column:phone;default:\"\""` + SNILS string `json:"snils" gorm:"column:snils;default:\"\""` + SecondName string `json:"second_name" gorm:"column:second_name;default:\"\""` + ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/lawsuit.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/lawsuit.go new file mode 100644 index 00000000..ce78edb6 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/lawsuit.go @@ -0,0 +1,113 @@ +package object_model + +import ( + "fmt" + "time" + + "github.com/vmihailenco/msgpack/v5" + "gitlab.aescorp.ru/dsp_dev/claim/common/object_model/alias" +) + +// Lawsuit Дело. Объединяет весь набор данных по конкретному должнику. +type Lawsuit struct { + CommonStruct + GroupStruct + NameStruct + Branch Branch `json:"branch" gorm:"-:all"` + BranchID int64 `json:"branch_id" gorm:"column:branch_id;default:null"` + Chance string `json:"chance" gorm:"column:chance;default:\"\""` + ClaimAt time.Time `json:"claim_at" gorm:"column:claim_at;default:null"` // Уведомление о задолженности. Оплатить до. + ClaimPeriodStr string `json:"claim_period_str" gorm:"column:claim_period_str;default:\"\""` + ClaimType ClaimType `json:"claim_type" gorm:"-:all"` // Тип задолженности + ClaimTypeID int64 `json:"claim_type_id" gorm:"column:claim_type_id;default:null"` + ClosedAt time.Time `json:"closed_at" gorm:"column:closed_at;default:null"` + Contract Contract `json:"contract" gorm:"-:all"` // Договор + ContractID int64 `json:"contract_id" gorm:"column:contract_id;default:null"` + ControlledAt time.Time `json:"controlled_at" gorm:"column:controlled_at;default:null"` + Court Court `json:"court" gorm:"-:all"` + CourtID int64 `json:"court_id" gorm:"column:court_id;default:null"` + CuratorClaim Employee `json:"curator_claim" gorm:"-:all"` + CuratorClaimID int64 `json:"curator_claim_id" gorm:"column:curator_claim_id;default:null"` + CuratorContract Employee `json:"curator_contract" gorm:"-:all"` + CuratorContractID int64 `json:"curator_contract_id" gorm:"column:curator_contract_id;default:null"` + CuratorLegal Employee `json:"curator_legal" gorm:"-:all"` + CuratorLegalID int64 `json:"curator_legal_id" gorm:"column:curator_legal_id;default:null"` + CuratorPayment Employee `json:"curator_payment" gorm:"-:all"` + CuratorPaymentID int64 `json:"curator_payment_id" gorm:"column:curator_payment_id;default:null"` + CuratorTechAudit Employee `json:"curator_tech_audit" gorm:"-:all"` + CuratorTechAuditID int64 `json:"curator_tech_audit_id" gorm:"column:curator_tech_audit_id;default:null"` + DateFrom time.Time `json:"date_from" gorm:"column:date_from;default:null"` + DateTo time.Time `json:"date_to" gorm:"column:date_to;default:null"` + DebtSum float64 `json:"debt_sum" gorm:"column:debt_sum;default:0"` // Общая сумма долга + DebtSumSentClaim float64 `json:"debt_sum_sent_claim" gorm:"column:debt_sum_sent_claim;default:0"` // Общий долг при отправке претензии, руб. + DebtSumSentNotify float64 `json:"debt_sum_sent_notify" gorm:"column:debt_sum_sent_notify;default:0"` // Общий долг при отправке уведомления, руб. + InvoiceSum float64 `json:"invoice_sum" gorm:"column:invoice_sum;default:0"` // Сумма долга за период + IsClosed bool `json:"is_closed" gorm:"column:is_closed;default:null"` + NotifyClaimAt time.Time `json:"notify_claim_at" gorm:"column:notify_claim_at;default:null"` // Уведомление о задолженности. Дата отправки. + NotifyClaimChannel int `json:"notify_claim_channel" gorm:"column:notify_claim_channel;default:null"` // Уведомление о задолженности. Канал отправки. + NotifyClaimCode int `json:"notify_claim_code" gorm:"column:notify_claim_code;default:null"` // Уведомление о задолженности. Код доставки из НСИ. + NotifyClaimDone bool `json:"notify_claim_done" gorm:"column:notify_claim_done;default:null"` // Уведомление о задолженности. Факт отправки. + NotifyClaimMailingCode string `json:"notify_claim_mailing_code" gorm:"column:notify_claim_mailing_code;default:null"` // Уведомление о задолженности. Уникальный код отправки. + NotifyPretrialAt time.Time `json:"notify_pretrial_at" gorm:"column:notify_pretrial_at;default:null"` // Досудебная претензия. Дата отправки. + NotifyPretrialChannel int `json:"notify_pretrial_channel" gorm:"column:notify_pretrial_channel;default:null"` // Досудебная претензия. Канал отправки. + NotifyPretrialCode int `json:"notify_pretrial_code" gorm:"column:notify_pretrial_code;default:null"` // Досудебная претензия. Код доставки из НСИ. + NotifyPretrialDone bool `json:"notify_pretrial_done" gorm:"column:notify_pretrial_done;default:null"` // Досудебная претензия. Факт отправки. + NotifyPretrialMailingCode string `json:"notify_pretrial_mailing_code" gorm:"column:notify_pretrial_mailing_code;default:null"` // Досудебная претензия. Уникальный код отправки. + Number alias.LawsuitNumber `json:"number" gorm:"column:number;default:\"\""` + NumberClaim alias.ClaimNumber `json:"number_claim" gorm:"column:number_claim;default:\"\""` + NumberTrial string `json:"number_trial" gorm:"column:number_trial;default:\"\""` + PaySum float64 `json:"pay_sum" gorm:"column:pay_sum;default:0"` // Платежи + Penalty float64 `json:"penalty" gorm:"column:penalty;default:0"` + Penny float64 `json:"penny" gorm:"column:penny;default:0"` + Percent317 float64 `json:"percent_317" gorm:"column:percent_317;default:0"` + Percent395 float64 `json:"percent_395" gorm:"column:percent_395;default:0"` + PretrialAt time.Time `json:"pretrial_at" gorm:"column:pretrial_at;default:null"` // Досудебная претензия. Оплатить до. + ProcessStartedAt time.Time `json:"process_started_at" gorm:"column:process_started_at;default:null"` + ProcessKey string `json:"process_key" gorm:"column:process_key;default:\"\""` + Reason LawsuitReasonType `json:"reason" gorm:"-:all"` + ReasonID int64 `json:"reason_id" gorm:"column:reason_id;default:null"` + RestrictSum float64 `json:"restrict_sum" gorm:"column:restrict_sum;default:0"` + Stage LawsuitStageType `json:"stage" gorm:"-:all"` // Этап + StageAt time.Time `json:"stage_at" gorm:"column:stage_at;default:null"` + StageID int64 `json:"stage_id" gorm:"column:stage_id;default:null"` + StateDuty float64 `json:"state_duty" gorm:"column:state_duty;default:0"` // Пошлина + Status LawsuitStatusType `json:"status" gorm:"-:all"` // Статус + StatusAt time.Time `json:"status_at" gorm:"column:status_at;default:null"` + StatusID int64 `json:"status_id" gorm:"column:status_id;default:null"` + Tag string `json:"tag" gorm:"column:tag;default:\"\""` + UnknownPayments bool `json:"unknown_payments" gorm:"unknown_payments:tag;default:false"` // "С не разнесёнными платежами" +} + +// ClaimNumber -- возвращает номер портфеля +func (sf *Lawsuit) ClaimNumber() alias.ClaimNumber { + return sf.NumberClaim +} + +// NewLawsuit Новый объект дела +func NewLawsuit(contractNumber alias.ContractNumber) Lawsuit { + strClaimNumber := fmt.Sprintf("ПР_%s_%s", time.Now().Format("200601-02"), contractNumber) + strContractNumber := fmt.Sprintf("ПФ_%s_%s", time.Now().Format("200601-02"), contractNumber) + sf := Lawsuit{ + Number: alias.LawsuitNumber(strContractNumber), + NumberClaim: alias.ClaimNumber(strClaimNumber), + NumberTrial: fmt.Sprintf("ПИ_%s_%s", time.Now().Format("200601-02"), contractNumber), + } + return sf +} + +func AsLawsuit(b []byte) (Lawsuit, error) { + c := Lawsuit{} + err := msgpack.Unmarshal(b, &c) + if err != nil { + return Lawsuit{}, err + } + return c, nil +} + +func LawsuitAsBytes(c *Lawsuit) ([]byte, error) { + b, err := msgpack.Marshal(c) + if err != nil { + return nil, err + } + return b, nil +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/lawsuit_invoice.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/lawsuit_invoice.go new file mode 100644 index 00000000..b34e558a --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/lawsuit_invoice.go @@ -0,0 +1,23 @@ +package object_model + +import ( + "time" + + "gitlab.aescorp.ru/dsp_dev/claim/common/object_model/alias" +) + +// LawsuitInvoice Счета фактуры относящиеся к делу. +type LawsuitInvoice struct { + CommonStruct + ID alias.InvoiceId `json:"id" gorm:"column:id;primaryKey;autoIncrement:true"` + ClosedAt time.Time `json:"closed_at" gorm:"column:closed_at;default:null"` + ClosedSum float64 `json:"closed_sum" gorm:"column:closed_sum;default:null"` + Count int64 `json:"count" gorm:"column:count;not null"` + Document Document `json:"document" gorm:"-:all"` + DocumentID int64 `json:"document_id" gorm:"column:document_id;default:null"` // Document + DocumentSum float64 `json:"document_sum" gorm:"column:document_sum;not null;default:0"` // Сумма указанная в платёжном документе + IsClosed bool `json:"is_closed" gorm:"is_closed:tag;default:false"` + IsCorrective bool `json:"is_corrective" gorm:"column:is_corrective;default:false"` + LawsuitID int64 `json:"lawsuit_id" gorm:"column:lawsuit_id;default:null"` // Lawsuit + Sum float64 `json:"sum" gorm:"column:sum;not null;default:0"` // Сумма фактуры после коррекции +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/lawsuit_invoice_correction.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/lawsuit_invoice_correction.go new file mode 100644 index 00000000..96f33486 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/lawsuit_invoice_correction.go @@ -0,0 +1,10 @@ +package object_model + +// LawsuitInvoiceCorrection - +type LawsuitInvoiceCorrection struct { + CommonStruct + CorrectionDocumentID int64 `json:"correction_document_id" gorm:"column:correction_document_id;default:null"` + CorrectionDocumentSum float64 `json:"correction_document_sum" gorm:"column:correction_document_sum;default:null"` + InvoiceDocumentID int64 `json:"invoice_document_id" gorm:"column:invoice_document_id;default:null"` + LawsuitID int64 `json:"lawsuit_id" gorm:"column:lawsuit_id;default:null"` // Lawsuit +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/lawsuit_payment.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/lawsuit_payment.go new file mode 100644 index 00000000..47caf580 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/lawsuit_payment.go @@ -0,0 +1,52 @@ +package object_model + +import ( + "gitlab.aescorp.ru/dsp_dev/claim/common/object_model/alias" + "gitlab.aescorp.ru/dsp_dev/claim/common/object_model/front/front_format" +) + +// LawsuitPayment -- платежи относящиеся к делу +type LawsuitPayment struct { + CommonStruct + ID alias.PaymentId `json:"id" gorm:"column:id;primaryKey;autoIncrement:true"` + Document Document `json:"document" gorm:"-:all"` + DocumentID int64 `json:"document_id" gorm:"column:document_id;default:null"` // Document + DocumentSum float64 `json:"document_sum" gorm:"column:document_sum;not null;default:0"` // Сумма указанная в платёжном документе + Invoice LawsuitInvoice `json:"invoice" gorm:"-:all"` + InvoiceID alias.InvoiceId `json:"invoice_id" gorm:"column:invoice_id;default:null"` // LawsuitInvoice + IsCorrective bool `json:"is_corrective" gorm:"column:is_corrective;default:false"` + LawsuitID alias.LawsuitId `json:"lawsuit_id" gorm:"column:lawsuit_id;default:null"` // Lawsuit + Sum float64 `json:"sum" gorm:"column:sum;not null;default:0"` // Сумма погашения после коррекции +} + +// IsAfterNotify -- возвращает признак создания платежа после уведомления +func (sf *LawsuitPayment) IsAfterNotify(contractNumber alias.ContractNumber) alias.IsAfterNotify { + lawsuit := NewLawsuit(contractNumber) + controlDate := lawsuit.CreatedAt + strControlDate := controlDate.Local().Format("2006-01-02 15:04:05") + paymentDate := sf.CreatedAt + strPaymentDate := paymentDate.Local().Format("2006-01-02 15:04:05") + return strControlDate < strPaymentDate +} + +// RegisteredAt -- омент регистрации платежа в системе +func (sf *LawsuitPayment) RegisteredAt() alias.PaymentRegisteredAt { + strDate := front_format.FrontTime(sf.CreatedAt) + return alias.PaymentRegisteredAt(strDate) +} + +// DatePayAt -- возвращает момент оплаты +func (sf *LawsuitPayment) DatePayAt() alias.FrontDate { + frontDate := front_format.FrontDate(sf.Document.DocumentAt) + return frontDate +} + +// InvoiceId -- возвращает ID привязанной С/Ф +func (sf *LawsuitPayment) InvoiceId() alias.InvoiceId { + return sf.InvoiceID +} + +// Id -- возвращает ID платёжки +func (sf *LawsuitPayment) Id() alias.PaymentId { + return sf.ID +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/lawsuit_payment_correction.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/lawsuit_payment_correction.go new file mode 100644 index 00000000..46c7adb2 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/lawsuit_payment_correction.go @@ -0,0 +1,10 @@ +package object_model + +// LawsuitPaymentCorrection - +type LawsuitPaymentCorrection struct { + CommonStruct + CorrectionDocumentID int64 `json:"correction_document_id" gorm:"column:correction_document_id;default:null"` + CorrectionDocumentSum float64 `json:"correction_document_sum" gorm:"column:correction_document_sum;default:null"` + LawsuitID int64 `json:"lawsuit_id" gorm:"column:lawsuit_id;default:null"` // Lawsuit + PaymentDocumentID int64 `json:"payment_document_id" gorm:"column:payment_document_id;default:null"` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/lawsuit_reason_type.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/lawsuit_reason_type.go new file mode 100644 index 00000000..ae7f5957 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/lawsuit_reason_type.go @@ -0,0 +1,8 @@ +package object_model + +// LawsuitReasonType Причина отбора для претензии (Справочник). +type LawsuitReasonType struct { + CommonStruct + NameStruct + Code string `json:"code" gorm:"column:code;default:\"\""` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/lawsuit_stage_type.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/lawsuit_stage_type.go new file mode 100644 index 00000000..26134304 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/lawsuit_stage_type.go @@ -0,0 +1,8 @@ +package object_model + +// LawsuitStageType Этапы дел (справочник). +type LawsuitStageType struct { + CommonStruct + NameStruct + Code string `json:"code" gorm:"column:code;default:0"` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/lawsuit_status_state.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/lawsuit_status_state.go new file mode 100644 index 00000000..9ae79b59 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/lawsuit_status_state.go @@ -0,0 +1,10 @@ +package object_model + +// LawsuitStatusState История статусов дела. +type LawsuitStatusState struct { + CommonStruct + LawsuitID int64 `json:"lawsuit_id" gorm:"column:lawsuit_id;default:null"` + StatusID int64 `json:"status_id" gorm:"column:status_id;default:null"` + Tag string `json:"tag" gorm:"column:tag;default:\"\""` + TotalDebt float64 `json:"total_debt" gorm:"column:total_debt;default:null"` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/lawsuit_status_type.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/lawsuit_status_type.go new file mode 100644 index 00000000..22c52c55 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/lawsuit_status_type.go @@ -0,0 +1,8 @@ +package object_model + +// LawsuitStatusType Статусы дел (справочник). +type LawsuitStatusType struct { + CommonStruct + NameStruct + Code string `json:"code" gorm:"column:code;default:0"` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/legal_type.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/legal_type.go new file mode 100644 index 00000000..e7f4c592 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/legal_type.go @@ -0,0 +1,8 @@ +package object_model + +// LegalType Тип юридического лица (справочник). +type LegalType struct { + CommonStruct + NameStruct + IsIndividual bool `json:"is_individual" gorm:"column:is_individual;default:false"` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/linc_struct_ext.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/linc_struct_ext.go new file mode 100644 index 00000000..7240b754 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/linc_struct_ext.go @@ -0,0 +1,6 @@ +package object_model + +type ExtLinkStruct struct { + TableNameID int64 `json:"table_name_id" gorm:"column:table_name_id;default:null"` + TableRowID int64 `json:"table_row_id" gorm:"column:table_row_id;default:null"` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/message.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/message.go new file mode 100644 index 00000000..7ec71334 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/message.go @@ -0,0 +1,20 @@ +package object_model + +// Message Сообщения (входящие и исходящие). +type Message struct { + CommonStruct + + // Тип сообщения + // Идентификатор сообщения + // Дата отправки + // Статус отправки + // Код доставки + // Статус доставки + + ChannelTypeID int64 `json:"channel_type_id" gorm:"column:channel_type_id;default:null"` + Code string `json:"code" gorm:"column:code;default:\"\""` + Data string `json:"data" gorm:"column:data;default:\"\""` + DirectionTypeID int64 `json:"direction_type_id" gorm:"column:direction_type_id;default:null"` + LawsuitID int64 `json:"lawsuit_id" gorm:"column:lawsuit_id;default:null"` + Result string `json:"result" gorm:"column:result;default:\"\""` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/name_struct.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/name_struct.go new file mode 100644 index 00000000..020912f1 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/name_struct.go @@ -0,0 +1,10 @@ +package object_model + +// =========================================================================== +// ===== Списки ===== +// =========================================================================== + +type NameStruct struct { + Description string `json:"description" gorm:"column:description;default:\"\""` + Name string `json:"name" gorm:"column:name;default:\"\""` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/object_model.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/object_model.go index aa4d073c..15c86ec5 100644 --- a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/object_model.go +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/object_model.go @@ -2,2129 +2,25 @@ package object_model import ( "fmt" - "regexp" - "strconv" "strings" "time" - - "github.com/vmihailenco/msgpack/v5" - "gitlab.aescorp.ru/dsp_dev/claim/common/object_model/object_view" ) -// regexp ищет все типы string с default null string.{1,}.{1,}gorm.{1,}default:null -// regexp ищет все типы bool с default null bool.{1,}.{1,}gorm.{1,}default:null -// regexp ищет все типы time.Time с default null time.Time.{1,}gorm.{1,}default:null - -// =========================================================================== -// ===== Списки ===== -// =========================================================================== - -// TypeRef общие, как правило, фиксированные справочники -type TypeRef struct { - ChannelTypes []ChannelType `json:"channel_types"` // 1. Каналы сообщений - ClaimTypes []ClaimType `json:"claim_types"` // 2. Типы дел - ContractCategoryTypes []ContractCategoryType `json:"contract_category_types"` // 3. Категории договоров - DebtTypes []DebtType `json:"debt_types"` // 4. Типы задолженностей - DirectionTypes []DirectionType `json:"direction_types"` // 5. Направления сообщений - DocumentLinkTypes []DocumentLinkType `json:"document_link_types"` // 6. Типы связей документов - DocumentTypes []DocumentType `json:"document_types"` // 7. Типы документов - FileTypes []FileType `json:"file_types"` // 8. Типы файлов - GenderTypes []GenderType `json:"gender_types"` // 9. Пол - LawsuitReasonTypes []LawsuitReasonType `json:"lawsuit_reason_types"` // 10. Причина отбора для претензии (Справочник). - LawsuitStageTypes []LawsuitStageType `json:"lawsuit_stage_types"` // 11. Этапы дел (справочник). - LawsuitStatusTypes []LawsuitStatusType `json:"lawsuit_status_types"` // 12. Статусы дел (справочник). - LegalTypes []LegalType `json:"legal_types"` // 13. Тип юридического лица - OrganizationCategoryTypes []OrganizationCategoryType `json:"organization_category_types"` // 14. Категории организаций - OrganizationStateTypes []OrganizationStateType `json:"organization_state_types"` // 15. Состояния организаций - ServiceTypes []ServiceType `json:"service_types"` // 16. Типы услуг - TableNames []TableName `json:"table_names"` // 17. Имена таблиц для привязок -} - -// CommonRef Справочники -type CommonRef struct { - Banks []Bank `json:"banks"` // 1. Банки - Branches []Branch `json:"branches"` // 2. Отделения - Courts []Court `json:"courts"` // 3. Суды - FileTemplates []FileTemplate `json:"file_templates"` // 4. Шаблоны документов - ServiceProviders []ServiceProvider `json:"service_providers"` // 5. Поставщики услуг - UserRoles []UserRole `json:"user_roles"` // 6. Роли сотрудников - WhiteList []ContractWhiteItem `json:"white_list"` // 7. Белый список - BlackList []ContractBlackItem `json:"black_list"` // 8. Чёрный список -} - -// BriefCase Набор данных для конкретного портфеля -type BriefCase struct { - Lawsuit Lawsuit // Дело - ChangeItems []ChangeItem `json:"change_items"` // 3. История изменений - Comments []Comment `json:"comments"` // 4. Комментарии - Files []File `json:"files"` // 7. Файлы - Invoices []LawsuitInvoice `json:"invoices"` // 8. Счета фактуры - Messages []Message `json:"messages"` // 9. Сообщения - Payments []LawsuitPayment `json:"payments"` // 10. Платежи - StateDuties []StateDuty `json:"state_duties"` // 11. Гос.пошлина - StatusStates []LawsuitStatusState `json:"status_states"` // 12. История статусов дела - Hashtags []Hashtag `json:"hashtags"` // 13. Хештеги портфеля - // TODO Добавить период претензии -} - -// ClaimWork ПИР -type ClaimWork struct { - BriefCases []BriefCase `json:"brief_cases"` -} - -// =========================================================================== -// ===== Объекты ===== -// =========================================================================== - -type CommonStruct struct { - ID int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement:true"` - ExtID int64 `json:"ext_id" gorm:"column:ext_id;default:null"` - CreatedAt time.Time `json:"created_at" gorm:"column:created_at;autoCreateTime"` - ModifiedAt time.Time `json:"modified_at" gorm:"column:modified_at;autoUpdateTime"` - DeletedAt time.Time `json:"deleted_at" gorm:"column:deleted_at;default:null"` - IsDeleted bool `json:"is_deleted" gorm:"column:is_deleted;default:false"` -} - -type NameStruct struct { - Description string `json:"description" gorm:"column:description;default:\"\""` - Name string `json:"name" gorm:"column:name;default:\"\""` -} - -type GroupStruct struct { - IsGroup bool `json:"is_group" gorm:"column:is_group;default:false"` - ParentID int64 `json:"parent_id" gorm:"column:parent_id;default:null"` -} - -type ExtLinkStruct struct { - TableNameID int64 `json:"table_name_id" gorm:"column:table_name_id;default:null"` - TableRowID int64 `json:"table_row_id" gorm:"column:table_row_id;default:null"` -} - -// =========================================================================== - -// Contract Договоры. -type Contract struct { - CommonStruct - GroupStruct - BeginAt time.Time `json:"begin_at" gorm:"column:begin_at"` - BranchID int64 `json:"branch_id" gorm:"column:branch_id;default:null"` - CategoryID int64 `json:"category_id" gorm:"column:category_id;default:null"` - Category ContractCategoryType `json:"category" gorm:"-:all"` - ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` - CuratorClaim Employee `json:"curator_claim" gorm:"-:all"` - CuratorClaimID int64 `json:"curator_claim_id" gorm:"column:curator_claim_id;default:null"` - CuratorContract Employee `json:"curator_contract" gorm:"-:all"` - CuratorContractID int64 `json:"curator_contract_id" gorm:"column:curator_contract_id;default:null"` - CuratorLegal Employee `json:"curator_legal" gorm:"-:all"` - CuratorLegalID int64 `json:"curator_legal_id" gorm:"column:curator_legal_id;default:null"` - CuratorPayment Employee `json:"curator_payment" gorm:"-:all"` - CuratorPaymentID int64 `json:"curator_payment_id" gorm:"column:curator_payment_id;default:null"` - CuratorTechAudit Employee `json:"curator_tech_audit" gorm:"-:all"` - CuratorTechAuditID int64 `json:"curator_tech_audit_id" gorm:"column:curator_tech_audit_id;default:null"` - DaysToResolveClaim int `json:"days_to_resolve_claim" gorm:"column:days_to_resolve_claim"` - Description string `json:"description" gorm:"column:description;default:\"\""` - Email string `json:"email" gorm:"column:email;default:\"\""` - EndAt time.Time `json:"end_at" gorm:"column:end_at"` - IndividualID int64 `json:"individual_id" gorm:"column:individual_id;default:null"` - IsIndOrganization bool `json:"is_ind_organization" gorm:"column:is_ind_organization;default:false"` - IsOrganization bool `json:"is_organization" gorm:"column:is_organization;default:false"` - IsValidEmail bool `json:"is_valid_email" gorm:"column:is_valid_email;default:true"` - Number string `json:"number" gorm:"column:number;default:\"\""` - Organization Organization `json:"organization" gorm:"-:all"` - OrganizationID int64 `json:"organization_id" gorm:"column:organization_id;default:null"` - PostAddress string `json:"post_address" gorm:"column:post_address;default:\"\""` - SignAt time.Time `json:"sign_at" gorm:"column:sign_at"` - Status string `json:"status" gorm:"column:status;default:\"\""` - TerminateAt time.Time `json:"terminate_at" gorm:"column:terminate_at"` - IsErrorFromStack bool `json:"is_error_from_stack" gorm:"column:is_error_from_stack;default:false"` - ErrorFromStackAt time.Time `json:"error_from_stack_at" gorm:"column:error_from_stack_at"` - PaymentDays []PaymentDay `json:"payment_days"` // Дни платежей - PaymentSchedules []PaymentSchedule `json:"payment_schedules"` // Графики платежей -} - -// LawsuitStatusType Статусы дел (справочник). -type LawsuitStatusType struct { - CommonStruct - NameStruct - Code string `json:"code" gorm:"column:code;default:0"` -} - -// LawsuitStageType Этапы дел (справочник). -type LawsuitStageType struct { - CommonStruct - NameStruct - Code string `json:"code" gorm:"column:code;default:0"` -} - -// LawsuitReasonType Причина отбора для претензии (Справочник). -type LawsuitReasonType struct { - CommonStruct - NameStruct - Code string `json:"code" gorm:"column:code;default:\"\""` -} - -// Lawsuit Дело. Объединяет весь набор данных по конкретному должнику. -type Lawsuit struct { - CommonStruct - GroupStruct - NameStruct - Branch Branch `json:"branch" gorm:"-:all"` - BranchID int64 `json:"branch_id" gorm:"column:branch_id;default:null"` - Chance string `json:"chance" gorm:"column:chance;default:\"\""` - ClaimAt time.Time `json:"claim_at" gorm:"column:claim_at;default:null"` // Уведомление о задолженности. Оплатить до. - ClaimPeriodStr string `json:"claim_period_str" gorm:"column:claim_period_str;default:\"\""` - ClaimType ClaimType `json:"claim_type" gorm:"-:all"` // Тип задолженности - ClaimTypeID int64 `json:"claim_type_id" gorm:"column:claim_type_id;default:null"` - ClosedAt time.Time `json:"closed_at" gorm:"column:closed_at;default:null"` - Contract Contract `json:"contract" gorm:"-:all"` // Договор - ContractID int64 `json:"contract_id" gorm:"column:contract_id;default:null"` - ControlledAt time.Time `json:"controlled_at" gorm:"column:controlled_at;default:null"` - Court Court `json:"court" gorm:"-:all"` - CourtID int64 `json:"court_id" gorm:"column:court_id;default:null"` - CuratorClaim Employee `json:"curator_claim" gorm:"-:all"` - CuratorClaimID int64 `json:"curator_claim_id" gorm:"column:curator_claim_id;default:null"` - CuratorContract Employee `json:"curator_contract" gorm:"-:all"` - CuratorContractID int64 `json:"curator_contract_id" gorm:"column:curator_contract_id;default:null"` - CuratorLegal Employee `json:"curator_legal" gorm:"-:all"` - CuratorLegalID int64 `json:"curator_legal_id" gorm:"column:curator_legal_id;default:null"` - CuratorPayment Employee `json:"curator_payment" gorm:"-:all"` - CuratorPaymentID int64 `json:"curator_payment_id" gorm:"column:curator_payment_id;default:null"` - CuratorTechAudit Employee `json:"curator_tech_audit" gorm:"-:all"` - CuratorTechAuditID int64 `json:"curator_tech_audit_id" gorm:"column:curator_tech_audit_id;default:null"` - DateFrom time.Time `json:"date_from" gorm:"column:date_from;default:null"` - DateTo time.Time `json:"date_to" gorm:"column:date_to;default:null"` - DebtSum float64 `json:"debt_sum" gorm:"column:debt_sum;default:0"` // Общая сумма долга - InvoiceSum float64 `json:"invoice_sum" gorm:"column:invoice_sum;default:0"` // Сумма долга за период - IsClosed bool `json:"is_closed" gorm:"column:is_closed;default:null"` - NotifyClaimAt time.Time `json:"notify_claim_at" gorm:"column:notify_claim_at;default:null"` // Уведомление о задолженности. Дата отправки. - NotifyClaimChannel int `json:"notify_claim_channel" gorm:"column:notify_claim_channel;default:null"` // Уведомление о задолженности. Канал отправки. - NotifyClaimCode int `json:"notify_claim_code" gorm:"column:notify_claim_code;default:null"` // Уведомление о задолженности. Код доставки из НСИ. - NotifyClaimDone bool `json:"notify_claim_done" gorm:"column:notify_claim_done;default:null"` // Уведомление о задолженности. Факт отправки. - NotifyClaimMailingCode string `json:"notify_claim_mailing_code" gorm:"column:notify_claim_mailing_code;default:null"` // Уведомление о задолженности. Уникальный код отправки. - NotifyPretrialAt time.Time `json:"notify_pretrial_at" gorm:"column:notify_pretrial_at;default:null"` // Досудебная претензия. Дата отправки. - NotifyPretrialChannel int `json:"notify_pretrial_channel" gorm:"column:notify_pretrial_channel;default:null"` // Досудебная претензия. Канал отправки. - NotifyPretrialCode int `json:"notify_pretrial_code" gorm:"column:notify_pretrial_code;default:null"` // Досудебная претензия. Код доставки из НСИ. - NotifyPretrialDone bool `json:"notify_pretrial_done" gorm:"column:notify_pretrial_done;default:null"` // Досудебная претензия. Факт отправки. - NotifyPretrialMailingCode string `json:"notify_pretrial_mailing_code" gorm:"column:notify_pretrial_mailing_code;default:null"` // Досудебная претензия. Уникальный код отправки. - Number string `json:"number" gorm:"column:number;default:\"\""` - NumberClaim string `json:"number_claim" gorm:"column:number_claim;default:\"\""` - NumberTrial string `json:"number_trial" gorm:"column:number_trial;default:\"\""` - PaySum float64 `json:"pay_sum" gorm:"column:pay_sum;default:0"` // Платежи - Penalty float64 `json:"penalty" gorm:"column:penalty;default:0"` - Penny float64 `json:"penny" gorm:"column:penny;default:0"` - Percent317 float64 `json:"percent_317" gorm:"column:percent_317;default:0"` - Percent395 float64 `json:"percent_395" gorm:"column:percent_395;default:0"` - PretrialAt time.Time `json:"pretrial_at" gorm:"column:pretrial_at;default:null"` // Досудебная претензия. Оплатить до. - ProcessStartedAt time.Time `json:"process_started_at" gorm:"column:process_started_at;default:null"` - ProcessKey string `json:"process_key" gorm:"column:process_key;default:\"\""` - Reason LawsuitReasonType `json:"reason" gorm:"-:all"` - ReasonID int64 `json:"reason_id" gorm:"column:reason_id;default:null"` - RestrictSum float64 `json:"restrict_sum" gorm:"column:restrict_sum;default:0"` - Stage LawsuitStageType `json:"stage" gorm:"-:all"` // Этап - StageAt time.Time `json:"stage_at" gorm:"column:stage_at;default:null"` - StageID int64 `json:"stage_id" gorm:"column:stage_id;default:null"` - StateDuty float64 `json:"state_duty" gorm:"column:state_duty;default:0"` // Пошлина - Status LawsuitStatusType `json:"status" gorm:"-:all"` // Статус - StatusAt time.Time `json:"status_at" gorm:"column:status_at;default:null"` - StatusID int64 `json:"status_id" gorm:"column:status_id;default:null"` - Tag string `json:"tag" gorm:"column:tag;default:\"\""` - UnknownPayments bool `json:"unknown_payments" gorm:"unknown_payments:tag;default:false"` // "С не разнесёнными платежами" -} - -// LawsuitInvoice Счета фактуры относящиеся к делу. -type LawsuitInvoice struct { - CommonStruct - ClosedAt time.Time `json:"closed_at" gorm:"column:closed_at;default:null"` - ClosedSum float64 `json:"closed_sum" gorm:"column:closed_sum;default:null"` - Count int64 `json:"count" gorm:"column:count;not null"` - Document Document `json:"document" gorm:"-:all"` - DocumentID int64 `json:"document_id" gorm:"column:document_id;default:null"` // Document - DocumentSum float64 `json:"document_sum" gorm:"column:document_sum;not null;default:0"` // Сумма указанная в платёжном документе - IsClosed bool `json:"is_closed" gorm:"is_closed:tag;default:false"` - IsCorrective bool `json:"is_corrective" gorm:"column:is_corrective;default:false"` - LawsuitID int64 `json:"lawsuit_id" gorm:"column:lawsuit_id;default:null"` // Lawsuit - Sum float64 `json:"sum" gorm:"column:sum;not null;default:0"` // Сумма фактуры после коррекции -} - -// LawsuitPayment Платежи относящиеся к делу. -type LawsuitPayment struct { - CommonStruct - Document Document `json:"document" gorm:"-:all"` - DocumentID int64 `json:"document_id" gorm:"column:document_id;default:null"` // Document - DocumentSum float64 `json:"document_sum" gorm:"column:document_sum;not null;default:0"` // Сумма указанная в платёжном документе - Invoice LawsuitInvoice `json:"invoice" gorm:"-:all"` - InvoiceID int64 `json:"invoice_id" gorm:"column:invoice_id;default:null"` // LawsuitInvoice - IsCorrective bool `json:"is_corrective" gorm:"column:is_corrective;default:false"` - LawsuitID int64 `json:"lawsuit_id" gorm:"column:lawsuit_id;default:null"` // Lawsuit - Sum float64 `json:"sum" gorm:"column:sum;not null;default:0"` // Сумма погашения после коррекции -} - -// LawsuitInvoiceCorrection - -type LawsuitInvoiceCorrection struct { - CommonStruct - CorrectionDocumentID int64 `json:"correction_document_id" gorm:"column:correction_document_id;default:null"` - CorrectionDocumentSum float64 `json:"correction_document_sum" gorm:"column:correction_document_sum;default:null"` - InvoiceDocumentID int64 `json:"invoice_document_id" gorm:"column:invoice_document_id;default:null"` - LawsuitID int64 `json:"lawsuit_id" gorm:"column:lawsuit_id;default:null"` // Lawsuit -} - -// LawsuitPaymentCorrection - -type LawsuitPaymentCorrection struct { - CommonStruct - CorrectionDocumentID int64 `json:"correction_document_id" gorm:"column:correction_document_id;default:null"` - CorrectionDocumentSum float64 `json:"correction_document_sum" gorm:"column:correction_document_sum;default:null"` - LawsuitID int64 `json:"lawsuit_id" gorm:"column:lawsuit_id;default:null"` // Lawsuit - PaymentDocumentID int64 `json:"payment_document_id" gorm:"column:payment_document_id;default:null"` -} - -// LawsuitStatusState История статусов дела. -type LawsuitStatusState struct { - CommonStruct - LawsuitID int64 `json:"lawsuit_id" gorm:"column:lawsuit_id;default:null"` - StatusID int64 `json:"status_id" gorm:"column:status_id;default:null"` - Tag string `json:"tag" gorm:"column:tag;default:\"\""` - TotalDebt float64 `json:"total_debt" gorm:"column:total_debt;default:null"` -} - -// TODO LawsuitPeriod Период претензии - -// FileType Тип файла (справочник). -type FileType struct { - CommonStruct - NameStruct -} - -// StateDuty Госпошлина -type StateDuty struct { - CommonStruct - GroupStruct - NameStruct - Sum float64 `json:"sum" gorm:"column:sum;default:null"` - RequestNumber string `json:"request_number" gorm:"column:request_number;default:\"\""` - RequestDate time.Time `json:"request_date" gorm:"column:request_date;default:null"` - CourtID int64 `json:"court_id" gorm:"column:court_id;default:null"` - LawsuitID int64 `json:"lawsuit_id" gorm:"column:lawsuit_id;default:null"` -} - -// DebtType Виды задолженности -type DebtType struct { - CommonStruct - GroupStruct - NameStruct - CodeNSI int `json:"code_nsi" gorm:"column:code_nsi;default:0"` - ExtCode int `json:"ext_code" gorm:"column:ext_code;default:0"` - ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` -} - -// FileTemplate Шаблоны файлов (справочник). -type FileTemplate struct { - CommonStruct - NameStruct - FileID string `json:"file_id" gorm:"column:file_id;default:\"\""` -} - -// Message Сообщения (входящие и исходящие). -type Message struct { - CommonStruct - - // Тип сообщения - // Идентификатор сообщения - // Дата отправки - // Статус отправки - // Код доставки - // Статус доставки - - ChannelTypeID int64 `json:"channel_type_id" gorm:"column:channel_type_id;default:null"` - Code string `json:"code" gorm:"column:code;default:\"\""` - Data string `json:"data" gorm:"column:data;default:\"\""` - DirectionTypeID int64 `json:"direction_type_id" gorm:"column:direction_type_id;default:null"` - LawsuitID int64 `json:"lawsuit_id" gorm:"column:lawsuit_id;default:null"` - Result string `json:"result" gorm:"column:result;default:\"\""` -} - -// Employee Сотрудники (Справочник). -type Employee struct { - CommonStruct - NameStruct - GroupStruct - BranchID int64 `json:"branch_id" gorm:"column:branch_id;default:null"` - Email string `json:"email" gorm:"column:email;default:\"\""` - IsActive bool `json:"is_active" gorm:"column:is_active;default:false"` - Login string `json:"login" gorm:"column:login;default:\"\""` - ParentName string `json:"parent_name" gorm:"column:parent_name;default:\"\""` - Phone string `json:"phone" gorm:"column:phone;default:\"\""` - Photo string `json:"photo" gorm:"column:photo;default:\"\""` - Position string `json:"position" gorm:"column:position;default:\"\""` - SecondName string `json:"second_name" gorm:"column:second_name;default:\"\""` - Tag string `json:"tag" gorm:"column:tag;default:\"\""` - ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` -} - -// Branch Филиалы (справочник). -type Branch struct { - CommonStruct - GroupStruct - NameStruct - Code int64 `json:"code" gorm:"column:code;default:null"` - OrganizationID int64 `json:"organization_id" gorm:"column:organization_id;default:null"` - PersonalAreaLink string `json:"personal_area_link" gorm:"personal_area_link:tag;default:\"\""` -} - -// Organization Юридическое лицо (справочник). -type Organization struct { - CommonStruct - NameStruct - GroupStruct - BankruptAt time.Time `json:"bankrupt_at" gorm:"column:bankrupt_at"` - BookkeeperName string `json:"bookkeeper_name" gorm:"column:bookkeeper_name;default:\"\""` - CategoryID int64 `json:"category_id" gorm:"column:category_id;default:null"` - ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` - Email string `json:"email" gorm:"column:email;default:\"\""` - FullName string `json:"full_name" gorm:"column:full_name;default:\"\""` - INN string `json:"inn" gorm:"column:inn;default:\"\""` - IsActive bool `json:"is_active" gorm:"column:is_active;default:false"` - IsBankrupt bool `json:"is_bankrupt" gorm:"column:is_bankrupt;default:false"` - IsLiquidated bool `json:"is_liquidated" gorm:"column:is_liquidated;default:false"` - KPP string `json:"kpp" gorm:"column:kpp;default:\"\""` - LegalAddress string `json:"legal_address" gorm:"column:legal_address;default:\"\""` - LegalTypeID int64 `json:"legal_type_id" gorm:"column:legal_type_id;default:0"` - LiquidateAt time.Time `json:"liquidate_at" gorm:"column:liquidate_at"` - ManagerName string `json:"manager_name" gorm:"column:manager_name;default:\"\""` - OGRN string `json:"ogrn" gorm:"column:ogrn;default:\"\""` - OKATO string `json:"okato" gorm:"column:okato;default:\"\""` - OKPO string `json:"okpo" gorm:"column:okpo;default:\"\""` - Phone string `json:"phone" gorm:"column:phone;default:\"\""` - PostAddress string `json:"post_address" gorm:"column:post_address;default:\"\""` - RegistrationAt time.Time `json:"registration_at" gorm:"column:registration_at;default:null"` - State OrganizationStateType `json:"state" gorm:"-:all"` // Статус организации из НСИ. - StateCode string `json:"state_code" gorm:"column:state_code;default:\"\""` // Код статуса организации из НСИ. - StateID int64 `json:"state_id" gorm:"column:state_id;default:null"` // ID статуса организации из НСИ. - WWW string `json:"www" gorm:"column:www;default:\"\""` - - // LegalType LegalType `json:"legal_type" gorm:"-:all"` // TODO LegalType - - Accounts []Account `json:"accounts" gorm:"-:all"` -} - -type OrganizationCasebook struct { - CommonStruct - INN string `json:"inn" gorm:"column:inn;default:\"\""` - JSONFileID int64 `json:"json_file_id" gorm:"column:json_file_id;default:null"` - KPP string `json:"kpp" gorm:"column:kpp;default:\"\""` - OrganizationID int64 `json:"organization_id" gorm:"column:organization_id;default:null"` - PDFFileID int64 `json:"pdf_file_id" gorm:"column:pdf_file_id;default:null"` - UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at;default:null"` -} - -// OrganizationCategoryType Категория организаций (справочник). -type OrganizationCategoryType struct { - CommonStruct - NameStruct - GroupStruct - ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` -} - -// OrganizationStateType Состояние организации (справочник). -type OrganizationStateType struct { - CommonStruct - NameStruct - Code string `json:"code" gorm:"column:code;default:\"1\""` - ActionIndividual string `json:"action_individual" gorm:"action_individual:code;default:\"none\""` // include exclude none - ActionOrganization string `json:"action_organization" gorm:"action_organization:code;default:\"none\""` // include exclude none - Color string `json:"color" gorm:"color:code;default:\"\""` // red yellow green -} - -// ContractCategoryType Категория договоров (справочник). -type ContractCategoryType struct { - CommonStruct - NameStruct - GroupStruct - Code string `json:"code" gorm:"column:code;default:\"\""` - ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` -} - -// Individual Физическое лицо (справочник). -type Individual struct { - CommonStruct - NameStruct - BirthDate time.Time `json:"birth_date" gorm:"column:birth_date;default:null"` - DeathDate time.Time `json:"death_date" gorm:"column:death_date;default:null"` - Email string `json:"email" gorm:"column:email;default:\"\""` - GenderID int64 `json:"gender_id" gorm:"column:gender_id;default:null"` - INN string `json:"inn" gorm:"column:inn;default:\"\""` - ParentName string `json:"parent_name" gorm:"column:parent_name;default:\"\""` - Phone string `json:"phone" gorm:"column:phone;default:\"\""` - SNILS string `json:"snils" gorm:"column:snils;default:\"\""` - SecondName string `json:"second_name" gorm:"column:second_name;default:\"\""` - ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` -} - -// GenderType Пол (справочник). -type GenderType struct { - CommonStruct - Name string `json:"name" gorm:"column:name;default:\"\""` -} - -// DirectionType Направление передачи сообщения (справочник). -type DirectionType struct { - CommonStruct - NameStruct -} - -// LegalType Тип юридического лица (справочник). -type LegalType struct { - CommonStruct - NameStruct - IsIndividual bool `json:"is_individual" gorm:"column:is_individual;default:false"` -} - -// ChannelType Тип канала (справочник). -type ChannelType struct { - CommonStruct - NameStruct -} - -// ClaimType Типы исков (справочник). -type ClaimType struct { - CommonStruct - NameStruct - Code string `json:"code" gorm:"column:code;default:\"\""` -} - -// Document Документ. -type Document struct { - CommonStruct // Id с/ф в СТЕК; Дата формирования - GroupStruct - Analytics string `json:"analytics" gorm:"column:analytics;default:\"\""` // Тип начисления (окончательный, пени, ограничения, по суду); - Balance float64 `json:"balance" gorm:"column:balance;default:null"` // Неоплаченный остаток С/ф - BillKindID int64 `json:"bill_kind_id" gorm:"column:bill_kind_id;default:null"` // - BillingMonth time.Time `json:"billing_month" gorm:"column:billing_month;default:null"` - ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` - ContractID int64 `json:"contract_id" gorm:"column:contract_id;default:null"` // Номер договора; - Count int64 `json:"count" gorm:"column:count;not null"` // Квт.ч в С/ф; - DebtSum float64 `json:"debt_sum" gorm:"column:debt_sum;default:null"` // Долг в претензии - DocumentAt time.Time `json:"document_at" gorm:"column:document_at;default:null"` // Дата С/ф; - DocumentSum float64 `json:"document_sum" gorm:"column:document_sum;not null"` // Начислено по С/ф - DocumentTypeID int64 `json:"document_type_id" gorm:"column:document_type_id;default:null"` - Note string `json:"note" gorm:"column:note;default:\"\""` // Примечание, в частности назначение платежа - Number string `json:"number" gorm:"column:number;default:\"\""` // Номер С/ф; - NumberFull string `json:"number_full" gorm:"column:number_full;default:\"\""` // Полный номер С/ф; - PayDeadline time.Time `json:"pay_deadline" gorm:"column:pay_deadline;default:null"` // День когда уже пошла просрочка - PayFrom time.Time `json:"pay_from" gorm:"column:pay_from;default:null"` // Период С/ф; с - PayTo time.Time `json:"pay_to" gorm:"column:pay_to;default:null"` // Период С/ф; по - Payment float64 `json:"payment" gorm:"column:payment;default:null"` // Оплата по С/ф - Reason string `json:"reason" gorm:"column:reason;default:\"\""` - ReversalID int64 `json:"reversal_id" gorm:"column:reversal_id;default:null"` // Указатель на исправленный документ -} - -// BillKindType Вид платежа -type BillKindType struct { - CommonStruct - NameStruct - Code int `json:"code" gorm:"column:code;default:null"` -} - -// Balance Сальдо договора. -type Balance struct { - CommonStruct - BillingMonth time.Time `json:"billing_month" gorm:"column:billing_month;default:null"` - ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` - ContractID int64 `json:"contract_id" gorm:"column:contract_id;default:null"` - DebtTypeID int64 `json:"debt_type_id" gorm:"column:debt_type_id;default:null"` - DocumentAt time.Time `json:"document_at" gorm:"column:document_at;default:null"` - DocumentInvoiceID int64 `json:"document_invoice_id" gorm:"column:document_invoice_id;default:null"` - DocumentPaymentID int64 `json:"document_payment_id" gorm:"column:document_payment_id;default:null"` - Sum float64 `json:"sum" gorm:"column:sum;default:null"` -} - -// DocumentLink Связи документов -type DocumentLink struct { - CommonStruct - ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` - ContractID int64 `json:"contract_id" gorm:"column:contract_id;default:null"` - CorrectionSum float64 `json:"correction_sum" gorm:"column:correction_sum;not null;default:0"` - Document1ID int64 `json:"document1_id" gorm:"column:document1_id;default:null"` - Document2ID int64 `json:"document2_id" gorm:"column:document2_id;default:null"` - LinkTypeID int64 `json:"link_type_id" gorm:"column:link_type_id;default:null"` -} - -// DocumentLinkType Тип связи документов -type DocumentLinkType struct { - CommonStruct - NameStruct - Code int `json:"code" gorm:"column:code;default:null"` -} - -// Calendar - список выходных -type Calendar struct { - CommonStruct - Date time.Time `json:"date" gorm:"column:date;default:null"` - Hours int `json:"hours" gorm:"column:hours;default:0"` - Days int `json:"days" gorm:"column:days;default:0"` - DayTypeID int64 `json:"day_type_id" gorm:"column:day_type_id;default:null"` - Comment string `json:"comment" gorm:"column:comment;default:\"\""` -} - -// DayType - тип рабочего дня -type DayType struct { - CommonStruct - NameStruct - ShortName string `json:"short_name" gorm:"column:short_name;default:\"\""` - IsWorkDay bool `json:"is_work_day" gorm:"column:is_work_day;default:false"` -} - -// DocumentType Тип документов (справочник). -type DocumentType struct { - CommonStruct - NameStruct - IsService bool `json:"is_service" gorm:"column:is_service;default:false"` - IsVisible bool `json:"is_visible" gorm:"column:is_visible;default:false"` - ShortName string `json:"short_name" gorm:"column:short_name;default:\"\""` - Type int `json:"type" gorm:"column:type;default:0"` - IncomeExpense int `json:"income_expense" gorm:"column:income_expense;default:null"` - ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` -} - -// UserRole Роль (справочник). -type UserRole struct { - CommonStruct - NameStruct -} - -// PaymentSchedule График платежей по договору -type PaymentSchedule struct { - CommonStruct - ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` - ContractID int64 `json:"contract_id" gorm:"column:contract_id;default:null"` - DateFrom time.Time `json:"date_from" gorm:"column:date_from;default:null"` - DateTo time.Time `json:"date_to" gorm:"column:date_to;default:null"` - Day int `json:"day" gorm:"column:day;not null"` - Percent int `json:"percent" gorm:"column:percent;not null"` -} - -// PaymentDay День платежа по договору -type PaymentDay struct { - CommonStruct - ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` - ContractID int64 `json:"contract_id" gorm:"column:contract_id;default:null"` - DateFrom time.Time `json:"date_from" gorm:"column:date_from;default:null"` - DateTo time.Time `json:"date_to" gorm:"column:date_to;default:null"` - Day int `json:"day" gorm:"column:day;not null"` -} - -// ServiceProvider Поставщик услуг (справочник). -type ServiceProvider struct { - CommonStruct - OrganizationID int64 `json:"organization_id" gorm:"column:organization_id;default:null"` - ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` - DateFrom time.Time `json:"date_from" gorm:"column:date_from;default:null"` - DateTo time.Time `json:"date_to" gorm:"column:date_to;default:null"` -} - -// ServiceType Типы услуг (справочник). -type ServiceType struct { - CommonStruct - NameStruct - GroupStruct - Code int `json:"code" gorm:"column:code;default:0"` - FullName string `json:"full_name" gorm:"column:full_name;default:\"\""` - Measure string `json:"measure" gorm:"column:measure;default:\"\""` - ServiceProviderID int64 `json:"service_provider_id" gorm:"column:service_provider_id;default:null"` - ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` -} - -// Bank Банки (справочник). -type Bank struct { - CommonStruct - GroupStruct - NameStruct - OrganizationID int64 `json:"organization_id" gorm:"column:organization_id;default:null"` - City string `json:"city_name" gorm:"column:city_name;default:\"\""` - BIK string `json:"bik" gorm:"column:bik;default:\"\""` - CorrespondentAccount string `json:"correspondent_account" gorm:"column:correspondent_account;default:\"\""` - ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` -} - -// Court Суды (справочник). -type Court struct { - CommonStruct - GroupStruct - NameStruct - OrganizationID int64 `json:"organization_id" gorm:"column:organization_id;default:null"` - City string `json:"city_name" gorm:"column:city_name;default:\"\""` -} - -// File Файлы. -type File struct { - CommonStruct - GroupStruct - NameStruct - ExtLinkStruct - BranchID int64 `json:"branch_id" gorm:"column:branch_id;default:null"` - EmployeeID int64 `json:"employee_id" gorm:"column:employee_id;default:null"` - Extension string `json:"extension" gorm:"column:extension;default:\"\""` - FileID string `json:"file_id" gorm:"column:file_id;default:\"\""` - FileName string `json:"file_name" gorm:"column:file_name;default:\"\""` - FileTypeID int64 `json:"file_type_id" gorm:"column:file_type_id;default:null"` - FullName string `json:"full_name" gorm:"column:full_name;default:\"\""` - Size int64 `json:"size" gorm:"column:size;default:null"` - TemplateID int64 `json:"template_id" gorm:"column:template_id;default:null"` - Version int `json:"version" gorm:"column:version;default:0"` -} - -// Comment Комментарии. -type Comment struct { - CommonStruct - ExtLinkStruct - Message string `json:"message" gorm:"column:message;default:\"\""` -} - -// ChangeItem Изменения -// Key - изменённое поле -// Value - новое значение -// Prev - прежнее значение -type ChangeItem struct { - CommonStruct - ExtLinkStruct - // TODO UserID - // TODO Action - // TODO Table - // TODO Field - Key string `json:"key" gorm:"column:key;default:\"\""` - Value string `json:"value" gorm:"column:value;default:\"\""` - Prev string `json:"prev" gorm:"column:prev;default:\"\""` -} - -// TableName объект позволяющий привязать такие компоненты как комментарий или файл к разным объектам -type TableName struct { - CommonStruct - NameStruct -} - -type Connection struct { - ID int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement:true"` - Name string `json:"name" gorm:"column:name;default:\"\""` - IsLegal bool `json:"is_legal" gorm:"column:is_legal;default:false"` - BranchId int64 `json:"branch_id" gorm:"column:branch_id;default:0"` - Server string `json:"server" gorm:"column:server;default:\"\""` - Port string `json:"port" gorm:"column:port;default:\"\""` - DbName string `json:"db_name" gorm:"column:db_name;default:\"\""` - DbScheme string `json:"db_scheme" gorm:"column:db_scheme;default:\"\""` - Login string `json:"login" gorm:"column:login;default:\"\""` - Password string `json:"password" gorm:"column:password;default:\"\""` -} - -// BankAccountOrganization Соответствие банка - лицевого счёта - организации. -type BankAccountOrganization struct { - CommonStruct - Bank Bank `json:"bank" gorm:"-:all"` - BankID int64 `json:"bank_id" gorm:"column:bank_id;default:null"` - ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` - AccountNumber string `json:"account_number" gorm:"column:account_number;default:\"\""` - Organization Organization `json:"organization" gorm:"-:all"` - OrganizationID int64 `json:"organization_id" gorm:"column:organization_id;default:null"` -} - -// Account Лицевой счёт -type Account struct { - CommonStruct - Bank Bank `json:"bank" gorm:"-:all"` - BankID int64 `json:"bank_id" gorm:"column:bank_id;default:null"` - Number string `json:"number" gorm:"column:number;default:\"\""` -} - -// Facsimile Соответствие участков ответственных и договоров -type Facsimile struct { - CommonStruct - Branch string `json:"branch" gorm:"column:branch;default:\"\""` - Department string `json:"department" gorm:"column:department;default:\"\""` - Responsible string `json:"responsible" gorm:"column:responsible;default:\"\""` - Contract string `json:"contract" gorm:"column:contract;default:\"\""` -} - -// AccountingArea Области учёта -type AccountingArea struct { - CommonStruct - NameStruct - ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` - Code int `json:"code" gorm:"column:code;default:null"` -} - -// CompletedMonth Закрытые месяцы -type CompletedMonth struct { - CommonStruct - ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` - AccountingAreaID int64 `json:"accounting_area_id" gorm:"column:accounting_area_id;default:null"` - BillingMonth time.Time `json:"billing_month" gorm:"column:billing_month;default:null"` -} - -// ContractWhiteItem "Белый" список договоров. Кому не предъявляется претензия. -type ContractWhiteItem struct { - CommonStruct - Contract Contract `json:"contract" gorm:"-:all"` - ContractID int64 `json:"contract_id" gorm:"column:contract_id;default:null"` - ContractNumber string `json:"contract_number" gorm:"column:contract_number;default:null"` - CreatedBy Employee `json:"created_by" gorm:"-:all"` - CreatedByID int64 `json:"created_by_id" gorm:"column:created_by_id;default:null"` - DateFrom time.Time `json:"date_from" gorm:"column:date_from;default:null"` - DateTo time.Time `json:"date_to" gorm:"column:date_to;default:null"` - EDMSLink string `json:"edms_link" gorm:"column:edms_link;default:\"\""` - ModifiedBy Employee `json:"modified_by" gorm:"-:all"` - ModifiedByID int64 `json:"modified_by_id" gorm:"column:modified_by_id;default:null"` - Note string `json:"note" gorm:"column:note;default:\"\""` - Reason string `json:"reason" gorm:"column:reason;default:\"\""` -} - -type ContractWhiteList []ContractWhiteItem - -// ContractBlackItem "Чёрный" список договоров. Кому предъявляется претензия без ожидания. -type ContractBlackItem struct { - CommonStruct - Contract Contract `json:"contract" gorm:"-:all"` - ContractID int64 `json:"contract_id" gorm:"column:contract_id;default:null"` - ContractNumber string `json:"contract_number" gorm:"column:contract_number;default:null"` - CreatedBy Employee `json:"created_by" gorm:"-:all"` - CreatedByID int64 `json:"created_by_id" gorm:"column:created_by_id;default:null"` - DateFrom time.Time `json:"date_from" gorm:"column:date_from;default:null"` - DateTo time.Time `json:"date_to" gorm:"column:date_to;default:null"` - EDMSLink string `json:"edms_link" gorm:"column:edms_link;default:\"\""` - ModifiedBy Employee `json:"modified_by" gorm:"-:all"` - ModifiedByID int64 `json:"modified_by_id" gorm:"column:modified_by_id;default:null"` - Note string `json:"note" gorm:"column:note;default:\"\""` - Reason string `json:"reason" gorm:"column:reason;default:\"\""` -} - -type ContractBlackList []ContractBlackItem - -type Hashtag struct { - CommonStruct - NameStruct -} - -type HashtagLink struct { - CommonStruct - ExtLinkStruct - HashtagID int64 `json:"hashtag_id" gorm:"column:hashtag_id;default:null"` -} - -type HashtagList []Hashtag - -// =========================================================================== -// ===== Отчёты ===== -// =========================================================================== - -// ReportSummary Суммарный отчёт (дашборд) -type ReportSummary struct { - // Всего претензий сформировано с начала года - ClaimsTotal int `json:"claims_total" gorm:"-:all"` - ClaimsTotalSum string `json:"claims_total_sum" gorm:"-:all"` - - // В работе (исключая завершённые статусы) - ClaimsInWork int `json:"claims_in_work" gorm:"-:all"` - ClaimsInWorkSum string `json:"claims_in_work_sum" gorm:"-:all"` - - // Завершено на этапе претензии в связи с оплатой с начала года - ClaimsStatus2 int `json:"claims_status_2" gorm:"-:all"` - ClaimsStatus2Sum string `json:"claims_status_2_sum" gorm:"-:all"` - - // Ожидает передачи в исковое производство - ClaimsStatus7 int `json:"claims_status_7" gorm:"-:all"` - ClaimsStatus7Sum string `json:"claims_status_7_sum" gorm:"-:all"` - - // Досудебная претензия, которая на стадии мониторинга с направлением по e-mail - ClaimsChannel1401 int `json:"claims_channel_1401" gorm:"-:all"` - ClaimsChannel1401Sum string `json:"claims_channel_1401_sum" gorm:"-:all"` - - // Досудебная претензия, которая на стадии мониторинга с направлением заказным письмом - ClaimsChannel1406 int `json:"claims_channel_1406" gorm:"-:all"` - ClaimsChannel1406Sum string `json:"claims_channel_1406_sum" gorm:"-:all"` - - // Претензии с платежами не разнесенными на счет-фактуры - ClaimsWithUnknown int `json:"claims_with_unknown" gorm:"-:all"` - ClaimsWithUnknownSum string `json:"claims_with_unknown_sum" gorm:"-:all"` -} - -// =========================================================================== -// ===== Методы ===== -// =========================================================================== - -// NewTypeRef Новый набор справочников типов -func NewTypeRef() TypeRef { - return TypeRef{} -} - -func AsTypeRef(b []byte) (TypeRef, error) { - c := NewTypeRef() - err := msgpack.Unmarshal(b, &c) - if err != nil { - return NewTypeRef(), err - } - return c, nil -} - -func TypeRefAsBytes(c *TypeRef) ([]byte, error) { - b, err := msgpack.Marshal(c) - if err != nil { - return nil, err - } - return b, nil -} - -// =========================================================================== - -// NewCommonRef Новый набор глобальных справочников -func NewCommonRef() CommonRef { - return CommonRef{} -} - -func AsCommonRef(b []byte) (CommonRef, error) { - c := NewCommonRef() - err := msgpack.Unmarshal(b, &c) - if err != nil { - return NewCommonRef(), err - } - return c, nil -} - -func CommonRefAsBytes(c *CommonRef) ([]byte, error) { - b, err := msgpack.Marshal(c) - if err != nil { - return nil, err - } - return b, nil -} - -// =========================================================================== - -// NewLawsuit Новый объект дела -func NewLawsuit(number string) Lawsuit { - return Lawsuit{ - Number: fmt.Sprintf("ПФ_%s_%s", time.Now().Format("200601-02"), number), - NumberClaim: fmt.Sprintf("ПР_%s_%s", time.Now().Format("200601-02"), number), - NumberTrial: fmt.Sprintf("ПИ_%s_%s", time.Now().Format("200601-02"), number), - } -} - -func AsLawsuit(b []byte) (Lawsuit, error) { - c := Lawsuit{} - err := msgpack.Unmarshal(b, &c) - if err != nil { - return Lawsuit{}, err - } - return c, nil -} - -func LawsuitAsBytes(c *Lawsuit) ([]byte, error) { - b, err := msgpack.Marshal(c) - if err != nil { - return nil, err - } - return b, nil -} - -// NewBriefCase Новый объект портфеля -func NewBriefCase() BriefCase { - return BriefCase{} -} - -func AsBriefCase(b []byte) (BriefCase, error) { - c := NewBriefCase() - err := msgpack.Unmarshal(b, &c) - if err != nil { - return NewBriefCase(), err - } - return c, nil -} - -func BriefCaseAsBytes(c *BriefCase) ([]byte, error) { - b, err := msgpack.Marshal(c) - if err != nil { - return nil, err - } - return b, nil -} - -// =========================================================================== - -// NewClaimWork Новый объект верхнего уровня, по сути содержит список портфелей. -func NewClaimWork() ClaimWork { - return ClaimWork{} -} - -func AsClaimWork(b []byte) (ClaimWork, error) { - c := NewClaimWork() - err := msgpack.Unmarshal(b, &c) - if err != nil { - return NewClaimWork(), err - } - return c, nil -} - -func ClaimWorkAsBytes(c *ClaimWork) ([]byte, error) { - b, err := msgpack.Marshal(c) - if err != nil { - return nil, err - } - return b, nil -} - -// =========================================================================== - -// NewFile Файл, который физически хранится в файловом хранилище -func NewFile() File { - return File{} -} - -func AsFile(b []byte) (File, error) { - f := NewFile() - err := msgpack.Unmarshal(b, &f) - if err != nil { - return NewFile(), err - } - return f, nil -} - -func FileAsBytes(f *File) ([]byte, error) { - b, err := msgpack.Marshal(f) - if err != nil { - return nil, err - } - return b, nil -} - -// =========================================================================== - -// NewEmployee Сотрудник -func NewEmployee() Employee { - return Employee{} -} - -func AsEmployee(b []byte) (Employee, error) { - e := NewEmployee() - err := msgpack.Unmarshal(b, &e) - if err != nil { - return NewEmployee(), err - } - return e, nil -} - -func EmployeeAsBytes(e *Employee) ([]byte, error) { - b, err := msgpack.Marshal(e) - if err != nil { - return nil, err - } - return b, nil -} - -// =========================================================================== - -// NewContract Договор -func NewContract() Contract { - return Contract{} -} - -func AsContract(b []byte) (Contract, error) { - c := NewContract() - err := msgpack.Unmarshal(b, &c) - if err != nil { - return NewContract(), err - } - return c, nil -} - -func ContractAsBytes(c *Contract) ([]byte, error) { - b, err := msgpack.Marshal(c) - if err != nil { - return nil, err - } - return b, nil -} - -// =========================================================================== - -// NewOrganization - -func NewOrganization() Organization { - return Organization{} -} - -func AsOrganization(b []byte) (Organization, error) { - c := NewOrganization() - err := msgpack.Unmarshal(b, &c) - if err != nil { - return NewOrganization(), err - } - return c, nil -} - -func OrganizationAsBytes(c *Organization) ([]byte, error) { - b, err := msgpack.Marshal(c) - if err != nil { - return nil, err - } - return b, nil -} - -// =========================================================================== - -// NewReportSummary Суммарный отчёт (дашборд) -func NewReportSummary() ReportSummary { - return ReportSummary{} -} - -func AsReportSummary(b []byte) (ReportSummary, error) { - c := NewReportSummary() - err := msgpack.Unmarshal(b, &c) - if err != nil { - return NewReportSummary(), err - } - return c, nil -} - -func ReportSummaryAsBytes(c *ReportSummary) ([]byte, error) { - b, err := msgpack.Marshal(c) - if err != nil { - return nil, err - } - return b, nil -} - -// =========================================================================== - -// NewFacsimile Данные факсимиле -func NewFacsimile() Facsimile { - return Facsimile{} -} - -func AsFacsimile(b []byte) (Facsimile, error) { - c := NewFacsimile() - err := msgpack.Unmarshal(b, &c) - if err != nil { - return NewFacsimile(), err - } - return c, nil -} - -func FacsimileAsBytes(c *Facsimile) ([]byte, error) { - b, err := msgpack.Marshal(c) - if err != nil { - return nil, err - } - return b, nil -} - -// =========================================================================== - -// NewWhiteListItem -- Новая запись белого списка -func NewWhiteListItem() ContractWhiteItem { - return ContractWhiteItem{} -} - -func AsWhiteListItem(b []byte) (ContractWhiteItem, error) { - c := NewWhiteListItem() - err := msgpack.Unmarshal(b, &c) - if err != nil { - return NewWhiteListItem(), err - } - return c, nil -} - -func WhiteListItemAsBytes(c *ContractWhiteItem) ([]byte, error) { - b, err := msgpack.Marshal(c) - if err != nil { - return nil, err - } - return b, nil -} - -// =========================================================================== - -// NewContractWhiteList Новый объект белого списка -func NewContractWhiteList() ContractWhiteList { - return ContractWhiteList{} -} - -func AsContractWhiteList(b []byte) (ContractWhiteList, error) { - c := NewContractWhiteList() - err := msgpack.Unmarshal(b, &c) - if err != nil { - return NewContractWhiteList(), err - } - return c, nil -} - -func ContractWhiteListAsBytes(c *ContractWhiteList) ([]byte, error) { - b, err := msgpack.Marshal(c) - if err != nil { - return nil, err - } - return b, nil -} - -// =========================================================================== - -// NewBlackListItem -- Новая запись чёрного списка -func NewBlackListItem() ContractBlackItem { - return ContractBlackItem{} -} - -func AsBlackListItem(b []byte) (ContractBlackItem, error) { - c := NewBlackListItem() - err := msgpack.Unmarshal(b, &c) - if err != nil { - return NewBlackListItem(), err - } - return c, nil -} - -func BlackListItemAsBytes(c *ContractBlackItem) ([]byte, error) { - b, err := msgpack.Marshal(c) - if err != nil { - return nil, err - } - return b, nil -} - -// =========================================================================== - -// NewContractBlackList -- Новый объект чёрного списка -func NewContractBlackList() ContractBlackList { - return ContractBlackList{} -} - -func AsContractBlackList(b []byte) (ContractBlackList, error) { - c := NewContractBlackList() - err := msgpack.Unmarshal(b, &c) - if err != nil { - return NewContractBlackList(), err - } - return c, nil -} - -func ContractBlackListAsBytes(c *ContractBlackList) ([]byte, error) { - b, err := msgpack.Marshal(c) - if err != nil { - return nil, err - } - return b, nil -} - -// =========================================================================== - -// NewHashtag Новый объект хештег -func NewHashtag() Hashtag { - return Hashtag{} -} - -func AsHashtag(b []byte) (Hashtag, error) { - h := NewHashtag() - err := msgpack.Unmarshal(b, &h) - if err != nil { - return NewHashtag(), err - } - return h, nil -} - -func HashtagAsBytes(h *Hashtag) ([]byte, error) { - b, err := msgpack.Marshal(h) - if err != nil { - return nil, err - } - return b, nil -} - -// =========================================================================== - -// NewHashtagList Новый объект хештег -func NewHashtagList() HashtagList { - return HashtagList{} -} - -func AsHashtagList(b []byte) (HashtagList, error) { - h := NewHashtagList() - err := msgpack.Unmarshal(b, &h) - if err != nil { - return NewHashtagList(), err - } - return h, nil -} - -func HashtagListAsBytes(h *HashtagList) ([]byte, error) { - b, err := msgpack.Marshal(h) - if err != nil { - return nil, err - } - return b, nil -} - -// =========================================================================== - -// NewHashtagLink Новый объект связи хештега -func NewHashtagLink() HashtagLink { - return HashtagLink{} -} - -func AsHashtagLink(b []byte) (HashtagLink, error) { - hl := NewHashtagLink() - err := msgpack.Unmarshal(b, &hl) - if err != nil { - return NewHashtagLink(), err - } - return hl, nil -} - -func HashtagLinkAsBytes(hl *HashtagLink) ([]byte, error) { - b, err := msgpack.Marshal(hl) - if err != nil { - return nil, err - } - return b, nil -} - -// =========================================================================== - -// BriefCaseView выборка -func BriefCaseView(bc *BriefCase, c *CommonRef, t *TypeRef, useFormat bool) (map[string]interface{}, error) { - result := make(map[string]interface{}) - - if bc == nil { - return result, fmt.Errorf("MailTemplateView, BriefCase is nil") - } - if c == nil { - return result, fmt.Errorf("MailTemplateView, CommonRef is nil") - } - if t == nil { - return result, fmt.Errorf("MailTemplateView, TypeRef is nil") - } - - lawSuit := bc.Lawsuit - - // ID - result["Lawsuit_ID"] = lawSuit.ID - // Дата претензии - if useFormat { - result["Lawsuit_CreatedAt"] = formatDate(lawSuit.CreatedAt) - } else { - result["Lawsuit_CreatedAt"] = lawSuit.CreatedAt - } - // Номер претензии - result["Lawsuit_Number"] = lawSuit.Number - result["Lawsuit_NumberClaim"] = lawSuit.NumberClaim - result["Lawsuit_NumberTrial"] = lawSuit.NumberTrial - - // TODO View LawsuitStageTypes Улучшить поиск - stage := LawsuitStageType{} - for i := 0; i < len(t.LawsuitStageTypes); i++ { - if t.LawsuitStageTypes[i].ID == lawSuit.StageID { - stage = t.LawsuitStageTypes[i] - break - } - } - // Этап - для фильтрации - result["Lawsuit_StageID"] = lawSuit.StageID - // Этап - для вариантов отображения - result["Lawsuit_StageCode"] = stage.Code - // Этап - для вывода в таблицу - result["Lawsuit_Stage"] = stage.Name - // Дата установки этапа - if useFormat { - result["Lawsuit_StageAt"] = formatDate(lawSuit.StageAt) - } else { - result["Lawsuit_StageAt"] = lawSuit.StageAt - } - - // TODO View LawsuitStatusTypes Улучшить поиск - status := LawsuitStatusType{} - for i := 0; i < len(t.LawsuitStatusTypes); i++ { - if t.LawsuitStatusTypes[i].ID == lawSuit.StatusID { - status = t.LawsuitStatusTypes[i] - break - } - } - // Статус - для фильтрации - result["Lawsuit_StatusID"] = lawSuit.StatusID - // Статус - для вариантов отображения - result["Lawsuit_StatusCode"] = status.Code - // Статус - для вывода в таблицу - result["Lawsuit_Status"] = status.Name - // Дата установки статуса - if useFormat { - result["Lawsuit_StatusAt"] = formatDate(lawSuit.StatusAt) - } else { - result["Lawsuit_StatusAt"] = lawSuit.StatusAt - } - - // TODO View LawsuitReasonTypes Улучшить поиск - reason := "Неизвестно" - for i := 0; i < len(t.LawsuitReasonTypes); i++ { - if t.LawsuitReasonTypes[i].ID == lawSuit.ReasonID { - reason = t.LawsuitReasonTypes[i].Name - break - } - } - // Статус - для фильтрации - result["Lawsuit_ReasonID"] = lawSuit.ReasonID - // Статус - для вывода в таблицу - result["Lawsuit_Reason"] = reason - - // TODO View ClaimTypes Улучшить поиск - claimType := "Неизвестно" - for i := 0; i < len(t.ClaimTypes); i++ { - if t.ClaimTypes[i].ID == lawSuit.ClaimTypeID { - claimType = t.ClaimTypes[i].Name - break - } - } - // Статус - для фильтрации - result["Lawsuit_ClaimTypeID"] = lawSuit.ClaimTypeID - // Статус - для вывода в таблицу - result["Lawsuit_ClaimType"] = claimType - - // TODO View ClaimTypes Улучшить поиск - branch := "" - for i := 0; i < len(c.Branches); i++ { - if c.Branches[i].ID == lawSuit.BranchID { - branch = c.Branches[i].Name - break - } - } - // Отделение - для фильтрации - result["Lawsuit_BranchID"] = lawSuit.BranchID - // Отделение - для вывода в таблицу - result["Lawsuit_Branch"] = branch - - dbtSumFull := bc.Lawsuit.DebtSum + - bc.Lawsuit.Penny + - bc.Lawsuit.Penalty + - bc.Lawsuit.StateDuty - - // Сумма процентов по 395 ГК РФ (руб.) - if useFormat { - result["Lawsuit_Percent_395"] = Currency(bc.Lawsuit.Percent395) - } else { - result["Lawsuit_Percent_395"] = bc.Lawsuit.Percent395 - } - // Сумма процентов по 317.1 ГК РФ (руб.) - if useFormat { - result["Lawsuit_Percent_317"] = Currency(bc.Lawsuit.Percent317) - } else { - result["Lawsuit_Percent_317"] = bc.Lawsuit.Percent317 - } - // Сумма договорной/законной неустойки (руб.) - if useFormat { - result["Lawsuit_Penalty"] = Currency(bc.Lawsuit.Penalty) - } else { - result["Lawsuit_Penalty"] = bc.Lawsuit.Penalty - } - // Пени по день фактической оплаты долга (руб.) - if useFormat { - result["Lawsuit_Penny"] = Currency(bc.Lawsuit.Penny) - } else { - result["Lawsuit_Penny"] = bc.Lawsuit.Penny - } - // Сумма госпошлины (руб.) - if useFormat { - result["Lawsuit_StateDuty"] = Currency(bc.Lawsuit.StateDuty) - } else { - result["Lawsuit_StateDuty"] = bc.Lawsuit.StateDuty - } - // Поступило денежных средств - if useFormat { - result["Lawsuit_ReceivedFunds"] = Currency(lawSuit.PaySum) - } else { - result["Lawsuit_ReceivedFunds"] = lawSuit.PaySum - } - // TODO Поле "Общий долг": Полная сумма долга - if useFormat { - result["Lawsuit_TotalDebt"] = Currency(dbtSumFull) - } else { - result["Lawsuit_TotalDebt"] = dbtSumFull - } - // TODO Поле "Основной долг": По счёт фактурам - if useFormat { - result["Lawsuit_MainDebt"] = Currency(lawSuit.InvoiceSum) - } else { - result["Lawsuit_MainDebt"] = lawSuit.InvoiceSum - } - // TODO Поле "Остаток долга": "Основной долг" - Поступило денежных средств - if useFormat { - result["Lawsuit_Balance"] = Currency(lawSuit.DebtSum) - } else { - result["Lawsuit_Balance"] = lawSuit.DebtSum - } - // TODO Колонка уведомление - if useFormat { - result["Lawsuit_Claim"] = Currency(lawSuit.InvoiceSum - lawSuit.PaySum) - } else { - result["Lawsuit_Claim"] = lawSuit.InvoiceSum - lawSuit.PaySum - } - // TODO Колонка претензия - if useFormat { - result["Lawsuit_Pretrial"] = "-" // Currency(lawSuit.InvoiceSum) - } else { - result["Lawsuit_Pretrial"] = "-" // lawSuit.InvoiceSum - } - - if lawSuit.UnknownPayments { - result["Lawsuit_UnknownPayments"] = 1 - } else { - result["Lawsuit_UnknownPayments"] = 0 - } - - changes := make([]interface{}, 0) - for i := 0; i < len(bc.ChangeItems); i++ { - // TODO Костыль, нужно по-быстрому решить, чтобы не парсить в веб - actionCode := 0 - newValueCode := 0 - prevValueCode := 0 - if bc.ChangeItems[i].Key == "Обновление статуса" { - actionCode = 1 - // "Сформировано уведомление (2)" - value := regexp.MustCompile(`\d`).FindStringSubmatch(bc.ChangeItems[i].Value) +// Поиск по истории дела обновление статуса на определенный код МОЖЕТ ПРИГОДИТЬСЯ В БУДУЩЕМ +/*func isIncludedStage(briefCaseChanges []ChangeItem, desiredValue int) bool { + for i := 0; i < len(briefCaseChanges); i++ { + if briefCaseChanges[i].Key == "Обновление статуса" { + value := regexp.MustCompile(`\d`).FindStringSubmatch(briefCaseChanges[i].Value) if len(value) == 1 { - newValueCode, _ = strconv.Atoi(value[0]) - } - } - tmp := map[string]interface{}{ - "ID": bc.ChangeItems[i].ID, - "CreatedAt": formatTime(bc.ChangeItems[i].CreatedAt), - "Action": bc.ChangeItems[i].Key, - "NewValue": bc.ChangeItems[i].Value, - "PrevValue": bc.ChangeItems[i].Prev, - "ActionCode": actionCode, - "NewValueCode": newValueCode, - "PrevValueCode": prevValueCode, - } - changes = append(changes, tmp) - } - result["Lawsuit_Changes"] = changes - - contract := &lawSuit.Contract - // ID - result["Contract_ID"] = contract.ID - // № Договор - result["Contract_Number"] = contract.Number - // Дата договора - if useFormat { - result["Contract_SignAt"] = formatDate(contract.SignAt) - } else { - result["Contract_SignAt"] = contract.SignAt - } - // Категория договора - category := "Неизвестно" - for i := 0; i < len(t.ContractCategoryTypes); i++ { - if t.ContractCategoryTypes[i].ID == contract.CategoryID { - category = t.ContractCategoryTypes[i].Name - break - } - } - result["Contract_Category"] = category - result["Contract_CategoryID"] = contract.CategoryID - // Статус - if contract.Status == "" { - result["Contract_Status"] = "Активен" - } else { - result["Contract_Status"] = contract.Status - } - // Почтовый адрес - if contract.PostAddress == "" { - result["Contract_PostAddress"] = "Не указан" - } else { - result["Contract_PostAddress"] = contract.PostAddress - } - // E-mail - if contract.Email == "" { - result["Contract_Email"] = "Не указан" - } else { - result["Contract_Email"] = contract.Email - } - // Валидность E-mail - if contract.IsValidEmail { - result["Contract_EmailValid"] = 1 - } else { - result["Contract_EmailValid"] = 0 - } - - // Судебный отдел - result["Contract_CuratorLegal"] = fmt.Sprintf("%v %v", contract.CuratorLegal.SecondName, contract.CuratorLegal.Name) - result["Contract_CuratorLegal_Email"] = contract.CuratorLegal.Email - result["Contract_CuratorLegal_Phone"] = contract.CuratorLegal.Phone - // Расчётный отдел - result["Contract_CuratorPayment"] = fmt.Sprintf("%v %v", contract.CuratorPayment.SecondName, contract.CuratorPayment.Name) - result["Contract_CuratorPayment_Email"] = contract.CuratorPayment.Email - result["Contract_CuratorPayment_Phone"] = contract.CuratorPayment.Phone - // Договорной отдел - result["Contract_CuratorContract"] = fmt.Sprintf("%v %v", contract.CuratorContract.SecondName, contract.CuratorContract.Name) - result["Contract_CuratorContract_Email"] = contract.CuratorContract.Email - result["Contract_CuratorContract_Phone"] = contract.CuratorContract.Phone - // Отдел тех. аудита - result["Contract_CuratorTechAudit"] = fmt.Sprintf("%v %v", contract.CuratorTechAudit.SecondName, contract.CuratorTechAudit.Name) - result["Contract_CuratorTechAudit_Email"] = contract.CuratorTechAudit.Email - result["Contract_CuratorTechAudit_Phone"] = contract.CuratorTechAudit.Phone - // Куратор претензии - result["Contract_CuratorClaim"] = fmt.Sprintf("%v %v", contract.CuratorClaim.SecondName, contract.CuratorClaim.Name) - result["Contract_CuratorClaim_Email"] = contract.CuratorClaim.Email - result["Contract_CuratorClaim_Phone"] = contract.CuratorClaim.Phone - - result["Contract_DaysToResolveClaim"] = contract.DaysToResolveClaim - - result["Contract_PaymentDay"] = 18 - for i := 0; i < len(contract.PaymentDays); i++ { - if time.Now().After(contract.PaymentDays[i].DateFrom) && - time.Now().Before(contract.PaymentDays[i].DateTo) { - result["Contract_PaymentDay"] = contract.PaymentDays[i].Day - break - } - } - - paymentSchedules := make([]interface{}, 0) - for i := 0; i < len(contract.PaymentSchedules); i++ { - if contract.PaymentSchedules[i].ContractID == contract.ID { - if useFormat { - tmp := map[string]interface{}{ - "Day": fmt.Sprintf("%d число", contract.PaymentSchedules[i].Day), - "Percent": fmt.Sprintf("%d %%", contract.PaymentSchedules[i].Percent), - } - paymentSchedules = append(paymentSchedules, tmp) - } else { - tmp := map[string]interface{}{ - "Day": fmt.Sprintf("%d", contract.PaymentSchedules[i].Day), - "Percent": fmt.Sprintf("%d", contract.PaymentSchedules[i].Percent), - } - paymentSchedules = append(paymentSchedules, tmp) - } - } - } - if len(paymentSchedules) == 0 { - tmp := map[string]interface{}{ - "Day": fmt.Sprintf("18"), - "Percent": fmt.Sprintf("100 %%"), - } - paymentSchedules = append(paymentSchedules, tmp) - } - // Срок оплаты по договору - result["Contract_PaymentSchedules"] = paymentSchedules - - invoices := make([]interface{}, 0) - totalSum := 0.0 - totalCorrectionSum := 0.0 - totalDebtSum := 0.0 - totalPayment := 0.0 - totalBalance := 0.0 - for i := 0; i < len(bc.Invoices); i++ { - // TODO Пока аналитики вообще скрываю - if strings.Trim(bc.Invoices[i].Document.Analytics, " ") != "" { - continue - } - - paymentSum := 0.0 - correctionSum := 0.0 - for j := 0; j < len(bc.Payments); j++ { - if bc.Invoices[i].ID == bc.Payments[j].InvoiceID { - if bc.Payments[j].IsCorrective { - correctionSum += bc.Payments[j].Sum - } else { - paymentSum += bc.Payments[j].Sum - } - - } - } - - note := bc.Invoices[i].Document.Note - if note == "" { - note = "Не задано" - } - - number := "СФ:" + bc.Invoices[i].Document.Number - numberFull := bc.Invoices[i].Document.NumberFull - sum := Currency(bc.Invoices[i].Sum) - if bc.Invoices[i].IsCorrective { - number = "К" + number - sum = "" - } - - tmp := map[string]interface{}{ - "ID": bc.Invoices[i].ID, - "ClaimNumber": lawSuit.NumberClaim, // Поле "Претензия" - "Date": formatDate(bc.Invoices[i].Document.DocumentAt), // Поле "Дата С/Ф" - "Number": number, // Поле "Номер С/Ф" - "NumberFull": numberFull, // Поле "Номер С/Ф" полный - "Type": bc.Invoices[i].Document.Analytics, // Поле "Тип начисления" - "Count": bc.Invoices[i].Count, // Кол-во кВт - "Sum": sum, // Поле "Начислено" - "Correction": Currency(correctionSum), // Поле "Корректировка" - "DebtSum": Currency(bc.Invoices[i].Sum - paymentSum), // Поле "Долг в претензии" - "Payment": Currency(paymentSum), // Поле "Оплачено" - "Balance": Currency(bc.Invoices[i].Sum - paymentSum), // Поле "Остаток" - "Note": note, // Поле "Примечание" - } - - // TODO Аналитики нужно считать отдельно - if strings.Trim(bc.Invoices[i].Document.Analytics, " ") == "" { - totalSum += bc.Invoices[i].Sum - totalCorrectionSum += correctionSum - totalPayment += paymentSum - - totalDebtSum += bc.Invoices[i].Sum - paymentSum - correctionSum - totalBalance += bc.Invoices[i].Sum - paymentSum - correctionSum - } - - invoices = append(invoices, tmp) - } - // Счета фактуры по данному договору - result["Contract_Invoices"] = invoices - // Суммы счетов фактур по данному договору - result["Contract_TotalInvoices"] = map[string]interface{}{ - "Sum": Currency(totalSum), // Поле "Начислено" - "CorSum": Currency(totalCorrectionSum), // Поле "Корректировка" - "DebtSum": Currency(totalDebtSum), // Поле "Долг в претензии" - "Payment": Currency(totalPayment), // Поле "Оплачено" - "Balance": Currency(totalBalance), // Поле "Остаток" - } - - result["Lawsuit_Period"] = bc.Lawsuit.ClaimPeriodStr - - payments := make([]interface{}, 0) - totalSum = 0.0 - totalCorrectionSum = 0.0 - totalDebtSum = 0.0 - totalPayment = 0.0 - totalBalance = 0.0 - totalUnknownPayment := 0.0 - for i := 0; i < len(bc.Payments); i++ { - // TODO Пока аналитики вообще скрываю - if strings.Trim(bc.Payments[i].Document.Analytics, " ") != "" { - continue - } - - note := bc.Payments[i].Document.Note - if note == "" { - note = "Не задано" - } - - invoiceSum := 0.0 - for j := 0; j < len(bc.Invoices); j++ { - if bc.Payments[i].InvoiceID == bc.Invoices[j].ID { - invoiceSum += bc.Invoices[j].Sum - break - } - } - - number := "ПП:" + bc.Payments[i].Document.Number - correction := "" - payment := Currency(bc.Payments[i].Sum) - if bc.Payments[i].Document.DocumentTypeID == 35 { - number = "СФ:" + bc.Payments[i].Document.Number - correction = Currency(bc.Payments[i].Sum) - payment = "" - } - if bc.Payments[i].IsCorrective { - number = "К" + number - } - - tmp := map[string]interface{}{ - "ID": bc.Payments[i].ID, - "InvoiceID": bc.Payments[i].InvoiceID, // Ссылка на С/Ф - "ClaimNumber": lawSuit.NumberClaim, // Поле "Претензия" - "Date": formatDate(bc.Payments[i].Document.DocumentAt), // Поле "Дата С/Ф" - "Number": number, // Поле "Номер С/Ф" - "Type": bc.Payments[i].Document.Analytics, // Поле "Тип начисления" - "Sum": "", // Поле "Начислено" - "Correction": correction, // Поле "Корректировка" - "DebtSum": "", // Поле "Долг в претензии" - "Payment": payment, // Поле "Оплачено" - "Balance": "", // Поле "Остаток" - "Note": note, // Поле "Примечание" - } - - // TODO Аналитики нужно считать отдельно - if strings.Trim(bc.Payments[i].Document.Analytics, " ") == "" { - // Платежи без фактур - if bc.Payments[i].InvoiceID == 0 { - totalUnknownPayment += bc.Payments[i].Sum - } else { - totalDebtSum += invoiceSum - bc.Payments[i].Sum - totalPayment += bc.Payments[i].Sum - totalBalance += invoiceSum - bc.Payments[i].Sum - - if bc.Payments[i].IsCorrective { - totalCorrectionSum += bc.Payments[i].Sum - } else { - totalSum += invoiceSum + valueCode, _ := strconv.Atoi(value[0]) + if desiredValue == valueCode { + return true } } } - - payments = append(payments, tmp) } - // Платёжные документы по данному договору - result["Contract_Payments"] = payments - // Суммы платёжных документов по данному договору - result["Contract_TotalPayments"] = map[string]interface{}{ - "Sum": Currency(totalSum), // Поле "Начислено" - "CorSum": Currency(totalCorrectionSum), // Поле "Корректировка" - "DebtSum": Currency(totalDebtSum), // Поле "Долг в претензии" - "Payment": Currency(totalPayment), // Поле "Оплачено" - "Balance": Currency(totalBalance), // Поле "Остаток" - } - // Суммы нераспознанных платёжных документов по данному договору - result["Contract_TotalUnknownPayments"] = map[string]interface{}{ - "Payment": Currency(totalUnknownPayment), // Поле "Сумма" - } - - organization := &contract.Organization - // ID - result["Organization_ID"] = organization.ID - // Email ЮЛ - if organization.Email == "" { - result["Organization_Email"] = "Не указан" - } else { - result["Organization_Email"] = organization.Email - } - // Наименование ЮЛ - result["Organization_Name"] = organization.Name - result["Organization_FullName"] = organization.FullName - // ИНН ЮЛ - result["Organization_INN"] = organization.INN - // КПП ЮЛ - result["Organization_KPP"] = organization.KPP - // Юридический адрес ЮЛ - result["Organization_LegalAddress"] = organization.LegalAddress - // Категория организации - category = "Неизвестно" - for i := 0; i < len(t.OrganizationCategoryTypes); i++ { - if t.OrganizationCategoryTypes[i].ID == organization.CategoryID { - category = t.OrganizationCategoryTypes[i].Name - break - } - } - result["Organization_CategoryID"] = organization.CategoryID - result["Organization_Category"] = category - // Состояние организации - state := "Действующее" - code := "1" - color := "green" - for i := 0; i < len(t.OrganizationStateTypes); i++ { - if t.OrganizationStateTypes[i].ID == organization.StateID { - state = t.OrganizationStateTypes[i].Name - code = t.OrganizationStateTypes[i].Code - color = t.OrganizationStateTypes[i].Color - break - } - } - result["Organization_State"] = state - result["Organization_StateCode"] = code - result["Organization_StateColor"] = color - result["Organization_StateID"] = organization.StateID - - // Ликвидность организации - deprecated - // if organization.IsLiquidated { - // result["Organization_Liquidity"] = "Ликвидирован" - // } else { - // result["Organization_Liquidity"] = "Действующий" - // } - // Банкротство организации - deprecated - // if organization.IsBankrupt { - // result["Organization_Bankrupt"] = "Банкрот" - // } else { - // result["Organization_Bankrupt"] = "Действующий" - // } - - FileMail := "" - FileMailName := "" - FileClaim := "" - FileClaimName := "" - FileClaimDetail := "" - FileClaimDetailName := "" - for i := 0; i < len(bc.Files); i++ { - if strings.Contains(bc.Files[i].Name, "Письмо") { - FileMail = bc.Files[i].FileID - FileMailName = bc.Files[i].FullName - } - - if strings.Contains(bc.Files[i].Name, "Претензия") { - FileClaim = bc.Files[i].FileID - FileClaimName = bc.Files[i].FullName - } - - if strings.Contains(bc.Files[i].Name, "Реестр") { - FileClaimDetail = bc.Files[i].FileID - FileClaimDetailName = bc.Files[i].FullName - } - } - result["File_Mail"] = FileMail - result["File_MailName"] = FileMailName - result["File_Claim"] = FileClaim - result["File_ClaimName"] = FileClaimName - result["File_ClaimDetail"] = FileClaimDetail - result["File_ClaimDetailName"] = FileClaimDetailName - - // TODO Переделать под нормальные статусы - if lawSuit.NotifyClaimDone { - result["Notify_ClaimStatus"] = fmt.Sprintf("%v", "Доставлено успешно") - } else if lawSuit.NotifyClaimAt.Before(time.Now().AddDate(-10, 1, 1)) { - result["Notify_ClaimStatus"] = fmt.Sprintf("%v", "Ожидание") - } else if !contract.IsValidEmail { - result["Notify_ClaimStatus"] = fmt.Sprintf("%v", "Не доставлено (недоступен канал)") - } else if contract.Email == "" { - result["Notify_ClaimStatus"] = fmt.Sprintf("%v", "Не доставлено (отсутствует канал)") - } else { - result["Notify_ClaimStatus"] = fmt.Sprintf("%v", contract.Email) - } - if lawSuit.NotifyPretrialDone { - result["Notify_PretrialStatus"] = fmt.Sprintf("%v", "Доставлено успешно") - } else if lawSuit.NotifyPretrialAt.Before(time.Now().AddDate(-10, 1, 1)) { - result["Notify_PretrialStatus"] = fmt.Sprintf("%v", "Ожидание") - } else if !contract.IsValidEmail { - result["Notify_StatusPretrial"] = fmt.Sprintf("%v", "Не доставлено (недоступен канал)") - } else if contract.Email == "" { - result["Notify_PretrialStatus"] = fmt.Sprintf("%v", "Не доставлено (отсутствует канал)") - } else { - result["Notify_PretrialStatus"] = fmt.Sprintf("%v", contract.Email) - } - result["Notify_ClaimChannel"] = lawSuit.NotifyClaimChannel - result["Notify_ClaimCode"] = lawSuit.NotifyClaimCode - result["Notify_ClaimDone"] = lawSuit.NotifyClaimDone - result["Notify_ClaimMailingCode"] = lawSuit.NotifyClaimMailingCode - result["Notify_PretrialChannel"] = lawSuit.NotifyPretrialChannel - result["Notify_PretrialCode"] = lawSuit.NotifyPretrialCode - result["Notify_PretrialDone"] = lawSuit.NotifyPretrialDone - result["Notify_PretrialMailingCode"] = lawSuit.NotifyPretrialMailingCode - if useFormat { - result["Notify_ClaimAt"] = formatDate(lawSuit.NotifyClaimAt) - result["Notify_PretrialAt"] = formatDate(lawSuit.NotifyPretrialAt) - } else { - result["Notify_ClaimAt"] = lawSuit.NotifyClaimAt - result["Notify_PretrialAt"] = lawSuit.NotifyPretrialAt - } - - hashtags := make([]interface{}, 0) - for i := 0; i < len(bc.Hashtags); i++ { - tmp := map[string]interface{}{ - "ID": bc.Hashtags[i].ID, - "Name": bc.Hashtags[i].Name, - "Description": bc.Hashtags[i].Description, - } - hashtags = append(hashtags, tmp) - } - result["Lawsuit_Hashtags"] = hashtags - - return result, nil -} - -// ClaimWorkView выборка -func ClaimWorkView(cw *ClaimWork, c *CommonRef, t *TypeRef, useFormat bool) (object_view.ViewMap, error) { - result := make(object_view.ViewMap, 0) - - if c == nil { - return result, nil - } - if len(cw.BriefCases) == 0 { - return result, nil - } - - for i := 0; i < len(cw.BriefCases); i++ { - v, err := BriefCaseView(&cw.BriefCases[i], c, t, useFormat) - if err != nil { - return result, fmt.Errorf("ClaimWorkView, BriefCaseView[%v], Error: %v", i, err) - } - result.Append(fmt.Sprintf("%v", i), v) - } - - return result, nil -} - -// MailTemplateView параметры шаблона для письма -func MailTemplateView(bc *BriefCase) (map[string]interface{}, error) { - result := make(map[string]interface{}) - - if bc == nil { - return result, fmt.Errorf("MailTemplateView, BriefCase is nil") - } - - // {"cmdType":"mailing","mailing":{"head":{"protVer":"1.0.1","sysId":"RAPIRA","sourceSystem":"BS012","created":"2023-01-23 13:03:59","minProcVer":"1.0.1","senderVer":"1.0.1"},"command":"init","mailingList":[{"mailingCode":"TEST5_CLAIMDEBT20230119T132742","mailingPhaseCode":"1/1","startAt":"","timezone":"0","endAt":""}]}} - // {"cmdType":"customerTemplateMessage","customerTemplateMessage":{"head":{"protVer":"1.0.1","sysId":"RAPIRA","sourceSystem":"BS012","created":"2023-01-23 13:03:59","minProcVer":"1.0.1","senderVer":"1.0.1"},"mailingCode":"TEST5_CLAIMDEBT20230119T132742","mailingPhaseCode":"1/1","templateCode":"CLAIMPRETRIAL","channelCode":"1401","fieldList":[{"contactInfo":"nechaevaa@atomsbt.ru","userId":"","userAddress":"183039, г. Мурманск, ул. Новое Плато, д.5, кв.60","persAcc":"5140145126","isOrganisationAcc":"1","header":"Досудебная претензия","dbtDate":"2022-09-30","dbtSum":"12 372,12","infoPhone":"9021356077","claimDate":"25.12.2022","claimPretrialDate":"28.12.2022","contractDate":"15.11.2018","contractNumber":"5140145126","dbtSumPeriod":"12 372,12","dbtSumFull":"14 460,29","lkLink":"https://lkul-murmansk.atomsbt.ru/","organisation":"","attachment":""}]}} - - dbtSumFull := bc.Lawsuit.DebtSum + - bc.Lawsuit.Penny + - bc.Lawsuit.Penalty + - bc.Lawsuit.StateDuty - - subject := "Уведомление о задолженности" - template := "CLAIMDEBT" - channel := "1401" // электронная почта - mailingCode := bc.Lawsuit.NotifyClaimMailingCode - inBlackList := false // TODO Добавить проверку на наличие в чёрном списке - if bc.Lawsuit.Status.Code != "1" || bc.Lawsuit.Contract.Email == "" || inBlackList { - subject = "Досудебная претензия" - template = "CLAIMPRETRIAL" - if bc.Lawsuit.Contract.Email == "" || !bc.Lawsuit.Contract.IsValidEmail { - channel = "1406" // Почта России - } - mailingCode = bc.Lawsuit.NotifyPretrialMailingCode - - attachments := make([]interface{}, 0) - for i := 0; i < len(bc.Files); i++ { - if !strings.Contains(bc.Files[i].Name, "Претензия") { - continue - } - tmp := map[string]interface{}{ - "bucketName": "claim", - // "fileName": bc.Files[i].FileName, // Тут название без с расширением - "fileName": bc.Files[i].Name, // Тут название без расширения - "fileExtension": bc.Files[i].Extension, - "fileSizeByte": bc.Files[i].Size, - "pathToFile": bc.Files[i].FullName, - "eTag": bc.Files[i].FileID, - } - attachments = append(attachments, tmp) - // Получаем только первый файл, поскольку их вообще по БП не должно быть больше - break - } - result["attachments"] = attachments // Вложения - } - - // Курск - https://lkul-kursk.atomsbt.ru/ - // Мурманск – https://lkul-murmansk.atomsbt.ru/ - // Тверь - https://lkul-tver.atomsbt.ru/ - // Смоленск - https://lkul-smolensk.atomsbt.ru/ - // Хакасия - https://lkul-khakasia.atomsbt.ru/ - lkLink := bc.Lawsuit.Branch.PersonalAreaLink - - result["StageCode"] = bc.Lawsuit.Stage.Code // Этап - result["StatusCode"] = bc.Lawsuit.Status.Code // Статус - result["mailingCode"] = mailingCode // TODO Код рассылка "CLAIM20221004T112001" Обязательно в таком формате - result["templateCode"] = template // TODO Код шаблона (имя-строка на стороне уведомлений) - result["channelCode"] = channel // TODO Канал доставки - result["lkLink"] = lkLink // Ссылка на Личный кабинет - result["claimDate"] = formatDate(bc.Lawsuit.ClaimAt) // Дата формирования претензии+3 к.д. - result["claimPretrialDate"] = formatDate(bc.Lawsuit.PretrialAt) // Дата формирования досудебной претензии+5 к.д. - result["contactInfo"] = bc.Lawsuit.Contract.Email // Endpoint абонента - result["contractDate"] = formatDate(bc.Lawsuit.Contract.SignAt) // Дата договора - result["contractNumber"] = bc.Lawsuit.Contract.Number // Номер договора - result["dbtDate"] = bc.Lawsuit.DateFrom.Format("2006-01-02") // Период - result["dbtDateStr"] = russianDate(bc.Lawsuit.DateFrom, true) // TODO Переделать на строку Период строкой - result["dbtSum"] = Currency(bc.Lawsuit.DebtSum) // TODO Сумма образовавшейся задолженности - result["dbtSumFull"] = Currency(dbtSumFull) // Общая сумма долга - result["dbtSumPeriod"] = Currency(bc.Lawsuit.DebtSum) // Сумма долга за период - result["mailingSubject"] = subject // Заголовок письма - result["infoPhone"] = bc.Lawsuit.Contract.Organization.Phone // Телефон абонента - result["isOrganisationAcc"] = "1" // Если организация - // Организация - if strings.Trim(bc.Lawsuit.Contract.Organization.FullName, " ") == "" { - result["organisation"] = bc.Lawsuit.Contract.Organization.Name - } else { - result["organisation"] = bc.Lawsuit.Contract.Organization.FullName - } - result["persAcc"] = bc.Lawsuit.Contract.Number // Лицевой счёт / номер договора - result["userAddress"] = bc.Lawsuit.Contract.Organization.PostAddress // Почтовый адрес абонента - - return result, nil -} - -// WhiteListView Белый список договоров -func WhiteListView(cwl *ContractWhiteList) (object_view.ViewMap, error) { - result := object_view.ViewMap{} - - for i := 0; i < len(*cwl); i++ { - item := (*cwl)[i] - - dateFrom := formatDate(item.DateFrom) - dateTo := formatDate(item.DateTo) - - if item.DateFrom.Year() <= 2000 { - dateFrom = "" - } - if item.DateTo.Year() >= 2100 { - dateTo = "" - } - - tmp := map[string]interface{}{ - "ID": item.ID, - "ContractNumber": item.Contract.Number, - "CreatedAt": formatDate(item.CreatedAt), - "CreatedBy": item.CreatedBy.Name, - "DateFrom": dateFrom, - "DateFromDatePicker": item.DateFrom.Format("2006-01-02"), - "DateTo": dateTo, - "DateToDatePicker": item.DateTo.Format("2006-01-02"), - "EDMSLink": item.EDMSLink, - "ModifiedAt": formatDate(item.ModifiedAt), - "ModifiedBy": item.ModifiedBy.Name, - "OrganizationCategory": item.Contract.Category.Name, - "OrganizationINN": item.Contract.Organization.INN, - "OrganizationKPP": item.Contract.Organization.KPP, - "OrganizationName": item.Contract.Organization.Name, - "Reason": item.Reason, - "IsDeleted": item.IsDeleted, - "DeletedAt": formatDate(item.DeletedAt), - } - result.Append(fmt.Sprintf("%v", i), tmp) - } - - return result, nil -} - -// BlackListView Белый список договоров -func BlackListView(cbl *ContractBlackList) (object_view.ViewMap, error) { - result := object_view.ViewMap{} - - for i := 0; i < len(*cbl); i++ { - item := (*cbl)[i] - - dateFrom := formatDate(item.DateFrom) - dateTo := formatDate(item.DateTo) - - if item.DateFrom.Year() <= 2000 { - dateFrom = "" - } - if item.DateTo.Year() >= 2100 { - dateTo = "" - } - - tmp := map[string]interface{}{ - "ID": item.ID, - "ContractNumber": item.Contract.Number, - "CreatedAt": formatDate(item.CreatedAt), - "CreatedBy": item.CreatedBy.Name, - "DateFrom": dateFrom, - "DateFromDatePicker": item.DateFrom.Format("2006-01-02"), - "DateTo": dateTo, - "DateToDatePicker": item.DateTo.Format("2006-01-02"), - "EDMSLink": item.EDMSLink, - "ModifiedAt": formatDate(item.ModifiedAt), - "ModifiedBy": item.ModifiedBy.Name, - "OrganizationCategory": item.Contract.Category.Name, - "OrganizationINN": item.Contract.Organization.INN, - "OrganizationKPP": item.Contract.Organization.KPP, - "OrganizationName": item.Contract.Organization.Name, - "Reason": item.Reason, - "IsDeleted": item.IsDeleted, - "DeletedAt": formatDate(item.DeletedAt), - } - result.Append(fmt.Sprintf("%v", i), tmp) - } - - return result, nil -} - -// HashtagListView Список хештегов -func HashtagListView(hl *HashtagList) (object_view.ViewMap, error) { - result := object_view.ViewMap{} - - for i := 0; i < len(*hl); i++ { - item := (*hl)[i] - - tmp := map[string]interface{}{ - "ID": item.ID, - "Name": item.Name, - } - result.Append(fmt.Sprintf("%v", i), tmp) - } - - return result, nil -} - -// =========================================================================== + return false +}*/ func Currency(number float64) string { tmp := fmt.Sprintf("%d", int64(number)) @@ -2154,39 +50,3 @@ func formatDate(date time.Time) string { func formatTime(date time.Time) string { return date.Format("02.01.2006 15:04:05") } - -func russianDate(date time.Time, long bool) string { - months := make(map[int]string, 0) - if long { - months[1] = "январь" - months[2] = "февраль" - months[3] = "март" - months[4] = "апрель" - months[5] = "май" - months[6] = "июнь" - months[7] = "июль" - months[8] = "август" - months[9] = "сентябрь" - months[10] = "октябрь" - months[11] = "ноябрь" - months[12] = "декабрь" - } else { - months[1] = "янв" - months[2] = "февр" - months[3] = "март" - months[4] = "апр" - months[5] = "май" - months[6] = "июнь" - months[7] = "июль" - months[8] = "авг" - months[9] = "сент" - months[10] = "окт" - months[11] = "нояб" - months[12] = "дек" - } - - m := date.Month() - y := date.Year() - - return fmt.Sprintf("%v %v", months[int(m)], y) -} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/organization.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/organization.go new file mode 100644 index 00000000..309614a8 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/organization.go @@ -0,0 +1,65 @@ +package object_model + +import ( + "time" + + "github.com/vmihailenco/msgpack/v5" +) + +// Organization Юридическое лицо (справочник). +type Organization struct { + CommonStruct + NameStruct + GroupStruct + BankruptAt time.Time `json:"bankrupt_at" gorm:"column:bankrupt_at"` + BookkeeperName string `json:"bookkeeper_name" gorm:"column:bookkeeper_name;default:\"\""` + CategoryID int64 `json:"category_id" gorm:"column:category_id;default:null"` + ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` + Email string `json:"email" gorm:"column:email;default:\"\""` + FullName string `json:"full_name" gorm:"column:full_name;default:\"\""` + INN string `json:"inn" gorm:"column:inn;default:\"\""` + IsActive bool `json:"is_active" gorm:"column:is_active;default:false"` + IsBankrupt bool `json:"is_bankrupt" gorm:"column:is_bankrupt;default:false"` + IsLiquidated bool `json:"is_liquidated" gorm:"column:is_liquidated;default:false"` + KPP string `json:"kpp" gorm:"column:kpp;default:\"\""` + LegalAddress string `json:"legal_address" gorm:"column:legal_address;default:\"\""` + LegalTypeID int64 `json:"legal_type_id" gorm:"column:legal_type_id;default:0"` + LiquidateAt time.Time `json:"liquidate_at" gorm:"column:liquidate_at"` + ManagerName string `json:"manager_name" gorm:"column:manager_name;default:\"\""` + OGRN string `json:"ogrn" gorm:"column:ogrn;default:\"\""` + OKATO string `json:"okato" gorm:"column:okato;default:\"\""` + OKPO string `json:"okpo" gorm:"column:okpo;default:\"\""` + Phone string `json:"phone" gorm:"column:phone;default:\"\""` + PostAddress string `json:"post_address" gorm:"column:post_address;default:\"\""` + RegistrationAt time.Time `json:"registration_at" gorm:"column:registration_at;default:null"` + State OrganizationStateType `json:"state" gorm:"-:all"` // Статус организации из НСИ. + StateCode string `json:"state_code" gorm:"column:state_code;default:\"\""` // Код статуса организации из НСИ. + StateID int64 `json:"state_id" gorm:"column:state_id;default:null"` // ID статуса организации из НСИ. + WWW string `json:"www" gorm:"column:www;default:\"\""` + + // LegalType LegalType `json:"legal_type" gorm:"-:all"` // TODO LegalType + + Accounts []Account `json:"accounts" gorm:"-:all"` +} + +// NewOrganization - +func NewOrganization() Organization { + return Organization{} +} + +func AsOrganization(b []byte) (Organization, error) { + c := NewOrganization() + err := msgpack.Unmarshal(b, &c) + if err != nil { + return NewOrganization(), err + } + return c, nil +} + +func OrganizationAsBytes(c *Organization) ([]byte, error) { + b, err := msgpack.Marshal(c) + if err != nil { + return nil, err + } + return b, nil +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/organization_casebook.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/organization_casebook.go new file mode 100644 index 00000000..a77a8043 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/organization_casebook.go @@ -0,0 +1,15 @@ +package object_model + +import ( + "time" +) + +type OrganizationCasebook struct { + CommonStruct + INN string `json:"inn" gorm:"column:inn;default:\"\""` + JSONFileID int64 `json:"json_file_id" gorm:"column:json_file_id;default:null"` + KPP string `json:"kpp" gorm:"column:kpp;default:\"\""` + OrganizationID int64 `json:"organization_id" gorm:"column:organization_id;default:null"` + PDFFileID int64 `json:"pdf_file_id" gorm:"column:pdf_file_id;default:null"` + UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at;default:null"` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/organization_category_type.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/organization_category_type.go new file mode 100644 index 00000000..35d5ca92 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/organization_category_type.go @@ -0,0 +1,9 @@ +package object_model + +// OrganizationCategoryType Категория организаций (справочник). +type OrganizationCategoryType struct { + CommonStruct + NameStruct + GroupStruct + ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/organization_state_type.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/organization_state_type.go new file mode 100644 index 00000000..b44c3eb2 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/organization_state_type.go @@ -0,0 +1,11 @@ +package object_model + +// OrganizationStateType Состояние организации (справочник). +type OrganizationStateType struct { + CommonStruct + NameStruct + Code string `json:"code" gorm:"column:code;default:\"1\""` + ActionIndividual string `json:"action_individual" gorm:"action_individual:code;default:\"none\""` // include exclude none + ActionOrganization string `json:"action_organization" gorm:"action_organization:code;default:\"none\""` // include exclude none + Color string `json:"color" gorm:"color:code;default:\"\""` // red yellow green +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/payment_day.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/payment_day.go new file mode 100644 index 00000000..c0a38779 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/payment_day.go @@ -0,0 +1,15 @@ +package object_model + +import ( + "time" +) + +// PaymentDay День платежа по договору +type PaymentDay struct { + CommonStruct + ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` + ContractID int64 `json:"contract_id" gorm:"column:contract_id;default:null"` + DateFrom time.Time `json:"date_from" gorm:"column:date_from;default:null"` + DateTo time.Time `json:"date_to" gorm:"column:date_to;default:null"` + Day int `json:"day" gorm:"column:day;not null"` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/payment_front.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/payment_front.go new file mode 100644 index 00000000..bf4e2ac7 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/payment_front.go @@ -0,0 +1,19 @@ +package object_model + +// PaymentFront -- платежка для отдачи на фронт +type PaymentFront struct { + Id_ int64 `json:"ID"` // ID платежа + InvoiceId_ int64 `json:"InvoiceID"` // ID с/ф + ClaimNumber_ string `json:"ClaimNumber"` // Номер претензии + DatePayAt_ string `json:"Date"` // Дата оплаты п/п + DateRegistreAt_ string `json:"DistributionDate"` // Дата попадания платежа в систему + IsAfterNotify_ bool `json:"is_payment_after_created"` // Если платеж был после уведомления + Number_ string `json:"Number"` // Номер платежа + Type_ string `json:"Type"` // Тип документа + InvoiceSum_ string `json:"Sum"` // Сумма (должна быть пустой для платежа) + InvoiceCorrectSum_ string `json:"Correction"` // Сумма корректировки если п/п оказалось с/ф + InvoiceDebtSum_ string `json:"DebtSum"` // Сумма задолженности если п/п оказалось с/ф (должно быть пустым для платежа) + Sum_ string `json:"Payment"` // Сумма платежа + InvoiceBalance_ string `json:"Balance"` // Остаток по с/ф после всех оплат (должна быть пустой для платежа) + Note_ string `json:"Note"` // Комментарий к платежу +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/payment_shedule.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/payment_shedule.go new file mode 100644 index 00000000..689a8fdf --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/payment_shedule.go @@ -0,0 +1,16 @@ +package object_model + +import ( + "time" +) + +// PaymentSchedule График платежей по договору +type PaymentSchedule struct { + CommonStruct + ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` + ContractID int64 `json:"contract_id" gorm:"column:contract_id;default:null"` + DateFrom time.Time `json:"date_from" gorm:"column:date_from;default:null"` + DateTo time.Time `json:"date_to" gorm:"column:date_to;default:null"` + Day int `json:"day" gorm:"column:day;not null"` + Percent int `json:"percent" gorm:"column:percent;not null"` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/report_summary.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/report_summary.go new file mode 100644 index 00000000..52a74bc1 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/report_summary.go @@ -0,0 +1,58 @@ +package object_model + +import ( + "github.com/vmihailenco/msgpack/v5" +) + +// ReportSummary Суммарный отчёт (дашборд) +type ReportSummary struct { + // Всего претензий сформировано с начала года + ClaimsTotal int `json:"claims_total" gorm:"-:all"` + ClaimsTotalSum string `json:"claims_total_sum" gorm:"-:all"` + + // В работе (исключая завершённые статусы) + ClaimsInWork int `json:"claims_in_work" gorm:"-:all"` + ClaimsInWorkSum string `json:"claims_in_work_sum" gorm:"-:all"` + + // Завершено на этапе претензии в связи с оплатой с начала года + ClaimsStatus2 int `json:"claims_status_2" gorm:"-:all"` + ClaimsStatus2Sum string `json:"claims_status_2_sum" gorm:"-:all"` + + // Ожидает передачи в исковое производство + ClaimsStatus7 int `json:"claims_status_7" gorm:"-:all"` + ClaimsStatus7Sum string `json:"claims_status_7_sum" gorm:"-:all"` + + // Досудебная претензия, которая на стадии мониторинга с направлением по e-mail + ClaimsChannel1401 int `json:"claims_channel_1401" gorm:"-:all"` + ClaimsChannel1401Sum string `json:"claims_channel_1401_sum" gorm:"-:all"` + + // Досудебная претензия, которая на стадии мониторинга с направлением заказным письмом + ClaimsChannel1406 int `json:"claims_channel_1406" gorm:"-:all"` + ClaimsChannel1406Sum string `json:"claims_channel_1406_sum" gorm:"-:all"` + + // Претензии с платежами не разнесенными на счет-фактуры + ClaimsWithUnknown int `json:"claims_with_unknown" gorm:"-:all"` + ClaimsWithUnknownSum string `json:"claims_with_unknown_sum" gorm:"-:all"` +} + +// NewReportSummary Суммарный отчёт (дашборд) +func NewReportSummary() ReportSummary { + return ReportSummary{} +} + +func AsReportSummary(b []byte) (ReportSummary, error) { + c := NewReportSummary() + err := msgpack.Unmarshal(b, &c) + if err != nil { + return NewReportSummary(), err + } + return c, nil +} + +func ReportSummaryAsBytes(c *ReportSummary) ([]byte, error) { + b, err := msgpack.Marshal(c) + if err != nil { + return nil, err + } + return b, nil +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/service_provider.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/service_provider.go new file mode 100644 index 00000000..16950eda --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/service_provider.go @@ -0,0 +1,14 @@ +package object_model + +import ( + "time" +) + +// ServiceProvider Поставщик услуг (справочник). +type ServiceProvider struct { + CommonStruct + OrganizationID int64 `json:"organization_id" gorm:"column:organization_id;default:null"` + ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` + DateFrom time.Time `json:"date_from" gorm:"column:date_from;default:null"` + DateTo time.Time `json:"date_to" gorm:"column:date_to;default:null"` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/service_type.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/service_type.go new file mode 100644 index 00000000..31850e3f --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/service_type.go @@ -0,0 +1,13 @@ +package object_model + +// ServiceType Типы услуг (справочник). +type ServiceType struct { + CommonStruct + NameStruct + GroupStruct + Code int `json:"code" gorm:"column:code;default:0"` + FullName string `json:"full_name" gorm:"column:full_name;default:\"\""` + Measure string `json:"measure" gorm:"column:measure;default:\"\""` + ServiceProviderID int64 `json:"service_provider_id" gorm:"column:service_provider_id;default:null"` + ConnectionID int64 `json:"connection_id" gorm:"column:connection_id;default:null"` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/state_duty.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/state_duty.go new file mode 100644 index 00000000..1f788a72 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/state_duty.go @@ -0,0 +1,17 @@ +package object_model + +import ( + "time" +) + +// StateDuty Госпошлина +type StateDuty struct { + CommonStruct + GroupStruct + NameStruct + Sum float64 `json:"sum" gorm:"column:sum;default:null"` + RequestNumber string `json:"request_number" gorm:"column:request_number;default:\"\""` + RequestDate time.Time `json:"request_date" gorm:"column:request_date;default:null"` + CourtID int64 `json:"court_id" gorm:"column:court_id;default:null"` + LawsuitID int64 `json:"lawsuit_id" gorm:"column:lawsuit_id;default:null"` +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/table_name.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/table_name.go new file mode 100644 index 00000000..2a9d90c7 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/table_name.go @@ -0,0 +1,7 @@ +package object_model + +// TableName объект позволяющий привязать такие компоненты как комментарий или файл к разным объектам +type TableName struct { + CommonStruct + NameStruct +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/type_ref.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/type_ref.go new file mode 100644 index 00000000..12fbca58 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/type_ref.go @@ -0,0 +1,48 @@ +package object_model + +import ( + "github.com/vmihailenco/msgpack/v5" +) + +// TypeRef общие, как правило, фиксированные справочники +type TypeRef struct { + ChannelTypes []ChannelType `json:"channel_types"` // 1. Каналы сообщений + ClaimTypes []ClaimType `json:"claim_types"` // 2. Типы дел + ContractCategoryTypes []ContractCategoryType `json:"contract_category_types"` // 3. Категории договоров + DebtTypes []DebtType `json:"debt_types"` // 4. Типы задолженностей + DirectionTypes []DirectionType `json:"direction_types"` // 5. Направления сообщений + DocumentLinkTypes []DocumentLinkType `json:"document_link_types"` // 6. Типы связей документов + DocumentTypes []DocumentType `json:"document_types"` // 7. Типы документов + FileTypes []FileType `json:"file_types"` // 8. Типы файлов + GenderTypes []GenderType `json:"gender_types"` // 9. Пол + LawsuitReasonTypes []LawsuitReasonType `json:"lawsuit_reason_types"` // 10. Причина отбора для претензии (Справочник). + LawsuitStageTypes []LawsuitStageType `json:"lawsuit_stage_types"` // 11. Этапы дел (справочник). + LawsuitStatusTypes []LawsuitStatusType `json:"lawsuit_status_types"` // 12. Статусы дел (справочник). + LegalTypes []LegalType `json:"legal_types"` // 13. Тип юридического лица + OrganizationCategoryTypes []OrganizationCategoryType `json:"organization_category_types"` // 14. Категории организаций + OrganizationStateTypes []OrganizationStateType `json:"organization_state_types"` // 15. Состояния организаций + ServiceTypes []ServiceType `json:"service_types"` // 16. Типы услуг + TableNames []TableName `json:"table_names"` // 17. Имена таблиц для привязок +} + +// NewTypeRef Новый набор справочников типов +func NewTypeRef() TypeRef { + return TypeRef{} +} + +func AsTypeRef(b []byte) (TypeRef, error) { + c := NewTypeRef() + err := msgpack.Unmarshal(b, &c) + if err != nil { + return NewTypeRef(), err + } + return c, nil +} + +func TypeRefAsBytes(c *TypeRef) ([]byte, error) { + b, err := msgpack.Marshal(c) + if err != nil { + return nil, err + } + return b, nil +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/user_role.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/user_role.go new file mode 100644 index 00000000..4ca6e38f --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/common/object_model/user_role.go @@ -0,0 +1,7 @@ +package object_model + +// UserRole Роль (справочник). +type UserRole struct { + CommonStruct + NameStruct +} diff --git a/vendor/go.mau.fi/whatsmeow/.editorconfig b/vendor/go.mau.fi/whatsmeow/.editorconfig new file mode 100644 index 00000000..d7ab7302 --- /dev/null +++ b/vendor/go.mau.fi/whatsmeow/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.{yaml,yml}] +indent_style = space +indent_size = 2 diff --git a/vendor/go.mau.fi/whatsmeow/binary/proto/def.pb.go b/vendor/go.mau.fi/whatsmeow/binary/proto/def.pb.go index 9a8cae49..e31b6c6a 100644 --- a/vendor/go.mau.fi/whatsmeow/binary/proto/def.pb.go +++ b/vendor/go.mau.fi/whatsmeow/binary/proto/def.pb.go @@ -285,6 +285,7 @@ const ( DeviceProps_WEAR_OS DeviceProps_PlatformType = 18 DeviceProps_AR_WRIST DeviceProps_PlatformType = 19 DeviceProps_AR_DEVICE DeviceProps_PlatformType = 20 + DeviceProps_UWP DeviceProps_PlatformType = 21 ) // Enum value maps for DeviceProps_PlatformType. @@ -311,6 +312,7 @@ var ( 18: "WEAR_OS", 19: "AR_WRIST", 20: "AR_DEVICE", + 21: "UWP", } DeviceProps_PlatformType_value = map[string]int32{ "UNKNOWN": 0, @@ -334,6 +336,7 @@ var ( "WEAR_OS": 18, "AR_WRIST": 19, "AR_DEVICE": 20, + "UWP": 21, } ) @@ -374,68 +377,6 @@ func (DeviceProps_PlatformType) EnumDescriptor() ([]byte, []int) { return file_binary_proto_def_proto_rawDescGZIP(), []int{5, 0} } -type PaymentInviteMessage_ServiceType int32 - -const ( - PaymentInviteMessage_UNKNOWN PaymentInviteMessage_ServiceType = 0 - PaymentInviteMessage_FBPAY PaymentInviteMessage_ServiceType = 1 - PaymentInviteMessage_NOVI PaymentInviteMessage_ServiceType = 2 - PaymentInviteMessage_UPI PaymentInviteMessage_ServiceType = 3 -) - -// Enum value maps for PaymentInviteMessage_ServiceType. -var ( - PaymentInviteMessage_ServiceType_name = map[int32]string{ - 0: "UNKNOWN", - 1: "FBPAY", - 2: "NOVI", - 3: "UPI", - } - PaymentInviteMessage_ServiceType_value = map[string]int32{ - "UNKNOWN": 0, - "FBPAY": 1, - "NOVI": 2, - "UPI": 3, - } -) - -func (x PaymentInviteMessage_ServiceType) Enum() *PaymentInviteMessage_ServiceType { - p := new(PaymentInviteMessage_ServiceType) - *p = x - return p -} - -func (x PaymentInviteMessage_ServiceType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (PaymentInviteMessage_ServiceType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[5].Descriptor() -} - -func (PaymentInviteMessage_ServiceType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[5] -} - -func (x PaymentInviteMessage_ServiceType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *PaymentInviteMessage_ServiceType) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = PaymentInviteMessage_ServiceType(num) - return nil -} - -// Deprecated: Use PaymentInviteMessage_ServiceType.Descriptor instead. -func (PaymentInviteMessage_ServiceType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{6, 0} -} - type OrderMessage_OrderSurface int32 const ( @@ -463,11 +404,11 @@ func (x OrderMessage_OrderSurface) String() string { } func (OrderMessage_OrderSurface) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[6].Descriptor() + return file_binary_proto_def_proto_enumTypes[5].Descriptor() } func (OrderMessage_OrderSurface) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[6] + return &file_binary_proto_def_proto_enumTypes[5] } func (x OrderMessage_OrderSurface) Number() protoreflect.EnumNumber { @@ -486,7 +427,7 @@ func (x *OrderMessage_OrderSurface) UnmarshalJSON(b []byte) error { // Deprecated: Use OrderMessage_OrderSurface.Descriptor instead. func (OrderMessage_OrderSurface) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{7, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{6, 0} } type OrderMessage_OrderStatus int32 @@ -516,11 +457,11 @@ func (x OrderMessage_OrderStatus) String() string { } func (OrderMessage_OrderStatus) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[7].Descriptor() + return file_binary_proto_def_proto_enumTypes[6].Descriptor() } func (OrderMessage_OrderStatus) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[7] + return &file_binary_proto_def_proto_enumTypes[6] } func (x OrderMessage_OrderStatus) Number() protoreflect.EnumNumber { @@ -539,7 +480,7 @@ func (x *OrderMessage_OrderStatus) UnmarshalJSON(b []byte) error { // Deprecated: Use OrderMessage_OrderStatus.Descriptor instead. func (OrderMessage_OrderStatus) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{7, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{6, 1} } type ListResponseMessage_ListType int32 @@ -572,11 +513,11 @@ func (x ListResponseMessage_ListType) String() string { } func (ListResponseMessage_ListType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[8].Descriptor() + return file_binary_proto_def_proto_enumTypes[7].Descriptor() } func (ListResponseMessage_ListType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[8] + return &file_binary_proto_def_proto_enumTypes[7] } func (x ListResponseMessage_ListType) Number() protoreflect.EnumNumber { @@ -595,7 +536,7 @@ func (x *ListResponseMessage_ListType) UnmarshalJSON(b []byte) error { // Deprecated: Use ListResponseMessage_ListType.Descriptor instead. func (ListResponseMessage_ListType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{10, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{9, 0} } type ListMessage_ListType int32 @@ -631,11 +572,11 @@ func (x ListMessage_ListType) String() string { } func (ListMessage_ListType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[9].Descriptor() + return file_binary_proto_def_proto_enumTypes[8].Descriptor() } func (ListMessage_ListType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[9] + return &file_binary_proto_def_proto_enumTypes[8] } func (x ListMessage_ListType) Number() protoreflect.EnumNumber { @@ -654,7 +595,7 @@ func (x *ListMessage_ListType) UnmarshalJSON(b []byte) error { // Deprecated: Use ListMessage_ListType.Descriptor instead. func (ListMessage_ListType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{11, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{10, 0} } type InvoiceMessage_AttachmentType int32 @@ -687,11 +628,11 @@ func (x InvoiceMessage_AttachmentType) String() string { } func (InvoiceMessage_AttachmentType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[10].Descriptor() + return file_binary_proto_def_proto_enumTypes[9].Descriptor() } func (InvoiceMessage_AttachmentType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[10] + return &file_binary_proto_def_proto_enumTypes[9] } func (x InvoiceMessage_AttachmentType) Number() protoreflect.EnumNumber { @@ -710,7 +651,7 @@ func (x *InvoiceMessage_AttachmentType) UnmarshalJSON(b []byte) error { // Deprecated: Use InvoiceMessage_AttachmentType.Descriptor instead. func (InvoiceMessage_AttachmentType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{13, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{12, 0} } type InteractiveResponseMessage_Body_Format int32 @@ -743,11 +684,11 @@ func (x InteractiveResponseMessage_Body_Format) String() string { } func (InteractiveResponseMessage_Body_Format) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[11].Descriptor() + return file_binary_proto_def_proto_enumTypes[10].Descriptor() } func (InteractiveResponseMessage_Body_Format) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[11] + return &file_binary_proto_def_proto_enumTypes[10] } func (x InteractiveResponseMessage_Body_Format) Number() protoreflect.EnumNumber { @@ -766,7 +707,7 @@ func (x *InteractiveResponseMessage_Body_Format) UnmarshalJSON(b []byte) error { // Deprecated: Use InteractiveResponseMessage_Body_Format.Descriptor instead. func (InteractiveResponseMessage_Body_Format) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{14, 1, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{13, 1, 0} } type InteractiveMessage_ShopMessage_Surface int32 @@ -805,11 +746,11 @@ func (x InteractiveMessage_ShopMessage_Surface) String() string { } func (InteractiveMessage_ShopMessage_Surface) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[12].Descriptor() + return file_binary_proto_def_proto_enumTypes[11].Descriptor() } func (InteractiveMessage_ShopMessage_Surface) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[12] + return &file_binary_proto_def_proto_enumTypes[11] } func (x InteractiveMessage_ShopMessage_Surface) Number() protoreflect.EnumNumber { @@ -828,7 +769,7 @@ func (x *InteractiveMessage_ShopMessage_Surface) UnmarshalJSON(b []byte) error { // Deprecated: Use InteractiveMessage_ShopMessage_Surface.Descriptor instead. func (InteractiveMessage_ShopMessage_Surface) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{15, 0, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{14, 0, 0} } type HistorySyncNotification_HistorySyncType int32 @@ -876,11 +817,11 @@ func (x HistorySyncNotification_HistorySyncType) String() string { } func (HistorySyncNotification_HistorySyncType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[13].Descriptor() + return file_binary_proto_def_proto_enumTypes[12].Descriptor() } func (HistorySyncNotification_HistorySyncType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[13] + return &file_binary_proto_def_proto_enumTypes[12] } func (x HistorySyncNotification_HistorySyncType) Number() protoreflect.EnumNumber { @@ -899,7 +840,7 @@ func (x *HistorySyncNotification_HistorySyncType) UnmarshalJSON(b []byte) error // Deprecated: Use HistorySyncNotification_HistorySyncType.Descriptor instead. func (HistorySyncNotification_HistorySyncType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{18, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{17, 0} } type HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent_DayOfWeekType int32 @@ -947,11 +888,11 @@ func (x HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeC } func (HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent_DayOfWeekType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[14].Descriptor() + return file_binary_proto_def_proto_enumTypes[13].Descriptor() } func (HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent_DayOfWeekType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[14] + return &file_binary_proto_def_proto_enumTypes[13] } func (x HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent_DayOfWeekType) Number() protoreflect.EnumNumber { @@ -970,7 +911,7 @@ func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTime // Deprecated: Use HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent_DayOfWeekType.Descriptor instead. func (HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent_DayOfWeekType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{19, 0, 0, 1, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{18, 0, 0, 1, 0} } type HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent_CalendarType int32 @@ -1003,11 +944,11 @@ func (x HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeC } func (HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent_CalendarType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[15].Descriptor() + return file_binary_proto_def_proto_enumTypes[14].Descriptor() } func (HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent_CalendarType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[15] + return &file_binary_proto_def_proto_enumTypes[14] } func (x HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent_CalendarType) Number() protoreflect.EnumNumber { @@ -1026,7 +967,7 @@ func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTime // Deprecated: Use HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent_CalendarType.Descriptor instead. func (HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent_CalendarType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{19, 0, 0, 1, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{18, 0, 0, 1, 1} } type GroupInviteMessage_GroupType int32 @@ -1059,11 +1000,11 @@ func (x GroupInviteMessage_GroupType) String() string { } func (GroupInviteMessage_GroupType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[16].Descriptor() + return file_binary_proto_def_proto_enumTypes[15].Descriptor() } func (GroupInviteMessage_GroupType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[16] + return &file_binary_proto_def_proto_enumTypes[15] } func (x GroupInviteMessage_GroupType) Number() protoreflect.EnumNumber { @@ -1082,7 +1023,7 @@ func (x *GroupInviteMessage_GroupType) UnmarshalJSON(b []byte) error { // Deprecated: Use GroupInviteMessage_GroupType.Descriptor instead. func (GroupInviteMessage_GroupType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{20, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{19, 0} } type ExtendedTextMessage_PreviewType int32 @@ -1115,11 +1056,11 @@ func (x ExtendedTextMessage_PreviewType) String() string { } func (ExtendedTextMessage_PreviewType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[17].Descriptor() + return file_binary_proto_def_proto_enumTypes[16].Descriptor() } func (ExtendedTextMessage_PreviewType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[17] + return &file_binary_proto_def_proto_enumTypes[16] } func (x ExtendedTextMessage_PreviewType) Number() protoreflect.EnumNumber { @@ -1138,7 +1079,7 @@ func (x *ExtendedTextMessage_PreviewType) UnmarshalJSON(b []byte) error { // Deprecated: Use ExtendedTextMessage_PreviewType.Descriptor instead. func (ExtendedTextMessage_PreviewType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{22, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{21, 0} } type ExtendedTextMessage_InviteLinkGroupType int32 @@ -1177,11 +1118,11 @@ func (x ExtendedTextMessage_InviteLinkGroupType) String() string { } func (ExtendedTextMessage_InviteLinkGroupType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[18].Descriptor() + return file_binary_proto_def_proto_enumTypes[17].Descriptor() } func (ExtendedTextMessage_InviteLinkGroupType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[18] + return &file_binary_proto_def_proto_enumTypes[17] } func (x ExtendedTextMessage_InviteLinkGroupType) Number() protoreflect.EnumNumber { @@ -1200,7 +1141,7 @@ func (x *ExtendedTextMessage_InviteLinkGroupType) UnmarshalJSON(b []byte) error // Deprecated: Use ExtendedTextMessage_InviteLinkGroupType.Descriptor instead. func (ExtendedTextMessage_InviteLinkGroupType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{22, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{21, 1} } type ExtendedTextMessage_FontType int32 @@ -1260,11 +1201,11 @@ func (x ExtendedTextMessage_FontType) String() string { } func (ExtendedTextMessage_FontType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[19].Descriptor() + return file_binary_proto_def_proto_enumTypes[18].Descriptor() } func (ExtendedTextMessage_FontType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[19] + return &file_binary_proto_def_proto_enumTypes[18] } func (x ExtendedTextMessage_FontType) Number() protoreflect.EnumNumber { @@ -1283,7 +1224,7 @@ func (x *ExtendedTextMessage_FontType) UnmarshalJSON(b []byte) error { // Deprecated: Use ExtendedTextMessage_FontType.Descriptor instead. func (ExtendedTextMessage_FontType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{22, 2} + return file_binary_proto_def_proto_rawDescGZIP(), []int{21, 2} } type ButtonsResponseMessage_Type int32 @@ -1316,11 +1257,11 @@ func (x ButtonsResponseMessage_Type) String() string { } func (ButtonsResponseMessage_Type) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[20].Descriptor() + return file_binary_proto_def_proto_enumTypes[19].Descriptor() } func (ButtonsResponseMessage_Type) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[20] + return &file_binary_proto_def_proto_enumTypes[19] } func (x ButtonsResponseMessage_Type) Number() protoreflect.EnumNumber { @@ -1339,7 +1280,7 @@ func (x *ButtonsResponseMessage_Type) UnmarshalJSON(b []byte) error { // Deprecated: Use ButtonsResponseMessage_Type.Descriptor instead. func (ButtonsResponseMessage_Type) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{32, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{31, 0} } type ButtonsMessage_HeaderType int32 @@ -1387,11 +1328,11 @@ func (x ButtonsMessage_HeaderType) String() string { } func (ButtonsMessage_HeaderType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[21].Descriptor() + return file_binary_proto_def_proto_enumTypes[20].Descriptor() } func (ButtonsMessage_HeaderType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[21] + return &file_binary_proto_def_proto_enumTypes[20] } func (x ButtonsMessage_HeaderType) Number() protoreflect.EnumNumber { @@ -1410,7 +1351,7 @@ func (x *ButtonsMessage_HeaderType) UnmarshalJSON(b []byte) error { // Deprecated: Use ButtonsMessage_HeaderType.Descriptor instead. func (ButtonsMessage_HeaderType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{33, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{32, 0} } type ButtonsMessage_Button_Type int32 @@ -1446,11 +1387,11 @@ func (x ButtonsMessage_Button_Type) String() string { } func (ButtonsMessage_Button_Type) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[22].Descriptor() + return file_binary_proto_def_proto_enumTypes[21].Descriptor() } func (ButtonsMessage_Button_Type) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[22] + return &file_binary_proto_def_proto_enumTypes[21] } func (x ButtonsMessage_Button_Type) Number() protoreflect.EnumNumber { @@ -1469,7 +1410,78 @@ func (x *ButtonsMessage_Button_Type) UnmarshalJSON(b []byte) error { // Deprecated: Use ButtonsMessage_Button_Type.Descriptor instead. func (ButtonsMessage_Button_Type) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{33, 0, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{32, 0, 0} +} + +type BotFeedbackMessage_BotFeedbackKind int32 + +const ( + BotFeedbackMessage_BOT_FEEDBACK_POSITIVE BotFeedbackMessage_BotFeedbackKind = 0 + BotFeedbackMessage_BOT_FEEDBACK_NEGATIVE_GENERIC BotFeedbackMessage_BotFeedbackKind = 1 + BotFeedbackMessage_BOT_FEEDBACK_NEGATIVE_HELPFUL BotFeedbackMessage_BotFeedbackKind = 2 + BotFeedbackMessage_BOT_FEEDBACK_NEGATIVE_INTERESTING BotFeedbackMessage_BotFeedbackKind = 3 + BotFeedbackMessage_BOT_FEEDBACK_NEGATIVE_ACCURATE BotFeedbackMessage_BotFeedbackKind = 4 + BotFeedbackMessage_BOT_FEEDBACK_NEGATIVE_SAFE BotFeedbackMessage_BotFeedbackKind = 5 + BotFeedbackMessage_BOT_FEEDBACK_NEGATIVE_OTHER BotFeedbackMessage_BotFeedbackKind = 6 +) + +// Enum value maps for BotFeedbackMessage_BotFeedbackKind. +var ( + BotFeedbackMessage_BotFeedbackKind_name = map[int32]string{ + 0: "BOT_FEEDBACK_POSITIVE", + 1: "BOT_FEEDBACK_NEGATIVE_GENERIC", + 2: "BOT_FEEDBACK_NEGATIVE_HELPFUL", + 3: "BOT_FEEDBACK_NEGATIVE_INTERESTING", + 4: "BOT_FEEDBACK_NEGATIVE_ACCURATE", + 5: "BOT_FEEDBACK_NEGATIVE_SAFE", + 6: "BOT_FEEDBACK_NEGATIVE_OTHER", + } + BotFeedbackMessage_BotFeedbackKind_value = map[string]int32{ + "BOT_FEEDBACK_POSITIVE": 0, + "BOT_FEEDBACK_NEGATIVE_GENERIC": 1, + "BOT_FEEDBACK_NEGATIVE_HELPFUL": 2, + "BOT_FEEDBACK_NEGATIVE_INTERESTING": 3, + "BOT_FEEDBACK_NEGATIVE_ACCURATE": 4, + "BOT_FEEDBACK_NEGATIVE_SAFE": 5, + "BOT_FEEDBACK_NEGATIVE_OTHER": 6, + } +) + +func (x BotFeedbackMessage_BotFeedbackKind) Enum() *BotFeedbackMessage_BotFeedbackKind { + p := new(BotFeedbackMessage_BotFeedbackKind) + *p = x + return p +} + +func (x BotFeedbackMessage_BotFeedbackKind) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (BotFeedbackMessage_BotFeedbackKind) Descriptor() protoreflect.EnumDescriptor { + return file_binary_proto_def_proto_enumTypes[22].Descriptor() +} + +func (BotFeedbackMessage_BotFeedbackKind) Type() protoreflect.EnumType { + return &file_binary_proto_def_proto_enumTypes[22] +} + +func (x BotFeedbackMessage_BotFeedbackKind) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *BotFeedbackMessage_BotFeedbackKind) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = BotFeedbackMessage_BotFeedbackKind(num) + return nil +} + +// Deprecated: Use BotFeedbackMessage_BotFeedbackKind.Descriptor instead. +func (BotFeedbackMessage_BotFeedbackKind) EnumDescriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{33, 0} } type DisappearingMode_Initiator int32 @@ -1702,7 +1714,7 @@ func (x *PaymentBackground_Type) UnmarshalJSON(b []byte) error { // Deprecated: Use PaymentBackground_Type.Descriptor instead. func (PaymentBackground_Type) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{52, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{54, 0} } type VideoMessage_Attribution int32 @@ -1761,7 +1773,7 @@ func (x *VideoMessage_Attribution) UnmarshalJSON(b []byte) error { // Deprecated: Use VideoMessage_Attribution.Descriptor instead. func (VideoMessage_Attribution) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{56, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{59, 0} } type ScheduledCallEditMessage_EditType int32 @@ -1817,7 +1829,7 @@ func (x *ScheduledCallEditMessage_EditType) UnmarshalJSON(b []byte) error { // Deprecated: Use ScheduledCallEditMessage_EditType.Descriptor instead. func (ScheduledCallEditMessage_EditType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{63, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{66, 0} } type ScheduledCallCreationMessage_CallType int32 @@ -1876,7 +1888,7 @@ func (x *ScheduledCallCreationMessage_CallType) UnmarshalJSON(b []byte) error { // Deprecated: Use ScheduledCallCreationMessage_CallType.Descriptor instead. func (ScheduledCallCreationMessage_CallType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{64, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{67, 0} } type ProtocolMessage_Type int32 @@ -1895,6 +1907,8 @@ const ( ProtocolMessage_MESSAGE_EDIT ProtocolMessage_Type = 14 ProtocolMessage_PEER_DATA_OPERATION_REQUEST_MESSAGE ProtocolMessage_Type = 16 ProtocolMessage_PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE ProtocolMessage_Type = 17 + ProtocolMessage_REQUEST_WELCOME_MESSAGE ProtocolMessage_Type = 18 + ProtocolMessage_BOT_FEEDBACK_MESSAGE ProtocolMessage_Type = 19 ) // Enum value maps for ProtocolMessage_Type. @@ -1913,6 +1927,8 @@ var ( 14: "MESSAGE_EDIT", 16: "PEER_DATA_OPERATION_REQUEST_MESSAGE", 17: "PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE", + 18: "REQUEST_WELCOME_MESSAGE", + 19: "BOT_FEEDBACK_MESSAGE", } ProtocolMessage_Type_value = map[string]int32{ "REVOKE": 0, @@ -1928,6 +1944,8 @@ var ( "MESSAGE_EDIT": 14, "PEER_DATA_OPERATION_REQUEST_MESSAGE": 16, "PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE": 17, + "REQUEST_WELCOME_MESSAGE": 18, + "BOT_FEEDBACK_MESSAGE": 19, } ) @@ -1965,7 +1983,7 @@ func (x *ProtocolMessage_Type) UnmarshalJSON(b []byte) error { // Deprecated: Use ProtocolMessage_Type.Descriptor instead. func (ProtocolMessage_Type) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{68, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{71, 0} } type PinInChatMessage_Type int32 @@ -2024,7 +2042,69 @@ func (x *PinInChatMessage_Type) UnmarshalJSON(b []byte) error { // Deprecated: Use PinInChatMessage_Type.Descriptor instead. func (PinInChatMessage_Type) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{75, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{78, 0} +} + +type PaymentInviteMessage_ServiceType int32 + +const ( + PaymentInviteMessage_UNKNOWN PaymentInviteMessage_ServiceType = 0 + PaymentInviteMessage_FBPAY PaymentInviteMessage_ServiceType = 1 + PaymentInviteMessage_NOVI PaymentInviteMessage_ServiceType = 2 + PaymentInviteMessage_UPI PaymentInviteMessage_ServiceType = 3 +) + +// Enum value maps for PaymentInviteMessage_ServiceType. +var ( + PaymentInviteMessage_ServiceType_name = map[int32]string{ + 0: "UNKNOWN", + 1: "FBPAY", + 2: "NOVI", + 3: "UPI", + } + PaymentInviteMessage_ServiceType_value = map[string]int32{ + "UNKNOWN": 0, + "FBPAY": 1, + "NOVI": 2, + "UPI": 3, + } +) + +func (x PaymentInviteMessage_ServiceType) Enum() *PaymentInviteMessage_ServiceType { + p := new(PaymentInviteMessage_ServiceType) + *p = x + return p +} + +func (x PaymentInviteMessage_ServiceType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PaymentInviteMessage_ServiceType) Descriptor() protoreflect.EnumDescriptor { + return file_binary_proto_def_proto_enumTypes[32].Descriptor() +} + +func (PaymentInviteMessage_ServiceType) Type() protoreflect.EnumType { + return &file_binary_proto_def_proto_enumTypes[32] +} + +func (x PaymentInviteMessage_ServiceType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *PaymentInviteMessage_ServiceType) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = PaymentInviteMessage_ServiceType(num) + return nil +} + +// Deprecated: Use PaymentInviteMessage_ServiceType.Descriptor instead. +func (PaymentInviteMessage_ServiceType) EnumDescriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{81, 0} } type PastParticipant_LeaveReason int32 @@ -2057,11 +2137,11 @@ func (x PastParticipant_LeaveReason) String() string { } func (PastParticipant_LeaveReason) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[32].Descriptor() + return file_binary_proto_def_proto_enumTypes[33].Descriptor() } func (PastParticipant_LeaveReason) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[32] + return &file_binary_proto_def_proto_enumTypes[33] } func (x PastParticipant_LeaveReason) Number() protoreflect.EnumNumber { @@ -2080,7 +2160,7 @@ func (x *PastParticipant_LeaveReason) UnmarshalJSON(b []byte) error { // Deprecated: Use PastParticipant_LeaveReason.Descriptor instead. func (PastParticipant_LeaveReason) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{83, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{87, 0} } type HistorySync_HistorySyncType int32 @@ -2128,11 +2208,11 @@ func (x HistorySync_HistorySyncType) String() string { } func (HistorySync_HistorySyncType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[33].Descriptor() + return file_binary_proto_def_proto_enumTypes[34].Descriptor() } func (HistorySync_HistorySyncType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[33] + return &file_binary_proto_def_proto_enumTypes[34] } func (x HistorySync_HistorySyncType) Number() protoreflect.EnumNumber { @@ -2151,7 +2231,7 @@ func (x *HistorySync_HistorySyncType) UnmarshalJSON(b []byte) error { // Deprecated: Use HistorySync_HistorySyncType.Descriptor instead. func (HistorySync_HistorySyncType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{85, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{89, 0} } type GroupParticipant_Rank int32 @@ -2187,11 +2267,11 @@ func (x GroupParticipant_Rank) String() string { } func (GroupParticipant_Rank) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[34].Descriptor() + return file_binary_proto_def_proto_enumTypes[35].Descriptor() } func (GroupParticipant_Rank) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[34] + return &file_binary_proto_def_proto_enumTypes[35] } func (x GroupParticipant_Rank) Number() protoreflect.EnumNumber { @@ -2210,7 +2290,7 @@ func (x *GroupParticipant_Rank) UnmarshalJSON(b []byte) error { // Deprecated: Use GroupParticipant_Rank.Descriptor instead. func (GroupParticipant_Rank) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{87, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{91, 0} } type Conversation_EndOfHistoryTransferType int32 @@ -2246,11 +2326,11 @@ func (x Conversation_EndOfHistoryTransferType) String() string { } func (Conversation_EndOfHistoryTransferType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[35].Descriptor() + return file_binary_proto_def_proto_enumTypes[36].Descriptor() } func (Conversation_EndOfHistoryTransferType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[35] + return &file_binary_proto_def_proto_enumTypes[36] } func (x Conversation_EndOfHistoryTransferType) Number() protoreflect.EnumNumber { @@ -2269,7 +2349,7 @@ func (x *Conversation_EndOfHistoryTransferType) UnmarshalJSON(b []byte) error { // Deprecated: Use Conversation_EndOfHistoryTransferType.Descriptor instead. func (Conversation_EndOfHistoryTransferType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{89, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{93, 0} } type MediaRetryNotification_ResultType int32 @@ -2308,11 +2388,11 @@ func (x MediaRetryNotification_ResultType) String() string { } func (MediaRetryNotification_ResultType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[36].Descriptor() + return file_binary_proto_def_proto_enumTypes[37].Descriptor() } func (MediaRetryNotification_ResultType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[36] + return &file_binary_proto_def_proto_enumTypes[37] } func (x MediaRetryNotification_ResultType) Number() protoreflect.EnumNumber { @@ -2331,7 +2411,7 @@ func (x *MediaRetryNotification_ResultType) UnmarshalJSON(b []byte) error { // Deprecated: Use MediaRetryNotification_ResultType.Descriptor instead. func (MediaRetryNotification_ResultType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{95, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{97, 0} } type SyncdMutation_SyncdOperation int32 @@ -2364,11 +2444,11 @@ func (x SyncdMutation_SyncdOperation) String() string { } func (SyncdMutation_SyncdOperation) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[37].Descriptor() + return file_binary_proto_def_proto_enumTypes[38].Descriptor() } func (SyncdMutation_SyncdOperation) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[37] + return &file_binary_proto_def_proto_enumTypes[38] } func (x SyncdMutation_SyncdOperation) Number() protoreflect.EnumNumber { @@ -2387,7 +2467,7 @@ func (x *SyncdMutation_SyncdOperation) UnmarshalJSON(b []byte) error { // Deprecated: Use SyncdMutation_SyncdOperation.Descriptor instead. func (SyncdMutation_SyncdOperation) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{103, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{105, 0} } type MarketingMessageAction_MarketingMessagePrototypeType int32 @@ -2417,11 +2497,11 @@ func (x MarketingMessageAction_MarketingMessagePrototypeType) String() string { } func (MarketingMessageAction_MarketingMessagePrototypeType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[38].Descriptor() + return file_binary_proto_def_proto_enumTypes[39].Descriptor() } func (MarketingMessageAction_MarketingMessagePrototypeType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[38] + return &file_binary_proto_def_proto_enumTypes[39] } func (x MarketingMessageAction_MarketingMessagePrototypeType) Number() protoreflect.EnumNumber { @@ -2440,7 +2520,7 @@ func (x *MarketingMessageAction_MarketingMessagePrototypeType) UnmarshalJSON(b [ // Deprecated: Use MarketingMessageAction_MarketingMessagePrototypeType.Descriptor instead. func (MarketingMessageAction_MarketingMessagePrototypeType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{130, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{132, 0} } type BizIdentityInfo_VerifiedLevelValue int32 @@ -2476,11 +2556,11 @@ func (x BizIdentityInfo_VerifiedLevelValue) String() string { } func (BizIdentityInfo_VerifiedLevelValue) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[39].Descriptor() + return file_binary_proto_def_proto_enumTypes[40].Descriptor() } func (BizIdentityInfo_VerifiedLevelValue) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[39] + return &file_binary_proto_def_proto_enumTypes[40] } func (x BizIdentityInfo_VerifiedLevelValue) Number() protoreflect.EnumNumber { @@ -2499,7 +2579,7 @@ func (x *BizIdentityInfo_VerifiedLevelValue) UnmarshalJSON(b []byte) error { // Deprecated: Use BizIdentityInfo_VerifiedLevelValue.Descriptor instead. func (BizIdentityInfo_VerifiedLevelValue) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{150, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{152, 0} } type BizIdentityInfo_HostStorageType int32 @@ -2532,11 +2612,11 @@ func (x BizIdentityInfo_HostStorageType) String() string { } func (BizIdentityInfo_HostStorageType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[40].Descriptor() + return file_binary_proto_def_proto_enumTypes[41].Descriptor() } func (BizIdentityInfo_HostStorageType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[40] + return &file_binary_proto_def_proto_enumTypes[41] } func (x BizIdentityInfo_HostStorageType) Number() protoreflect.EnumNumber { @@ -2555,7 +2635,7 @@ func (x *BizIdentityInfo_HostStorageType) UnmarshalJSON(b []byte) error { // Deprecated: Use BizIdentityInfo_HostStorageType.Descriptor instead. func (BizIdentityInfo_HostStorageType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{150, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{152, 1} } type BizIdentityInfo_ActualActorsType int32 @@ -2588,11 +2668,11 @@ func (x BizIdentityInfo_ActualActorsType) String() string { } func (BizIdentityInfo_ActualActorsType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[41].Descriptor() + return file_binary_proto_def_proto_enumTypes[42].Descriptor() } func (BizIdentityInfo_ActualActorsType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[41] + return &file_binary_proto_def_proto_enumTypes[42] } func (x BizIdentityInfo_ActualActorsType) Number() protoreflect.EnumNumber { @@ -2611,7 +2691,7 @@ func (x *BizIdentityInfo_ActualActorsType) UnmarshalJSON(b []byte) error { // Deprecated: Use BizIdentityInfo_ActualActorsType.Descriptor instead. func (BizIdentityInfo_ActualActorsType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{150, 2} + return file_binary_proto_def_proto_rawDescGZIP(), []int{152, 2} } type BizAccountLinkInfo_HostStorageType int32 @@ -2644,11 +2724,11 @@ func (x BizAccountLinkInfo_HostStorageType) String() string { } func (BizAccountLinkInfo_HostStorageType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[42].Descriptor() + return file_binary_proto_def_proto_enumTypes[43].Descriptor() } func (BizAccountLinkInfo_HostStorageType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[42] + return &file_binary_proto_def_proto_enumTypes[43] } func (x BizAccountLinkInfo_HostStorageType) Number() protoreflect.EnumNumber { @@ -2667,7 +2747,7 @@ func (x *BizAccountLinkInfo_HostStorageType) UnmarshalJSON(b []byte) error { // Deprecated: Use BizAccountLinkInfo_HostStorageType.Descriptor instead. func (BizAccountLinkInfo_HostStorageType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{152, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{154, 0} } type BizAccountLinkInfo_AccountType int32 @@ -2697,11 +2777,11 @@ func (x BizAccountLinkInfo_AccountType) String() string { } func (BizAccountLinkInfo_AccountType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[43].Descriptor() + return file_binary_proto_def_proto_enumTypes[44].Descriptor() } func (BizAccountLinkInfo_AccountType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[43] + return &file_binary_proto_def_proto_enumTypes[44] } func (x BizAccountLinkInfo_AccountType) Number() protoreflect.EnumNumber { @@ -2720,7 +2800,7 @@ func (x *BizAccountLinkInfo_AccountType) UnmarshalJSON(b []byte) error { // Deprecated: Use BizAccountLinkInfo_AccountType.Descriptor instead. func (BizAccountLinkInfo_AccountType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{152, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{154, 1} } type ClientPayload_Product int32 @@ -2756,11 +2836,11 @@ func (x ClientPayload_Product) String() string { } func (ClientPayload_Product) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[44].Descriptor() + return file_binary_proto_def_proto_enumTypes[45].Descriptor() } func (ClientPayload_Product) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[44] + return &file_binary_proto_def_proto_enumTypes[45] } func (x ClientPayload_Product) Number() protoreflect.EnumNumber { @@ -2779,7 +2859,7 @@ func (x *ClientPayload_Product) UnmarshalJSON(b []byte) error { // Deprecated: Use ClientPayload_Product.Descriptor instead. func (ClientPayload_Product) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{157, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{159, 0} } type ClientPayload_IOSAppExtension int32 @@ -2815,11 +2895,11 @@ func (x ClientPayload_IOSAppExtension) String() string { } func (ClientPayload_IOSAppExtension) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[45].Descriptor() + return file_binary_proto_def_proto_enumTypes[46].Descriptor() } func (ClientPayload_IOSAppExtension) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[45] + return &file_binary_proto_def_proto_enumTypes[46] } func (x ClientPayload_IOSAppExtension) Number() protoreflect.EnumNumber { @@ -2838,7 +2918,7 @@ func (x *ClientPayload_IOSAppExtension) UnmarshalJSON(b []byte) error { // Deprecated: Use ClientPayload_IOSAppExtension.Descriptor instead. func (ClientPayload_IOSAppExtension) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{157, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{159, 1} } type ClientPayload_ConnectType int32 @@ -2910,11 +2990,11 @@ func (x ClientPayload_ConnectType) String() string { } func (ClientPayload_ConnectType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[46].Descriptor() + return file_binary_proto_def_proto_enumTypes[47].Descriptor() } func (ClientPayload_ConnectType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[46] + return &file_binary_proto_def_proto_enumTypes[47] } func (x ClientPayload_ConnectType) Number() protoreflect.EnumNumber { @@ -2933,7 +3013,7 @@ func (x *ClientPayload_ConnectType) UnmarshalJSON(b []byte) error { // Deprecated: Use ClientPayload_ConnectType.Descriptor instead. func (ClientPayload_ConnectType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{157, 2} + return file_binary_proto_def_proto_rawDescGZIP(), []int{159, 2} } type ClientPayload_ConnectReason int32 @@ -2981,11 +3061,11 @@ func (x ClientPayload_ConnectReason) String() string { } func (ClientPayload_ConnectReason) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[47].Descriptor() + return file_binary_proto_def_proto_enumTypes[48].Descriptor() } func (ClientPayload_ConnectReason) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[47] + return &file_binary_proto_def_proto_enumTypes[48] } func (x ClientPayload_ConnectReason) Number() protoreflect.EnumNumber { @@ -3004,7 +3084,7 @@ func (x *ClientPayload_ConnectReason) UnmarshalJSON(b []byte) error { // Deprecated: Use ClientPayload_ConnectReason.Descriptor instead. func (ClientPayload_ConnectReason) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{157, 3} + return file_binary_proto_def_proto_rawDescGZIP(), []int{159, 3} } type ClientPayload_WebInfo_WebSubPlatform int32 @@ -3046,11 +3126,11 @@ func (x ClientPayload_WebInfo_WebSubPlatform) String() string { } func (ClientPayload_WebInfo_WebSubPlatform) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[48].Descriptor() + return file_binary_proto_def_proto_enumTypes[49].Descriptor() } func (ClientPayload_WebInfo_WebSubPlatform) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[48] + return &file_binary_proto_def_proto_enumTypes[49] } func (x ClientPayload_WebInfo_WebSubPlatform) Number() protoreflect.EnumNumber { @@ -3069,7 +3149,7 @@ func (x *ClientPayload_WebInfo_WebSubPlatform) UnmarshalJSON(b []byte) error { // Deprecated: Use ClientPayload_WebInfo_WebSubPlatform.Descriptor instead. func (ClientPayload_WebInfo_WebSubPlatform) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{157, 0, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{159, 0, 0} } type ClientPayload_UserAgent_ReleaseChannel int32 @@ -3108,11 +3188,11 @@ func (x ClientPayload_UserAgent_ReleaseChannel) String() string { } func (ClientPayload_UserAgent_ReleaseChannel) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[49].Descriptor() + return file_binary_proto_def_proto_enumTypes[50].Descriptor() } func (ClientPayload_UserAgent_ReleaseChannel) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[49] + return &file_binary_proto_def_proto_enumTypes[50] } func (x ClientPayload_UserAgent_ReleaseChannel) Number() protoreflect.EnumNumber { @@ -3131,7 +3211,7 @@ func (x *ClientPayload_UserAgent_ReleaseChannel) UnmarshalJSON(b []byte) error { // Deprecated: Use ClientPayload_UserAgent_ReleaseChannel.Descriptor instead. func (ClientPayload_UserAgent_ReleaseChannel) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{157, 1, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{159, 1, 0} } type ClientPayload_UserAgent_Platform int32 @@ -3260,11 +3340,11 @@ func (x ClientPayload_UserAgent_Platform) String() string { } func (ClientPayload_UserAgent_Platform) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[50].Descriptor() + return file_binary_proto_def_proto_enumTypes[51].Descriptor() } func (ClientPayload_UserAgent_Platform) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[50] + return &file_binary_proto_def_proto_enumTypes[51] } func (x ClientPayload_UserAgent_Platform) Number() protoreflect.EnumNumber { @@ -3283,7 +3363,72 @@ func (x *ClientPayload_UserAgent_Platform) UnmarshalJSON(b []byte) error { // Deprecated: Use ClientPayload_UserAgent_Platform.Descriptor instead. func (ClientPayload_UserAgent_Platform) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{157, 1, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{159, 1, 1} +} + +type ClientPayload_UserAgent_DeviceType int32 + +const ( + ClientPayload_UserAgent_PHONE ClientPayload_UserAgent_DeviceType = 0 + ClientPayload_UserAgent_TABLET ClientPayload_UserAgent_DeviceType = 1 + ClientPayload_UserAgent_DESKTOP ClientPayload_UserAgent_DeviceType = 2 + ClientPayload_UserAgent_WEARABLE ClientPayload_UserAgent_DeviceType = 3 + ClientPayload_UserAgent_VR ClientPayload_UserAgent_DeviceType = 4 +) + +// Enum value maps for ClientPayload_UserAgent_DeviceType. +var ( + ClientPayload_UserAgent_DeviceType_name = map[int32]string{ + 0: "PHONE", + 1: "TABLET", + 2: "DESKTOP", + 3: "WEARABLE", + 4: "VR", + } + ClientPayload_UserAgent_DeviceType_value = map[string]int32{ + "PHONE": 0, + "TABLET": 1, + "DESKTOP": 2, + "WEARABLE": 3, + "VR": 4, + } +) + +func (x ClientPayload_UserAgent_DeviceType) Enum() *ClientPayload_UserAgent_DeviceType { + p := new(ClientPayload_UserAgent_DeviceType) + *p = x + return p +} + +func (x ClientPayload_UserAgent_DeviceType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ClientPayload_UserAgent_DeviceType) Descriptor() protoreflect.EnumDescriptor { + return file_binary_proto_def_proto_enumTypes[52].Descriptor() +} + +func (ClientPayload_UserAgent_DeviceType) Type() protoreflect.EnumType { + return &file_binary_proto_def_proto_enumTypes[52] +} + +func (x ClientPayload_UserAgent_DeviceType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *ClientPayload_UserAgent_DeviceType) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = ClientPayload_UserAgent_DeviceType(num) + return nil +} + +// Deprecated: Use ClientPayload_UserAgent_DeviceType.Descriptor instead. +func (ClientPayload_UserAgent_DeviceType) EnumDescriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{159, 1, 2} } type ClientPayload_DNSSource_DNSResolutionMethod int32 @@ -3325,11 +3470,11 @@ func (x ClientPayload_DNSSource_DNSResolutionMethod) String() string { } func (ClientPayload_DNSSource_DNSResolutionMethod) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[51].Descriptor() + return file_binary_proto_def_proto_enumTypes[53].Descriptor() } func (ClientPayload_DNSSource_DNSResolutionMethod) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[51] + return &file_binary_proto_def_proto_enumTypes[53] } func (x ClientPayload_DNSSource_DNSResolutionMethod) Number() protoreflect.EnumNumber { @@ -3348,7 +3493,7 @@ func (x *ClientPayload_DNSSource_DNSResolutionMethod) UnmarshalJSON(b []byte) er // Deprecated: Use ClientPayload_DNSSource_DNSResolutionMethod.Descriptor instead. func (ClientPayload_DNSSource_DNSResolutionMethod) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{157, 4, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{159, 4, 0} } type WebMessageInfo_StubType int32 @@ -3537,6 +3682,7 @@ const ( WebMessageInfo_PAYMENT_INVITE_SETUP_INVITEE_SEND_AND_RECEIVE WebMessageInfo_StubType = 180 WebMessageInfo_LINKED_GROUP_CALL_START WebMessageInfo_StubType = 181 WebMessageInfo_REPORT_TO_ADMIN_ENABLED_STATUS WebMessageInfo_StubType = 182 + WebMessageInfo_EMPTY_SUBGROUP_CREATE WebMessageInfo_StubType = 183 ) // Enum value maps for WebMessageInfo_StubType. @@ -3725,6 +3871,7 @@ var ( 180: "PAYMENT_INVITE_SETUP_INVITEE_SEND_AND_RECEIVE", 181: "LINKED_GROUP_CALL_START", 182: "REPORT_TO_ADMIN_ENABLED_STATUS", + 183: "EMPTY_SUBGROUP_CREATE", } WebMessageInfo_StubType_value = map[string]int32{ "UNKNOWN": 0, @@ -3910,6 +4057,7 @@ var ( "PAYMENT_INVITE_SETUP_INVITEE_SEND_AND_RECEIVE": 180, "LINKED_GROUP_CALL_START": 181, "REPORT_TO_ADMIN_ENABLED_STATUS": 182, + "EMPTY_SUBGROUP_CREATE": 183, } ) @@ -3924,11 +4072,11 @@ func (x WebMessageInfo_StubType) String() string { } func (WebMessageInfo_StubType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[52].Descriptor() + return file_binary_proto_def_proto_enumTypes[54].Descriptor() } func (WebMessageInfo_StubType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[52] + return &file_binary_proto_def_proto_enumTypes[54] } func (x WebMessageInfo_StubType) Number() protoreflect.EnumNumber { @@ -3947,7 +4095,7 @@ func (x *WebMessageInfo_StubType) UnmarshalJSON(b []byte) error { // Deprecated: Use WebMessageInfo_StubType.Descriptor instead. func (WebMessageInfo_StubType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{159, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{161, 0} } type WebMessageInfo_Status int32 @@ -3992,11 +4140,11 @@ func (x WebMessageInfo_Status) String() string { } func (WebMessageInfo_Status) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[53].Descriptor() + return file_binary_proto_def_proto_enumTypes[55].Descriptor() } func (WebMessageInfo_Status) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[53] + return &file_binary_proto_def_proto_enumTypes[55] } func (x WebMessageInfo_Status) Number() protoreflect.EnumNumber { @@ -4015,7 +4163,7 @@ func (x *WebMessageInfo_Status) UnmarshalJSON(b []byte) error { // Deprecated: Use WebMessageInfo_Status.Descriptor instead. func (WebMessageInfo_Status) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{159, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{161, 1} } type WebMessageInfo_BizPrivacyStatus int32 @@ -4054,11 +4202,11 @@ func (x WebMessageInfo_BizPrivacyStatus) String() string { } func (WebMessageInfo_BizPrivacyStatus) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[54].Descriptor() + return file_binary_proto_def_proto_enumTypes[56].Descriptor() } func (WebMessageInfo_BizPrivacyStatus) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[54] + return &file_binary_proto_def_proto_enumTypes[56] } func (x WebMessageInfo_BizPrivacyStatus) Number() protoreflect.EnumNumber { @@ -4077,7 +4225,7 @@ func (x *WebMessageInfo_BizPrivacyStatus) UnmarshalJSON(b []byte) error { // Deprecated: Use WebMessageInfo_BizPrivacyStatus.Descriptor instead. func (WebMessageInfo_BizPrivacyStatus) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{159, 2} + return file_binary_proto_def_proto_rawDescGZIP(), []int{161, 2} } type WebFeatures_Flag int32 @@ -4116,11 +4264,11 @@ func (x WebFeatures_Flag) String() string { } func (WebFeatures_Flag) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[55].Descriptor() + return file_binary_proto_def_proto_enumTypes[57].Descriptor() } func (WebFeatures_Flag) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[55] + return &file_binary_proto_def_proto_enumTypes[57] } func (x WebFeatures_Flag) Number() protoreflect.EnumNumber { @@ -4139,7 +4287,7 @@ func (x *WebFeatures_Flag) UnmarshalJSON(b []byte) error { // Deprecated: Use WebFeatures_Flag.Descriptor instead. func (WebFeatures_Flag) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{160, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{162, 0} } type PinInChat_Type int32 @@ -4175,11 +4323,11 @@ func (x PinInChat_Type) String() string { } func (PinInChat_Type) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[56].Descriptor() + return file_binary_proto_def_proto_enumTypes[58].Descriptor() } func (PinInChat_Type) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[56] + return &file_binary_proto_def_proto_enumTypes[58] } func (x PinInChat_Type) Number() protoreflect.EnumNumber { @@ -4198,7 +4346,7 @@ func (x *PinInChat_Type) UnmarshalJSON(b []byte) error { // Deprecated: Use PinInChat_Type.Descriptor instead. func (PinInChat_Type) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{166, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{168, 0} } type PaymentInfo_TxnStatus int32 @@ -4321,11 +4469,11 @@ func (x PaymentInfo_TxnStatus) String() string { } func (PaymentInfo_TxnStatus) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[57].Descriptor() + return file_binary_proto_def_proto_enumTypes[59].Descriptor() } func (PaymentInfo_TxnStatus) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[57] + return &file_binary_proto_def_proto_enumTypes[59] } func (x PaymentInfo_TxnStatus) Number() protoreflect.EnumNumber { @@ -4344,7 +4492,7 @@ func (x *PaymentInfo_TxnStatus) UnmarshalJSON(b []byte) error { // Deprecated: Use PaymentInfo_TxnStatus.Descriptor instead. func (PaymentInfo_TxnStatus) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{168, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{170, 0} } type PaymentInfo_Status int32 @@ -4407,11 +4555,11 @@ func (x PaymentInfo_Status) String() string { } func (PaymentInfo_Status) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[58].Descriptor() + return file_binary_proto_def_proto_enumTypes[60].Descriptor() } func (PaymentInfo_Status) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[58] + return &file_binary_proto_def_proto_enumTypes[60] } func (x PaymentInfo_Status) Number() protoreflect.EnumNumber { @@ -4430,7 +4578,7 @@ func (x *PaymentInfo_Status) UnmarshalJSON(b []byte) error { // Deprecated: Use PaymentInfo_Status.Descriptor instead. func (PaymentInfo_Status) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{168, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{170, 1} } type PaymentInfo_Currency int32 @@ -4463,11 +4611,11 @@ func (x PaymentInfo_Currency) String() string { } func (PaymentInfo_Currency) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[59].Descriptor() + return file_binary_proto_def_proto_enumTypes[61].Descriptor() } func (PaymentInfo_Currency) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[59] + return &file_binary_proto_def_proto_enumTypes[61] } func (x PaymentInfo_Currency) Number() protoreflect.EnumNumber { @@ -4486,7 +4634,7 @@ func (x *PaymentInfo_Currency) UnmarshalJSON(b []byte) error { // Deprecated: Use PaymentInfo_Currency.Descriptor instead. func (PaymentInfo_Currency) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{168, 2} + return file_binary_proto_def_proto_rawDescGZIP(), []int{170, 2} } type ADVSignedKeyIndexList struct { @@ -4907,61 +5055,6 @@ func (x *DeviceProps) GetHistorySyncConfig() *DeviceProps_HistorySyncConfig { return nil } -type PaymentInviteMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ServiceType *PaymentInviteMessage_ServiceType `protobuf:"varint,1,opt,name=serviceType,enum=proto.PaymentInviteMessage_ServiceType" json:"serviceType,omitempty"` - ExpiryTimestamp *int64 `protobuf:"varint,2,opt,name=expiryTimestamp" json:"expiryTimestamp,omitempty"` -} - -func (x *PaymentInviteMessage) Reset() { - *x = PaymentInviteMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PaymentInviteMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PaymentInviteMessage) ProtoMessage() {} - -func (x *PaymentInviteMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PaymentInviteMessage.ProtoReflect.Descriptor instead. -func (*PaymentInviteMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{6} -} - -func (x *PaymentInviteMessage) GetServiceType() PaymentInviteMessage_ServiceType { - if x != nil && x.ServiceType != nil { - return *x.ServiceType - } - return PaymentInviteMessage_UNKNOWN -} - -func (x *PaymentInviteMessage) GetExpiryTimestamp() int64 { - if x != nil && x.ExpiryTimestamp != nil { - return *x.ExpiryTimestamp - } - return 0 -} - type OrderMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4984,7 +5077,7 @@ type OrderMessage struct { func (x *OrderMessage) Reset() { *x = OrderMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[7] + mi := &file_binary_proto_def_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4997,7 +5090,7 @@ func (x *OrderMessage) String() string { func (*OrderMessage) ProtoMessage() {} func (x *OrderMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[7] + mi := &file_binary_proto_def_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5010,7 +5103,7 @@ func (x *OrderMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use OrderMessage.ProtoReflect.Descriptor instead. func (*OrderMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{7} + return file_binary_proto_def_proto_rawDescGZIP(), []int{6} } func (x *OrderMessage) GetOrderId() string { @@ -5119,7 +5212,7 @@ type LocationMessage struct { func (x *LocationMessage) Reset() { *x = LocationMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[8] + mi := &file_binary_proto_def_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5132,7 +5225,7 @@ func (x *LocationMessage) String() string { func (*LocationMessage) ProtoMessage() {} func (x *LocationMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[8] + mi := &file_binary_proto_def_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5145,7 +5238,7 @@ func (x *LocationMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use LocationMessage.ProtoReflect.Descriptor instead. func (*LocationMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{8} + return file_binary_proto_def_proto_rawDescGZIP(), []int{7} } func (x *LocationMessage) GetDegreesLatitude() float64 { @@ -5252,7 +5345,7 @@ type LiveLocationMessage struct { func (x *LiveLocationMessage) Reset() { *x = LiveLocationMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[9] + mi := &file_binary_proto_def_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5265,7 +5358,7 @@ func (x *LiveLocationMessage) String() string { func (*LiveLocationMessage) ProtoMessage() {} func (x *LiveLocationMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[9] + mi := &file_binary_proto_def_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5278,7 +5371,7 @@ func (x *LiveLocationMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use LiveLocationMessage.ProtoReflect.Descriptor instead. func (*LiveLocationMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{9} + return file_binary_proto_def_proto_rawDescGZIP(), []int{8} } func (x *LiveLocationMessage) GetDegreesLatitude() float64 { @@ -5366,7 +5459,7 @@ type ListResponseMessage struct { func (x *ListResponseMessage) Reset() { *x = ListResponseMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[10] + mi := &file_binary_proto_def_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5379,7 +5472,7 @@ func (x *ListResponseMessage) String() string { func (*ListResponseMessage) ProtoMessage() {} func (x *ListResponseMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[10] + mi := &file_binary_proto_def_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5392,7 +5485,7 @@ func (x *ListResponseMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use ListResponseMessage.ProtoReflect.Descriptor instead. func (*ListResponseMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{10} + return file_binary_proto_def_proto_rawDescGZIP(), []int{9} } func (x *ListResponseMessage) GetTitle() string { @@ -5448,7 +5541,7 @@ type ListMessage struct { func (x *ListMessage) Reset() { *x = ListMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[11] + mi := &file_binary_proto_def_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5461,7 +5554,7 @@ func (x *ListMessage) String() string { func (*ListMessage) ProtoMessage() {} func (x *ListMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[11] + mi := &file_binary_proto_def_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5474,7 +5567,7 @@ func (x *ListMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use ListMessage.ProtoReflect.Descriptor instead. func (*ListMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{11} + return file_binary_proto_def_proto_rawDescGZIP(), []int{10} } func (x *ListMessage) GetTitle() string { @@ -5546,7 +5639,7 @@ type KeepInChatMessage struct { func (x *KeepInChatMessage) Reset() { *x = KeepInChatMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[12] + mi := &file_binary_proto_def_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5559,7 +5652,7 @@ func (x *KeepInChatMessage) String() string { func (*KeepInChatMessage) ProtoMessage() {} func (x *KeepInChatMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[12] + mi := &file_binary_proto_def_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5572,7 +5665,7 @@ func (x *KeepInChatMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use KeepInChatMessage.ProtoReflect.Descriptor instead. func (*KeepInChatMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{12} + return file_binary_proto_def_proto_rawDescGZIP(), []int{11} } func (x *KeepInChatMessage) GetKey() *MessageKey { @@ -5616,7 +5709,7 @@ type InvoiceMessage struct { func (x *InvoiceMessage) Reset() { *x = InvoiceMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[13] + mi := &file_binary_proto_def_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5629,7 +5722,7 @@ func (x *InvoiceMessage) String() string { func (*InvoiceMessage) ProtoMessage() {} func (x *InvoiceMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[13] + mi := &file_binary_proto_def_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5642,7 +5735,7 @@ func (x *InvoiceMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use InvoiceMessage.ProtoReflect.Descriptor instead. func (*InvoiceMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{13} + return file_binary_proto_def_proto_rawDescGZIP(), []int{12} } func (x *InvoiceMessage) GetNote() string { @@ -5731,7 +5824,7 @@ type InteractiveResponseMessage struct { func (x *InteractiveResponseMessage) Reset() { *x = InteractiveResponseMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[14] + mi := &file_binary_proto_def_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5744,7 +5837,7 @@ func (x *InteractiveResponseMessage) String() string { func (*InteractiveResponseMessage) ProtoMessage() {} func (x *InteractiveResponseMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[14] + mi := &file_binary_proto_def_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5757,7 +5850,7 @@ func (x *InteractiveResponseMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use InteractiveResponseMessage.ProtoReflect.Descriptor instead. func (*InteractiveResponseMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{14} + return file_binary_proto_def_proto_rawDescGZIP(), []int{13} } func (x *InteractiveResponseMessage) GetBody() *InteractiveResponseMessage_Body { @@ -5813,13 +5906,14 @@ type InteractiveMessage struct { // *InteractiveMessage_ShopStorefrontMessage // *InteractiveMessage_CollectionMessage_ // *InteractiveMessage_NativeFlowMessage_ + // *InteractiveMessage_CarouselMessage_ InteractiveMessage isInteractiveMessage_InteractiveMessage `protobuf_oneof:"interactiveMessage"` } func (x *InteractiveMessage) Reset() { *x = InteractiveMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[15] + mi := &file_binary_proto_def_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5832,7 +5926,7 @@ func (x *InteractiveMessage) String() string { func (*InteractiveMessage) ProtoMessage() {} func (x *InteractiveMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[15] + mi := &file_binary_proto_def_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5845,7 +5939,7 @@ func (x *InteractiveMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use InteractiveMessage.ProtoReflect.Descriptor instead. func (*InteractiveMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{15} + return file_binary_proto_def_proto_rawDescGZIP(), []int{14} } func (x *InteractiveMessage) GetHeader() *InteractiveMessage_Header { @@ -5904,6 +5998,13 @@ func (x *InteractiveMessage) GetNativeFlowMessage() *InteractiveMessage_NativeFl return nil } +func (x *InteractiveMessage) GetCarouselMessage() *InteractiveMessage_CarouselMessage { + if x, ok := x.GetInteractiveMessage().(*InteractiveMessage_CarouselMessage_); ok { + return x.CarouselMessage + } + return nil +} + type isInteractiveMessage_InteractiveMessage interface { isInteractiveMessage_InteractiveMessage() } @@ -5920,12 +6021,18 @@ type InteractiveMessage_NativeFlowMessage_ struct { NativeFlowMessage *InteractiveMessage_NativeFlowMessage `protobuf:"bytes,6,opt,name=nativeFlowMessage,oneof"` } +type InteractiveMessage_CarouselMessage_ struct { + CarouselMessage *InteractiveMessage_CarouselMessage `protobuf:"bytes,7,opt,name=carouselMessage,oneof"` +} + func (*InteractiveMessage_ShopStorefrontMessage) isInteractiveMessage_InteractiveMessage() {} func (*InteractiveMessage_CollectionMessage_) isInteractiveMessage_InteractiveMessage() {} func (*InteractiveMessage_NativeFlowMessage_) isInteractiveMessage_InteractiveMessage() {} +func (*InteractiveMessage_CarouselMessage_) isInteractiveMessage_InteractiveMessage() {} + type InitialSecurityNotificationSettingSync struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -5937,7 +6044,7 @@ type InitialSecurityNotificationSettingSync struct { func (x *InitialSecurityNotificationSettingSync) Reset() { *x = InitialSecurityNotificationSettingSync{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[16] + mi := &file_binary_proto_def_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5950,7 +6057,7 @@ func (x *InitialSecurityNotificationSettingSync) String() string { func (*InitialSecurityNotificationSettingSync) ProtoMessage() {} func (x *InitialSecurityNotificationSettingSync) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[16] + mi := &file_binary_proto_def_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5963,7 +6070,7 @@ func (x *InitialSecurityNotificationSettingSync) ProtoReflect() protoreflect.Mes // Deprecated: Use InitialSecurityNotificationSettingSync.ProtoReflect.Descriptor instead. func (*InitialSecurityNotificationSettingSync) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{16} + return file_binary_proto_def_proto_rawDescGZIP(), []int{15} } func (x *InitialSecurityNotificationSettingSync) GetSecurityNotificationEnabled() bool { @@ -6009,7 +6116,7 @@ type ImageMessage struct { func (x *ImageMessage) Reset() { *x = ImageMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[17] + mi := &file_binary_proto_def_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6022,7 +6129,7 @@ func (x *ImageMessage) String() string { func (*ImageMessage) ProtoMessage() {} func (x *ImageMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[17] + mi := &file_binary_proto_def_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6035,7 +6142,7 @@ func (x *ImageMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use ImageMessage.ProtoReflect.Descriptor instead. func (*ImageMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{17} + return file_binary_proto_def_proto_rawDescGZIP(), []int{16} } func (x *ImageMessage) GetUrl() string { @@ -6242,7 +6349,7 @@ type HistorySyncNotification struct { func (x *HistorySyncNotification) Reset() { *x = HistorySyncNotification{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[18] + mi := &file_binary_proto_def_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6255,7 +6362,7 @@ func (x *HistorySyncNotification) String() string { func (*HistorySyncNotification) ProtoMessage() {} func (x *HistorySyncNotification) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[18] + mi := &file_binary_proto_def_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6268,7 +6375,7 @@ func (x *HistorySyncNotification) ProtoReflect() protoreflect.Message { // Deprecated: Use HistorySyncNotification.ProtoReflect.Descriptor instead. func (*HistorySyncNotification) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{18} + return file_binary_proto_def_proto_rawDescGZIP(), []int{17} } func (x *HistorySyncNotification) GetFileSha256() []byte { @@ -6374,7 +6481,7 @@ type HighlyStructuredMessage struct { func (x *HighlyStructuredMessage) Reset() { *x = HighlyStructuredMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[19] + mi := &file_binary_proto_def_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6387,7 +6494,7 @@ func (x *HighlyStructuredMessage) String() string { func (*HighlyStructuredMessage) ProtoMessage() {} func (x *HighlyStructuredMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[19] + mi := &file_binary_proto_def_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6400,7 +6507,7 @@ func (x *HighlyStructuredMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use HighlyStructuredMessage.ProtoReflect.Descriptor instead. func (*HighlyStructuredMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{19} + return file_binary_proto_def_proto_rawDescGZIP(), []int{18} } func (x *HighlyStructuredMessage) GetNamespace() string { @@ -6484,7 +6591,7 @@ type GroupInviteMessage struct { func (x *GroupInviteMessage) Reset() { *x = GroupInviteMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[20] + mi := &file_binary_proto_def_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6497,7 +6604,7 @@ func (x *GroupInviteMessage) String() string { func (*GroupInviteMessage) ProtoMessage() {} func (x *GroupInviteMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[20] + mi := &file_binary_proto_def_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6510,7 +6617,7 @@ func (x *GroupInviteMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupInviteMessage.ProtoReflect.Descriptor instead. func (*GroupInviteMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{20} + return file_binary_proto_def_proto_rawDescGZIP(), []int{19} } func (x *GroupInviteMessage) GetGroupJid() string { @@ -6580,7 +6687,7 @@ type FutureProofMessage struct { func (x *FutureProofMessage) Reset() { *x = FutureProofMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[21] + mi := &file_binary_proto_def_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6593,7 +6700,7 @@ func (x *FutureProofMessage) String() string { func (*FutureProofMessage) ProtoMessage() {} func (x *FutureProofMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[21] + mi := &file_binary_proto_def_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6606,7 +6713,7 @@ func (x *FutureProofMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use FutureProofMessage.ProtoReflect.Descriptor instead. func (*FutureProofMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{21} + return file_binary_proto_def_proto_rawDescGZIP(), []int{20} } func (x *FutureProofMessage) GetMessage() *Message { @@ -6650,7 +6757,7 @@ type ExtendedTextMessage struct { func (x *ExtendedTextMessage) Reset() { *x = ExtendedTextMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[22] + mi := &file_binary_proto_def_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6663,7 +6770,7 @@ func (x *ExtendedTextMessage) String() string { func (*ExtendedTextMessage) ProtoMessage() {} func (x *ExtendedTextMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[22] + mi := &file_binary_proto_def_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6676,7 +6783,7 @@ func (x *ExtendedTextMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use ExtendedTextMessage.ProtoReflect.Descriptor instead. func (*ExtendedTextMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{22} + return file_binary_proto_def_proto_rawDescGZIP(), []int{21} } func (x *ExtendedTextMessage) GetText() string { @@ -6860,7 +6967,7 @@ type EncReactionMessage struct { func (x *EncReactionMessage) Reset() { *x = EncReactionMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[23] + mi := &file_binary_proto_def_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6873,7 +6980,7 @@ func (x *EncReactionMessage) String() string { func (*EncReactionMessage) ProtoMessage() {} func (x *EncReactionMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[23] + mi := &file_binary_proto_def_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6886,7 +6993,7 @@ func (x *EncReactionMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use EncReactionMessage.ProtoReflect.Descriptor instead. func (*EncReactionMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{23} + return file_binary_proto_def_proto_rawDescGZIP(), []int{22} } func (x *EncReactionMessage) GetTargetMessageKey() *MessageKey { @@ -6940,7 +7047,7 @@ type DocumentMessage struct { func (x *DocumentMessage) Reset() { *x = DocumentMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[24] + mi := &file_binary_proto_def_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6953,7 +7060,7 @@ func (x *DocumentMessage) String() string { func (*DocumentMessage) ProtoMessage() {} func (x *DocumentMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[24] + mi := &file_binary_proto_def_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6966,7 +7073,7 @@ func (x *DocumentMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use DocumentMessage.ProtoReflect.Descriptor instead. func (*DocumentMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{24} + return file_binary_proto_def_proto_rawDescGZIP(), []int{23} } func (x *DocumentMessage) GetUrl() string { @@ -7122,7 +7229,7 @@ type DeviceSentMessage struct { func (x *DeviceSentMessage) Reset() { *x = DeviceSentMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[25] + mi := &file_binary_proto_def_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7135,7 +7242,7 @@ func (x *DeviceSentMessage) String() string { func (*DeviceSentMessage) ProtoMessage() {} func (x *DeviceSentMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[25] + mi := &file_binary_proto_def_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7148,7 +7255,7 @@ func (x *DeviceSentMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use DeviceSentMessage.ProtoReflect.Descriptor instead. func (*DeviceSentMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{25} + return file_binary_proto_def_proto_rawDescGZIP(), []int{24} } func (x *DeviceSentMessage) GetDestinationJid() string { @@ -7183,7 +7290,7 @@ type DeclinePaymentRequestMessage struct { func (x *DeclinePaymentRequestMessage) Reset() { *x = DeclinePaymentRequestMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[26] + mi := &file_binary_proto_def_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7196,7 +7303,7 @@ func (x *DeclinePaymentRequestMessage) String() string { func (*DeclinePaymentRequestMessage) ProtoMessage() {} func (x *DeclinePaymentRequestMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[26] + mi := &file_binary_proto_def_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7209,7 +7316,7 @@ func (x *DeclinePaymentRequestMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use DeclinePaymentRequestMessage.ProtoReflect.Descriptor instead. func (*DeclinePaymentRequestMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{26} + return file_binary_proto_def_proto_rawDescGZIP(), []int{25} } func (x *DeclinePaymentRequestMessage) GetKey() *MessageKey { @@ -7232,7 +7339,7 @@ type ContactsArrayMessage struct { func (x *ContactsArrayMessage) Reset() { *x = ContactsArrayMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[27] + mi := &file_binary_proto_def_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7245,7 +7352,7 @@ func (x *ContactsArrayMessage) String() string { func (*ContactsArrayMessage) ProtoMessage() {} func (x *ContactsArrayMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[27] + mi := &file_binary_proto_def_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7258,7 +7365,7 @@ func (x *ContactsArrayMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use ContactsArrayMessage.ProtoReflect.Descriptor instead. func (*ContactsArrayMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{27} + return file_binary_proto_def_proto_rawDescGZIP(), []int{26} } func (x *ContactsArrayMessage) GetDisplayName() string { @@ -7295,7 +7402,7 @@ type ContactMessage struct { func (x *ContactMessage) Reset() { *x = ContactMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[28] + mi := &file_binary_proto_def_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7308,7 +7415,7 @@ func (x *ContactMessage) String() string { func (*ContactMessage) ProtoMessage() {} func (x *ContactMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[28] + mi := &file_binary_proto_def_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7321,7 +7428,7 @@ func (x *ContactMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use ContactMessage.ProtoReflect.Descriptor instead. func (*ContactMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{28} + return file_binary_proto_def_proto_rawDescGZIP(), []int{27} } func (x *ContactMessage) GetDisplayName() string { @@ -7357,7 +7464,7 @@ type Chat struct { func (x *Chat) Reset() { *x = Chat{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[29] + mi := &file_binary_proto_def_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7370,7 +7477,7 @@ func (x *Chat) String() string { func (*Chat) ProtoMessage() {} func (x *Chat) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[29] + mi := &file_binary_proto_def_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7383,7 +7490,7 @@ func (x *Chat) ProtoReflect() protoreflect.Message { // Deprecated: Use Chat.ProtoReflect.Descriptor instead. func (*Chat) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{29} + return file_binary_proto_def_proto_rawDescGZIP(), []int{28} } func (x *Chat) GetDisplayName() string { @@ -7411,7 +7518,7 @@ type CancelPaymentRequestMessage struct { func (x *CancelPaymentRequestMessage) Reset() { *x = CancelPaymentRequestMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[30] + mi := &file_binary_proto_def_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7424,7 +7531,7 @@ func (x *CancelPaymentRequestMessage) String() string { func (*CancelPaymentRequestMessage) ProtoMessage() {} func (x *CancelPaymentRequestMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[30] + mi := &file_binary_proto_def_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7437,7 +7544,7 @@ func (x *CancelPaymentRequestMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use CancelPaymentRequestMessage.ProtoReflect.Descriptor instead. func (*CancelPaymentRequestMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{30} + return file_binary_proto_def_proto_rawDescGZIP(), []int{29} } func (x *CancelPaymentRequestMessage) GetKey() *MessageKey { @@ -7461,7 +7568,7 @@ type Call struct { func (x *Call) Reset() { *x = Call{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[31] + mi := &file_binary_proto_def_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7474,7 +7581,7 @@ func (x *Call) String() string { func (*Call) ProtoMessage() {} func (x *Call) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[31] + mi := &file_binary_proto_def_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7487,7 +7594,7 @@ func (x *Call) ProtoReflect() protoreflect.Message { // Deprecated: Use Call.ProtoReflect.Descriptor instead. func (*Call) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{31} + return file_binary_proto_def_proto_rawDescGZIP(), []int{30} } func (x *Call) GetCallKey() []byte { @@ -7535,7 +7642,7 @@ type ButtonsResponseMessage struct { func (x *ButtonsResponseMessage) Reset() { *x = ButtonsResponseMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[32] + mi := &file_binary_proto_def_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7548,7 +7655,7 @@ func (x *ButtonsResponseMessage) String() string { func (*ButtonsResponseMessage) ProtoMessage() {} func (x *ButtonsResponseMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[32] + mi := &file_binary_proto_def_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7561,7 +7668,7 @@ func (x *ButtonsResponseMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use ButtonsResponseMessage.ProtoReflect.Descriptor instead. func (*ButtonsResponseMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{32} + return file_binary_proto_def_proto_rawDescGZIP(), []int{31} } func (x *ButtonsResponseMessage) GetSelectedButtonId() string { @@ -7632,7 +7739,7 @@ type ButtonsMessage struct { func (x *ButtonsMessage) Reset() { *x = ButtonsMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[33] + mi := &file_binary_proto_def_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7645,7 +7752,7 @@ func (x *ButtonsMessage) String() string { func (*ButtonsMessage) ProtoMessage() {} func (x *ButtonsMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[33] + mi := &file_binary_proto_def_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7658,7 +7765,7 @@ func (x *ButtonsMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use ButtonsMessage.ProtoReflect.Descriptor instead. func (*ButtonsMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{33} + return file_binary_proto_def_proto_rawDescGZIP(), []int{32} } func (x *ButtonsMessage) GetContentText() string { @@ -7772,6 +7879,69 @@ func (*ButtonsMessage_VideoMessage) isButtonsMessage_Header() {} func (*ButtonsMessage_LocationMessage) isButtonsMessage_Header() {} +type BotFeedbackMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MessageKey *MessageKey `protobuf:"bytes,1,opt,name=messageKey" json:"messageKey,omitempty"` + Kind *BotFeedbackMessage_BotFeedbackKind `protobuf:"varint,2,opt,name=kind,enum=proto.BotFeedbackMessage_BotFeedbackKind" json:"kind,omitempty"` + Text *string `protobuf:"bytes,3,opt,name=text" json:"text,omitempty"` +} + +func (x *BotFeedbackMessage) Reset() { + *x = BotFeedbackMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_binary_proto_def_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BotFeedbackMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BotFeedbackMessage) ProtoMessage() {} + +func (x *BotFeedbackMessage) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[33] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BotFeedbackMessage.ProtoReflect.Descriptor instead. +func (*BotFeedbackMessage) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{33} +} + +func (x *BotFeedbackMessage) GetMessageKey() *MessageKey { + if x != nil { + return x.MessageKey + } + return nil +} + +func (x *BotFeedbackMessage) GetKind() BotFeedbackMessage_BotFeedbackKind { + if x != nil && x.Kind != nil { + return *x.Kind + } + return BotFeedbackMessage_BOT_FEEDBACK_POSITIVE +} + +func (x *BotFeedbackMessage) GetText() string { + if x != nil && x.Text != nil { + return *x.Text + } + return "" +} + type AudioMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -9001,6 +9171,108 @@ func (x *ContextInfo) GetUtm() *ContextInfo_UTMInfo { return nil } +type BotMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AvatarMetadata *BotAvatarMetadata `protobuf:"bytes,1,opt,name=avatarMetadata" json:"avatarMetadata,omitempty"` +} + +func (x *BotMetadata) Reset() { + *x = BotMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_binary_proto_def_proto_msgTypes[49] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BotMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BotMetadata) ProtoMessage() {} + +func (x *BotMetadata) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[49] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BotMetadata.ProtoReflect.Descriptor instead. +func (*BotMetadata) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{49} +} + +func (x *BotMetadata) GetAvatarMetadata() *BotAvatarMetadata { + if x != nil { + return x.AvatarMetadata + } + return nil +} + +type BotAvatarMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Sentiment *uint32 `protobuf:"varint,1,opt,name=sentiment" json:"sentiment,omitempty"` + DynamicVideoList []*BotAvatarMetadata_PlaybackMetadata `protobuf:"bytes,2,rep,name=dynamicVideoList" json:"dynamicVideoList,omitempty"` +} + +func (x *BotAvatarMetadata) Reset() { + *x = BotAvatarMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_binary_proto_def_proto_msgTypes[50] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BotAvatarMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BotAvatarMetadata) ProtoMessage() {} + +func (x *BotAvatarMetadata) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[50] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BotAvatarMetadata.ProtoReflect.Descriptor instead. +func (*BotAvatarMetadata) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{50} +} + +func (x *BotAvatarMetadata) GetSentiment() uint32 { + if x != nil && x.Sentiment != nil { + return *x.Sentiment + } + return 0 +} + +func (x *BotAvatarMetadata) GetDynamicVideoList() []*BotAvatarMetadata_PlaybackMetadata { + if x != nil { + return x.DynamicVideoList + } + return nil +} + type ActionLink struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -9013,7 +9285,7 @@ type ActionLink struct { func (x *ActionLink) Reset() { *x = ActionLink{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[49] + mi := &file_binary_proto_def_proto_msgTypes[51] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9026,7 +9298,7 @@ func (x *ActionLink) String() string { func (*ActionLink) ProtoMessage() {} func (x *ActionLink) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[49] + mi := &file_binary_proto_def_proto_msgTypes[51] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9039,7 +9311,7 @@ func (x *ActionLink) ProtoReflect() protoreflect.Message { // Deprecated: Use ActionLink.ProtoReflect.Descriptor instead. func (*ActionLink) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{49} + return file_binary_proto_def_proto_rawDescGZIP(), []int{51} } func (x *ActionLink) GetUrl() string { @@ -9073,7 +9345,7 @@ type TemplateButton struct { func (x *TemplateButton) Reset() { *x = TemplateButton{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[50] + mi := &file_binary_proto_def_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9086,7 +9358,7 @@ func (x *TemplateButton) String() string { func (*TemplateButton) ProtoMessage() {} func (x *TemplateButton) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[50] + mi := &file_binary_proto_def_proto_msgTypes[52] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9099,7 +9371,7 @@ func (x *TemplateButton) ProtoReflect() protoreflect.Message { // Deprecated: Use TemplateButton.ProtoReflect.Descriptor instead. func (*TemplateButton) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{50} + return file_binary_proto_def_proto_rawDescGZIP(), []int{52} } func (x *TemplateButton) GetIndex() uint32 { @@ -9173,7 +9445,7 @@ type Point struct { func (x *Point) Reset() { *x = Point{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[51] + mi := &file_binary_proto_def_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9186,7 +9458,7 @@ func (x *Point) String() string { func (*Point) ProtoMessage() {} func (x *Point) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[51] + mi := &file_binary_proto_def_proto_msgTypes[53] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9199,7 +9471,7 @@ func (x *Point) ProtoReflect() protoreflect.Message { // Deprecated: Use Point.ProtoReflect.Descriptor instead. func (*Point) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{51} + return file_binary_proto_def_proto_rawDescGZIP(), []int{53} } func (x *Point) GetXDeprecated() int32 { @@ -9250,7 +9522,7 @@ type PaymentBackground struct { func (x *PaymentBackground) Reset() { *x = PaymentBackground{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[52] + mi := &file_binary_proto_def_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9263,7 +9535,7 @@ func (x *PaymentBackground) String() string { func (*PaymentBackground) ProtoMessage() {} func (x *PaymentBackground) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[52] + mi := &file_binary_proto_def_proto_msgTypes[54] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9276,7 +9548,7 @@ func (x *PaymentBackground) ProtoReflect() protoreflect.Message { // Deprecated: Use PaymentBackground.ProtoReflect.Descriptor instead. func (*PaymentBackground) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{52} + return file_binary_proto_def_proto_rawDescGZIP(), []int{54} } func (x *PaymentBackground) GetId() string { @@ -9362,7 +9634,7 @@ type Money struct { func (x *Money) Reset() { *x = Money{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[53] + mi := &file_binary_proto_def_proto_msgTypes[55] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9375,7 +9647,7 @@ func (x *Money) String() string { func (*Money) ProtoMessage() {} func (x *Money) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[53] + mi := &file_binary_proto_def_proto_msgTypes[55] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9388,7 +9660,7 @@ func (x *Money) ProtoReflect() protoreflect.Message { // Deprecated: Use Money.ProtoReflect.Descriptor instead. func (*Money) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{53} + return file_binary_proto_def_proto_rawDescGZIP(), []int{55} } func (x *Money) GetValue() int64 { @@ -9473,12 +9745,13 @@ type Message struct { PollCreationMessageV3 *PollCreationMessage `protobuf:"bytes,64,opt,name=pollCreationMessageV3" json:"pollCreationMessageV3,omitempty"` ScheduledCallEditMessage *ScheduledCallEditMessage `protobuf:"bytes,65,opt,name=scheduledCallEditMessage" json:"scheduledCallEditMessage,omitempty"` PtvMessage *VideoMessage `protobuf:"bytes,66,opt,name=ptvMessage" json:"ptvMessage,omitempty"` + BotInvokeMessage *FutureProofMessage `protobuf:"bytes,67,opt,name=botInvokeMessage" json:"botInvokeMessage,omitempty"` } func (x *Message) Reset() { *x = Message{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[54] + mi := &file_binary_proto_def_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9491,7 +9764,7 @@ func (x *Message) String() string { func (*Message) ProtoMessage() {} func (x *Message) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[54] + mi := &file_binary_proto_def_proto_msgTypes[56] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9504,7 +9777,7 @@ func (x *Message) ProtoReflect() protoreflect.Message { // Deprecated: Use Message.ProtoReflect.Descriptor instead. func (*Message) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{54} + return file_binary_proto_def_proto_rawDescGZIP(), []int{56} } func (x *Message) GetConversation() string { @@ -9899,6 +10172,76 @@ func (x *Message) GetPtvMessage() *VideoMessage { return nil } +func (x *Message) GetBotInvokeMessage() *FutureProofMessage { + if x != nil { + return x.BotInvokeMessage + } + return nil +} + +type MessageSecretMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version *int32 `protobuf:"fixed32,1,opt,name=version" json:"version,omitempty"` + EncIv []byte `protobuf:"bytes,2,opt,name=encIv" json:"encIv,omitempty"` + EncPayload []byte `protobuf:"bytes,3,opt,name=encPayload" json:"encPayload,omitempty"` +} + +func (x *MessageSecretMessage) Reset() { + *x = MessageSecretMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_binary_proto_def_proto_msgTypes[57] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageSecretMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageSecretMessage) ProtoMessage() {} + +func (x *MessageSecretMessage) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[57] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageSecretMessage.ProtoReflect.Descriptor instead. +func (*MessageSecretMessage) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{57} +} + +func (x *MessageSecretMessage) GetVersion() int32 { + if x != nil && x.Version != nil { + return *x.Version + } + return 0 +} + +func (x *MessageSecretMessage) GetEncIv() []byte { + if x != nil { + return x.EncIv + } + return nil +} + +func (x *MessageSecretMessage) GetEncPayload() []byte { + if x != nil { + return x.EncPayload + } + return nil +} + type MessageContextInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -9909,12 +10252,14 @@ type MessageContextInfo struct { MessageSecret []byte `protobuf:"bytes,3,opt,name=messageSecret" json:"messageSecret,omitempty"` PaddingBytes []byte `protobuf:"bytes,4,opt,name=paddingBytes" json:"paddingBytes,omitempty"` MessageAddOnDurationInSecs *uint32 `protobuf:"varint,5,opt,name=messageAddOnDurationInSecs" json:"messageAddOnDurationInSecs,omitempty"` + BotMessageSecret []byte `protobuf:"bytes,6,opt,name=botMessageSecret" json:"botMessageSecret,omitempty"` + BotMetadata *BotMetadata `protobuf:"bytes,7,opt,name=botMetadata" json:"botMetadata,omitempty"` } func (x *MessageContextInfo) Reset() { *x = MessageContextInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[55] + mi := &file_binary_proto_def_proto_msgTypes[58] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9927,7 +10272,7 @@ func (x *MessageContextInfo) String() string { func (*MessageContextInfo) ProtoMessage() {} func (x *MessageContextInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[55] + mi := &file_binary_proto_def_proto_msgTypes[58] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9940,7 +10285,7 @@ func (x *MessageContextInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use MessageContextInfo.ProtoReflect.Descriptor instead. func (*MessageContextInfo) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{55} + return file_binary_proto_def_proto_rawDescGZIP(), []int{58} } func (x *MessageContextInfo) GetDeviceListMetadata() *DeviceListMetadata { @@ -9978,6 +10323,20 @@ func (x *MessageContextInfo) GetMessageAddOnDurationInSecs() uint32 { return 0 } +func (x *MessageContextInfo) GetBotMessageSecret() []byte { + if x != nil { + return x.BotMessageSecret + } + return nil +} + +func (x *MessageContextInfo) GetBotMetadata() *BotMetadata { + if x != nil { + return x.BotMetadata + } + return nil +} + type VideoMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -10011,7 +10370,7 @@ type VideoMessage struct { func (x *VideoMessage) Reset() { *x = VideoMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[56] + mi := &file_binary_proto_def_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10024,7 +10383,7 @@ func (x *VideoMessage) String() string { func (*VideoMessage) ProtoMessage() {} func (x *VideoMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[56] + mi := &file_binary_proto_def_proto_msgTypes[59] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10037,7 +10396,7 @@ func (x *VideoMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use VideoMessage.ProtoReflect.Descriptor instead. func (*VideoMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{56} + return file_binary_proto_def_proto_rawDescGZIP(), []int{59} } func (x *VideoMessage) GetUrl() string { @@ -10220,7 +10579,7 @@ type TemplateMessage struct { func (x *TemplateMessage) Reset() { *x = TemplateMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[57] + mi := &file_binary_proto_def_proto_msgTypes[60] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10233,7 +10592,7 @@ func (x *TemplateMessage) String() string { func (*TemplateMessage) ProtoMessage() {} func (x *TemplateMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[57] + mi := &file_binary_proto_def_proto_msgTypes[60] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10246,7 +10605,7 @@ func (x *TemplateMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use TemplateMessage.ProtoReflect.Descriptor instead. func (*TemplateMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{57} + return file_binary_proto_def_proto_rawDescGZIP(), []int{60} } func (x *TemplateMessage) GetContextInfo() *ContextInfo { @@ -10334,7 +10693,7 @@ type TemplateButtonReplyMessage struct { func (x *TemplateButtonReplyMessage) Reset() { *x = TemplateButtonReplyMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[58] + mi := &file_binary_proto_def_proto_msgTypes[61] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10347,7 +10706,7 @@ func (x *TemplateButtonReplyMessage) String() string { func (*TemplateButtonReplyMessage) ProtoMessage() {} func (x *TemplateButtonReplyMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[58] + mi := &file_binary_proto_def_proto_msgTypes[61] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10360,7 +10719,7 @@ func (x *TemplateButtonReplyMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use TemplateButtonReplyMessage.ProtoReflect.Descriptor instead. func (*TemplateButtonReplyMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{58} + return file_binary_proto_def_proto_rawDescGZIP(), []int{61} } func (x *TemplateButtonReplyMessage) GetSelectedId() string { @@ -10404,7 +10763,7 @@ type StickerSyncRMRMessage struct { func (x *StickerSyncRMRMessage) Reset() { *x = StickerSyncRMRMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[59] + mi := &file_binary_proto_def_proto_msgTypes[62] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10417,7 +10776,7 @@ func (x *StickerSyncRMRMessage) String() string { func (*StickerSyncRMRMessage) ProtoMessage() {} func (x *StickerSyncRMRMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[59] + mi := &file_binary_proto_def_proto_msgTypes[62] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10430,7 +10789,7 @@ func (x *StickerSyncRMRMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use StickerSyncRMRMessage.ProtoReflect.Descriptor instead. func (*StickerSyncRMRMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{59} + return file_binary_proto_def_proto_rawDescGZIP(), []int{62} } func (x *StickerSyncRMRMessage) GetFilehash() []string { @@ -10481,7 +10840,7 @@ type StickerMessage struct { func (x *StickerMessage) Reset() { *x = StickerMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[60] + mi := &file_binary_proto_def_proto_msgTypes[63] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10494,7 +10853,7 @@ func (x *StickerMessage) String() string { func (*StickerMessage) ProtoMessage() {} func (x *StickerMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[60] + mi := &file_binary_proto_def_proto_msgTypes[63] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10507,7 +10866,7 @@ func (x *StickerMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use StickerMessage.ProtoReflect.Descriptor instead. func (*StickerMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{60} + return file_binary_proto_def_proto_rawDescGZIP(), []int{63} } func (x *StickerMessage) GetUrl() string { @@ -10641,7 +11000,7 @@ type SenderKeyDistributionMessage struct { func (x *SenderKeyDistributionMessage) Reset() { *x = SenderKeyDistributionMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[61] + mi := &file_binary_proto_def_proto_msgTypes[64] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10654,7 +11013,7 @@ func (x *SenderKeyDistributionMessage) String() string { func (*SenderKeyDistributionMessage) ProtoMessage() {} func (x *SenderKeyDistributionMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[61] + mi := &file_binary_proto_def_proto_msgTypes[64] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10667,7 +11026,7 @@ func (x *SenderKeyDistributionMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use SenderKeyDistributionMessage.ProtoReflect.Descriptor instead. func (*SenderKeyDistributionMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{61} + return file_binary_proto_def_proto_rawDescGZIP(), []int{64} } func (x *SenderKeyDistributionMessage) GetGroupId() string { @@ -10697,7 +11056,7 @@ type SendPaymentMessage struct { func (x *SendPaymentMessage) Reset() { *x = SendPaymentMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[62] + mi := &file_binary_proto_def_proto_msgTypes[65] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10710,7 +11069,7 @@ func (x *SendPaymentMessage) String() string { func (*SendPaymentMessage) ProtoMessage() {} func (x *SendPaymentMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[62] + mi := &file_binary_proto_def_proto_msgTypes[65] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10723,7 +11082,7 @@ func (x *SendPaymentMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use SendPaymentMessage.ProtoReflect.Descriptor instead. func (*SendPaymentMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{62} + return file_binary_proto_def_proto_rawDescGZIP(), []int{65} } func (x *SendPaymentMessage) GetNoteMessage() *Message { @@ -10759,7 +11118,7 @@ type ScheduledCallEditMessage struct { func (x *ScheduledCallEditMessage) Reset() { *x = ScheduledCallEditMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[63] + mi := &file_binary_proto_def_proto_msgTypes[66] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10772,7 +11131,7 @@ func (x *ScheduledCallEditMessage) String() string { func (*ScheduledCallEditMessage) ProtoMessage() {} func (x *ScheduledCallEditMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[63] + mi := &file_binary_proto_def_proto_msgTypes[66] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10785,7 +11144,7 @@ func (x *ScheduledCallEditMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use ScheduledCallEditMessage.ProtoReflect.Descriptor instead. func (*ScheduledCallEditMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{63} + return file_binary_proto_def_proto_rawDescGZIP(), []int{66} } func (x *ScheduledCallEditMessage) GetKey() *MessageKey { @@ -10815,7 +11174,7 @@ type ScheduledCallCreationMessage struct { func (x *ScheduledCallCreationMessage) Reset() { *x = ScheduledCallCreationMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[64] + mi := &file_binary_proto_def_proto_msgTypes[67] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10828,7 +11187,7 @@ func (x *ScheduledCallCreationMessage) String() string { func (*ScheduledCallCreationMessage) ProtoMessage() {} func (x *ScheduledCallCreationMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[64] + mi := &file_binary_proto_def_proto_msgTypes[67] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10841,7 +11200,7 @@ func (x *ScheduledCallCreationMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use ScheduledCallCreationMessage.ProtoReflect.Descriptor instead. func (*ScheduledCallCreationMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{64} + return file_binary_proto_def_proto_rawDescGZIP(), []int{67} } func (x *ScheduledCallCreationMessage) GetScheduledTimestampMs() int64 { @@ -10876,7 +11235,7 @@ type RequestPhoneNumberMessage struct { func (x *RequestPhoneNumberMessage) Reset() { *x = RequestPhoneNumberMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[65] + mi := &file_binary_proto_def_proto_msgTypes[68] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10889,7 +11248,7 @@ func (x *RequestPhoneNumberMessage) String() string { func (*RequestPhoneNumberMessage) ProtoMessage() {} func (x *RequestPhoneNumberMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[65] + mi := &file_binary_proto_def_proto_msgTypes[68] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10902,7 +11261,7 @@ func (x *RequestPhoneNumberMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use RequestPhoneNumberMessage.ProtoReflect.Descriptor instead. func (*RequestPhoneNumberMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{65} + return file_binary_proto_def_proto_rawDescGZIP(), []int{68} } func (x *RequestPhoneNumberMessage) GetContextInfo() *ContextInfo { @@ -10929,7 +11288,7 @@ type RequestPaymentMessage struct { func (x *RequestPaymentMessage) Reset() { *x = RequestPaymentMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[66] + mi := &file_binary_proto_def_proto_msgTypes[69] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10942,7 +11301,7 @@ func (x *RequestPaymentMessage) String() string { func (*RequestPaymentMessage) ProtoMessage() {} func (x *RequestPaymentMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[66] + mi := &file_binary_proto_def_proto_msgTypes[69] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10955,7 +11314,7 @@ func (x *RequestPaymentMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use RequestPaymentMessage.ProtoReflect.Descriptor instead. func (*RequestPaymentMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{66} + return file_binary_proto_def_proto_rawDescGZIP(), []int{69} } func (x *RequestPaymentMessage) GetNoteMessage() *Message { @@ -11021,7 +11380,7 @@ type ReactionMessage struct { func (x *ReactionMessage) Reset() { *x = ReactionMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[67] + mi := &file_binary_proto_def_proto_msgTypes[70] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11034,7 +11393,7 @@ func (x *ReactionMessage) String() string { func (*ReactionMessage) ProtoMessage() {} func (x *ReactionMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[67] + mi := &file_binary_proto_def_proto_msgTypes[70] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11047,7 +11406,7 @@ func (x *ReactionMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use ReactionMessage.ProtoReflect.Descriptor instead. func (*ReactionMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{67} + return file_binary_proto_def_proto_rawDescGZIP(), []int{70} } func (x *ReactionMessage) GetKey() *MessageKey { @@ -11097,12 +11456,13 @@ type ProtocolMessage struct { TimestampMs *int64 `protobuf:"varint,15,opt,name=timestampMs" json:"timestampMs,omitempty"` PeerDataOperationRequestMessage *PeerDataOperationRequestMessage `protobuf:"bytes,16,opt,name=peerDataOperationRequestMessage" json:"peerDataOperationRequestMessage,omitempty"` PeerDataOperationRequestResponseMessage *PeerDataOperationRequestResponseMessage `protobuf:"bytes,17,opt,name=peerDataOperationRequestResponseMessage" json:"peerDataOperationRequestResponseMessage,omitempty"` + BotFeedbackMessage *BotFeedbackMessage `protobuf:"bytes,18,opt,name=botFeedbackMessage" json:"botFeedbackMessage,omitempty"` } func (x *ProtocolMessage) Reset() { *x = ProtocolMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[68] + mi := &file_binary_proto_def_proto_msgTypes[71] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11115,7 +11475,7 @@ func (x *ProtocolMessage) String() string { func (*ProtocolMessage) ProtoMessage() {} func (x *ProtocolMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[68] + mi := &file_binary_proto_def_proto_msgTypes[71] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11128,7 +11488,7 @@ func (x *ProtocolMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use ProtocolMessage.ProtoReflect.Descriptor instead. func (*ProtocolMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{68} + return file_binary_proto_def_proto_rawDescGZIP(), []int{71} } func (x *ProtocolMessage) GetKey() *MessageKey { @@ -11229,6 +11589,13 @@ func (x *ProtocolMessage) GetPeerDataOperationRequestResponseMessage() *PeerData return nil } +func (x *ProtocolMessage) GetBotFeedbackMessage() *BotFeedbackMessage { + if x != nil { + return x.BotFeedbackMessage + } + return nil +} + type ProductMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -11245,7 +11612,7 @@ type ProductMessage struct { func (x *ProductMessage) Reset() { *x = ProductMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[69] + mi := &file_binary_proto_def_proto_msgTypes[72] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11258,7 +11625,7 @@ func (x *ProductMessage) String() string { func (*ProductMessage) ProtoMessage() {} func (x *ProductMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[69] + mi := &file_binary_proto_def_proto_msgTypes[72] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11271,7 +11638,7 @@ func (x *ProductMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use ProductMessage.ProtoReflect.Descriptor instead. func (*ProductMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{69} + return file_binary_proto_def_proto_rawDescGZIP(), []int{72} } func (x *ProductMessage) GetProduct() *ProductMessage_ProductSnapshot { @@ -11327,7 +11694,7 @@ type PollVoteMessage struct { func (x *PollVoteMessage) Reset() { *x = PollVoteMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[70] + mi := &file_binary_proto_def_proto_msgTypes[73] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11340,7 +11707,7 @@ func (x *PollVoteMessage) String() string { func (*PollVoteMessage) ProtoMessage() {} func (x *PollVoteMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[70] + mi := &file_binary_proto_def_proto_msgTypes[73] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11353,7 +11720,7 @@ func (x *PollVoteMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use PollVoteMessage.ProtoReflect.Descriptor instead. func (*PollVoteMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{70} + return file_binary_proto_def_proto_rawDescGZIP(), []int{73} } func (x *PollVoteMessage) GetSelectedOptions() [][]byte { @@ -11377,7 +11744,7 @@ type PollUpdateMessage struct { func (x *PollUpdateMessage) Reset() { *x = PollUpdateMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[71] + mi := &file_binary_proto_def_proto_msgTypes[74] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11390,7 +11757,7 @@ func (x *PollUpdateMessage) String() string { func (*PollUpdateMessage) ProtoMessage() {} func (x *PollUpdateMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[71] + mi := &file_binary_proto_def_proto_msgTypes[74] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11403,7 +11770,7 @@ func (x *PollUpdateMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use PollUpdateMessage.ProtoReflect.Descriptor instead. func (*PollUpdateMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{71} + return file_binary_proto_def_proto_rawDescGZIP(), []int{74} } func (x *PollUpdateMessage) GetPollCreationMessageKey() *MessageKey { @@ -11443,7 +11810,7 @@ type PollUpdateMessageMetadata struct { func (x *PollUpdateMessageMetadata) Reset() { *x = PollUpdateMessageMetadata{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[72] + mi := &file_binary_proto_def_proto_msgTypes[75] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11456,7 +11823,7 @@ func (x *PollUpdateMessageMetadata) String() string { func (*PollUpdateMessageMetadata) ProtoMessage() {} func (x *PollUpdateMessageMetadata) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[72] + mi := &file_binary_proto_def_proto_msgTypes[75] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11469,7 +11836,7 @@ func (x *PollUpdateMessageMetadata) ProtoReflect() protoreflect.Message { // Deprecated: Use PollUpdateMessageMetadata.ProtoReflect.Descriptor instead. func (*PollUpdateMessageMetadata) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{72} + return file_binary_proto_def_proto_rawDescGZIP(), []int{75} } type PollEncValue struct { @@ -11484,7 +11851,7 @@ type PollEncValue struct { func (x *PollEncValue) Reset() { *x = PollEncValue{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[73] + mi := &file_binary_proto_def_proto_msgTypes[76] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11497,7 +11864,7 @@ func (x *PollEncValue) String() string { func (*PollEncValue) ProtoMessage() {} func (x *PollEncValue) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[73] + mi := &file_binary_proto_def_proto_msgTypes[76] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11510,7 +11877,7 @@ func (x *PollEncValue) ProtoReflect() protoreflect.Message { // Deprecated: Use PollEncValue.ProtoReflect.Descriptor instead. func (*PollEncValue) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{73} + return file_binary_proto_def_proto_rawDescGZIP(), []int{76} } func (x *PollEncValue) GetEncPayload() []byte { @@ -11542,7 +11909,7 @@ type PollCreationMessage struct { func (x *PollCreationMessage) Reset() { *x = PollCreationMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[74] + mi := &file_binary_proto_def_proto_msgTypes[77] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11555,7 +11922,7 @@ func (x *PollCreationMessage) String() string { func (*PollCreationMessage) ProtoMessage() {} func (x *PollCreationMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[74] + mi := &file_binary_proto_def_proto_msgTypes[77] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11568,7 +11935,7 @@ func (x *PollCreationMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use PollCreationMessage.ProtoReflect.Descriptor instead. func (*PollCreationMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{74} + return file_binary_proto_def_proto_rawDescGZIP(), []int{77} } func (x *PollCreationMessage) GetEncKey() []byte { @@ -11619,7 +11986,7 @@ type PinInChatMessage struct { func (x *PinInChatMessage) Reset() { *x = PinInChatMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[75] + mi := &file_binary_proto_def_proto_msgTypes[78] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11632,7 +11999,7 @@ func (x *PinInChatMessage) String() string { func (*PinInChatMessage) ProtoMessage() {} func (x *PinInChatMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[75] + mi := &file_binary_proto_def_proto_msgTypes[78] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11645,7 +12012,7 @@ func (x *PinInChatMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use PinInChatMessage.ProtoReflect.Descriptor instead. func (*PinInChatMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{75} + return file_binary_proto_def_proto_rawDescGZIP(), []int{78} } func (x *PinInChatMessage) GetKey() *MessageKey { @@ -11682,7 +12049,7 @@ type PeerDataOperationRequestResponseMessage struct { func (x *PeerDataOperationRequestResponseMessage) Reset() { *x = PeerDataOperationRequestResponseMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[76] + mi := &file_binary_proto_def_proto_msgTypes[79] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11695,7 +12062,7 @@ func (x *PeerDataOperationRequestResponseMessage) String() string { func (*PeerDataOperationRequestResponseMessage) ProtoMessage() {} func (x *PeerDataOperationRequestResponseMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[76] + mi := &file_binary_proto_def_proto_msgTypes[79] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11708,7 +12075,7 @@ func (x *PeerDataOperationRequestResponseMessage) ProtoReflect() protoreflect.Me // Deprecated: Use PeerDataOperationRequestResponseMessage.ProtoReflect.Descriptor instead. func (*PeerDataOperationRequestResponseMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{76} + return file_binary_proto_def_proto_rawDescGZIP(), []int{79} } func (x *PeerDataOperationRequestResponseMessage) GetPeerDataOperationRequestType() PeerDataOperationRequestType { @@ -11747,7 +12114,7 @@ type PeerDataOperationRequestMessage struct { func (x *PeerDataOperationRequestMessage) Reset() { *x = PeerDataOperationRequestMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[77] + mi := &file_binary_proto_def_proto_msgTypes[80] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11760,7 +12127,7 @@ func (x *PeerDataOperationRequestMessage) String() string { func (*PeerDataOperationRequestMessage) ProtoMessage() {} func (x *PeerDataOperationRequestMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[77] + mi := &file_binary_proto_def_proto_msgTypes[80] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11773,7 +12140,7 @@ func (x *PeerDataOperationRequestMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use PeerDataOperationRequestMessage.ProtoReflect.Descriptor instead. func (*PeerDataOperationRequestMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{77} + return file_binary_proto_def_proto_rawDescGZIP(), []int{80} } func (x *PeerDataOperationRequestMessage) GetPeerDataOperationRequestType() PeerDataOperationRequestType { @@ -11811,6 +12178,61 @@ func (x *PeerDataOperationRequestMessage) GetPlaceholderMessageResendRequest() [ return nil } +type PaymentInviteMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ServiceType *PaymentInviteMessage_ServiceType `protobuf:"varint,1,opt,name=serviceType,enum=proto.PaymentInviteMessage_ServiceType" json:"serviceType,omitempty"` + ExpiryTimestamp *int64 `protobuf:"varint,2,opt,name=expiryTimestamp" json:"expiryTimestamp,omitempty"` +} + +func (x *PaymentInviteMessage) Reset() { + *x = PaymentInviteMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_binary_proto_def_proto_msgTypes[81] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PaymentInviteMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PaymentInviteMessage) ProtoMessage() {} + +func (x *PaymentInviteMessage) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[81] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PaymentInviteMessage.ProtoReflect.Descriptor instead. +func (*PaymentInviteMessage) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{81} +} + +func (x *PaymentInviteMessage) GetServiceType() PaymentInviteMessage_ServiceType { + if x != nil && x.ServiceType != nil { + return *x.ServiceType + } + return PaymentInviteMessage_UNKNOWN +} + +func (x *PaymentInviteMessage) GetExpiryTimestamp() int64 { + if x != nil && x.ExpiryTimestamp != nil { + return *x.ExpiryTimestamp + } + return 0 +} + type EphemeralSetting struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -11823,7 +12245,7 @@ type EphemeralSetting struct { func (x *EphemeralSetting) Reset() { *x = EphemeralSetting{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[78] + mi := &file_binary_proto_def_proto_msgTypes[82] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11836,7 +12258,7 @@ func (x *EphemeralSetting) String() string { func (*EphemeralSetting) ProtoMessage() {} func (x *EphemeralSetting) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[78] + mi := &file_binary_proto_def_proto_msgTypes[82] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11849,7 +12271,7 @@ func (x *EphemeralSetting) ProtoReflect() protoreflect.Message { // Deprecated: Use EphemeralSetting.ProtoReflect.Descriptor instead. func (*EphemeralSetting) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{78} + return file_binary_proto_def_proto_rawDescGZIP(), []int{82} } func (x *EphemeralSetting) GetDuration() int32 { @@ -11878,7 +12300,7 @@ type WallpaperSettings struct { func (x *WallpaperSettings) Reset() { *x = WallpaperSettings{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[79] + mi := &file_binary_proto_def_proto_msgTypes[83] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11891,7 +12313,7 @@ func (x *WallpaperSettings) String() string { func (*WallpaperSettings) ProtoMessage() {} func (x *WallpaperSettings) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[79] + mi := &file_binary_proto_def_proto_msgTypes[83] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11904,7 +12326,7 @@ func (x *WallpaperSettings) ProtoReflect() protoreflect.Message { // Deprecated: Use WallpaperSettings.ProtoReflect.Descriptor instead. func (*WallpaperSettings) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{79} + return file_binary_proto_def_proto_rawDescGZIP(), []int{83} } func (x *WallpaperSettings) GetFilename() string { @@ -11942,7 +12364,7 @@ type StickerMetadata struct { func (x *StickerMetadata) Reset() { *x = StickerMetadata{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[80] + mi := &file_binary_proto_def_proto_msgTypes[84] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11955,7 +12377,7 @@ func (x *StickerMetadata) String() string { func (*StickerMetadata) ProtoMessage() {} func (x *StickerMetadata) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[80] + mi := &file_binary_proto_def_proto_msgTypes[84] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11968,7 +12390,7 @@ func (x *StickerMetadata) ProtoReflect() protoreflect.Message { // Deprecated: Use StickerMetadata.ProtoReflect.Descriptor instead. func (*StickerMetadata) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{80} + return file_binary_proto_def_proto_rawDescGZIP(), []int{84} } func (x *StickerMetadata) GetUrl() string { @@ -12060,7 +12482,7 @@ type Pushname struct { func (x *Pushname) Reset() { *x = Pushname{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[81] + mi := &file_binary_proto_def_proto_msgTypes[85] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12073,7 +12495,7 @@ func (x *Pushname) String() string { func (*Pushname) ProtoMessage() {} func (x *Pushname) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[81] + mi := &file_binary_proto_def_proto_msgTypes[85] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12086,7 +12508,7 @@ func (x *Pushname) ProtoReflect() protoreflect.Message { // Deprecated: Use Pushname.ProtoReflect.Descriptor instead. func (*Pushname) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{81} + return file_binary_proto_def_proto_rawDescGZIP(), []int{85} } func (x *Pushname) GetId() string { @@ -12115,7 +12537,7 @@ type PastParticipants struct { func (x *PastParticipants) Reset() { *x = PastParticipants{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[82] + mi := &file_binary_proto_def_proto_msgTypes[86] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12128,7 +12550,7 @@ func (x *PastParticipants) String() string { func (*PastParticipants) ProtoMessage() {} func (x *PastParticipants) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[82] + mi := &file_binary_proto_def_proto_msgTypes[86] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12141,7 +12563,7 @@ func (x *PastParticipants) ProtoReflect() protoreflect.Message { // Deprecated: Use PastParticipants.ProtoReflect.Descriptor instead. func (*PastParticipants) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{82} + return file_binary_proto_def_proto_rawDescGZIP(), []int{86} } func (x *PastParticipants) GetGroupJid() string { @@ -12171,7 +12593,7 @@ type PastParticipant struct { func (x *PastParticipant) Reset() { *x = PastParticipant{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[83] + mi := &file_binary_proto_def_proto_msgTypes[87] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12184,7 +12606,7 @@ func (x *PastParticipant) String() string { func (*PastParticipant) ProtoMessage() {} func (x *PastParticipant) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[83] + mi := &file_binary_proto_def_proto_msgTypes[87] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12197,7 +12619,7 @@ func (x *PastParticipant) ProtoReflect() protoreflect.Message { // Deprecated: Use PastParticipant.ProtoReflect.Descriptor instead. func (*PastParticipant) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{83} + return file_binary_proto_def_proto_rawDescGZIP(), []int{87} } func (x *PastParticipant) GetUserJid() string { @@ -12237,7 +12659,7 @@ type NotificationSettings struct { func (x *NotificationSettings) Reset() { *x = NotificationSettings{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[84] + mi := &file_binary_proto_def_proto_msgTypes[88] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12250,7 +12672,7 @@ func (x *NotificationSettings) String() string { func (*NotificationSettings) ProtoMessage() {} func (x *NotificationSettings) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[84] + mi := &file_binary_proto_def_proto_msgTypes[88] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12263,7 +12685,7 @@ func (x *NotificationSettings) ProtoReflect() protoreflect.Message { // Deprecated: Use NotificationSettings.ProtoReflect.Descriptor instead. func (*NotificationSettings) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{84} + return file_binary_proto_def_proto_rawDescGZIP(), []int{88} } func (x *NotificationSettings) GetMessageVibrate() string { @@ -12329,7 +12751,7 @@ type HistorySync struct { func (x *HistorySync) Reset() { *x = HistorySync{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[85] + mi := &file_binary_proto_def_proto_msgTypes[89] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12342,7 +12764,7 @@ func (x *HistorySync) String() string { func (*HistorySync) ProtoMessage() {} func (x *HistorySync) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[85] + mi := &file_binary_proto_def_proto_msgTypes[89] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12355,7 +12777,7 @@ func (x *HistorySync) ProtoReflect() protoreflect.Message { // Deprecated: Use HistorySync.ProtoReflect.Descriptor instead. func (*HistorySync) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{85} + return file_binary_proto_def_proto_rawDescGZIP(), []int{89} } func (x *HistorySync) GetSyncType() HistorySync_HistorySyncType { @@ -12447,7 +12869,7 @@ type HistorySyncMsg struct { func (x *HistorySyncMsg) Reset() { *x = HistorySyncMsg{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[86] + mi := &file_binary_proto_def_proto_msgTypes[90] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12460,7 +12882,7 @@ func (x *HistorySyncMsg) String() string { func (*HistorySyncMsg) ProtoMessage() {} func (x *HistorySyncMsg) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[86] + mi := &file_binary_proto_def_proto_msgTypes[90] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12473,7 +12895,7 @@ func (x *HistorySyncMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use HistorySyncMsg.ProtoReflect.Descriptor instead. func (*HistorySyncMsg) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{86} + return file_binary_proto_def_proto_rawDescGZIP(), []int{90} } func (x *HistorySyncMsg) GetMessage() *WebMessageInfo { @@ -12502,7 +12924,7 @@ type GroupParticipant struct { func (x *GroupParticipant) Reset() { *x = GroupParticipant{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[87] + mi := &file_binary_proto_def_proto_msgTypes[91] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12515,7 +12937,7 @@ func (x *GroupParticipant) String() string { func (*GroupParticipant) ProtoMessage() {} func (x *GroupParticipant) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[87] + mi := &file_binary_proto_def_proto_msgTypes[91] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12528,7 +12950,7 @@ func (x *GroupParticipant) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupParticipant.ProtoReflect.Descriptor instead. func (*GroupParticipant) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{87} + return file_binary_proto_def_proto_rawDescGZIP(), []int{91} } func (x *GroupParticipant) GetUserJid() string { @@ -12573,7 +12995,7 @@ type GlobalSettings struct { func (x *GlobalSettings) Reset() { *x = GlobalSettings{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[88] + mi := &file_binary_proto_def_proto_msgTypes[92] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12586,7 +13008,7 @@ func (x *GlobalSettings) String() string { func (*GlobalSettings) ProtoMessage() {} func (x *GlobalSettings) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[88] + mi := &file_binary_proto_def_proto_msgTypes[92] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12599,7 +13021,7 @@ func (x *GlobalSettings) ProtoReflect() protoreflect.Message { // Deprecated: Use GlobalSettings.ProtoReflect.Descriptor instead. func (*GlobalSettings) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{88} + return file_binary_proto_def_proto_rawDescGZIP(), []int{92} } func (x *GlobalSettings) GetLightThemeWallpaper() *WallpaperSettings { @@ -12780,7 +13202,7 @@ type Conversation struct { func (x *Conversation) Reset() { *x = Conversation{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[89] + mi := &file_binary_proto_def_proto_msgTypes[93] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12793,7 +13215,7 @@ func (x *Conversation) String() string { func (*Conversation) ProtoMessage() {} func (x *Conversation) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[89] + mi := &file_binary_proto_def_proto_msgTypes[93] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12806,7 +13228,7 @@ func (x *Conversation) ProtoReflect() protoreflect.Message { // Deprecated: Use Conversation.ProtoReflect.Descriptor instead. func (*Conversation) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{89} + return file_binary_proto_def_proto_rawDescGZIP(), []int{93} } func (x *Conversation) GetId() string { @@ -13115,7 +13537,7 @@ type AvatarUserSettings struct { func (x *AvatarUserSettings) Reset() { *x = AvatarUserSettings{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[90] + mi := &file_binary_proto_def_proto_msgTypes[94] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13128,7 +13550,7 @@ func (x *AvatarUserSettings) String() string { func (*AvatarUserSettings) ProtoMessage() {} func (x *AvatarUserSettings) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[90] + mi := &file_binary_proto_def_proto_msgTypes[94] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13141,7 +13563,7 @@ func (x *AvatarUserSettings) ProtoReflect() protoreflect.Message { // Deprecated: Use AvatarUserSettings.ProtoReflect.Descriptor instead. func (*AvatarUserSettings) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{90} + return file_binary_proto_def_proto_rawDescGZIP(), []int{94} } func (x *AvatarUserSettings) GetFbid() string { @@ -13172,7 +13594,7 @@ type AutoDownloadSettings struct { func (x *AutoDownloadSettings) Reset() { *x = AutoDownloadSettings{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[91] + mi := &file_binary_proto_def_proto_msgTypes[95] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13185,7 +13607,7 @@ func (x *AutoDownloadSettings) String() string { func (*AutoDownloadSettings) ProtoMessage() {} func (x *AutoDownloadSettings) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[91] + mi := &file_binary_proto_def_proto_msgTypes[95] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13198,7 +13620,7 @@ func (x *AutoDownloadSettings) ProtoReflect() protoreflect.Message { // Deprecated: Use AutoDownloadSettings.ProtoReflect.Descriptor instead. func (*AutoDownloadSettings) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{91} + return file_binary_proto_def_proto_rawDescGZIP(), []int{95} } func (x *AutoDownloadSettings) GetDownloadImages() bool { @@ -13229,308 +13651,6 @@ func (x *AutoDownloadSettings) GetDownloadDocuments() bool { return false } -type MsgRowOpaqueData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - CurrentMsg *MsgOpaqueData `protobuf:"bytes,1,opt,name=currentMsg" json:"currentMsg,omitempty"` - QuotedMsg *MsgOpaqueData `protobuf:"bytes,2,opt,name=quotedMsg" json:"quotedMsg,omitempty"` -} - -func (x *MsgRowOpaqueData) Reset() { - *x = MsgRowOpaqueData{} - if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[92] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgRowOpaqueData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgRowOpaqueData) ProtoMessage() {} - -func (x *MsgRowOpaqueData) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[92] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MsgRowOpaqueData.ProtoReflect.Descriptor instead. -func (*MsgRowOpaqueData) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{92} -} - -func (x *MsgRowOpaqueData) GetCurrentMsg() *MsgOpaqueData { - if x != nil { - return x.CurrentMsg - } - return nil -} - -func (x *MsgRowOpaqueData) GetQuotedMsg() *MsgOpaqueData { - if x != nil { - return x.QuotedMsg - } - return nil -} - -type MsgOpaqueData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Body *string `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` - Caption *string `protobuf:"bytes,3,opt,name=caption" json:"caption,omitempty"` - Lng *float64 `protobuf:"fixed64,5,opt,name=lng" json:"lng,omitempty"` - IsLive *bool `protobuf:"varint,6,opt,name=isLive" json:"isLive,omitempty"` - Lat *float64 `protobuf:"fixed64,7,opt,name=lat" json:"lat,omitempty"` - PaymentAmount1000 *int32 `protobuf:"varint,8,opt,name=paymentAmount1000" json:"paymentAmount1000,omitempty"` - PaymentNoteMsgBody *string `protobuf:"bytes,9,opt,name=paymentNoteMsgBody" json:"paymentNoteMsgBody,omitempty"` - CanonicalUrl *string `protobuf:"bytes,10,opt,name=canonicalUrl" json:"canonicalUrl,omitempty"` - MatchedText *string `protobuf:"bytes,11,opt,name=matchedText" json:"matchedText,omitempty"` - Title *string `protobuf:"bytes,12,opt,name=title" json:"title,omitempty"` - Description *string `protobuf:"bytes,13,opt,name=description" json:"description,omitempty"` - FutureproofBuffer []byte `protobuf:"bytes,14,opt,name=futureproofBuffer" json:"futureproofBuffer,omitempty"` - ClientUrl *string `protobuf:"bytes,15,opt,name=clientUrl" json:"clientUrl,omitempty"` - Loc *string `protobuf:"bytes,16,opt,name=loc" json:"loc,omitempty"` - PollName *string `protobuf:"bytes,17,opt,name=pollName" json:"pollName,omitempty"` - PollOptions []*MsgOpaqueData_PollOption `protobuf:"bytes,18,rep,name=pollOptions" json:"pollOptions,omitempty"` - PollSelectableOptionsCount *uint32 `protobuf:"varint,20,opt,name=pollSelectableOptionsCount" json:"pollSelectableOptionsCount,omitempty"` - MessageSecret []byte `protobuf:"bytes,21,opt,name=messageSecret" json:"messageSecret,omitempty"` - OriginalSelfAuthor *string `protobuf:"bytes,51,opt,name=originalSelfAuthor" json:"originalSelfAuthor,omitempty"` - SenderTimestampMs *int64 `protobuf:"varint,22,opt,name=senderTimestampMs" json:"senderTimestampMs,omitempty"` - PollUpdateParentKey *string `protobuf:"bytes,23,opt,name=pollUpdateParentKey" json:"pollUpdateParentKey,omitempty"` - EncPollVote *PollEncValue `protobuf:"bytes,24,opt,name=encPollVote" json:"encPollVote,omitempty"` - IsSentCagPollCreation *bool `protobuf:"varint,28,opt,name=isSentCagPollCreation" json:"isSentCagPollCreation,omitempty"` - EncReactionTargetMessageKey *string `protobuf:"bytes,25,opt,name=encReactionTargetMessageKey" json:"encReactionTargetMessageKey,omitempty"` - EncReactionEncPayload []byte `protobuf:"bytes,26,opt,name=encReactionEncPayload" json:"encReactionEncPayload,omitempty"` - EncReactionEncIv []byte `protobuf:"bytes,27,opt,name=encReactionEncIv" json:"encReactionEncIv,omitempty"` -} - -func (x *MsgOpaqueData) Reset() { - *x = MsgOpaqueData{} - if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[93] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgOpaqueData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgOpaqueData) ProtoMessage() {} - -func (x *MsgOpaqueData) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[93] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MsgOpaqueData.ProtoReflect.Descriptor instead. -func (*MsgOpaqueData) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{93} -} - -func (x *MsgOpaqueData) GetBody() string { - if x != nil && x.Body != nil { - return *x.Body - } - return "" -} - -func (x *MsgOpaqueData) GetCaption() string { - if x != nil && x.Caption != nil { - return *x.Caption - } - return "" -} - -func (x *MsgOpaqueData) GetLng() float64 { - if x != nil && x.Lng != nil { - return *x.Lng - } - return 0 -} - -func (x *MsgOpaqueData) GetIsLive() bool { - if x != nil && x.IsLive != nil { - return *x.IsLive - } - return false -} - -func (x *MsgOpaqueData) GetLat() float64 { - if x != nil && x.Lat != nil { - return *x.Lat - } - return 0 -} - -func (x *MsgOpaqueData) GetPaymentAmount1000() int32 { - if x != nil && x.PaymentAmount1000 != nil { - return *x.PaymentAmount1000 - } - return 0 -} - -func (x *MsgOpaqueData) GetPaymentNoteMsgBody() string { - if x != nil && x.PaymentNoteMsgBody != nil { - return *x.PaymentNoteMsgBody - } - return "" -} - -func (x *MsgOpaqueData) GetCanonicalUrl() string { - if x != nil && x.CanonicalUrl != nil { - return *x.CanonicalUrl - } - return "" -} - -func (x *MsgOpaqueData) GetMatchedText() string { - if x != nil && x.MatchedText != nil { - return *x.MatchedText - } - return "" -} - -func (x *MsgOpaqueData) GetTitle() string { - if x != nil && x.Title != nil { - return *x.Title - } - return "" -} - -func (x *MsgOpaqueData) GetDescription() string { - if x != nil && x.Description != nil { - return *x.Description - } - return "" -} - -func (x *MsgOpaqueData) GetFutureproofBuffer() []byte { - if x != nil { - return x.FutureproofBuffer - } - return nil -} - -func (x *MsgOpaqueData) GetClientUrl() string { - if x != nil && x.ClientUrl != nil { - return *x.ClientUrl - } - return "" -} - -func (x *MsgOpaqueData) GetLoc() string { - if x != nil && x.Loc != nil { - return *x.Loc - } - return "" -} - -func (x *MsgOpaqueData) GetPollName() string { - if x != nil && x.PollName != nil { - return *x.PollName - } - return "" -} - -func (x *MsgOpaqueData) GetPollOptions() []*MsgOpaqueData_PollOption { - if x != nil { - return x.PollOptions - } - return nil -} - -func (x *MsgOpaqueData) GetPollSelectableOptionsCount() uint32 { - if x != nil && x.PollSelectableOptionsCount != nil { - return *x.PollSelectableOptionsCount - } - return 0 -} - -func (x *MsgOpaqueData) GetMessageSecret() []byte { - if x != nil { - return x.MessageSecret - } - return nil -} - -func (x *MsgOpaqueData) GetOriginalSelfAuthor() string { - if x != nil && x.OriginalSelfAuthor != nil { - return *x.OriginalSelfAuthor - } - return "" -} - -func (x *MsgOpaqueData) GetSenderTimestampMs() int64 { - if x != nil && x.SenderTimestampMs != nil { - return *x.SenderTimestampMs - } - return 0 -} - -func (x *MsgOpaqueData) GetPollUpdateParentKey() string { - if x != nil && x.PollUpdateParentKey != nil { - return *x.PollUpdateParentKey - } - return "" -} - -func (x *MsgOpaqueData) GetEncPollVote() *PollEncValue { - if x != nil { - return x.EncPollVote - } - return nil -} - -func (x *MsgOpaqueData) GetIsSentCagPollCreation() bool { - if x != nil && x.IsSentCagPollCreation != nil { - return *x.IsSentCagPollCreation - } - return false -} - -func (x *MsgOpaqueData) GetEncReactionTargetMessageKey() string { - if x != nil && x.EncReactionTargetMessageKey != nil { - return *x.EncReactionTargetMessageKey - } - return "" -} - -func (x *MsgOpaqueData) GetEncReactionEncPayload() []byte { - if x != nil { - return x.EncReactionEncPayload - } - return nil -} - -func (x *MsgOpaqueData) GetEncReactionEncIv() []byte { - if x != nil { - return x.EncReactionEncIv - } - return nil -} - type ServerErrorReceipt struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -13542,7 +13662,7 @@ type ServerErrorReceipt struct { func (x *ServerErrorReceipt) Reset() { *x = ServerErrorReceipt{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[94] + mi := &file_binary_proto_def_proto_msgTypes[96] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13555,7 +13675,7 @@ func (x *ServerErrorReceipt) String() string { func (*ServerErrorReceipt) ProtoMessage() {} func (x *ServerErrorReceipt) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[94] + mi := &file_binary_proto_def_proto_msgTypes[96] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13568,7 +13688,7 @@ func (x *ServerErrorReceipt) ProtoReflect() protoreflect.Message { // Deprecated: Use ServerErrorReceipt.ProtoReflect.Descriptor instead. func (*ServerErrorReceipt) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{94} + return file_binary_proto_def_proto_rawDescGZIP(), []int{96} } func (x *ServerErrorReceipt) GetStanzaId() string { @@ -13591,7 +13711,7 @@ type MediaRetryNotification struct { func (x *MediaRetryNotification) Reset() { *x = MediaRetryNotification{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[95] + mi := &file_binary_proto_def_proto_msgTypes[97] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13604,7 +13724,7 @@ func (x *MediaRetryNotification) String() string { func (*MediaRetryNotification) ProtoMessage() {} func (x *MediaRetryNotification) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[95] + mi := &file_binary_proto_def_proto_msgTypes[97] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13617,7 +13737,7 @@ func (x *MediaRetryNotification) ProtoReflect() protoreflect.Message { // Deprecated: Use MediaRetryNotification.ProtoReflect.Descriptor instead. func (*MediaRetryNotification) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{95} + return file_binary_proto_def_proto_rawDescGZIP(), []int{97} } func (x *MediaRetryNotification) GetStanzaId() string { @@ -13655,7 +13775,7 @@ type MessageKey struct { func (x *MessageKey) Reset() { *x = MessageKey{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[96] + mi := &file_binary_proto_def_proto_msgTypes[98] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13668,7 +13788,7 @@ func (x *MessageKey) String() string { func (*MessageKey) ProtoMessage() {} func (x *MessageKey) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[96] + mi := &file_binary_proto_def_proto_msgTypes[98] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13681,7 +13801,7 @@ func (x *MessageKey) ProtoReflect() protoreflect.Message { // Deprecated: Use MessageKey.ProtoReflect.Descriptor instead. func (*MessageKey) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{96} + return file_binary_proto_def_proto_rawDescGZIP(), []int{98} } func (x *MessageKey) GetRemoteJid() string { @@ -13723,7 +13843,7 @@ type SyncdVersion struct { func (x *SyncdVersion) Reset() { *x = SyncdVersion{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[97] + mi := &file_binary_proto_def_proto_msgTypes[99] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13736,7 +13856,7 @@ func (x *SyncdVersion) String() string { func (*SyncdVersion) ProtoMessage() {} func (x *SyncdVersion) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[97] + mi := &file_binary_proto_def_proto_msgTypes[99] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13749,7 +13869,7 @@ func (x *SyncdVersion) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncdVersion.ProtoReflect.Descriptor instead. func (*SyncdVersion) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{97} + return file_binary_proto_def_proto_rawDescGZIP(), []int{99} } func (x *SyncdVersion) GetVersion() uint64 { @@ -13770,7 +13890,7 @@ type SyncdValue struct { func (x *SyncdValue) Reset() { *x = SyncdValue{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[98] + mi := &file_binary_proto_def_proto_msgTypes[100] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13783,7 +13903,7 @@ func (x *SyncdValue) String() string { func (*SyncdValue) ProtoMessage() {} func (x *SyncdValue) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[98] + mi := &file_binary_proto_def_proto_msgTypes[100] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13796,7 +13916,7 @@ func (x *SyncdValue) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncdValue.ProtoReflect.Descriptor instead. func (*SyncdValue) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{98} + return file_binary_proto_def_proto_rawDescGZIP(), []int{100} } func (x *SyncdValue) GetBlob() []byte { @@ -13820,7 +13940,7 @@ type SyncdSnapshot struct { func (x *SyncdSnapshot) Reset() { *x = SyncdSnapshot{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[99] + mi := &file_binary_proto_def_proto_msgTypes[101] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13833,7 +13953,7 @@ func (x *SyncdSnapshot) String() string { func (*SyncdSnapshot) ProtoMessage() {} func (x *SyncdSnapshot) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[99] + mi := &file_binary_proto_def_proto_msgTypes[101] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13846,7 +13966,7 @@ func (x *SyncdSnapshot) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncdSnapshot.ProtoReflect.Descriptor instead. func (*SyncdSnapshot) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{99} + return file_binary_proto_def_proto_rawDescGZIP(), []int{101} } func (x *SyncdSnapshot) GetVersion() *SyncdVersion { @@ -13890,7 +14010,7 @@ type SyncdRecord struct { func (x *SyncdRecord) Reset() { *x = SyncdRecord{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[100] + mi := &file_binary_proto_def_proto_msgTypes[102] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13903,7 +14023,7 @@ func (x *SyncdRecord) String() string { func (*SyncdRecord) ProtoMessage() {} func (x *SyncdRecord) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[100] + mi := &file_binary_proto_def_proto_msgTypes[102] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13916,7 +14036,7 @@ func (x *SyncdRecord) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncdRecord.ProtoReflect.Descriptor instead. func (*SyncdRecord) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{100} + return file_binary_proto_def_proto_rawDescGZIP(), []int{102} } func (x *SyncdRecord) GetIndex() *SyncdIndex { @@ -13958,7 +14078,7 @@ type SyncdPatch struct { func (x *SyncdPatch) Reset() { *x = SyncdPatch{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[101] + mi := &file_binary_proto_def_proto_msgTypes[103] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13971,7 +14091,7 @@ func (x *SyncdPatch) String() string { func (*SyncdPatch) ProtoMessage() {} func (x *SyncdPatch) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[101] + mi := &file_binary_proto_def_proto_msgTypes[103] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13984,7 +14104,7 @@ func (x *SyncdPatch) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncdPatch.ProtoReflect.Descriptor instead. func (*SyncdPatch) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{101} + return file_binary_proto_def_proto_rawDescGZIP(), []int{103} } func (x *SyncdPatch) GetVersion() *SyncdVersion { @@ -14054,7 +14174,7 @@ type SyncdMutations struct { func (x *SyncdMutations) Reset() { *x = SyncdMutations{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[102] + mi := &file_binary_proto_def_proto_msgTypes[104] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14067,7 +14187,7 @@ func (x *SyncdMutations) String() string { func (*SyncdMutations) ProtoMessage() {} func (x *SyncdMutations) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[102] + mi := &file_binary_proto_def_proto_msgTypes[104] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14080,7 +14200,7 @@ func (x *SyncdMutations) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncdMutations.ProtoReflect.Descriptor instead. func (*SyncdMutations) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{102} + return file_binary_proto_def_proto_rawDescGZIP(), []int{104} } func (x *SyncdMutations) GetMutations() []*SyncdMutation { @@ -14102,7 +14222,7 @@ type SyncdMutation struct { func (x *SyncdMutation) Reset() { *x = SyncdMutation{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[103] + mi := &file_binary_proto_def_proto_msgTypes[105] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14115,7 +14235,7 @@ func (x *SyncdMutation) String() string { func (*SyncdMutation) ProtoMessage() {} func (x *SyncdMutation) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[103] + mi := &file_binary_proto_def_proto_msgTypes[105] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14128,7 +14248,7 @@ func (x *SyncdMutation) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncdMutation.ProtoReflect.Descriptor instead. func (*SyncdMutation) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{103} + return file_binary_proto_def_proto_rawDescGZIP(), []int{105} } func (x *SyncdMutation) GetOperation() SyncdMutation_SyncdOperation { @@ -14156,7 +14276,7 @@ type SyncdIndex struct { func (x *SyncdIndex) Reset() { *x = SyncdIndex{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[104] + mi := &file_binary_proto_def_proto_msgTypes[106] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14169,7 +14289,7 @@ func (x *SyncdIndex) String() string { func (*SyncdIndex) ProtoMessage() {} func (x *SyncdIndex) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[104] + mi := &file_binary_proto_def_proto_msgTypes[106] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14182,7 +14302,7 @@ func (x *SyncdIndex) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncdIndex.ProtoReflect.Descriptor instead. func (*SyncdIndex) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{104} + return file_binary_proto_def_proto_rawDescGZIP(), []int{106} } func (x *SyncdIndex) GetBlob() []byte { @@ -14203,7 +14323,7 @@ type KeyId struct { func (x *KeyId) Reset() { *x = KeyId{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[105] + mi := &file_binary_proto_def_proto_msgTypes[107] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14216,7 +14336,7 @@ func (x *KeyId) String() string { func (*KeyId) ProtoMessage() {} func (x *KeyId) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[105] + mi := &file_binary_proto_def_proto_msgTypes[107] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14229,7 +14349,7 @@ func (x *KeyId) ProtoReflect() protoreflect.Message { // Deprecated: Use KeyId.ProtoReflect.Descriptor instead. func (*KeyId) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{105} + return file_binary_proto_def_proto_rawDescGZIP(), []int{107} } func (x *KeyId) GetId() []byte { @@ -14255,7 +14375,7 @@ type ExternalBlobReference struct { func (x *ExternalBlobReference) Reset() { *x = ExternalBlobReference{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[106] + mi := &file_binary_proto_def_proto_msgTypes[108] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14268,7 +14388,7 @@ func (x *ExternalBlobReference) String() string { func (*ExternalBlobReference) ProtoMessage() {} func (x *ExternalBlobReference) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[106] + mi := &file_binary_proto_def_proto_msgTypes[108] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14281,7 +14401,7 @@ func (x *ExternalBlobReference) ProtoReflect() protoreflect.Message { // Deprecated: Use ExternalBlobReference.ProtoReflect.Descriptor instead. func (*ExternalBlobReference) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{106} + return file_binary_proto_def_proto_rawDescGZIP(), []int{108} } func (x *ExternalBlobReference) GetMediaKey() []byte { @@ -14338,7 +14458,7 @@ type ExitCode struct { func (x *ExitCode) Reset() { *x = ExitCode{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[107] + mi := &file_binary_proto_def_proto_msgTypes[109] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14351,7 +14471,7 @@ func (x *ExitCode) String() string { func (*ExitCode) ProtoMessage() {} func (x *ExitCode) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[107] + mi := &file_binary_proto_def_proto_msgTypes[109] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14364,7 +14484,7 @@ func (x *ExitCode) ProtoReflect() protoreflect.Message { // Deprecated: Use ExitCode.ProtoReflect.Descriptor instead. func (*ExitCode) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{107} + return file_binary_proto_def_proto_rawDescGZIP(), []int{109} } func (x *ExitCode) GetCode() uint64 { @@ -14427,7 +14547,7 @@ type SyncActionValue struct { func (x *SyncActionValue) Reset() { *x = SyncActionValue{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[108] + mi := &file_binary_proto_def_proto_msgTypes[110] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14440,7 +14560,7 @@ func (x *SyncActionValue) String() string { func (*SyncActionValue) ProtoMessage() {} func (x *SyncActionValue) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[108] + mi := &file_binary_proto_def_proto_msgTypes[110] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14453,7 +14573,7 @@ func (x *SyncActionValue) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncActionValue.ProtoReflect.Descriptor instead. func (*SyncActionValue) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{108} + return file_binary_proto_def_proto_rawDescGZIP(), []int{110} } func (x *SyncActionValue) GetTimestamp() int64 { @@ -14719,7 +14839,7 @@ type UserStatusMuteAction struct { func (x *UserStatusMuteAction) Reset() { *x = UserStatusMuteAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[109] + mi := &file_binary_proto_def_proto_msgTypes[111] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14732,7 +14852,7 @@ func (x *UserStatusMuteAction) String() string { func (*UserStatusMuteAction) ProtoMessage() {} func (x *UserStatusMuteAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[109] + mi := &file_binary_proto_def_proto_msgTypes[111] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14745,7 +14865,7 @@ func (x *UserStatusMuteAction) ProtoReflect() protoreflect.Message { // Deprecated: Use UserStatusMuteAction.ProtoReflect.Descriptor instead. func (*UserStatusMuteAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{109} + return file_binary_proto_def_proto_rawDescGZIP(), []int{111} } func (x *UserStatusMuteAction) GetMuted() bool { @@ -14766,7 +14886,7 @@ type UnarchiveChatsSetting struct { func (x *UnarchiveChatsSetting) Reset() { *x = UnarchiveChatsSetting{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[110] + mi := &file_binary_proto_def_proto_msgTypes[112] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14779,7 +14899,7 @@ func (x *UnarchiveChatsSetting) String() string { func (*UnarchiveChatsSetting) ProtoMessage() {} func (x *UnarchiveChatsSetting) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[110] + mi := &file_binary_proto_def_proto_msgTypes[112] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14792,7 +14912,7 @@ func (x *UnarchiveChatsSetting) ProtoReflect() protoreflect.Message { // Deprecated: Use UnarchiveChatsSetting.ProtoReflect.Descriptor instead. func (*UnarchiveChatsSetting) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{110} + return file_binary_proto_def_proto_rawDescGZIP(), []int{112} } func (x *UnarchiveChatsSetting) GetUnarchiveChats() bool { @@ -14813,7 +14933,7 @@ type TimeFormatAction struct { func (x *TimeFormatAction) Reset() { *x = TimeFormatAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[111] + mi := &file_binary_proto_def_proto_msgTypes[113] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14826,7 +14946,7 @@ func (x *TimeFormatAction) String() string { func (*TimeFormatAction) ProtoMessage() {} func (x *TimeFormatAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[111] + mi := &file_binary_proto_def_proto_msgTypes[113] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14839,7 +14959,7 @@ func (x *TimeFormatAction) ProtoReflect() protoreflect.Message { // Deprecated: Use TimeFormatAction.ProtoReflect.Descriptor instead. func (*TimeFormatAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{111} + return file_binary_proto_def_proto_rawDescGZIP(), []int{113} } func (x *TimeFormatAction) GetIsTwentyFourHourFormatEnabled() bool { @@ -14861,7 +14981,7 @@ type SyncActionMessage struct { func (x *SyncActionMessage) Reset() { *x = SyncActionMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[112] + mi := &file_binary_proto_def_proto_msgTypes[114] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14874,7 +14994,7 @@ func (x *SyncActionMessage) String() string { func (*SyncActionMessage) ProtoMessage() {} func (x *SyncActionMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[112] + mi := &file_binary_proto_def_proto_msgTypes[114] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14887,7 +15007,7 @@ func (x *SyncActionMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncActionMessage.ProtoReflect.Descriptor instead. func (*SyncActionMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{112} + return file_binary_proto_def_proto_rawDescGZIP(), []int{114} } func (x *SyncActionMessage) GetKey() *MessageKey { @@ -14917,7 +15037,7 @@ type SyncActionMessageRange struct { func (x *SyncActionMessageRange) Reset() { *x = SyncActionMessageRange{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[113] + mi := &file_binary_proto_def_proto_msgTypes[115] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14930,7 +15050,7 @@ func (x *SyncActionMessageRange) String() string { func (*SyncActionMessageRange) ProtoMessage() {} func (x *SyncActionMessageRange) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[113] + mi := &file_binary_proto_def_proto_msgTypes[115] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14943,7 +15063,7 @@ func (x *SyncActionMessageRange) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncActionMessageRange.ProtoReflect.Descriptor instead. func (*SyncActionMessageRange) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{113} + return file_binary_proto_def_proto_rawDescGZIP(), []int{115} } func (x *SyncActionMessageRange) GetLastMessageTimestamp() int64 { @@ -14980,7 +15100,7 @@ type SubscriptionAction struct { func (x *SubscriptionAction) Reset() { *x = SubscriptionAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[114] + mi := &file_binary_proto_def_proto_msgTypes[116] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14993,7 +15113,7 @@ func (x *SubscriptionAction) String() string { func (*SubscriptionAction) ProtoMessage() {} func (x *SubscriptionAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[114] + mi := &file_binary_proto_def_proto_msgTypes[116] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15006,7 +15126,7 @@ func (x *SubscriptionAction) ProtoReflect() protoreflect.Message { // Deprecated: Use SubscriptionAction.ProtoReflect.Descriptor instead. func (*SubscriptionAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{114} + return file_binary_proto_def_proto_rawDescGZIP(), []int{116} } func (x *SubscriptionAction) GetIsDeactivated() bool { @@ -15050,7 +15170,7 @@ type StickerAction struct { func (x *StickerAction) Reset() { *x = StickerAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[115] + mi := &file_binary_proto_def_proto_msgTypes[117] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15063,7 +15183,7 @@ func (x *StickerAction) String() string { func (*StickerAction) ProtoMessage() {} func (x *StickerAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[115] + mi := &file_binary_proto_def_proto_msgTypes[117] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15076,7 +15196,7 @@ func (x *StickerAction) ProtoReflect() protoreflect.Message { // Deprecated: Use StickerAction.ProtoReflect.Descriptor instead. func (*StickerAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{115} + return file_binary_proto_def_proto_rawDescGZIP(), []int{117} } func (x *StickerAction) GetUrl() string { @@ -15160,7 +15280,7 @@ type StarAction struct { func (x *StarAction) Reset() { *x = StarAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[116] + mi := &file_binary_proto_def_proto_msgTypes[118] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15173,7 +15293,7 @@ func (x *StarAction) String() string { func (*StarAction) ProtoMessage() {} func (x *StarAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[116] + mi := &file_binary_proto_def_proto_msgTypes[118] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15186,7 +15306,7 @@ func (x *StarAction) ProtoReflect() protoreflect.Message { // Deprecated: Use StarAction.ProtoReflect.Descriptor instead. func (*StarAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{116} + return file_binary_proto_def_proto_rawDescGZIP(), []int{118} } func (x *StarAction) GetStarred() bool { @@ -15207,7 +15327,7 @@ type SecurityNotificationSetting struct { func (x *SecurityNotificationSetting) Reset() { *x = SecurityNotificationSetting{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[117] + mi := &file_binary_proto_def_proto_msgTypes[119] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15220,7 +15340,7 @@ func (x *SecurityNotificationSetting) String() string { func (*SecurityNotificationSetting) ProtoMessage() {} func (x *SecurityNotificationSetting) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[117] + mi := &file_binary_proto_def_proto_msgTypes[119] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15233,7 +15353,7 @@ func (x *SecurityNotificationSetting) ProtoReflect() protoreflect.Message { // Deprecated: Use SecurityNotificationSetting.ProtoReflect.Descriptor instead. func (*SecurityNotificationSetting) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{117} + return file_binary_proto_def_proto_rawDescGZIP(), []int{119} } func (x *SecurityNotificationSetting) GetShowNotification() bool { @@ -15254,7 +15374,7 @@ type RemoveRecentStickerAction struct { func (x *RemoveRecentStickerAction) Reset() { *x = RemoveRecentStickerAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[118] + mi := &file_binary_proto_def_proto_msgTypes[120] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15267,7 +15387,7 @@ func (x *RemoveRecentStickerAction) String() string { func (*RemoveRecentStickerAction) ProtoMessage() {} func (x *RemoveRecentStickerAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[118] + mi := &file_binary_proto_def_proto_msgTypes[120] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15280,7 +15400,7 @@ func (x *RemoveRecentStickerAction) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveRecentStickerAction.ProtoReflect.Descriptor instead. func (*RemoveRecentStickerAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{118} + return file_binary_proto_def_proto_rawDescGZIP(), []int{120} } func (x *RemoveRecentStickerAction) GetLastStickerSentTs() int64 { @@ -15301,7 +15421,7 @@ type RecentEmojiWeightsAction struct { func (x *RecentEmojiWeightsAction) Reset() { *x = RecentEmojiWeightsAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[119] + mi := &file_binary_proto_def_proto_msgTypes[121] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15314,7 +15434,7 @@ func (x *RecentEmojiWeightsAction) String() string { func (*RecentEmojiWeightsAction) ProtoMessage() {} func (x *RecentEmojiWeightsAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[119] + mi := &file_binary_proto_def_proto_msgTypes[121] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15327,7 +15447,7 @@ func (x *RecentEmojiWeightsAction) ProtoReflect() protoreflect.Message { // Deprecated: Use RecentEmojiWeightsAction.ProtoReflect.Descriptor instead. func (*RecentEmojiWeightsAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{119} + return file_binary_proto_def_proto_rawDescGZIP(), []int{121} } func (x *RecentEmojiWeightsAction) GetWeights() []*RecentEmojiWeight { @@ -15352,7 +15472,7 @@ type QuickReplyAction struct { func (x *QuickReplyAction) Reset() { *x = QuickReplyAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[120] + mi := &file_binary_proto_def_proto_msgTypes[122] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15365,7 +15485,7 @@ func (x *QuickReplyAction) String() string { func (*QuickReplyAction) ProtoMessage() {} func (x *QuickReplyAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[120] + mi := &file_binary_proto_def_proto_msgTypes[122] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15378,7 +15498,7 @@ func (x *QuickReplyAction) ProtoReflect() protoreflect.Message { // Deprecated: Use QuickReplyAction.ProtoReflect.Descriptor instead. func (*QuickReplyAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{120} + return file_binary_proto_def_proto_rawDescGZIP(), []int{122} } func (x *QuickReplyAction) GetShortcut() string { @@ -15427,7 +15547,7 @@ type PushNameSetting struct { func (x *PushNameSetting) Reset() { *x = PushNameSetting{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[121] + mi := &file_binary_proto_def_proto_msgTypes[123] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15440,7 +15560,7 @@ func (x *PushNameSetting) String() string { func (*PushNameSetting) ProtoMessage() {} func (x *PushNameSetting) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[121] + mi := &file_binary_proto_def_proto_msgTypes[123] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15453,7 +15573,7 @@ func (x *PushNameSetting) ProtoReflect() protoreflect.Message { // Deprecated: Use PushNameSetting.ProtoReflect.Descriptor instead. func (*PushNameSetting) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{121} + return file_binary_proto_def_proto_rawDescGZIP(), []int{123} } func (x *PushNameSetting) GetName() string { @@ -15474,7 +15594,7 @@ type PrivacySettingRelayAllCalls struct { func (x *PrivacySettingRelayAllCalls) Reset() { *x = PrivacySettingRelayAllCalls{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[122] + mi := &file_binary_proto_def_proto_msgTypes[124] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15487,7 +15607,7 @@ func (x *PrivacySettingRelayAllCalls) String() string { func (*PrivacySettingRelayAllCalls) ProtoMessage() {} func (x *PrivacySettingRelayAllCalls) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[122] + mi := &file_binary_proto_def_proto_msgTypes[124] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15500,7 +15620,7 @@ func (x *PrivacySettingRelayAllCalls) ProtoReflect() protoreflect.Message { // Deprecated: Use PrivacySettingRelayAllCalls.ProtoReflect.Descriptor instead. func (*PrivacySettingRelayAllCalls) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{122} + return file_binary_proto_def_proto_rawDescGZIP(), []int{124} } func (x *PrivacySettingRelayAllCalls) GetIsEnabled() bool { @@ -15521,7 +15641,7 @@ type PrimaryVersionAction struct { func (x *PrimaryVersionAction) Reset() { *x = PrimaryVersionAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[123] + mi := &file_binary_proto_def_proto_msgTypes[125] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15534,7 +15654,7 @@ func (x *PrimaryVersionAction) String() string { func (*PrimaryVersionAction) ProtoMessage() {} func (x *PrimaryVersionAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[123] + mi := &file_binary_proto_def_proto_msgTypes[125] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15547,7 +15667,7 @@ func (x *PrimaryVersionAction) ProtoReflect() protoreflect.Message { // Deprecated: Use PrimaryVersionAction.ProtoReflect.Descriptor instead. func (*PrimaryVersionAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{123} + return file_binary_proto_def_proto_rawDescGZIP(), []int{125} } func (x *PrimaryVersionAction) GetVersion() string { @@ -15568,7 +15688,7 @@ type PrimaryFeature struct { func (x *PrimaryFeature) Reset() { *x = PrimaryFeature{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[124] + mi := &file_binary_proto_def_proto_msgTypes[126] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15581,7 +15701,7 @@ func (x *PrimaryFeature) String() string { func (*PrimaryFeature) ProtoMessage() {} func (x *PrimaryFeature) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[124] + mi := &file_binary_proto_def_proto_msgTypes[126] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15594,7 +15714,7 @@ func (x *PrimaryFeature) ProtoReflect() protoreflect.Message { // Deprecated: Use PrimaryFeature.ProtoReflect.Descriptor instead. func (*PrimaryFeature) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{124} + return file_binary_proto_def_proto_rawDescGZIP(), []int{126} } func (x *PrimaryFeature) GetFlags() []string { @@ -15615,7 +15735,7 @@ type PnForLidChatAction struct { func (x *PnForLidChatAction) Reset() { *x = PnForLidChatAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[125] + mi := &file_binary_proto_def_proto_msgTypes[127] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15628,7 +15748,7 @@ func (x *PnForLidChatAction) String() string { func (*PnForLidChatAction) ProtoMessage() {} func (x *PnForLidChatAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[125] + mi := &file_binary_proto_def_proto_msgTypes[127] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15641,7 +15761,7 @@ func (x *PnForLidChatAction) ProtoReflect() protoreflect.Message { // Deprecated: Use PnForLidChatAction.ProtoReflect.Descriptor instead. func (*PnForLidChatAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{125} + return file_binary_proto_def_proto_rawDescGZIP(), []int{127} } func (x *PnForLidChatAction) GetPnJid() string { @@ -15662,7 +15782,7 @@ type PinAction struct { func (x *PinAction) Reset() { *x = PinAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[126] + mi := &file_binary_proto_def_proto_msgTypes[128] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15675,7 +15795,7 @@ func (x *PinAction) String() string { func (*PinAction) ProtoMessage() {} func (x *PinAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[126] + mi := &file_binary_proto_def_proto_msgTypes[128] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15688,7 +15808,7 @@ func (x *PinAction) ProtoReflect() protoreflect.Message { // Deprecated: Use PinAction.ProtoReflect.Descriptor instead. func (*PinAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{126} + return file_binary_proto_def_proto_rawDescGZIP(), []int{128} } func (x *PinAction) GetPinned() bool { @@ -15709,7 +15829,7 @@ type NuxAction struct { func (x *NuxAction) Reset() { *x = NuxAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[127] + mi := &file_binary_proto_def_proto_msgTypes[129] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15722,7 +15842,7 @@ func (x *NuxAction) String() string { func (*NuxAction) ProtoMessage() {} func (x *NuxAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[127] + mi := &file_binary_proto_def_proto_msgTypes[129] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15735,7 +15855,7 @@ func (x *NuxAction) ProtoReflect() protoreflect.Message { // Deprecated: Use NuxAction.ProtoReflect.Descriptor instead. func (*NuxAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{127} + return file_binary_proto_def_proto_rawDescGZIP(), []int{129} } func (x *NuxAction) GetAcknowledged() bool { @@ -15758,7 +15878,7 @@ type MuteAction struct { func (x *MuteAction) Reset() { *x = MuteAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[128] + mi := &file_binary_proto_def_proto_msgTypes[130] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15771,7 +15891,7 @@ func (x *MuteAction) String() string { func (*MuteAction) ProtoMessage() {} func (x *MuteAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[128] + mi := &file_binary_proto_def_proto_msgTypes[130] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15784,7 +15904,7 @@ func (x *MuteAction) ProtoReflect() protoreflect.Message { // Deprecated: Use MuteAction.ProtoReflect.Descriptor instead. func (*MuteAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{128} + return file_binary_proto_def_proto_rawDescGZIP(), []int{130} } func (x *MuteAction) GetMuted() bool { @@ -15819,7 +15939,7 @@ type MarketingMessageBroadcastAction struct { func (x *MarketingMessageBroadcastAction) Reset() { *x = MarketingMessageBroadcastAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[129] + mi := &file_binary_proto_def_proto_msgTypes[131] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15832,7 +15952,7 @@ func (x *MarketingMessageBroadcastAction) String() string { func (*MarketingMessageBroadcastAction) ProtoMessage() {} func (x *MarketingMessageBroadcastAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[129] + mi := &file_binary_proto_def_proto_msgTypes[131] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15845,7 +15965,7 @@ func (x *MarketingMessageBroadcastAction) ProtoReflect() protoreflect.Message { // Deprecated: Use MarketingMessageBroadcastAction.ProtoReflect.Descriptor instead. func (*MarketingMessageBroadcastAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{129} + return file_binary_proto_def_proto_rawDescGZIP(), []int{131} } func (x *MarketingMessageBroadcastAction) GetRepliedCount() int32 { @@ -15872,7 +15992,7 @@ type MarketingMessageAction struct { func (x *MarketingMessageAction) Reset() { *x = MarketingMessageAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[130] + mi := &file_binary_proto_def_proto_msgTypes[132] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15885,7 +16005,7 @@ func (x *MarketingMessageAction) String() string { func (*MarketingMessageAction) ProtoMessage() {} func (x *MarketingMessageAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[130] + mi := &file_binary_proto_def_proto_msgTypes[132] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15898,7 +16018,7 @@ func (x *MarketingMessageAction) ProtoReflect() protoreflect.Message { // Deprecated: Use MarketingMessageAction.ProtoReflect.Descriptor instead. func (*MarketingMessageAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{130} + return file_binary_proto_def_proto_rawDescGZIP(), []int{132} } func (x *MarketingMessageAction) GetName() string { @@ -15962,7 +16082,7 @@ type MarkChatAsReadAction struct { func (x *MarkChatAsReadAction) Reset() { *x = MarkChatAsReadAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[131] + mi := &file_binary_proto_def_proto_msgTypes[133] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15975,7 +16095,7 @@ func (x *MarkChatAsReadAction) String() string { func (*MarkChatAsReadAction) ProtoMessage() {} func (x *MarkChatAsReadAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[131] + mi := &file_binary_proto_def_proto_msgTypes[133] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15988,7 +16108,7 @@ func (x *MarkChatAsReadAction) ProtoReflect() protoreflect.Message { // Deprecated: Use MarkChatAsReadAction.ProtoReflect.Descriptor instead. func (*MarkChatAsReadAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{131} + return file_binary_proto_def_proto_rawDescGZIP(), []int{133} } func (x *MarkChatAsReadAction) GetRead() bool { @@ -16016,7 +16136,7 @@ type LocaleSetting struct { func (x *LocaleSetting) Reset() { *x = LocaleSetting{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[132] + mi := &file_binary_proto_def_proto_msgTypes[134] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16029,7 +16149,7 @@ func (x *LocaleSetting) String() string { func (*LocaleSetting) ProtoMessage() {} func (x *LocaleSetting) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[132] + mi := &file_binary_proto_def_proto_msgTypes[134] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16042,7 +16162,7 @@ func (x *LocaleSetting) ProtoReflect() protoreflect.Message { // Deprecated: Use LocaleSetting.ProtoReflect.Descriptor instead. func (*LocaleSetting) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{132} + return file_binary_proto_def_proto_rawDescGZIP(), []int{134} } func (x *LocaleSetting) GetLocale() string { @@ -16066,7 +16186,7 @@ type LabelEditAction struct { func (x *LabelEditAction) Reset() { *x = LabelEditAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[133] + mi := &file_binary_proto_def_proto_msgTypes[135] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16079,7 +16199,7 @@ func (x *LabelEditAction) String() string { func (*LabelEditAction) ProtoMessage() {} func (x *LabelEditAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[133] + mi := &file_binary_proto_def_proto_msgTypes[135] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16092,7 +16212,7 @@ func (x *LabelEditAction) ProtoReflect() protoreflect.Message { // Deprecated: Use LabelEditAction.ProtoReflect.Descriptor instead. func (*LabelEditAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{133} + return file_binary_proto_def_proto_rawDescGZIP(), []int{135} } func (x *LabelEditAction) GetName() string { @@ -16134,7 +16254,7 @@ type LabelAssociationAction struct { func (x *LabelAssociationAction) Reset() { *x = LabelAssociationAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[134] + mi := &file_binary_proto_def_proto_msgTypes[136] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16147,7 +16267,7 @@ func (x *LabelAssociationAction) String() string { func (*LabelAssociationAction) ProtoMessage() {} func (x *LabelAssociationAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[134] + mi := &file_binary_proto_def_proto_msgTypes[136] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16160,7 +16280,7 @@ func (x *LabelAssociationAction) ProtoReflect() protoreflect.Message { // Deprecated: Use LabelAssociationAction.ProtoReflect.Descriptor instead. func (*LabelAssociationAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{134} + return file_binary_proto_def_proto_rawDescGZIP(), []int{136} } func (x *LabelAssociationAction) GetLabeled() bool { @@ -16181,7 +16301,7 @@ type KeyExpiration struct { func (x *KeyExpiration) Reset() { *x = KeyExpiration{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[135] + mi := &file_binary_proto_def_proto_msgTypes[137] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16194,7 +16314,7 @@ func (x *KeyExpiration) String() string { func (*KeyExpiration) ProtoMessage() {} func (x *KeyExpiration) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[135] + mi := &file_binary_proto_def_proto_msgTypes[137] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16207,7 +16327,7 @@ func (x *KeyExpiration) ProtoReflect() protoreflect.Message { // Deprecated: Use KeyExpiration.ProtoReflect.Descriptor instead. func (*KeyExpiration) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{135} + return file_binary_proto_def_proto_rawDescGZIP(), []int{137} } func (x *KeyExpiration) GetExpiredKeyEpoch() int32 { @@ -16228,7 +16348,7 @@ type ExternalWebBetaAction struct { func (x *ExternalWebBetaAction) Reset() { *x = ExternalWebBetaAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[136] + mi := &file_binary_proto_def_proto_msgTypes[138] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16241,7 +16361,7 @@ func (x *ExternalWebBetaAction) String() string { func (*ExternalWebBetaAction) ProtoMessage() {} func (x *ExternalWebBetaAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[136] + mi := &file_binary_proto_def_proto_msgTypes[138] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16254,7 +16374,7 @@ func (x *ExternalWebBetaAction) ProtoReflect() protoreflect.Message { // Deprecated: Use ExternalWebBetaAction.ProtoReflect.Descriptor instead. func (*ExternalWebBetaAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{136} + return file_binary_proto_def_proto_rawDescGZIP(), []int{138} } func (x *ExternalWebBetaAction) GetIsOptIn() bool { @@ -16276,7 +16396,7 @@ type DeleteMessageForMeAction struct { func (x *DeleteMessageForMeAction) Reset() { *x = DeleteMessageForMeAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[137] + mi := &file_binary_proto_def_proto_msgTypes[139] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16289,7 +16409,7 @@ func (x *DeleteMessageForMeAction) String() string { func (*DeleteMessageForMeAction) ProtoMessage() {} func (x *DeleteMessageForMeAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[137] + mi := &file_binary_proto_def_proto_msgTypes[139] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16302,7 +16422,7 @@ func (x *DeleteMessageForMeAction) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteMessageForMeAction.ProtoReflect.Descriptor instead. func (*DeleteMessageForMeAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{137} + return file_binary_proto_def_proto_rawDescGZIP(), []int{139} } func (x *DeleteMessageForMeAction) GetDeleteMedia() bool { @@ -16330,7 +16450,7 @@ type DeleteChatAction struct { func (x *DeleteChatAction) Reset() { *x = DeleteChatAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[138] + mi := &file_binary_proto_def_proto_msgTypes[140] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16343,7 +16463,7 @@ func (x *DeleteChatAction) String() string { func (*DeleteChatAction) ProtoMessage() {} func (x *DeleteChatAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[138] + mi := &file_binary_proto_def_proto_msgTypes[140] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16356,7 +16476,7 @@ func (x *DeleteChatAction) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteChatAction.ProtoReflect.Descriptor instead. func (*DeleteChatAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{138} + return file_binary_proto_def_proto_rawDescGZIP(), []int{140} } func (x *DeleteChatAction) GetMessageRange() *SyncActionMessageRange { @@ -16379,7 +16499,7 @@ type ContactAction struct { func (x *ContactAction) Reset() { *x = ContactAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[139] + mi := &file_binary_proto_def_proto_msgTypes[141] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16392,7 +16512,7 @@ func (x *ContactAction) String() string { func (*ContactAction) ProtoMessage() {} func (x *ContactAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[139] + mi := &file_binary_proto_def_proto_msgTypes[141] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16405,7 +16525,7 @@ func (x *ContactAction) ProtoReflect() protoreflect.Message { // Deprecated: Use ContactAction.ProtoReflect.Descriptor instead. func (*ContactAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{139} + return file_binary_proto_def_proto_rawDescGZIP(), []int{141} } func (x *ContactAction) GetFullName() string { @@ -16440,7 +16560,7 @@ type ClearChatAction struct { func (x *ClearChatAction) Reset() { *x = ClearChatAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[140] + mi := &file_binary_proto_def_proto_msgTypes[142] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16453,7 +16573,7 @@ func (x *ClearChatAction) String() string { func (*ClearChatAction) ProtoMessage() {} func (x *ClearChatAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[140] + mi := &file_binary_proto_def_proto_msgTypes[142] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16466,7 +16586,7 @@ func (x *ClearChatAction) ProtoReflect() protoreflect.Message { // Deprecated: Use ClearChatAction.ProtoReflect.Descriptor instead. func (*ClearChatAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{140} + return file_binary_proto_def_proto_rawDescGZIP(), []int{142} } func (x *ClearChatAction) GetMessageRange() *SyncActionMessageRange { @@ -16487,7 +16607,7 @@ type ChatAssignmentOpenedStatusAction struct { func (x *ChatAssignmentOpenedStatusAction) Reset() { *x = ChatAssignmentOpenedStatusAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[141] + mi := &file_binary_proto_def_proto_msgTypes[143] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16500,7 +16620,7 @@ func (x *ChatAssignmentOpenedStatusAction) String() string { func (*ChatAssignmentOpenedStatusAction) ProtoMessage() {} func (x *ChatAssignmentOpenedStatusAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[141] + mi := &file_binary_proto_def_proto_msgTypes[143] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16513,7 +16633,7 @@ func (x *ChatAssignmentOpenedStatusAction) ProtoReflect() protoreflect.Message { // Deprecated: Use ChatAssignmentOpenedStatusAction.ProtoReflect.Descriptor instead. func (*ChatAssignmentOpenedStatusAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{141} + return file_binary_proto_def_proto_rawDescGZIP(), []int{143} } func (x *ChatAssignmentOpenedStatusAction) GetChatOpened() bool { @@ -16534,7 +16654,7 @@ type ChatAssignmentAction struct { func (x *ChatAssignmentAction) Reset() { *x = ChatAssignmentAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[142] + mi := &file_binary_proto_def_proto_msgTypes[144] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16547,7 +16667,7 @@ func (x *ChatAssignmentAction) String() string { func (*ChatAssignmentAction) ProtoMessage() {} func (x *ChatAssignmentAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[142] + mi := &file_binary_proto_def_proto_msgTypes[144] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16560,7 +16680,7 @@ func (x *ChatAssignmentAction) ProtoReflect() protoreflect.Message { // Deprecated: Use ChatAssignmentAction.ProtoReflect.Descriptor instead. func (*ChatAssignmentAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{142} + return file_binary_proto_def_proto_rawDescGZIP(), []int{144} } func (x *ChatAssignmentAction) GetDeviceAgentID() string { @@ -16582,7 +16702,7 @@ type ArchiveChatAction struct { func (x *ArchiveChatAction) Reset() { *x = ArchiveChatAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[143] + mi := &file_binary_proto_def_proto_msgTypes[145] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16595,7 +16715,7 @@ func (x *ArchiveChatAction) String() string { func (*ArchiveChatAction) ProtoMessage() {} func (x *ArchiveChatAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[143] + mi := &file_binary_proto_def_proto_msgTypes[145] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16608,7 +16728,7 @@ func (x *ArchiveChatAction) ProtoReflect() protoreflect.Message { // Deprecated: Use ArchiveChatAction.ProtoReflect.Descriptor instead. func (*ArchiveChatAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{143} + return file_binary_proto_def_proto_rawDescGZIP(), []int{145} } func (x *ArchiveChatAction) GetArchived() bool { @@ -16636,7 +16756,7 @@ type AndroidUnsupportedActions struct { func (x *AndroidUnsupportedActions) Reset() { *x = AndroidUnsupportedActions{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[144] + mi := &file_binary_proto_def_proto_msgTypes[146] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16649,7 +16769,7 @@ func (x *AndroidUnsupportedActions) String() string { func (*AndroidUnsupportedActions) ProtoMessage() {} func (x *AndroidUnsupportedActions) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[144] + mi := &file_binary_proto_def_proto_msgTypes[146] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16662,7 +16782,7 @@ func (x *AndroidUnsupportedActions) ProtoReflect() protoreflect.Message { // Deprecated: Use AndroidUnsupportedActions.ProtoReflect.Descriptor instead. func (*AndroidUnsupportedActions) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{144} + return file_binary_proto_def_proto_rawDescGZIP(), []int{146} } func (x *AndroidUnsupportedActions) GetAllowed() bool { @@ -16685,7 +16805,7 @@ type AgentAction struct { func (x *AgentAction) Reset() { *x = AgentAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[145] + mi := &file_binary_proto_def_proto_msgTypes[147] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16698,7 +16818,7 @@ func (x *AgentAction) String() string { func (*AgentAction) ProtoMessage() {} func (x *AgentAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[145] + mi := &file_binary_proto_def_proto_msgTypes[147] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16711,7 +16831,7 @@ func (x *AgentAction) ProtoReflect() protoreflect.Message { // Deprecated: Use AgentAction.ProtoReflect.Descriptor instead. func (*AgentAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{145} + return file_binary_proto_def_proto_rawDescGZIP(), []int{147} } func (x *AgentAction) GetName() string { @@ -16749,7 +16869,7 @@ type SyncActionData struct { func (x *SyncActionData) Reset() { *x = SyncActionData{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[146] + mi := &file_binary_proto_def_proto_msgTypes[148] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16762,7 +16882,7 @@ func (x *SyncActionData) String() string { func (*SyncActionData) ProtoMessage() {} func (x *SyncActionData) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[146] + mi := &file_binary_proto_def_proto_msgTypes[148] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16775,7 +16895,7 @@ func (x *SyncActionData) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncActionData.ProtoReflect.Descriptor instead. func (*SyncActionData) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{146} + return file_binary_proto_def_proto_rawDescGZIP(), []int{148} } func (x *SyncActionData) GetIndex() []byte { @@ -16818,7 +16938,7 @@ type RecentEmojiWeight struct { func (x *RecentEmojiWeight) Reset() { *x = RecentEmojiWeight{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[147] + mi := &file_binary_proto_def_proto_msgTypes[149] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16831,7 +16951,7 @@ func (x *RecentEmojiWeight) String() string { func (*RecentEmojiWeight) ProtoMessage() {} func (x *RecentEmojiWeight) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[147] + mi := &file_binary_proto_def_proto_msgTypes[149] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16844,7 +16964,7 @@ func (x *RecentEmojiWeight) ProtoReflect() protoreflect.Message { // Deprecated: Use RecentEmojiWeight.ProtoReflect.Descriptor instead. func (*RecentEmojiWeight) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{147} + return file_binary_proto_def_proto_rawDescGZIP(), []int{149} } func (x *RecentEmojiWeight) GetEmoji() string { @@ -16874,7 +16994,7 @@ type VerifiedNameCertificate struct { func (x *VerifiedNameCertificate) Reset() { *x = VerifiedNameCertificate{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[148] + mi := &file_binary_proto_def_proto_msgTypes[150] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16887,7 +17007,7 @@ func (x *VerifiedNameCertificate) String() string { func (*VerifiedNameCertificate) ProtoMessage() {} func (x *VerifiedNameCertificate) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[148] + mi := &file_binary_proto_def_proto_msgTypes[150] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16900,7 +17020,7 @@ func (x *VerifiedNameCertificate) ProtoReflect() protoreflect.Message { // Deprecated: Use VerifiedNameCertificate.ProtoReflect.Descriptor instead. func (*VerifiedNameCertificate) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{148} + return file_binary_proto_def_proto_rawDescGZIP(), []int{150} } func (x *VerifiedNameCertificate) GetDetails() []byte { @@ -16937,7 +17057,7 @@ type LocalizedName struct { func (x *LocalizedName) Reset() { *x = LocalizedName{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[149] + mi := &file_binary_proto_def_proto_msgTypes[151] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16950,7 +17070,7 @@ func (x *LocalizedName) String() string { func (*LocalizedName) ProtoMessage() {} func (x *LocalizedName) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[149] + mi := &file_binary_proto_def_proto_msgTypes[151] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16963,7 +17083,7 @@ func (x *LocalizedName) ProtoReflect() protoreflect.Message { // Deprecated: Use LocalizedName.ProtoReflect.Descriptor instead. func (*LocalizedName) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{149} + return file_binary_proto_def_proto_rawDescGZIP(), []int{151} } func (x *LocalizedName) GetLg() string { @@ -17005,7 +17125,7 @@ type BizIdentityInfo struct { func (x *BizIdentityInfo) Reset() { *x = BizIdentityInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[150] + mi := &file_binary_proto_def_proto_msgTypes[152] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -17018,7 +17138,7 @@ func (x *BizIdentityInfo) String() string { func (*BizIdentityInfo) ProtoMessage() {} func (x *BizIdentityInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[150] + mi := &file_binary_proto_def_proto_msgTypes[152] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17031,7 +17151,7 @@ func (x *BizIdentityInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use BizIdentityInfo.ProtoReflect.Descriptor instead. func (*BizIdentityInfo) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{150} + return file_binary_proto_def_proto_rawDescGZIP(), []int{152} } func (x *BizIdentityInfo) GetVlevel() BizIdentityInfo_VerifiedLevelValue { @@ -17102,7 +17222,7 @@ type BizAccountPayload struct { func (x *BizAccountPayload) Reset() { *x = BizAccountPayload{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[151] + mi := &file_binary_proto_def_proto_msgTypes[153] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -17115,7 +17235,7 @@ func (x *BizAccountPayload) String() string { func (*BizAccountPayload) ProtoMessage() {} func (x *BizAccountPayload) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[151] + mi := &file_binary_proto_def_proto_msgTypes[153] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17128,7 +17248,7 @@ func (x *BizAccountPayload) ProtoReflect() protoreflect.Message { // Deprecated: Use BizAccountPayload.ProtoReflect.Descriptor instead. func (*BizAccountPayload) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{151} + return file_binary_proto_def_proto_rawDescGZIP(), []int{153} } func (x *BizAccountPayload) GetVnameCert() *VerifiedNameCertificate { @@ -17160,7 +17280,7 @@ type BizAccountLinkInfo struct { func (x *BizAccountLinkInfo) Reset() { *x = BizAccountLinkInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[152] + mi := &file_binary_proto_def_proto_msgTypes[154] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -17173,7 +17293,7 @@ func (x *BizAccountLinkInfo) String() string { func (*BizAccountLinkInfo) ProtoMessage() {} func (x *BizAccountLinkInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[152] + mi := &file_binary_proto_def_proto_msgTypes[154] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17186,7 +17306,7 @@ func (x *BizAccountLinkInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use BizAccountLinkInfo.ProtoReflect.Descriptor instead. func (*BizAccountLinkInfo) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{152} + return file_binary_proto_def_proto_rawDescGZIP(), []int{154} } func (x *BizAccountLinkInfo) GetWhatsappBizAcctFbid() uint64 { @@ -17237,7 +17357,7 @@ type HandshakeMessage struct { func (x *HandshakeMessage) Reset() { *x = HandshakeMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[153] + mi := &file_binary_proto_def_proto_msgTypes[155] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -17250,7 +17370,7 @@ func (x *HandshakeMessage) String() string { func (*HandshakeMessage) ProtoMessage() {} func (x *HandshakeMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[153] + mi := &file_binary_proto_def_proto_msgTypes[155] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17263,7 +17383,7 @@ func (x *HandshakeMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use HandshakeMessage.ProtoReflect.Descriptor instead. func (*HandshakeMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{153} + return file_binary_proto_def_proto_rawDescGZIP(), []int{155} } func (x *HandshakeMessage) GetClientHello() *HandshakeClientHello { @@ -17300,7 +17420,7 @@ type HandshakeServerHello struct { func (x *HandshakeServerHello) Reset() { *x = HandshakeServerHello{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[154] + mi := &file_binary_proto_def_proto_msgTypes[156] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -17313,7 +17433,7 @@ func (x *HandshakeServerHello) String() string { func (*HandshakeServerHello) ProtoMessage() {} func (x *HandshakeServerHello) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[154] + mi := &file_binary_proto_def_proto_msgTypes[156] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17326,7 +17446,7 @@ func (x *HandshakeServerHello) ProtoReflect() protoreflect.Message { // Deprecated: Use HandshakeServerHello.ProtoReflect.Descriptor instead. func (*HandshakeServerHello) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{154} + return file_binary_proto_def_proto_rawDescGZIP(), []int{156} } func (x *HandshakeServerHello) GetEphemeral() []byte { @@ -17363,7 +17483,7 @@ type HandshakeClientHello struct { func (x *HandshakeClientHello) Reset() { *x = HandshakeClientHello{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[155] + mi := &file_binary_proto_def_proto_msgTypes[157] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -17376,7 +17496,7 @@ func (x *HandshakeClientHello) String() string { func (*HandshakeClientHello) ProtoMessage() {} func (x *HandshakeClientHello) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[155] + mi := &file_binary_proto_def_proto_msgTypes[157] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17389,7 +17509,7 @@ func (x *HandshakeClientHello) ProtoReflect() protoreflect.Message { // Deprecated: Use HandshakeClientHello.ProtoReflect.Descriptor instead. func (*HandshakeClientHello) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{155} + return file_binary_proto_def_proto_rawDescGZIP(), []int{157} } func (x *HandshakeClientHello) GetEphemeral() []byte { @@ -17425,7 +17545,7 @@ type HandshakeClientFinish struct { func (x *HandshakeClientFinish) Reset() { *x = HandshakeClientFinish{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[156] + mi := &file_binary_proto_def_proto_msgTypes[158] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -17438,7 +17558,7 @@ func (x *HandshakeClientFinish) String() string { func (*HandshakeClientFinish) ProtoMessage() {} func (x *HandshakeClientFinish) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[156] + mi := &file_binary_proto_def_proto_msgTypes[158] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17451,7 +17571,7 @@ func (x *HandshakeClientFinish) ProtoReflect() protoreflect.Message { // Deprecated: Use HandshakeClientFinish.ProtoReflect.Descriptor instead. func (*HandshakeClientFinish) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{156} + return file_binary_proto_def_proto_rawDescGZIP(), []int{158} } func (x *HandshakeClientFinish) GetStatic() []byte { @@ -17505,7 +17625,7 @@ type ClientPayload struct { func (x *ClientPayload) Reset() { *x = ClientPayload{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[157] + mi := &file_binary_proto_def_proto_msgTypes[159] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -17518,7 +17638,7 @@ func (x *ClientPayload) String() string { func (*ClientPayload) ProtoMessage() {} func (x *ClientPayload) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[157] + mi := &file_binary_proto_def_proto_msgTypes[159] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17531,7 +17651,7 @@ func (x *ClientPayload) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientPayload.ProtoReflect.Descriptor instead. func (*ClientPayload) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{157} + return file_binary_proto_def_proto_rawDescGZIP(), []int{159} } func (x *ClientPayload) GetUsername() uint64 { @@ -17737,7 +17857,7 @@ type WebNotificationsInfo struct { func (x *WebNotificationsInfo) Reset() { *x = WebNotificationsInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[158] + mi := &file_binary_proto_def_proto_msgTypes[160] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -17750,7 +17870,7 @@ func (x *WebNotificationsInfo) String() string { func (*WebNotificationsInfo) ProtoMessage() {} func (x *WebNotificationsInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[158] + mi := &file_binary_proto_def_proto_msgTypes[160] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17763,7 +17883,7 @@ func (x *WebNotificationsInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use WebNotificationsInfo.ProtoReflect.Descriptor instead. func (*WebNotificationsInfo) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{158} + return file_binary_proto_def_proto_rawDescGZIP(), []int{160} } func (x *WebNotificationsInfo) GetTimestamp() uint64 { @@ -17843,12 +17963,13 @@ type WebMessageInfo struct { OriginalSelfAuthorUserJidString *string `protobuf:"bytes,51,opt,name=originalSelfAuthorUserJidString" json:"originalSelfAuthorUserJidString,omitempty"` RevokeMessageTimestamp *uint64 `protobuf:"varint,52,opt,name=revokeMessageTimestamp" json:"revokeMessageTimestamp,omitempty"` PinInChat *PinInChat `protobuf:"bytes,54,opt,name=pinInChat" json:"pinInChat,omitempty"` + FutureproofMessageSecretMessage *FutureproofMessageSecretMessage `protobuf:"bytes,55,opt,name=futureproofMessageSecretMessage" json:"futureproofMessageSecretMessage,omitempty"` } func (x *WebMessageInfo) Reset() { *x = WebMessageInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[159] + mi := &file_binary_proto_def_proto_msgTypes[161] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -17861,7 +17982,7 @@ func (x *WebMessageInfo) String() string { func (*WebMessageInfo) ProtoMessage() {} func (x *WebMessageInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[159] + mi := &file_binary_proto_def_proto_msgTypes[161] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17874,7 +17995,7 @@ func (x *WebMessageInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use WebMessageInfo.ProtoReflect.Descriptor instead. func (*WebMessageInfo) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{159} + return file_binary_proto_def_proto_rawDescGZIP(), []int{161} } func (x *WebMessageInfo) GetKey() *MessageKey { @@ -18185,6 +18306,13 @@ func (x *WebMessageInfo) GetPinInChat() *PinInChat { return nil } +func (x *WebMessageInfo) GetFutureproofMessageSecretMessage() *FutureproofMessageSecretMessage { + if x != nil { + return x.FutureproofMessageSecretMessage + } + return nil +} + type WebFeatures struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -18240,7 +18368,7 @@ type WebFeatures struct { func (x *WebFeatures) Reset() { *x = WebFeatures{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[160] + mi := &file_binary_proto_def_proto_msgTypes[162] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -18253,7 +18381,7 @@ func (x *WebFeatures) String() string { func (*WebFeatures) ProtoMessage() {} func (x *WebFeatures) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[160] + mi := &file_binary_proto_def_proto_msgTypes[162] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -18266,7 +18394,7 @@ func (x *WebFeatures) ProtoReflect() protoreflect.Message { // Deprecated: Use WebFeatures.ProtoReflect.Descriptor instead. func (*WebFeatures) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{160} + return file_binary_proto_def_proto_rawDescGZIP(), []int{162} } func (x *WebFeatures) GetLabelsDisplay() WebFeatures_Flag { @@ -18600,7 +18728,7 @@ type UserReceipt struct { func (x *UserReceipt) Reset() { *x = UserReceipt{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[161] + mi := &file_binary_proto_def_proto_msgTypes[163] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -18613,7 +18741,7 @@ func (x *UserReceipt) String() string { func (*UserReceipt) ProtoMessage() {} func (x *UserReceipt) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[161] + mi := &file_binary_proto_def_proto_msgTypes[163] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -18626,7 +18754,7 @@ func (x *UserReceipt) ProtoReflect() protoreflect.Message { // Deprecated: Use UserReceipt.ProtoReflect.Descriptor instead. func (*UserReceipt) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{161} + return file_binary_proto_def_proto_rawDescGZIP(), []int{163} } func (x *UserReceipt) GetUserJid() string { @@ -18683,7 +18811,7 @@ type StatusPSA struct { func (x *StatusPSA) Reset() { *x = StatusPSA{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[162] + mi := &file_binary_proto_def_proto_msgTypes[164] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -18696,7 +18824,7 @@ func (x *StatusPSA) String() string { func (*StatusPSA) ProtoMessage() {} func (x *StatusPSA) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[162] + mi := &file_binary_proto_def_proto_msgTypes[164] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -18709,7 +18837,7 @@ func (x *StatusPSA) ProtoReflect() protoreflect.Message { // Deprecated: Use StatusPSA.ProtoReflect.Descriptor instead. func (*StatusPSA) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{162} + return file_binary_proto_def_proto_rawDescGZIP(), []int{164} } func (x *StatusPSA) GetCampaignId() uint64 { @@ -18741,7 +18869,7 @@ type Reaction struct { func (x *Reaction) Reset() { *x = Reaction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[163] + mi := &file_binary_proto_def_proto_msgTypes[165] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -18754,7 +18882,7 @@ func (x *Reaction) String() string { func (*Reaction) ProtoMessage() {} func (x *Reaction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[163] + mi := &file_binary_proto_def_proto_msgTypes[165] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -18767,7 +18895,7 @@ func (x *Reaction) ProtoReflect() protoreflect.Message { // Deprecated: Use Reaction.ProtoReflect.Descriptor instead. func (*Reaction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{163} + return file_binary_proto_def_proto_rawDescGZIP(), []int{165} } func (x *Reaction) GetKey() *MessageKey { @@ -18820,7 +18948,7 @@ type PollUpdate struct { func (x *PollUpdate) Reset() { *x = PollUpdate{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[164] + mi := &file_binary_proto_def_proto_msgTypes[166] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -18833,7 +18961,7 @@ func (x *PollUpdate) String() string { func (*PollUpdate) ProtoMessage() {} func (x *PollUpdate) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[164] + mi := &file_binary_proto_def_proto_msgTypes[166] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -18846,7 +18974,7 @@ func (x *PollUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use PollUpdate.ProtoReflect.Descriptor instead. func (*PollUpdate) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{164} + return file_binary_proto_def_proto_rawDescGZIP(), []int{166} } func (x *PollUpdate) GetPollUpdateMessageKey() *MessageKey { @@ -18895,7 +19023,7 @@ type PollAdditionalMetadata struct { func (x *PollAdditionalMetadata) Reset() { *x = PollAdditionalMetadata{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[165] + mi := &file_binary_proto_def_proto_msgTypes[167] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -18908,7 +19036,7 @@ func (x *PollAdditionalMetadata) String() string { func (*PollAdditionalMetadata) ProtoMessage() {} func (x *PollAdditionalMetadata) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[165] + mi := &file_binary_proto_def_proto_msgTypes[167] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -18921,7 +19049,7 @@ func (x *PollAdditionalMetadata) ProtoReflect() protoreflect.Message { // Deprecated: Use PollAdditionalMetadata.ProtoReflect.Descriptor instead. func (*PollAdditionalMetadata) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{165} + return file_binary_proto_def_proto_rawDescGZIP(), []int{167} } func (x *PollAdditionalMetadata) GetPollInvalidated() bool { @@ -18946,7 +19074,7 @@ type PinInChat struct { func (x *PinInChat) Reset() { *x = PinInChat{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[166] + mi := &file_binary_proto_def_proto_msgTypes[168] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -18959,7 +19087,7 @@ func (x *PinInChat) String() string { func (*PinInChat) ProtoMessage() {} func (x *PinInChat) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[166] + mi := &file_binary_proto_def_proto_msgTypes[168] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -18972,7 +19100,7 @@ func (x *PinInChat) ProtoReflect() protoreflect.Message { // Deprecated: Use PinInChat.ProtoReflect.Descriptor instead. func (*PinInChat) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{166} + return file_binary_proto_def_proto_rawDescGZIP(), []int{168} } func (x *PinInChat) GetType() PinInChat_Type { @@ -19023,7 +19151,7 @@ type PhotoChange struct { func (x *PhotoChange) Reset() { *x = PhotoChange{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[167] + mi := &file_binary_proto_def_proto_msgTypes[169] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19036,7 +19164,7 @@ func (x *PhotoChange) String() string { func (*PhotoChange) ProtoMessage() {} func (x *PhotoChange) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[167] + mi := &file_binary_proto_def_proto_msgTypes[169] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19049,7 +19177,7 @@ func (x *PhotoChange) ProtoReflect() protoreflect.Message { // Deprecated: Use PhotoChange.ProtoReflect.Descriptor instead. func (*PhotoChange) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{167} + return file_binary_proto_def_proto_rawDescGZIP(), []int{169} } func (x *PhotoChange) GetOldPhoto() []byte { @@ -19096,7 +19224,7 @@ type PaymentInfo struct { func (x *PaymentInfo) Reset() { *x = PaymentInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[168] + mi := &file_binary_proto_def_proto_msgTypes[170] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19109,7 +19237,7 @@ func (x *PaymentInfo) String() string { func (*PaymentInfo) ProtoMessage() {} func (x *PaymentInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[168] + mi := &file_binary_proto_def_proto_msgTypes[170] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19122,7 +19250,7 @@ func (x *PaymentInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use PaymentInfo.ProtoReflect.Descriptor instead. func (*PaymentInfo) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{168} + return file_binary_proto_def_proto_rawDescGZIP(), []int{170} } func (x *PaymentInfo) GetCurrencyDeprecated() PaymentInfo_Currency { @@ -19230,7 +19358,7 @@ type NotificationMessageInfo struct { func (x *NotificationMessageInfo) Reset() { *x = NotificationMessageInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[169] + mi := &file_binary_proto_def_proto_msgTypes[171] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19243,7 +19371,7 @@ func (x *NotificationMessageInfo) String() string { func (*NotificationMessageInfo) ProtoMessage() {} func (x *NotificationMessageInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[169] + mi := &file_binary_proto_def_proto_msgTypes[171] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19256,7 +19384,7 @@ func (x *NotificationMessageInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use NotificationMessageInfo.ProtoReflect.Descriptor instead. func (*NotificationMessageInfo) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{169} + return file_binary_proto_def_proto_rawDescGZIP(), []int{171} } func (x *NotificationMessageInfo) GetKey() *MessageKey { @@ -19298,7 +19426,7 @@ type MessageAddOnContextInfo struct { func (x *MessageAddOnContextInfo) Reset() { *x = MessageAddOnContextInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[170] + mi := &file_binary_proto_def_proto_msgTypes[172] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19311,7 +19439,7 @@ func (x *MessageAddOnContextInfo) String() string { func (*MessageAddOnContextInfo) ProtoMessage() {} func (x *MessageAddOnContextInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[170] + mi := &file_binary_proto_def_proto_msgTypes[172] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19324,7 +19452,7 @@ func (x *MessageAddOnContextInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use MessageAddOnContextInfo.ProtoReflect.Descriptor instead. func (*MessageAddOnContextInfo) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{170} + return file_binary_proto_def_proto_rawDescGZIP(), []int{172} } func (x *MessageAddOnContextInfo) GetMessageAddOnDurationInSecs() uint32 { @@ -19345,7 +19473,7 @@ type MediaData struct { func (x *MediaData) Reset() { *x = MediaData{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[171] + mi := &file_binary_proto_def_proto_msgTypes[173] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19358,7 +19486,7 @@ func (x *MediaData) String() string { func (*MediaData) ProtoMessage() {} func (x *MediaData) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[171] + mi := &file_binary_proto_def_proto_msgTypes[173] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19371,7 +19499,7 @@ func (x *MediaData) ProtoReflect() protoreflect.Message { // Deprecated: Use MediaData.ProtoReflect.Descriptor instead. func (*MediaData) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{171} + return file_binary_proto_def_proto_rawDescGZIP(), []int{173} } func (x *MediaData) GetLocalPath() string { @@ -19397,7 +19525,7 @@ type KeepInChat struct { func (x *KeepInChat) Reset() { *x = KeepInChat{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[172] + mi := &file_binary_proto_def_proto_msgTypes[174] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19410,7 +19538,7 @@ func (x *KeepInChat) String() string { func (*KeepInChat) ProtoMessage() {} func (x *KeepInChat) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[172] + mi := &file_binary_proto_def_proto_msgTypes[174] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19423,7 +19551,7 @@ func (x *KeepInChat) ProtoReflect() protoreflect.Message { // Deprecated: Use KeepInChat.ProtoReflect.Descriptor instead. func (*KeepInChat) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{172} + return file_binary_proto_def_proto_rawDescGZIP(), []int{174} } func (x *KeepInChat) GetKeepType() KeepType { @@ -19468,6 +19596,155 @@ func (x *KeepInChat) GetServerTimestampMs() int64 { return 0 } +type FutureproofMessageSecretMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MessageSecretMessage *MessageSecretMessage `protobuf:"bytes,1,req,name=messageSecretMessage" json:"messageSecretMessage,omitempty"` + FutureMessageData *FutureMessageData `protobuf:"bytes,2,req,name=futureMessageData" json:"futureMessageData,omitempty"` +} + +func (x *FutureproofMessageSecretMessage) Reset() { + *x = FutureproofMessageSecretMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_binary_proto_def_proto_msgTypes[175] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FutureproofMessageSecretMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FutureproofMessageSecretMessage) ProtoMessage() {} + +func (x *FutureproofMessageSecretMessage) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[175] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FutureproofMessageSecretMessage.ProtoReflect.Descriptor instead. +func (*FutureproofMessageSecretMessage) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{175} +} + +func (x *FutureproofMessageSecretMessage) GetMessageSecretMessage() *MessageSecretMessage { + if x != nil { + return x.MessageSecretMessage + } + return nil +} + +func (x *FutureproofMessageSecretMessage) GetFutureMessageData() *FutureMessageData { + if x != nil { + return x.FutureMessageData + } + return nil +} + +type FutureMessageData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BotData *BotData `protobuf:"bytes,1,opt,name=botData" json:"botData,omitempty"` +} + +func (x *FutureMessageData) Reset() { + *x = FutureMessageData{} + if protoimpl.UnsafeEnabled { + mi := &file_binary_proto_def_proto_msgTypes[176] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FutureMessageData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FutureMessageData) ProtoMessage() {} + +func (x *FutureMessageData) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[176] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FutureMessageData.ProtoReflect.Descriptor instead. +func (*FutureMessageData) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{176} +} + +func (x *FutureMessageData) GetBotData() *BotData { + if x != nil { + return x.BotData + } + return nil +} + +type BotData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TargetMessageKey *MessageKey `protobuf:"bytes,1,req,name=targetMessageKey" json:"targetMessageKey,omitempty"` +} + +func (x *BotData) Reset() { + *x = BotData{} + if protoimpl.UnsafeEnabled { + mi := &file_binary_proto_def_proto_msgTypes[177] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BotData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BotData) ProtoMessage() {} + +func (x *BotData) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[177] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BotData.ProtoReflect.Descriptor instead. +func (*BotData) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{177} +} + +func (x *BotData) GetTargetMessageKey() *MessageKey { + if x != nil { + return x.TargetMessageKey + } + return nil +} + type NoiseCertificate struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -19480,7 +19757,7 @@ type NoiseCertificate struct { func (x *NoiseCertificate) Reset() { *x = NoiseCertificate{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[173] + mi := &file_binary_proto_def_proto_msgTypes[178] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19493,7 +19770,7 @@ func (x *NoiseCertificate) String() string { func (*NoiseCertificate) ProtoMessage() {} func (x *NoiseCertificate) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[173] + mi := &file_binary_proto_def_proto_msgTypes[178] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19506,7 +19783,7 @@ func (x *NoiseCertificate) ProtoReflect() protoreflect.Message { // Deprecated: Use NoiseCertificate.ProtoReflect.Descriptor instead. func (*NoiseCertificate) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{173} + return file_binary_proto_def_proto_rawDescGZIP(), []int{178} } func (x *NoiseCertificate) GetDetails() []byte { @@ -19535,7 +19812,7 @@ type CertChain struct { func (x *CertChain) Reset() { *x = CertChain{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[174] + mi := &file_binary_proto_def_proto_msgTypes[179] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19548,7 +19825,7 @@ func (x *CertChain) String() string { func (*CertChain) ProtoMessage() {} func (x *CertChain) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[174] + mi := &file_binary_proto_def_proto_msgTypes[179] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19561,7 +19838,7 @@ func (x *CertChain) ProtoReflect() protoreflect.Message { // Deprecated: Use CertChain.ProtoReflect.Descriptor instead. func (*CertChain) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{174} + return file_binary_proto_def_proto_rawDescGZIP(), []int{179} } func (x *CertChain) GetLeaf() *CertChain_NoiseCertificate { @@ -19593,7 +19870,7 @@ type DeviceProps_HistorySyncConfig struct { func (x *DeviceProps_HistorySyncConfig) Reset() { *x = DeviceProps_HistorySyncConfig{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[175] + mi := &file_binary_proto_def_proto_msgTypes[180] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19606,7 +19883,7 @@ func (x *DeviceProps_HistorySyncConfig) String() string { func (*DeviceProps_HistorySyncConfig) ProtoMessage() {} func (x *DeviceProps_HistorySyncConfig) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[175] + mi := &file_binary_proto_def_proto_msgTypes[180] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19672,7 +19949,7 @@ type DeviceProps_AppVersion struct { func (x *DeviceProps_AppVersion) Reset() { *x = DeviceProps_AppVersion{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[176] + mi := &file_binary_proto_def_proto_msgTypes[181] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19685,7 +19962,7 @@ func (x *DeviceProps_AppVersion) String() string { func (*DeviceProps_AppVersion) ProtoMessage() {} func (x *DeviceProps_AppVersion) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[176] + mi := &file_binary_proto_def_proto_msgTypes[181] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19747,7 +20024,7 @@ type ListResponseMessage_SingleSelectReply struct { func (x *ListResponseMessage_SingleSelectReply) Reset() { *x = ListResponseMessage_SingleSelectReply{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[177] + mi := &file_binary_proto_def_proto_msgTypes[182] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19760,7 +20037,7 @@ func (x *ListResponseMessage_SingleSelectReply) String() string { func (*ListResponseMessage_SingleSelectReply) ProtoMessage() {} func (x *ListResponseMessage_SingleSelectReply) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[177] + mi := &file_binary_proto_def_proto_msgTypes[182] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19773,7 +20050,7 @@ func (x *ListResponseMessage_SingleSelectReply) ProtoReflect() protoreflect.Mess // Deprecated: Use ListResponseMessage_SingleSelectReply.ProtoReflect.Descriptor instead. func (*ListResponseMessage_SingleSelectReply) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{10, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{9, 0} } func (x *ListResponseMessage_SingleSelectReply) GetSelectedRowId() string { @@ -19795,7 +20072,7 @@ type ListMessage_Section struct { func (x *ListMessage_Section) Reset() { *x = ListMessage_Section{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[178] + mi := &file_binary_proto_def_proto_msgTypes[183] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19808,7 +20085,7 @@ func (x *ListMessage_Section) String() string { func (*ListMessage_Section) ProtoMessage() {} func (x *ListMessage_Section) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[178] + mi := &file_binary_proto_def_proto_msgTypes[183] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19821,7 +20098,7 @@ func (x *ListMessage_Section) ProtoReflect() protoreflect.Message { // Deprecated: Use ListMessage_Section.ProtoReflect.Descriptor instead. func (*ListMessage_Section) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{11, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{10, 0} } func (x *ListMessage_Section) GetTitle() string { @@ -19851,7 +20128,7 @@ type ListMessage_Row struct { func (x *ListMessage_Row) Reset() { *x = ListMessage_Row{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[179] + mi := &file_binary_proto_def_proto_msgTypes[184] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19864,7 +20141,7 @@ func (x *ListMessage_Row) String() string { func (*ListMessage_Row) ProtoMessage() {} func (x *ListMessage_Row) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[179] + mi := &file_binary_proto_def_proto_msgTypes[184] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19877,7 +20154,7 @@ func (x *ListMessage_Row) ProtoReflect() protoreflect.Message { // Deprecated: Use ListMessage_Row.ProtoReflect.Descriptor instead. func (*ListMessage_Row) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{11, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{10, 1} } func (x *ListMessage_Row) GetTitle() string { @@ -19912,7 +20189,7 @@ type ListMessage_Product struct { func (x *ListMessage_Product) Reset() { *x = ListMessage_Product{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[180] + mi := &file_binary_proto_def_proto_msgTypes[185] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19925,7 +20202,7 @@ func (x *ListMessage_Product) String() string { func (*ListMessage_Product) ProtoMessage() {} func (x *ListMessage_Product) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[180] + mi := &file_binary_proto_def_proto_msgTypes[185] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19938,7 +20215,7 @@ func (x *ListMessage_Product) ProtoReflect() protoreflect.Message { // Deprecated: Use ListMessage_Product.ProtoReflect.Descriptor instead. func (*ListMessage_Product) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{11, 2} + return file_binary_proto_def_proto_rawDescGZIP(), []int{10, 2} } func (x *ListMessage_Product) GetProductId() string { @@ -19960,7 +20237,7 @@ type ListMessage_ProductSection struct { func (x *ListMessage_ProductSection) Reset() { *x = ListMessage_ProductSection{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[181] + mi := &file_binary_proto_def_proto_msgTypes[186] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19973,7 +20250,7 @@ func (x *ListMessage_ProductSection) String() string { func (*ListMessage_ProductSection) ProtoMessage() {} func (x *ListMessage_ProductSection) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[181] + mi := &file_binary_proto_def_proto_msgTypes[186] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19986,7 +20263,7 @@ func (x *ListMessage_ProductSection) ProtoReflect() protoreflect.Message { // Deprecated: Use ListMessage_ProductSection.ProtoReflect.Descriptor instead. func (*ListMessage_ProductSection) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{11, 3} + return file_binary_proto_def_proto_rawDescGZIP(), []int{10, 3} } func (x *ListMessage_ProductSection) GetTitle() string { @@ -20016,7 +20293,7 @@ type ListMessage_ProductListInfo struct { func (x *ListMessage_ProductListInfo) Reset() { *x = ListMessage_ProductListInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[182] + mi := &file_binary_proto_def_proto_msgTypes[187] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -20029,7 +20306,7 @@ func (x *ListMessage_ProductListInfo) String() string { func (*ListMessage_ProductListInfo) ProtoMessage() {} func (x *ListMessage_ProductListInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[182] + mi := &file_binary_proto_def_proto_msgTypes[187] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -20042,7 +20319,7 @@ func (x *ListMessage_ProductListInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use ListMessage_ProductListInfo.ProtoReflect.Descriptor instead. func (*ListMessage_ProductListInfo) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{11, 4} + return file_binary_proto_def_proto_rawDescGZIP(), []int{10, 4} } func (x *ListMessage_ProductListInfo) GetProductSections() []*ListMessage_ProductSection { @@ -20078,7 +20355,7 @@ type ListMessage_ProductListHeaderImage struct { func (x *ListMessage_ProductListHeaderImage) Reset() { *x = ListMessage_ProductListHeaderImage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[183] + mi := &file_binary_proto_def_proto_msgTypes[188] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -20091,7 +20368,7 @@ func (x *ListMessage_ProductListHeaderImage) String() string { func (*ListMessage_ProductListHeaderImage) ProtoMessage() {} func (x *ListMessage_ProductListHeaderImage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[183] + mi := &file_binary_proto_def_proto_msgTypes[188] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -20104,7 +20381,7 @@ func (x *ListMessage_ProductListHeaderImage) ProtoReflect() protoreflect.Message // Deprecated: Use ListMessage_ProductListHeaderImage.ProtoReflect.Descriptor instead. func (*ListMessage_ProductListHeaderImage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{11, 5} + return file_binary_proto_def_proto_rawDescGZIP(), []int{10, 5} } func (x *ListMessage_ProductListHeaderImage) GetProductId() string { @@ -20134,7 +20411,7 @@ type InteractiveResponseMessage_NativeFlowResponseMessage struct { func (x *InteractiveResponseMessage_NativeFlowResponseMessage) Reset() { *x = InteractiveResponseMessage_NativeFlowResponseMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[184] + mi := &file_binary_proto_def_proto_msgTypes[189] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -20147,7 +20424,7 @@ func (x *InteractiveResponseMessage_NativeFlowResponseMessage) String() string { func (*InteractiveResponseMessage_NativeFlowResponseMessage) ProtoMessage() {} func (x *InteractiveResponseMessage_NativeFlowResponseMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[184] + mi := &file_binary_proto_def_proto_msgTypes[189] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -20160,7 +20437,7 @@ func (x *InteractiveResponseMessage_NativeFlowResponseMessage) ProtoReflect() pr // Deprecated: Use InteractiveResponseMessage_NativeFlowResponseMessage.ProtoReflect.Descriptor instead. func (*InteractiveResponseMessage_NativeFlowResponseMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{14, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{13, 0} } func (x *InteractiveResponseMessage_NativeFlowResponseMessage) GetName() string { @@ -20196,7 +20473,7 @@ type InteractiveResponseMessage_Body struct { func (x *InteractiveResponseMessage_Body) Reset() { *x = InteractiveResponseMessage_Body{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[185] + mi := &file_binary_proto_def_proto_msgTypes[190] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -20209,7 +20486,7 @@ func (x *InteractiveResponseMessage_Body) String() string { func (*InteractiveResponseMessage_Body) ProtoMessage() {} func (x *InteractiveResponseMessage_Body) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[185] + mi := &file_binary_proto_def_proto_msgTypes[190] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -20222,7 +20499,7 @@ func (x *InteractiveResponseMessage_Body) ProtoReflect() protoreflect.Message { // Deprecated: Use InteractiveResponseMessage_Body.ProtoReflect.Descriptor instead. func (*InteractiveResponseMessage_Body) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{14, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{13, 1} } func (x *InteractiveResponseMessage_Body) GetText() string { @@ -20252,7 +20529,7 @@ type InteractiveMessage_ShopMessage struct { func (x *InteractiveMessage_ShopMessage) Reset() { *x = InteractiveMessage_ShopMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[186] + mi := &file_binary_proto_def_proto_msgTypes[191] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -20265,7 +20542,7 @@ func (x *InteractiveMessage_ShopMessage) String() string { func (*InteractiveMessage_ShopMessage) ProtoMessage() {} func (x *InteractiveMessage_ShopMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[186] + mi := &file_binary_proto_def_proto_msgTypes[191] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -20278,7 +20555,7 @@ func (x *InteractiveMessage_ShopMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use InteractiveMessage_ShopMessage.ProtoReflect.Descriptor instead. func (*InteractiveMessage_ShopMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{15, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{14, 0} } func (x *InteractiveMessage_ShopMessage) GetId() string { @@ -20315,7 +20592,7 @@ type InteractiveMessage_NativeFlowMessage struct { func (x *InteractiveMessage_NativeFlowMessage) Reset() { *x = InteractiveMessage_NativeFlowMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[187] + mi := &file_binary_proto_def_proto_msgTypes[192] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -20328,7 +20605,7 @@ func (x *InteractiveMessage_NativeFlowMessage) String() string { func (*InteractiveMessage_NativeFlowMessage) ProtoMessage() {} func (x *InteractiveMessage_NativeFlowMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[187] + mi := &file_binary_proto_def_proto_msgTypes[192] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -20341,7 +20618,7 @@ func (x *InteractiveMessage_NativeFlowMessage) ProtoReflect() protoreflect.Messa // Deprecated: Use InteractiveMessage_NativeFlowMessage.ProtoReflect.Descriptor instead. func (*InteractiveMessage_NativeFlowMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{15, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{14, 1} } func (x *InteractiveMessage_NativeFlowMessage) GetButtons() []*InteractiveMessage_NativeFlowMessage_NativeFlowButton { @@ -20386,7 +20663,7 @@ type InteractiveMessage_Header struct { func (x *InteractiveMessage_Header) Reset() { *x = InteractiveMessage_Header{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[188] + mi := &file_binary_proto_def_proto_msgTypes[193] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -20399,7 +20676,7 @@ func (x *InteractiveMessage_Header) String() string { func (*InteractiveMessage_Header) ProtoMessage() {} func (x *InteractiveMessage_Header) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[188] + mi := &file_binary_proto_def_proto_msgTypes[193] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -20412,7 +20689,7 @@ func (x *InteractiveMessage_Header) ProtoReflect() protoreflect.Message { // Deprecated: Use InteractiveMessage_Header.ProtoReflect.Descriptor instead. func (*InteractiveMessage_Header) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{15, 2} + return file_binary_proto_def_proto_rawDescGZIP(), []int{14, 2} } func (x *InteractiveMessage_Header) GetTitle() string { @@ -20523,7 +20800,7 @@ type InteractiveMessage_Footer struct { func (x *InteractiveMessage_Footer) Reset() { *x = InteractiveMessage_Footer{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[189] + mi := &file_binary_proto_def_proto_msgTypes[194] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -20536,7 +20813,7 @@ func (x *InteractiveMessage_Footer) String() string { func (*InteractiveMessage_Footer) ProtoMessage() {} func (x *InteractiveMessage_Footer) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[189] + mi := &file_binary_proto_def_proto_msgTypes[194] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -20549,7 +20826,7 @@ func (x *InteractiveMessage_Footer) ProtoReflect() protoreflect.Message { // Deprecated: Use InteractiveMessage_Footer.ProtoReflect.Descriptor instead. func (*InteractiveMessage_Footer) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{15, 3} + return file_binary_proto_def_proto_rawDescGZIP(), []int{14, 3} } func (x *InteractiveMessage_Footer) GetText() string { @@ -20572,7 +20849,7 @@ type InteractiveMessage_CollectionMessage struct { func (x *InteractiveMessage_CollectionMessage) Reset() { *x = InteractiveMessage_CollectionMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[190] + mi := &file_binary_proto_def_proto_msgTypes[195] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -20585,7 +20862,7 @@ func (x *InteractiveMessage_CollectionMessage) String() string { func (*InteractiveMessage_CollectionMessage) ProtoMessage() {} func (x *InteractiveMessage_CollectionMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[190] + mi := &file_binary_proto_def_proto_msgTypes[195] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -20598,7 +20875,7 @@ func (x *InteractiveMessage_CollectionMessage) ProtoReflect() protoreflect.Messa // Deprecated: Use InteractiveMessage_CollectionMessage.ProtoReflect.Descriptor instead. func (*InteractiveMessage_CollectionMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{15, 4} + return file_binary_proto_def_proto_rawDescGZIP(), []int{14, 4} } func (x *InteractiveMessage_CollectionMessage) GetBizJid() string { @@ -20622,6 +20899,53 @@ func (x *InteractiveMessage_CollectionMessage) GetMessageVersion() int32 { return 0 } +type InteractiveMessage_CarouselMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Cards []*InteractiveMessage `protobuf:"bytes,1,rep,name=cards" json:"cards,omitempty"` +} + +func (x *InteractiveMessage_CarouselMessage) Reset() { + *x = InteractiveMessage_CarouselMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_binary_proto_def_proto_msgTypes[196] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InteractiveMessage_CarouselMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InteractiveMessage_CarouselMessage) ProtoMessage() {} + +func (x *InteractiveMessage_CarouselMessage) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[196] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InteractiveMessage_CarouselMessage.ProtoReflect.Descriptor instead. +func (*InteractiveMessage_CarouselMessage) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{14, 5} +} + +func (x *InteractiveMessage_CarouselMessage) GetCards() []*InteractiveMessage { + if x != nil { + return x.Cards + } + return nil +} + type InteractiveMessage_Body struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -20633,7 +20957,7 @@ type InteractiveMessage_Body struct { func (x *InteractiveMessage_Body) Reset() { *x = InteractiveMessage_Body{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[191] + mi := &file_binary_proto_def_proto_msgTypes[197] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -20646,7 +20970,7 @@ func (x *InteractiveMessage_Body) String() string { func (*InteractiveMessage_Body) ProtoMessage() {} func (x *InteractiveMessage_Body) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[191] + mi := &file_binary_proto_def_proto_msgTypes[197] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -20659,7 +20983,7 @@ func (x *InteractiveMessage_Body) ProtoReflect() protoreflect.Message { // Deprecated: Use InteractiveMessage_Body.ProtoReflect.Descriptor instead. func (*InteractiveMessage_Body) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{15, 5} + return file_binary_proto_def_proto_rawDescGZIP(), []int{14, 6} } func (x *InteractiveMessage_Body) GetText() string { @@ -20681,7 +21005,7 @@ type InteractiveMessage_NativeFlowMessage_NativeFlowButton struct { func (x *InteractiveMessage_NativeFlowMessage_NativeFlowButton) Reset() { *x = InteractiveMessage_NativeFlowMessage_NativeFlowButton{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[192] + mi := &file_binary_proto_def_proto_msgTypes[198] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -20694,7 +21018,7 @@ func (x *InteractiveMessage_NativeFlowMessage_NativeFlowButton) String() string func (*InteractiveMessage_NativeFlowMessage_NativeFlowButton) ProtoMessage() {} func (x *InteractiveMessage_NativeFlowMessage_NativeFlowButton) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[192] + mi := &file_binary_proto_def_proto_msgTypes[198] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -20707,7 +21031,7 @@ func (x *InteractiveMessage_NativeFlowMessage_NativeFlowButton) ProtoReflect() p // Deprecated: Use InteractiveMessage_NativeFlowMessage_NativeFlowButton.ProtoReflect.Descriptor instead. func (*InteractiveMessage_NativeFlowMessage_NativeFlowButton) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{15, 1, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{14, 1, 0} } func (x *InteractiveMessage_NativeFlowMessage_NativeFlowButton) GetName() string { @@ -20740,7 +21064,7 @@ type HighlyStructuredMessage_HSMLocalizableParameter struct { func (x *HighlyStructuredMessage_HSMLocalizableParameter) Reset() { *x = HighlyStructuredMessage_HSMLocalizableParameter{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[193] + mi := &file_binary_proto_def_proto_msgTypes[199] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -20753,7 +21077,7 @@ func (x *HighlyStructuredMessage_HSMLocalizableParameter) String() string { func (*HighlyStructuredMessage_HSMLocalizableParameter) ProtoMessage() {} func (x *HighlyStructuredMessage_HSMLocalizableParameter) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[193] + mi := &file_binary_proto_def_proto_msgTypes[199] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -20766,7 +21090,7 @@ func (x *HighlyStructuredMessage_HSMLocalizableParameter) ProtoReflect() protore // Deprecated: Use HighlyStructuredMessage_HSMLocalizableParameter.ProtoReflect.Descriptor instead. func (*HighlyStructuredMessage_HSMLocalizableParameter) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{19, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{18, 0} } func (x *HighlyStructuredMessage_HSMLocalizableParameter) GetDefault() string { @@ -20830,7 +21154,7 @@ type HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime struct { func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime) Reset() { *x = HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[194] + mi := &file_binary_proto_def_proto_msgTypes[200] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -20843,7 +21167,7 @@ func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime) String() s func (*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime) ProtoMessage() {} func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[194] + mi := &file_binary_proto_def_proto_msgTypes[200] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -20856,7 +21180,7 @@ func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime) ProtoRefle // Deprecated: Use HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime.ProtoReflect.Descriptor instead. func (*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{19, 0, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{18, 0, 0} } func (m *HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime) GetDatetimeOneof() isHighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_DatetimeOneof { @@ -20910,7 +21234,7 @@ type HighlyStructuredMessage_HSMLocalizableParameter_HSMCurrency struct { func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMCurrency) Reset() { *x = HighlyStructuredMessage_HSMLocalizableParameter_HSMCurrency{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[195] + mi := &file_binary_proto_def_proto_msgTypes[201] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -20923,7 +21247,7 @@ func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMCurrency) String() s func (*HighlyStructuredMessage_HSMLocalizableParameter_HSMCurrency) ProtoMessage() {} func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMCurrency) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[195] + mi := &file_binary_proto_def_proto_msgTypes[201] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -20936,7 +21260,7 @@ func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMCurrency) ProtoRefle // Deprecated: Use HighlyStructuredMessage_HSMLocalizableParameter_HSMCurrency.ProtoReflect.Descriptor instead. func (*HighlyStructuredMessage_HSMLocalizableParameter_HSMCurrency) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{19, 0, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{18, 0, 1} } func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMCurrency) GetCurrencyCode() string { @@ -20964,7 +21288,7 @@ type HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeUnix func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeUnixEpoch) Reset() { *x = HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeUnixEpoch{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[196] + mi := &file_binary_proto_def_proto_msgTypes[202] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -20978,7 +21302,7 @@ func (*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeUn } func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeUnixEpoch) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[196] + mi := &file_binary_proto_def_proto_msgTypes[202] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -20991,7 +21315,7 @@ func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTime // Deprecated: Use HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeUnixEpoch.ProtoReflect.Descriptor instead. func (*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeUnixEpoch) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{19, 0, 0, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{18, 0, 0, 0} } func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeUnixEpoch) GetTimestamp() int64 { @@ -21018,7 +21342,7 @@ type HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComp func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent) Reset() { *x = HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[197] + mi := &file_binary_proto_def_proto_msgTypes[203] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -21032,7 +21356,7 @@ func (*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeCo } func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[197] + mi := &file_binary_proto_def_proto_msgTypes[203] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -21045,7 +21369,7 @@ func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTime // Deprecated: Use HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent.ProtoReflect.Descriptor instead. func (*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{19, 0, 0, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{18, 0, 0, 1} } func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent) GetDayOfWeek() HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent_DayOfWeekType { @@ -21111,7 +21435,7 @@ type ButtonsMessage_Button struct { func (x *ButtonsMessage_Button) Reset() { *x = ButtonsMessage_Button{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[198] + mi := &file_binary_proto_def_proto_msgTypes[204] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -21124,7 +21448,7 @@ func (x *ButtonsMessage_Button) String() string { func (*ButtonsMessage_Button) ProtoMessage() {} func (x *ButtonsMessage_Button) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[198] + mi := &file_binary_proto_def_proto_msgTypes[204] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -21137,7 +21461,7 @@ func (x *ButtonsMessage_Button) ProtoReflect() protoreflect.Message { // Deprecated: Use ButtonsMessage_Button.ProtoReflect.Descriptor instead. func (*ButtonsMessage_Button) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{33, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{32, 0} } func (x *ButtonsMessage_Button) GetButtonId() string { @@ -21180,7 +21504,7 @@ type ButtonsMessage_Button_NativeFlowInfo struct { func (x *ButtonsMessage_Button_NativeFlowInfo) Reset() { *x = ButtonsMessage_Button_NativeFlowInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[199] + mi := &file_binary_proto_def_proto_msgTypes[205] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -21193,7 +21517,7 @@ func (x *ButtonsMessage_Button_NativeFlowInfo) String() string { func (*ButtonsMessage_Button_NativeFlowInfo) ProtoMessage() {} func (x *ButtonsMessage_Button_NativeFlowInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[199] + mi := &file_binary_proto_def_proto_msgTypes[205] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -21206,7 +21530,7 @@ func (x *ButtonsMessage_Button_NativeFlowInfo) ProtoReflect() protoreflect.Messa // Deprecated: Use ButtonsMessage_Button_NativeFlowInfo.ProtoReflect.Descriptor instead. func (*ButtonsMessage_Button_NativeFlowInfo) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{33, 0, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{32, 0, 0} } func (x *ButtonsMessage_Button_NativeFlowInfo) GetName() string { @@ -21234,7 +21558,7 @@ type ButtonsMessage_Button_ButtonText struct { func (x *ButtonsMessage_Button_ButtonText) Reset() { *x = ButtonsMessage_Button_ButtonText{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[200] + mi := &file_binary_proto_def_proto_msgTypes[206] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -21247,7 +21571,7 @@ func (x *ButtonsMessage_Button_ButtonText) String() string { func (*ButtonsMessage_Button_ButtonText) ProtoMessage() {} func (x *ButtonsMessage_Button_ButtonText) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[200] + mi := &file_binary_proto_def_proto_msgTypes[206] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -21260,7 +21584,7 @@ func (x *ButtonsMessage_Button_ButtonText) ProtoReflect() protoreflect.Message { // Deprecated: Use ButtonsMessage_Button_ButtonText.ProtoReflect.Descriptor instead. func (*ButtonsMessage_Button_ButtonText) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{33, 0, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{32, 0, 1} } func (x *ButtonsMessage_Button_ButtonText) GetDisplayText() string { @@ -21282,7 +21606,7 @@ type HydratedTemplateButton_HydratedURLButton struct { func (x *HydratedTemplateButton_HydratedURLButton) Reset() { *x = HydratedTemplateButton_HydratedURLButton{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[201] + mi := &file_binary_proto_def_proto_msgTypes[207] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -21295,7 +21619,7 @@ func (x *HydratedTemplateButton_HydratedURLButton) String() string { func (*HydratedTemplateButton_HydratedURLButton) ProtoMessage() {} func (x *HydratedTemplateButton_HydratedURLButton) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[201] + mi := &file_binary_proto_def_proto_msgTypes[207] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -21337,7 +21661,7 @@ type HydratedTemplateButton_HydratedQuickReplyButton struct { func (x *HydratedTemplateButton_HydratedQuickReplyButton) Reset() { *x = HydratedTemplateButton_HydratedQuickReplyButton{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[202] + mi := &file_binary_proto_def_proto_msgTypes[208] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -21350,7 +21674,7 @@ func (x *HydratedTemplateButton_HydratedQuickReplyButton) String() string { func (*HydratedTemplateButton_HydratedQuickReplyButton) ProtoMessage() {} func (x *HydratedTemplateButton_HydratedQuickReplyButton) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[202] + mi := &file_binary_proto_def_proto_msgTypes[208] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -21392,7 +21716,7 @@ type HydratedTemplateButton_HydratedCallButton struct { func (x *HydratedTemplateButton_HydratedCallButton) Reset() { *x = HydratedTemplateButton_HydratedCallButton{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[203] + mi := &file_binary_proto_def_proto_msgTypes[209] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -21405,7 +21729,7 @@ func (x *HydratedTemplateButton_HydratedCallButton) String() string { func (*HydratedTemplateButton_HydratedCallButton) ProtoMessage() {} func (x *HydratedTemplateButton_HydratedCallButton) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[203] + mi := &file_binary_proto_def_proto_msgTypes[209] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -21447,7 +21771,7 @@ type ContextInfo_UTMInfo struct { func (x *ContextInfo_UTMInfo) Reset() { *x = ContextInfo_UTMInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[204] + mi := &file_binary_proto_def_proto_msgTypes[210] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -21460,7 +21784,7 @@ func (x *ContextInfo_UTMInfo) String() string { func (*ContextInfo_UTMInfo) ProtoMessage() {} func (x *ContextInfo_UTMInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[204] + mi := &file_binary_proto_def_proto_msgTypes[210] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -21514,7 +21838,7 @@ type ContextInfo_ExternalAdReplyInfo struct { func (x *ContextInfo_ExternalAdReplyInfo) Reset() { *x = ContextInfo_ExternalAdReplyInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[205] + mi := &file_binary_proto_def_proto_msgTypes[211] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -21527,7 +21851,7 @@ func (x *ContextInfo_ExternalAdReplyInfo) String() string { func (*ContextInfo_ExternalAdReplyInfo) ProtoMessage() {} func (x *ContextInfo_ExternalAdReplyInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[205] + mi := &file_binary_proto_def_proto_msgTypes[211] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -21655,7 +21979,7 @@ type ContextInfo_AdReplyInfo struct { func (x *ContextInfo_AdReplyInfo) Reset() { *x = ContextInfo_AdReplyInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[206] + mi := &file_binary_proto_def_proto_msgTypes[212] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -21668,7 +21992,7 @@ func (x *ContextInfo_AdReplyInfo) String() string { func (*ContextInfo_AdReplyInfo) ProtoMessage() {} func (x *ContextInfo_AdReplyInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[206] + mi := &file_binary_proto_def_proto_msgTypes[212] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -21712,6 +22036,93 @@ func (x *ContextInfo_AdReplyInfo) GetCaption() string { return "" } +type BotAvatarMetadata_PlaybackMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SdProgressiveUrl *string `protobuf:"bytes,1,opt,name=sdProgressiveUrl" json:"sdProgressiveUrl,omitempty"` + HdProgressiveUrl *string `protobuf:"bytes,2,opt,name=hdProgressiveUrl" json:"hdProgressiveUrl,omitempty"` + DashManifest *string `protobuf:"bytes,3,opt,name=dashManifest" json:"dashManifest,omitempty"` + Sentiment *uint32 `protobuf:"varint,4,opt,name=sentiment" json:"sentiment,omitempty"` + DurationMs *uint32 `protobuf:"varint,5,opt,name=durationMs" json:"durationMs,omitempty"` + VideoID *int64 `protobuf:"varint,6,opt,name=videoID" json:"videoID,omitempty"` +} + +func (x *BotAvatarMetadata_PlaybackMetadata) Reset() { + *x = BotAvatarMetadata_PlaybackMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_binary_proto_def_proto_msgTypes[213] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BotAvatarMetadata_PlaybackMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BotAvatarMetadata_PlaybackMetadata) ProtoMessage() {} + +func (x *BotAvatarMetadata_PlaybackMetadata) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[213] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BotAvatarMetadata_PlaybackMetadata.ProtoReflect.Descriptor instead. +func (*BotAvatarMetadata_PlaybackMetadata) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{50, 0} +} + +func (x *BotAvatarMetadata_PlaybackMetadata) GetSdProgressiveUrl() string { + if x != nil && x.SdProgressiveUrl != nil { + return *x.SdProgressiveUrl + } + return "" +} + +func (x *BotAvatarMetadata_PlaybackMetadata) GetHdProgressiveUrl() string { + if x != nil && x.HdProgressiveUrl != nil { + return *x.HdProgressiveUrl + } + return "" +} + +func (x *BotAvatarMetadata_PlaybackMetadata) GetDashManifest() string { + if x != nil && x.DashManifest != nil { + return *x.DashManifest + } + return "" +} + +func (x *BotAvatarMetadata_PlaybackMetadata) GetSentiment() uint32 { + if x != nil && x.Sentiment != nil { + return *x.Sentiment + } + return 0 +} + +func (x *BotAvatarMetadata_PlaybackMetadata) GetDurationMs() uint32 { + if x != nil && x.DurationMs != nil { + return *x.DurationMs + } + return 0 +} + +func (x *BotAvatarMetadata_PlaybackMetadata) GetVideoID() int64 { + if x != nil && x.VideoID != nil { + return *x.VideoID + } + return 0 +} + type TemplateButton_URLButton struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -21724,7 +22135,7 @@ type TemplateButton_URLButton struct { func (x *TemplateButton_URLButton) Reset() { *x = TemplateButton_URLButton{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[207] + mi := &file_binary_proto_def_proto_msgTypes[214] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -21737,7 +22148,7 @@ func (x *TemplateButton_URLButton) String() string { func (*TemplateButton_URLButton) ProtoMessage() {} func (x *TemplateButton_URLButton) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[207] + mi := &file_binary_proto_def_proto_msgTypes[214] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -21750,7 +22161,7 @@ func (x *TemplateButton_URLButton) ProtoReflect() protoreflect.Message { // Deprecated: Use TemplateButton_URLButton.ProtoReflect.Descriptor instead. func (*TemplateButton_URLButton) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{50, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{52, 0} } func (x *TemplateButton_URLButton) GetDisplayText() *HighlyStructuredMessage { @@ -21779,7 +22190,7 @@ type TemplateButton_QuickReplyButton struct { func (x *TemplateButton_QuickReplyButton) Reset() { *x = TemplateButton_QuickReplyButton{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[208] + mi := &file_binary_proto_def_proto_msgTypes[215] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -21792,7 +22203,7 @@ func (x *TemplateButton_QuickReplyButton) String() string { func (*TemplateButton_QuickReplyButton) ProtoMessage() {} func (x *TemplateButton_QuickReplyButton) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[208] + mi := &file_binary_proto_def_proto_msgTypes[215] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -21805,7 +22216,7 @@ func (x *TemplateButton_QuickReplyButton) ProtoReflect() protoreflect.Message { // Deprecated: Use TemplateButton_QuickReplyButton.ProtoReflect.Descriptor instead. func (*TemplateButton_QuickReplyButton) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{50, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{52, 1} } func (x *TemplateButton_QuickReplyButton) GetDisplayText() *HighlyStructuredMessage { @@ -21834,7 +22245,7 @@ type TemplateButton_CallButton struct { func (x *TemplateButton_CallButton) Reset() { *x = TemplateButton_CallButton{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[209] + mi := &file_binary_proto_def_proto_msgTypes[216] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -21847,7 +22258,7 @@ func (x *TemplateButton_CallButton) String() string { func (*TemplateButton_CallButton) ProtoMessage() {} func (x *TemplateButton_CallButton) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[209] + mi := &file_binary_proto_def_proto_msgTypes[216] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -21860,7 +22271,7 @@ func (x *TemplateButton_CallButton) ProtoReflect() protoreflect.Message { // Deprecated: Use TemplateButton_CallButton.ProtoReflect.Descriptor instead. func (*TemplateButton_CallButton) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{50, 2} + return file_binary_proto_def_proto_rawDescGZIP(), []int{52, 2} } func (x *TemplateButton_CallButton) GetDisplayText() *HighlyStructuredMessage { @@ -21892,7 +22303,7 @@ type PaymentBackground_MediaData struct { func (x *PaymentBackground_MediaData) Reset() { *x = PaymentBackground_MediaData{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[210] + mi := &file_binary_proto_def_proto_msgTypes[217] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -21905,7 +22316,7 @@ func (x *PaymentBackground_MediaData) String() string { func (*PaymentBackground_MediaData) ProtoMessage() {} func (x *PaymentBackground_MediaData) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[210] + mi := &file_binary_proto_def_proto_msgTypes[217] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -21918,7 +22329,7 @@ func (x *PaymentBackground_MediaData) ProtoReflect() protoreflect.Message { // Deprecated: Use PaymentBackground_MediaData.ProtoReflect.Descriptor instead. func (*PaymentBackground_MediaData) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{52, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{54, 0} } func (x *PaymentBackground_MediaData) GetMediaKey() []byte { @@ -21978,7 +22389,7 @@ type TemplateMessage_HydratedFourRowTemplate struct { func (x *TemplateMessage_HydratedFourRowTemplate) Reset() { *x = TemplateMessage_HydratedFourRowTemplate{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[211] + mi := &file_binary_proto_def_proto_msgTypes[218] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -21991,7 +22402,7 @@ func (x *TemplateMessage_HydratedFourRowTemplate) String() string { func (*TemplateMessage_HydratedFourRowTemplate) ProtoMessage() {} func (x *TemplateMessage_HydratedFourRowTemplate) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[211] + mi := &file_binary_proto_def_proto_msgTypes[218] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -22004,7 +22415,7 @@ func (x *TemplateMessage_HydratedFourRowTemplate) ProtoReflect() protoreflect.Me // Deprecated: Use TemplateMessage_HydratedFourRowTemplate.ProtoReflect.Descriptor instead. func (*TemplateMessage_HydratedFourRowTemplate) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{57, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{60, 0} } func (x *TemplateMessage_HydratedFourRowTemplate) GetHydratedContentText() string { @@ -22137,7 +22548,7 @@ type TemplateMessage_FourRowTemplate struct { func (x *TemplateMessage_FourRowTemplate) Reset() { *x = TemplateMessage_FourRowTemplate{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[212] + mi := &file_binary_proto_def_proto_msgTypes[219] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -22150,7 +22561,7 @@ func (x *TemplateMessage_FourRowTemplate) String() string { func (*TemplateMessage_FourRowTemplate) ProtoMessage() {} func (x *TemplateMessage_FourRowTemplate) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[212] + mi := &file_binary_proto_def_proto_msgTypes[219] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -22163,7 +22574,7 @@ func (x *TemplateMessage_FourRowTemplate) ProtoReflect() protoreflect.Message { // Deprecated: Use TemplateMessage_FourRowTemplate.ProtoReflect.Descriptor instead. func (*TemplateMessage_FourRowTemplate) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{57, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{60, 1} } func (x *TemplateMessage_FourRowTemplate) GetContent() *HighlyStructuredMessage { @@ -22285,7 +22696,7 @@ type ProductMessage_ProductSnapshot struct { func (x *ProductMessage_ProductSnapshot) Reset() { *x = ProductMessage_ProductSnapshot{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[213] + mi := &file_binary_proto_def_proto_msgTypes[220] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -22298,7 +22709,7 @@ func (x *ProductMessage_ProductSnapshot) String() string { func (*ProductMessage_ProductSnapshot) ProtoMessage() {} func (x *ProductMessage_ProductSnapshot) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[213] + mi := &file_binary_proto_def_proto_msgTypes[220] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -22311,7 +22722,7 @@ func (x *ProductMessage_ProductSnapshot) ProtoReflect() protoreflect.Message { // Deprecated: Use ProductMessage_ProductSnapshot.ProtoReflect.Descriptor instead. func (*ProductMessage_ProductSnapshot) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{69, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{72, 0} } func (x *ProductMessage_ProductSnapshot) GetProductImage() *ImageMessage { @@ -22404,7 +22815,7 @@ type ProductMessage_CatalogSnapshot struct { func (x *ProductMessage_CatalogSnapshot) Reset() { *x = ProductMessage_CatalogSnapshot{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[214] + mi := &file_binary_proto_def_proto_msgTypes[221] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -22417,7 +22828,7 @@ func (x *ProductMessage_CatalogSnapshot) String() string { func (*ProductMessage_CatalogSnapshot) ProtoMessage() {} func (x *ProductMessage_CatalogSnapshot) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[214] + mi := &file_binary_proto_def_proto_msgTypes[221] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -22430,7 +22841,7 @@ func (x *ProductMessage_CatalogSnapshot) ProtoReflect() protoreflect.Message { // Deprecated: Use ProductMessage_CatalogSnapshot.ProtoReflect.Descriptor instead. func (*ProductMessage_CatalogSnapshot) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{69, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{72, 1} } func (x *ProductMessage_CatalogSnapshot) GetCatalogImage() *ImageMessage { @@ -22465,7 +22876,7 @@ type PollCreationMessage_Option struct { func (x *PollCreationMessage_Option) Reset() { *x = PollCreationMessage_Option{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[215] + mi := &file_binary_proto_def_proto_msgTypes[222] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -22478,7 +22889,7 @@ func (x *PollCreationMessage_Option) String() string { func (*PollCreationMessage_Option) ProtoMessage() {} func (x *PollCreationMessage_Option) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[215] + mi := &file_binary_proto_def_proto_msgTypes[222] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -22491,7 +22902,7 @@ func (x *PollCreationMessage_Option) ProtoReflect() protoreflect.Message { // Deprecated: Use PollCreationMessage_Option.ProtoReflect.Descriptor instead. func (*PollCreationMessage_Option) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{74, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{77, 0} } func (x *PollCreationMessage_Option) GetOptionName() string { @@ -22515,7 +22926,7 @@ type PeerDataOperationRequestResponseMessage_PeerDataOperationResult struct { func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult) Reset() { *x = PeerDataOperationRequestResponseMessage_PeerDataOperationResult{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[216] + mi := &file_binary_proto_def_proto_msgTypes[223] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -22528,7 +22939,7 @@ func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult) String func (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult) ProtoMessage() {} func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[216] + mi := &file_binary_proto_def_proto_msgTypes[223] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -22541,7 +22952,7 @@ func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult) ProtoR // Deprecated: Use PeerDataOperationRequestResponseMessage_PeerDataOperationResult.ProtoReflect.Descriptor instead. func (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{76, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{79, 0} } func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult) GetMediaUploadResult() MediaRetryNotification_ResultType { @@ -22583,7 +22994,7 @@ type PeerDataOperationRequestResponseMessage_PeerDataOperationResult_Placeholder func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult_PlaceholderMessageResendResponse) Reset() { *x = PeerDataOperationRequestResponseMessage_PeerDataOperationResult_PlaceholderMessageResendResponse{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[217] + mi := &file_binary_proto_def_proto_msgTypes[224] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -22597,7 +23008,7 @@ func (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_Placehold } func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult_PlaceholderMessageResendResponse) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[217] + mi := &file_binary_proto_def_proto_msgTypes[224] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -22610,7 +23021,7 @@ func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult_Placeho // Deprecated: Use PeerDataOperationRequestResponseMessage_PeerDataOperationResult_PlaceholderMessageResendResponse.ProtoReflect.Descriptor instead. func (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_PlaceholderMessageResendResponse) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{76, 0, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{79, 0, 0} } func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult_PlaceholderMessageResendResponse) GetWebMessageInfoBytes() []byte { @@ -22638,7 +23049,7 @@ type PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreview func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse) Reset() { *x = PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[218] + mi := &file_binary_proto_def_proto_msgTypes[225] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -22652,7 +23063,7 @@ func (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPrevi } func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[218] + mi := &file_binary_proto_def_proto_msgTypes[225] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -22665,7 +23076,7 @@ func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPre // Deprecated: Use PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse.ProtoReflect.Descriptor instead. func (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{76, 0, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{79, 0, 1} } func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse) GetUrl() string { @@ -22741,7 +23152,7 @@ type PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreview func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse_LinkPreviewHighQualityThumbnail) Reset() { *x = PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse_LinkPreviewHighQualityThumbnail{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[219] + mi := &file_binary_proto_def_proto_msgTypes[226] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -22755,7 +23166,7 @@ func (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPrevi } func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse_LinkPreviewHighQualityThumbnail) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[219] + mi := &file_binary_proto_def_proto_msgTypes[226] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -22768,7 +23179,7 @@ func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPre // Deprecated: Use PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse_LinkPreviewHighQualityThumbnail.ProtoReflect.Descriptor instead. func (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse_LinkPreviewHighQualityThumbnail) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{76, 0, 1, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{79, 0, 1, 0} } func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse_LinkPreviewHighQualityThumbnail) GetDirectPath() string { @@ -22832,7 +23243,7 @@ type PeerDataOperationRequestMessage_RequestUrlPreview struct { func (x *PeerDataOperationRequestMessage_RequestUrlPreview) Reset() { *x = PeerDataOperationRequestMessage_RequestUrlPreview{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[220] + mi := &file_binary_proto_def_proto_msgTypes[227] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -22845,7 +23256,7 @@ func (x *PeerDataOperationRequestMessage_RequestUrlPreview) String() string { func (*PeerDataOperationRequestMessage_RequestUrlPreview) ProtoMessage() {} func (x *PeerDataOperationRequestMessage_RequestUrlPreview) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[220] + mi := &file_binary_proto_def_proto_msgTypes[227] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -22858,7 +23269,7 @@ func (x *PeerDataOperationRequestMessage_RequestUrlPreview) ProtoReflect() proto // Deprecated: Use PeerDataOperationRequestMessage_RequestUrlPreview.ProtoReflect.Descriptor instead. func (*PeerDataOperationRequestMessage_RequestUrlPreview) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{77, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{80, 0} } func (x *PeerDataOperationRequestMessage_RequestUrlPreview) GetUrl() string { @@ -22886,7 +23297,7 @@ type PeerDataOperationRequestMessage_RequestStickerReupload struct { func (x *PeerDataOperationRequestMessage_RequestStickerReupload) Reset() { *x = PeerDataOperationRequestMessage_RequestStickerReupload{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[221] + mi := &file_binary_proto_def_proto_msgTypes[228] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -22899,7 +23310,7 @@ func (x *PeerDataOperationRequestMessage_RequestStickerReupload) String() string func (*PeerDataOperationRequestMessage_RequestStickerReupload) ProtoMessage() {} func (x *PeerDataOperationRequestMessage_RequestStickerReupload) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[221] + mi := &file_binary_proto_def_proto_msgTypes[228] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -22912,7 +23323,7 @@ func (x *PeerDataOperationRequestMessage_RequestStickerReupload) ProtoReflect() // Deprecated: Use PeerDataOperationRequestMessage_RequestStickerReupload.ProtoReflect.Descriptor instead. func (*PeerDataOperationRequestMessage_RequestStickerReupload) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{77, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{80, 1} } func (x *PeerDataOperationRequestMessage_RequestStickerReupload) GetFileSha256() string { @@ -22933,7 +23344,7 @@ type PeerDataOperationRequestMessage_PlaceholderMessageResendRequest struct { func (x *PeerDataOperationRequestMessage_PlaceholderMessageResendRequest) Reset() { *x = PeerDataOperationRequestMessage_PlaceholderMessageResendRequest{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[222] + mi := &file_binary_proto_def_proto_msgTypes[229] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -22946,7 +23357,7 @@ func (x *PeerDataOperationRequestMessage_PlaceholderMessageResendRequest) String func (*PeerDataOperationRequestMessage_PlaceholderMessageResendRequest) ProtoMessage() {} func (x *PeerDataOperationRequestMessage_PlaceholderMessageResendRequest) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[222] + mi := &file_binary_proto_def_proto_msgTypes[229] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -22959,7 +23370,7 @@ func (x *PeerDataOperationRequestMessage_PlaceholderMessageResendRequest) ProtoR // Deprecated: Use PeerDataOperationRequestMessage_PlaceholderMessageResendRequest.ProtoReflect.Descriptor instead. func (*PeerDataOperationRequestMessage_PlaceholderMessageResendRequest) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{77, 2} + return file_binary_proto_def_proto_rawDescGZIP(), []int{80, 2} } func (x *PeerDataOperationRequestMessage_PlaceholderMessageResendRequest) GetMessageKey() *MessageKey { @@ -22984,7 +23395,7 @@ type PeerDataOperationRequestMessage_HistorySyncOnDemandRequest struct { func (x *PeerDataOperationRequestMessage_HistorySyncOnDemandRequest) Reset() { *x = PeerDataOperationRequestMessage_HistorySyncOnDemandRequest{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[223] + mi := &file_binary_proto_def_proto_msgTypes[230] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -22997,7 +23408,7 @@ func (x *PeerDataOperationRequestMessage_HistorySyncOnDemandRequest) String() st func (*PeerDataOperationRequestMessage_HistorySyncOnDemandRequest) ProtoMessage() {} func (x *PeerDataOperationRequestMessage_HistorySyncOnDemandRequest) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[223] + mi := &file_binary_proto_def_proto_msgTypes[230] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -23010,7 +23421,7 @@ func (x *PeerDataOperationRequestMessage_HistorySyncOnDemandRequest) ProtoReflec // Deprecated: Use PeerDataOperationRequestMessage_HistorySyncOnDemandRequest.ProtoReflect.Descriptor instead. func (*PeerDataOperationRequestMessage_HistorySyncOnDemandRequest) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{77, 3} + return file_binary_proto_def_proto_rawDescGZIP(), []int{80, 3} } func (x *PeerDataOperationRequestMessage_HistorySyncOnDemandRequest) GetChatJid() string { @@ -23048,53 +23459,6 @@ func (x *PeerDataOperationRequestMessage_HistorySyncOnDemandRequest) GetOldestMs return 0 } -type MsgOpaqueData_PollOption struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` -} - -func (x *MsgOpaqueData_PollOption) Reset() { - *x = MsgOpaqueData_PollOption{} - if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[224] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgOpaqueData_PollOption) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgOpaqueData_PollOption) ProtoMessage() {} - -func (x *MsgOpaqueData_PollOption) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[224] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MsgOpaqueData_PollOption.ProtoReflect.Descriptor instead. -func (*MsgOpaqueData_PollOption) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{93, 0} -} - -func (x *MsgOpaqueData_PollOption) GetName() string { - if x != nil && x.Name != nil { - return *x.Name - } - return "" -} - type VerifiedNameCertificate_Details struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -23110,7 +23474,7 @@ type VerifiedNameCertificate_Details struct { func (x *VerifiedNameCertificate_Details) Reset() { *x = VerifiedNameCertificate_Details{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[225] + mi := &file_binary_proto_def_proto_msgTypes[231] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -23123,7 +23487,7 @@ func (x *VerifiedNameCertificate_Details) String() string { func (*VerifiedNameCertificate_Details) ProtoMessage() {} func (x *VerifiedNameCertificate_Details) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[225] + mi := &file_binary_proto_def_proto_msgTypes[231] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -23136,7 +23500,7 @@ func (x *VerifiedNameCertificate_Details) ProtoReflect() protoreflect.Message { // Deprecated: Use VerifiedNameCertificate_Details.ProtoReflect.Descriptor instead. func (*VerifiedNameCertificate_Details) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{148, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{150, 0} } func (x *VerifiedNameCertificate_Details) GetSerial() uint64 { @@ -23188,7 +23552,7 @@ type ClientPayload_WebInfo struct { func (x *ClientPayload_WebInfo) Reset() { *x = ClientPayload_WebInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[226] + mi := &file_binary_proto_def_proto_msgTypes[232] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -23201,7 +23565,7 @@ func (x *ClientPayload_WebInfo) String() string { func (*ClientPayload_WebInfo) ProtoMessage() {} func (x *ClientPayload_WebInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[226] + mi := &file_binary_proto_def_proto_msgTypes[232] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -23214,7 +23578,7 @@ func (x *ClientPayload_WebInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientPayload_WebInfo.ProtoReflect.Descriptor instead. func (*ClientPayload_WebInfo) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{157, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{159, 0} } func (x *ClientPayload_WebInfo) GetRefToken() string { @@ -23264,12 +23628,13 @@ type ClientPayload_UserAgent struct { LocaleCountryIso31661Alpha2 *string `protobuf:"bytes,12,opt,name=localeCountryIso31661Alpha2" json:"localeCountryIso31661Alpha2,omitempty"` DeviceBoard *string `protobuf:"bytes,13,opt,name=deviceBoard" json:"deviceBoard,omitempty"` DeviceExpId *string `protobuf:"bytes,14,opt,name=deviceExpId" json:"deviceExpId,omitempty"` + DeviceType *ClientPayload_UserAgent_DeviceType `protobuf:"varint,15,opt,name=deviceType,enum=proto.ClientPayload_UserAgent_DeviceType" json:"deviceType,omitempty"` } func (x *ClientPayload_UserAgent) Reset() { *x = ClientPayload_UserAgent{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[227] + mi := &file_binary_proto_def_proto_msgTypes[233] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -23282,7 +23647,7 @@ func (x *ClientPayload_UserAgent) String() string { func (*ClientPayload_UserAgent) ProtoMessage() {} func (x *ClientPayload_UserAgent) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[227] + mi := &file_binary_proto_def_proto_msgTypes[233] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -23295,7 +23660,7 @@ func (x *ClientPayload_UserAgent) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientPayload_UserAgent.ProtoReflect.Descriptor instead. func (*ClientPayload_UserAgent) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{157, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{159, 1} } func (x *ClientPayload_UserAgent) GetPlatform() ClientPayload_UserAgent_Platform { @@ -23396,6 +23761,13 @@ func (x *ClientPayload_UserAgent) GetDeviceExpId() string { return "" } +func (x *ClientPayload_UserAgent) GetDeviceType() ClientPayload_UserAgent_DeviceType { + if x != nil && x.DeviceType != nil { + return *x.DeviceType + } + return ClientPayload_UserAgent_PHONE +} + type ClientPayload_InteropData struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -23409,7 +23781,7 @@ type ClientPayload_InteropData struct { func (x *ClientPayload_InteropData) Reset() { *x = ClientPayload_InteropData{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[228] + mi := &file_binary_proto_def_proto_msgTypes[234] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -23422,7 +23794,7 @@ func (x *ClientPayload_InteropData) String() string { func (*ClientPayload_InteropData) ProtoMessage() {} func (x *ClientPayload_InteropData) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[228] + mi := &file_binary_proto_def_proto_msgTypes[234] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -23435,7 +23807,7 @@ func (x *ClientPayload_InteropData) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientPayload_InteropData.ProtoReflect.Descriptor instead. func (*ClientPayload_InteropData) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{157, 2} + return file_binary_proto_def_proto_rawDescGZIP(), []int{159, 2} } func (x *ClientPayload_InteropData) GetAccountId() uint64 { @@ -23477,7 +23849,7 @@ type ClientPayload_DevicePairingRegistrationData struct { func (x *ClientPayload_DevicePairingRegistrationData) Reset() { *x = ClientPayload_DevicePairingRegistrationData{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[229] + mi := &file_binary_proto_def_proto_msgTypes[235] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -23490,7 +23862,7 @@ func (x *ClientPayload_DevicePairingRegistrationData) String() string { func (*ClientPayload_DevicePairingRegistrationData) ProtoMessage() {} func (x *ClientPayload_DevicePairingRegistrationData) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[229] + mi := &file_binary_proto_def_proto_msgTypes[235] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -23503,7 +23875,7 @@ func (x *ClientPayload_DevicePairingRegistrationData) ProtoReflect() protoreflec // Deprecated: Use ClientPayload_DevicePairingRegistrationData.ProtoReflect.Descriptor instead. func (*ClientPayload_DevicePairingRegistrationData) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{157, 3} + return file_binary_proto_def_proto_rawDescGZIP(), []int{159, 3} } func (x *ClientPayload_DevicePairingRegistrationData) GetERegid() []byte { @@ -23574,7 +23946,7 @@ type ClientPayload_DNSSource struct { func (x *ClientPayload_DNSSource) Reset() { *x = ClientPayload_DNSSource{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[230] + mi := &file_binary_proto_def_proto_msgTypes[236] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -23587,7 +23959,7 @@ func (x *ClientPayload_DNSSource) String() string { func (*ClientPayload_DNSSource) ProtoMessage() {} func (x *ClientPayload_DNSSource) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[230] + mi := &file_binary_proto_def_proto_msgTypes[236] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -23600,7 +23972,7 @@ func (x *ClientPayload_DNSSource) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientPayload_DNSSource.ProtoReflect.Descriptor instead. func (*ClientPayload_DNSSource) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{157, 4} + return file_binary_proto_def_proto_rawDescGZIP(), []int{159, 4} } func (x *ClientPayload_DNSSource) GetDnsMethod() ClientPayload_DNSSource_DNSResolutionMethod { @@ -23638,7 +24010,7 @@ type ClientPayload_WebInfo_WebdPayload struct { func (x *ClientPayload_WebInfo_WebdPayload) Reset() { *x = ClientPayload_WebInfo_WebdPayload{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[231] + mi := &file_binary_proto_def_proto_msgTypes[237] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -23651,7 +24023,7 @@ func (x *ClientPayload_WebInfo_WebdPayload) String() string { func (*ClientPayload_WebInfo_WebdPayload) ProtoMessage() {} func (x *ClientPayload_WebInfo_WebdPayload) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[231] + mi := &file_binary_proto_def_proto_msgTypes[237] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -23664,7 +24036,7 @@ func (x *ClientPayload_WebInfo_WebdPayload) ProtoReflect() protoreflect.Message // Deprecated: Use ClientPayload_WebInfo_WebdPayload.ProtoReflect.Descriptor instead. func (*ClientPayload_WebInfo_WebdPayload) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{157, 0, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{159, 0, 0} } func (x *ClientPayload_WebInfo_WebdPayload) GetUsesParticipantInKey() bool { @@ -23759,7 +24131,7 @@ type ClientPayload_UserAgent_AppVersion struct { func (x *ClientPayload_UserAgent_AppVersion) Reset() { *x = ClientPayload_UserAgent_AppVersion{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[232] + mi := &file_binary_proto_def_proto_msgTypes[238] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -23772,7 +24144,7 @@ func (x *ClientPayload_UserAgent_AppVersion) String() string { func (*ClientPayload_UserAgent_AppVersion) ProtoMessage() {} func (x *ClientPayload_UserAgent_AppVersion) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[232] + mi := &file_binary_proto_def_proto_msgTypes[238] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -23785,7 +24157,7 @@ func (x *ClientPayload_UserAgent_AppVersion) ProtoReflect() protoreflect.Message // Deprecated: Use ClientPayload_UserAgent_AppVersion.ProtoReflect.Descriptor instead. func (*ClientPayload_UserAgent_AppVersion) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{157, 1, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{159, 1, 0} } func (x *ClientPayload_UserAgent_AppVersion) GetPrimary() uint32 { @@ -23838,7 +24210,7 @@ type NoiseCertificate_Details struct { func (x *NoiseCertificate_Details) Reset() { *x = NoiseCertificate_Details{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[233] + mi := &file_binary_proto_def_proto_msgTypes[239] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -23851,7 +24223,7 @@ func (x *NoiseCertificate_Details) String() string { func (*NoiseCertificate_Details) ProtoMessage() {} func (x *NoiseCertificate_Details) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[233] + mi := &file_binary_proto_def_proto_msgTypes[239] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -23864,7 +24236,7 @@ func (x *NoiseCertificate_Details) ProtoReflect() protoreflect.Message { // Deprecated: Use NoiseCertificate_Details.ProtoReflect.Descriptor instead. func (*NoiseCertificate_Details) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{173, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{178, 0} } func (x *NoiseCertificate_Details) GetSerial() uint32 { @@ -23914,7 +24286,7 @@ type CertChain_NoiseCertificate struct { func (x *CertChain_NoiseCertificate) Reset() { *x = CertChain_NoiseCertificate{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[234] + mi := &file_binary_proto_def_proto_msgTypes[240] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -23927,7 +24299,7 @@ func (x *CertChain_NoiseCertificate) String() string { func (*CertChain_NoiseCertificate) ProtoMessage() {} func (x *CertChain_NoiseCertificate) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[234] + mi := &file_binary_proto_def_proto_msgTypes[240] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -23940,7 +24312,7 @@ func (x *CertChain_NoiseCertificate) ProtoReflect() protoreflect.Message { // Deprecated: Use CertChain_NoiseCertificate.ProtoReflect.Descriptor instead. func (*CertChain_NoiseCertificate) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{174, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{179, 0} } func (x *CertChain_NoiseCertificate) GetDetails() []byte { @@ -23972,7 +24344,7 @@ type CertChain_NoiseCertificate_Details struct { func (x *CertChain_NoiseCertificate_Details) Reset() { *x = CertChain_NoiseCertificate_Details{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[235] + mi := &file_binary_proto_def_proto_msgTypes[241] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -23985,7 +24357,7 @@ func (x *CertChain_NoiseCertificate_Details) String() string { func (*CertChain_NoiseCertificate_Details) ProtoMessage() {} func (x *CertChain_NoiseCertificate_Details) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[235] + mi := &file_binary_proto_def_proto_msgTypes[241] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -23998,7 +24370,7 @@ func (x *CertChain_NoiseCertificate_Details) ProtoReflect() protoreflect.Message // Deprecated: Use CertChain_NoiseCertificate_Details.ProtoReflect.Descriptor instead. func (*CertChain_NoiseCertificate_Details) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{174, 0, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{179, 0, 0} } func (x *CertChain_NoiseCertificate_Details) GetSerial() uint32 { @@ -24053,32 +24425,32 @@ func file_binary_proto_def_proto_rawDescGZIP() []byte { return file_binary_proto_def_proto_rawDescData } -var file_binary_proto_def_proto_enumTypes = make([]protoimpl.EnumInfo, 60) -var file_binary_proto_def_proto_msgTypes = make([]protoimpl.MessageInfo, 236) +var file_binary_proto_def_proto_enumTypes = make([]protoimpl.EnumInfo, 62) +var file_binary_proto_def_proto_msgTypes = make([]protoimpl.MessageInfo, 242) var file_binary_proto_def_proto_goTypes = []interface{}{ (ADVEncryptionType)(0), // 0: proto.ADVEncryptionType (KeepType)(0), // 1: proto.KeepType (PeerDataOperationRequestType)(0), // 2: proto.PeerDataOperationRequestType (MediaVisibility)(0), // 3: proto.MediaVisibility (DeviceProps_PlatformType)(0), // 4: proto.DeviceProps.PlatformType - (PaymentInviteMessage_ServiceType)(0), // 5: proto.PaymentInviteMessage.ServiceType - (OrderMessage_OrderSurface)(0), // 6: proto.OrderMessage.OrderSurface - (OrderMessage_OrderStatus)(0), // 7: proto.OrderMessage.OrderStatus - (ListResponseMessage_ListType)(0), // 8: proto.ListResponseMessage.ListType - (ListMessage_ListType)(0), // 9: proto.ListMessage.ListType - (InvoiceMessage_AttachmentType)(0), // 10: proto.InvoiceMessage.AttachmentType - (InteractiveResponseMessage_Body_Format)(0), // 11: proto.InteractiveResponseMessage.Body.Format - (InteractiveMessage_ShopMessage_Surface)(0), // 12: proto.InteractiveMessage.ShopMessage.Surface - (HistorySyncNotification_HistorySyncType)(0), // 13: proto.HistorySyncNotification.HistorySyncType - (HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent_DayOfWeekType)(0), // 14: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.DayOfWeekType - (HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent_CalendarType)(0), // 15: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.CalendarType - (GroupInviteMessage_GroupType)(0), // 16: proto.GroupInviteMessage.GroupType - (ExtendedTextMessage_PreviewType)(0), // 17: proto.ExtendedTextMessage.PreviewType - (ExtendedTextMessage_InviteLinkGroupType)(0), // 18: proto.ExtendedTextMessage.InviteLinkGroupType - (ExtendedTextMessage_FontType)(0), // 19: proto.ExtendedTextMessage.FontType - (ButtonsResponseMessage_Type)(0), // 20: proto.ButtonsResponseMessage.Type - (ButtonsMessage_HeaderType)(0), // 21: proto.ButtonsMessage.HeaderType - (ButtonsMessage_Button_Type)(0), // 22: proto.ButtonsMessage.Button.Type + (OrderMessage_OrderSurface)(0), // 5: proto.OrderMessage.OrderSurface + (OrderMessage_OrderStatus)(0), // 6: proto.OrderMessage.OrderStatus + (ListResponseMessage_ListType)(0), // 7: proto.ListResponseMessage.ListType + (ListMessage_ListType)(0), // 8: proto.ListMessage.ListType + (InvoiceMessage_AttachmentType)(0), // 9: proto.InvoiceMessage.AttachmentType + (InteractiveResponseMessage_Body_Format)(0), // 10: proto.InteractiveResponseMessage.Body.Format + (InteractiveMessage_ShopMessage_Surface)(0), // 11: proto.InteractiveMessage.ShopMessage.Surface + (HistorySyncNotification_HistorySyncType)(0), // 12: proto.HistorySyncNotification.HistorySyncType + (HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent_DayOfWeekType)(0), // 13: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.DayOfWeekType + (HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent_CalendarType)(0), // 14: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.CalendarType + (GroupInviteMessage_GroupType)(0), // 15: proto.GroupInviteMessage.GroupType + (ExtendedTextMessage_PreviewType)(0), // 16: proto.ExtendedTextMessage.PreviewType + (ExtendedTextMessage_InviteLinkGroupType)(0), // 17: proto.ExtendedTextMessage.InviteLinkGroupType + (ExtendedTextMessage_FontType)(0), // 18: proto.ExtendedTextMessage.FontType + (ButtonsResponseMessage_Type)(0), // 19: proto.ButtonsResponseMessage.Type + (ButtonsMessage_HeaderType)(0), // 20: proto.ButtonsMessage.HeaderType + (ButtonsMessage_Button_Type)(0), // 21: proto.ButtonsMessage.Button.Type + (BotFeedbackMessage_BotFeedbackKind)(0), // 22: proto.BotFeedbackMessage.BotFeedbackKind (DisappearingMode_Initiator)(0), // 23: proto.DisappearingMode.Initiator (ContextInfo_ExternalAdReplyInfo_MediaType)(0), // 24: proto.ContextInfo.ExternalAdReplyInfo.MediaType (ContextInfo_AdReplyInfo_MediaType)(0), // 25: proto.ContextInfo.AdReplyInfo.MediaType @@ -24088,714 +24460,733 @@ var file_binary_proto_def_proto_goTypes = []interface{}{ (ScheduledCallCreationMessage_CallType)(0), // 29: proto.ScheduledCallCreationMessage.CallType (ProtocolMessage_Type)(0), // 30: proto.ProtocolMessage.Type (PinInChatMessage_Type)(0), // 31: proto.PinInChatMessage.Type - (PastParticipant_LeaveReason)(0), // 32: proto.PastParticipant.LeaveReason - (HistorySync_HistorySyncType)(0), // 33: proto.HistorySync.HistorySyncType - (GroupParticipant_Rank)(0), // 34: proto.GroupParticipant.Rank - (Conversation_EndOfHistoryTransferType)(0), // 35: proto.Conversation.EndOfHistoryTransferType - (MediaRetryNotification_ResultType)(0), // 36: proto.MediaRetryNotification.ResultType - (SyncdMutation_SyncdOperation)(0), // 37: proto.SyncdMutation.SyncdOperation - (MarketingMessageAction_MarketingMessagePrototypeType)(0), // 38: proto.MarketingMessageAction.MarketingMessagePrototypeType - (BizIdentityInfo_VerifiedLevelValue)(0), // 39: proto.BizIdentityInfo.VerifiedLevelValue - (BizIdentityInfo_HostStorageType)(0), // 40: proto.BizIdentityInfo.HostStorageType - (BizIdentityInfo_ActualActorsType)(0), // 41: proto.BizIdentityInfo.ActualActorsType - (BizAccountLinkInfo_HostStorageType)(0), // 42: proto.BizAccountLinkInfo.HostStorageType - (BizAccountLinkInfo_AccountType)(0), // 43: proto.BizAccountLinkInfo.AccountType - (ClientPayload_Product)(0), // 44: proto.ClientPayload.Product - (ClientPayload_IOSAppExtension)(0), // 45: proto.ClientPayload.IOSAppExtension - (ClientPayload_ConnectType)(0), // 46: proto.ClientPayload.ConnectType - (ClientPayload_ConnectReason)(0), // 47: proto.ClientPayload.ConnectReason - (ClientPayload_WebInfo_WebSubPlatform)(0), // 48: proto.ClientPayload.WebInfo.WebSubPlatform - (ClientPayload_UserAgent_ReleaseChannel)(0), // 49: proto.ClientPayload.UserAgent.ReleaseChannel - (ClientPayload_UserAgent_Platform)(0), // 50: proto.ClientPayload.UserAgent.Platform - (ClientPayload_DNSSource_DNSResolutionMethod)(0), // 51: proto.ClientPayload.DNSSource.DNSResolutionMethod - (WebMessageInfo_StubType)(0), // 52: proto.WebMessageInfo.StubType - (WebMessageInfo_Status)(0), // 53: proto.WebMessageInfo.Status - (WebMessageInfo_BizPrivacyStatus)(0), // 54: proto.WebMessageInfo.BizPrivacyStatus - (WebFeatures_Flag)(0), // 55: proto.WebFeatures.Flag - (PinInChat_Type)(0), // 56: proto.PinInChat.Type - (PaymentInfo_TxnStatus)(0), // 57: proto.PaymentInfo.TxnStatus - (PaymentInfo_Status)(0), // 58: proto.PaymentInfo.Status - (PaymentInfo_Currency)(0), // 59: proto.PaymentInfo.Currency - (*ADVSignedKeyIndexList)(nil), // 60: proto.ADVSignedKeyIndexList - (*ADVSignedDeviceIdentity)(nil), // 61: proto.ADVSignedDeviceIdentity - (*ADVSignedDeviceIdentityHMAC)(nil), // 62: proto.ADVSignedDeviceIdentityHMAC - (*ADVKeyIndexList)(nil), // 63: proto.ADVKeyIndexList - (*ADVDeviceIdentity)(nil), // 64: proto.ADVDeviceIdentity - (*DeviceProps)(nil), // 65: proto.DeviceProps - (*PaymentInviteMessage)(nil), // 66: proto.PaymentInviteMessage - (*OrderMessage)(nil), // 67: proto.OrderMessage - (*LocationMessage)(nil), // 68: proto.LocationMessage - (*LiveLocationMessage)(nil), // 69: proto.LiveLocationMessage - (*ListResponseMessage)(nil), // 70: proto.ListResponseMessage - (*ListMessage)(nil), // 71: proto.ListMessage - (*KeepInChatMessage)(nil), // 72: proto.KeepInChatMessage - (*InvoiceMessage)(nil), // 73: proto.InvoiceMessage - (*InteractiveResponseMessage)(nil), // 74: proto.InteractiveResponseMessage - (*InteractiveMessage)(nil), // 75: proto.InteractiveMessage - (*InitialSecurityNotificationSettingSync)(nil), // 76: proto.InitialSecurityNotificationSettingSync - (*ImageMessage)(nil), // 77: proto.ImageMessage - (*HistorySyncNotification)(nil), // 78: proto.HistorySyncNotification - (*HighlyStructuredMessage)(nil), // 79: proto.HighlyStructuredMessage - (*GroupInviteMessage)(nil), // 80: proto.GroupInviteMessage - (*FutureProofMessage)(nil), // 81: proto.FutureProofMessage - (*ExtendedTextMessage)(nil), // 82: proto.ExtendedTextMessage - (*EncReactionMessage)(nil), // 83: proto.EncReactionMessage - (*DocumentMessage)(nil), // 84: proto.DocumentMessage - (*DeviceSentMessage)(nil), // 85: proto.DeviceSentMessage - (*DeclinePaymentRequestMessage)(nil), // 86: proto.DeclinePaymentRequestMessage - (*ContactsArrayMessage)(nil), // 87: proto.ContactsArrayMessage - (*ContactMessage)(nil), // 88: proto.ContactMessage - (*Chat)(nil), // 89: proto.Chat - (*CancelPaymentRequestMessage)(nil), // 90: proto.CancelPaymentRequestMessage - (*Call)(nil), // 91: proto.Call - (*ButtonsResponseMessage)(nil), // 92: proto.ButtonsResponseMessage - (*ButtonsMessage)(nil), // 93: proto.ButtonsMessage - (*AudioMessage)(nil), // 94: proto.AudioMessage - (*AppStateSyncKey)(nil), // 95: proto.AppStateSyncKey - (*AppStateSyncKeyShare)(nil), // 96: proto.AppStateSyncKeyShare - (*AppStateSyncKeyRequest)(nil), // 97: proto.AppStateSyncKeyRequest - (*AppStateSyncKeyId)(nil), // 98: proto.AppStateSyncKeyId - (*AppStateSyncKeyFingerprint)(nil), // 99: proto.AppStateSyncKeyFingerprint - (*AppStateSyncKeyData)(nil), // 100: proto.AppStateSyncKeyData - (*AppStateFatalExceptionNotification)(nil), // 101: proto.AppStateFatalExceptionNotification - (*Location)(nil), // 102: proto.Location - (*InteractiveAnnotation)(nil), // 103: proto.InteractiveAnnotation - (*HydratedTemplateButton)(nil), // 104: proto.HydratedTemplateButton - (*GroupMention)(nil), // 105: proto.GroupMention - (*DisappearingMode)(nil), // 106: proto.DisappearingMode - (*DeviceListMetadata)(nil), // 107: proto.DeviceListMetadata - (*ContextInfo)(nil), // 108: proto.ContextInfo - (*ActionLink)(nil), // 109: proto.ActionLink - (*TemplateButton)(nil), // 110: proto.TemplateButton - (*Point)(nil), // 111: proto.Point - (*PaymentBackground)(nil), // 112: proto.PaymentBackground - (*Money)(nil), // 113: proto.Money - (*Message)(nil), // 114: proto.Message - (*MessageContextInfo)(nil), // 115: proto.MessageContextInfo - (*VideoMessage)(nil), // 116: proto.VideoMessage - (*TemplateMessage)(nil), // 117: proto.TemplateMessage - (*TemplateButtonReplyMessage)(nil), // 118: proto.TemplateButtonReplyMessage - (*StickerSyncRMRMessage)(nil), // 119: proto.StickerSyncRMRMessage - (*StickerMessage)(nil), // 120: proto.StickerMessage - (*SenderKeyDistributionMessage)(nil), // 121: proto.SenderKeyDistributionMessage - (*SendPaymentMessage)(nil), // 122: proto.SendPaymentMessage - (*ScheduledCallEditMessage)(nil), // 123: proto.ScheduledCallEditMessage - (*ScheduledCallCreationMessage)(nil), // 124: proto.ScheduledCallCreationMessage - (*RequestPhoneNumberMessage)(nil), // 125: proto.RequestPhoneNumberMessage - (*RequestPaymentMessage)(nil), // 126: proto.RequestPaymentMessage - (*ReactionMessage)(nil), // 127: proto.ReactionMessage - (*ProtocolMessage)(nil), // 128: proto.ProtocolMessage - (*ProductMessage)(nil), // 129: proto.ProductMessage - (*PollVoteMessage)(nil), // 130: proto.PollVoteMessage - (*PollUpdateMessage)(nil), // 131: proto.PollUpdateMessage - (*PollUpdateMessageMetadata)(nil), // 132: proto.PollUpdateMessageMetadata - (*PollEncValue)(nil), // 133: proto.PollEncValue - (*PollCreationMessage)(nil), // 134: proto.PollCreationMessage - (*PinInChatMessage)(nil), // 135: proto.PinInChatMessage - (*PeerDataOperationRequestResponseMessage)(nil), // 136: proto.PeerDataOperationRequestResponseMessage - (*PeerDataOperationRequestMessage)(nil), // 137: proto.PeerDataOperationRequestMessage - (*EphemeralSetting)(nil), // 138: proto.EphemeralSetting - (*WallpaperSettings)(nil), // 139: proto.WallpaperSettings - (*StickerMetadata)(nil), // 140: proto.StickerMetadata - (*Pushname)(nil), // 141: proto.Pushname - (*PastParticipants)(nil), // 142: proto.PastParticipants - (*PastParticipant)(nil), // 143: proto.PastParticipant - (*NotificationSettings)(nil), // 144: proto.NotificationSettings - (*HistorySync)(nil), // 145: proto.HistorySync - (*HistorySyncMsg)(nil), // 146: proto.HistorySyncMsg - (*GroupParticipant)(nil), // 147: proto.GroupParticipant - (*GlobalSettings)(nil), // 148: proto.GlobalSettings - (*Conversation)(nil), // 149: proto.Conversation - (*AvatarUserSettings)(nil), // 150: proto.AvatarUserSettings - (*AutoDownloadSettings)(nil), // 151: proto.AutoDownloadSettings - (*MsgRowOpaqueData)(nil), // 152: proto.MsgRowOpaqueData - (*MsgOpaqueData)(nil), // 153: proto.MsgOpaqueData - (*ServerErrorReceipt)(nil), // 154: proto.ServerErrorReceipt - (*MediaRetryNotification)(nil), // 155: proto.MediaRetryNotification - (*MessageKey)(nil), // 156: proto.MessageKey - (*SyncdVersion)(nil), // 157: proto.SyncdVersion - (*SyncdValue)(nil), // 158: proto.SyncdValue - (*SyncdSnapshot)(nil), // 159: proto.SyncdSnapshot - (*SyncdRecord)(nil), // 160: proto.SyncdRecord - (*SyncdPatch)(nil), // 161: proto.SyncdPatch - (*SyncdMutations)(nil), // 162: proto.SyncdMutations - (*SyncdMutation)(nil), // 163: proto.SyncdMutation - (*SyncdIndex)(nil), // 164: proto.SyncdIndex - (*KeyId)(nil), // 165: proto.KeyId - (*ExternalBlobReference)(nil), // 166: proto.ExternalBlobReference - (*ExitCode)(nil), // 167: proto.ExitCode - (*SyncActionValue)(nil), // 168: proto.SyncActionValue - (*UserStatusMuteAction)(nil), // 169: proto.UserStatusMuteAction - (*UnarchiveChatsSetting)(nil), // 170: proto.UnarchiveChatsSetting - (*TimeFormatAction)(nil), // 171: proto.TimeFormatAction - (*SyncActionMessage)(nil), // 172: proto.SyncActionMessage - (*SyncActionMessageRange)(nil), // 173: proto.SyncActionMessageRange - (*SubscriptionAction)(nil), // 174: proto.SubscriptionAction - (*StickerAction)(nil), // 175: proto.StickerAction - (*StarAction)(nil), // 176: proto.StarAction - (*SecurityNotificationSetting)(nil), // 177: proto.SecurityNotificationSetting - (*RemoveRecentStickerAction)(nil), // 178: proto.RemoveRecentStickerAction - (*RecentEmojiWeightsAction)(nil), // 179: proto.RecentEmojiWeightsAction - (*QuickReplyAction)(nil), // 180: proto.QuickReplyAction - (*PushNameSetting)(nil), // 181: proto.PushNameSetting - (*PrivacySettingRelayAllCalls)(nil), // 182: proto.PrivacySettingRelayAllCalls - (*PrimaryVersionAction)(nil), // 183: proto.PrimaryVersionAction - (*PrimaryFeature)(nil), // 184: proto.PrimaryFeature - (*PnForLidChatAction)(nil), // 185: proto.PnForLidChatAction - (*PinAction)(nil), // 186: proto.PinAction - (*NuxAction)(nil), // 187: proto.NuxAction - (*MuteAction)(nil), // 188: proto.MuteAction - (*MarketingMessageBroadcastAction)(nil), // 189: proto.MarketingMessageBroadcastAction - (*MarketingMessageAction)(nil), // 190: proto.MarketingMessageAction - (*MarkChatAsReadAction)(nil), // 191: proto.MarkChatAsReadAction - (*LocaleSetting)(nil), // 192: proto.LocaleSetting - (*LabelEditAction)(nil), // 193: proto.LabelEditAction - (*LabelAssociationAction)(nil), // 194: proto.LabelAssociationAction - (*KeyExpiration)(nil), // 195: proto.KeyExpiration - (*ExternalWebBetaAction)(nil), // 196: proto.ExternalWebBetaAction - (*DeleteMessageForMeAction)(nil), // 197: proto.DeleteMessageForMeAction - (*DeleteChatAction)(nil), // 198: proto.DeleteChatAction - (*ContactAction)(nil), // 199: proto.ContactAction - (*ClearChatAction)(nil), // 200: proto.ClearChatAction - (*ChatAssignmentOpenedStatusAction)(nil), // 201: proto.ChatAssignmentOpenedStatusAction - (*ChatAssignmentAction)(nil), // 202: proto.ChatAssignmentAction - (*ArchiveChatAction)(nil), // 203: proto.ArchiveChatAction - (*AndroidUnsupportedActions)(nil), // 204: proto.AndroidUnsupportedActions - (*AgentAction)(nil), // 205: proto.AgentAction - (*SyncActionData)(nil), // 206: proto.SyncActionData - (*RecentEmojiWeight)(nil), // 207: proto.RecentEmojiWeight - (*VerifiedNameCertificate)(nil), // 208: proto.VerifiedNameCertificate - (*LocalizedName)(nil), // 209: proto.LocalizedName - (*BizIdentityInfo)(nil), // 210: proto.BizIdentityInfo - (*BizAccountPayload)(nil), // 211: proto.BizAccountPayload - (*BizAccountLinkInfo)(nil), // 212: proto.BizAccountLinkInfo - (*HandshakeMessage)(nil), // 213: proto.HandshakeMessage - (*HandshakeServerHello)(nil), // 214: proto.HandshakeServerHello - (*HandshakeClientHello)(nil), // 215: proto.HandshakeClientHello - (*HandshakeClientFinish)(nil), // 216: proto.HandshakeClientFinish - (*ClientPayload)(nil), // 217: proto.ClientPayload - (*WebNotificationsInfo)(nil), // 218: proto.WebNotificationsInfo - (*WebMessageInfo)(nil), // 219: proto.WebMessageInfo - (*WebFeatures)(nil), // 220: proto.WebFeatures - (*UserReceipt)(nil), // 221: proto.UserReceipt - (*StatusPSA)(nil), // 222: proto.StatusPSA - (*Reaction)(nil), // 223: proto.Reaction - (*PollUpdate)(nil), // 224: proto.PollUpdate - (*PollAdditionalMetadata)(nil), // 225: proto.PollAdditionalMetadata - (*PinInChat)(nil), // 226: proto.PinInChat - (*PhotoChange)(nil), // 227: proto.PhotoChange - (*PaymentInfo)(nil), // 228: proto.PaymentInfo - (*NotificationMessageInfo)(nil), // 229: proto.NotificationMessageInfo - (*MessageAddOnContextInfo)(nil), // 230: proto.MessageAddOnContextInfo - (*MediaData)(nil), // 231: proto.MediaData - (*KeepInChat)(nil), // 232: proto.KeepInChat - (*NoiseCertificate)(nil), // 233: proto.NoiseCertificate - (*CertChain)(nil), // 234: proto.CertChain - (*DeviceProps_HistorySyncConfig)(nil), // 235: proto.DeviceProps.HistorySyncConfig - (*DeviceProps_AppVersion)(nil), // 236: proto.DeviceProps.AppVersion - (*ListResponseMessage_SingleSelectReply)(nil), // 237: proto.ListResponseMessage.SingleSelectReply - (*ListMessage_Section)(nil), // 238: proto.ListMessage.Section - (*ListMessage_Row)(nil), // 239: proto.ListMessage.Row - (*ListMessage_Product)(nil), // 240: proto.ListMessage.Product - (*ListMessage_ProductSection)(nil), // 241: proto.ListMessage.ProductSection - (*ListMessage_ProductListInfo)(nil), // 242: proto.ListMessage.ProductListInfo - (*ListMessage_ProductListHeaderImage)(nil), // 243: proto.ListMessage.ProductListHeaderImage - (*InteractiveResponseMessage_NativeFlowResponseMessage)(nil), // 244: proto.InteractiveResponseMessage.NativeFlowResponseMessage - (*InteractiveResponseMessage_Body)(nil), // 245: proto.InteractiveResponseMessage.Body - (*InteractiveMessage_ShopMessage)(nil), // 246: proto.InteractiveMessage.ShopMessage - (*InteractiveMessage_NativeFlowMessage)(nil), // 247: proto.InteractiveMessage.NativeFlowMessage - (*InteractiveMessage_Header)(nil), // 248: proto.InteractiveMessage.Header - (*InteractiveMessage_Footer)(nil), // 249: proto.InteractiveMessage.Footer - (*InteractiveMessage_CollectionMessage)(nil), // 250: proto.InteractiveMessage.CollectionMessage - (*InteractiveMessage_Body)(nil), // 251: proto.InteractiveMessage.Body - (*InteractiveMessage_NativeFlowMessage_NativeFlowButton)(nil), // 252: proto.InteractiveMessage.NativeFlowMessage.NativeFlowButton - (*HighlyStructuredMessage_HSMLocalizableParameter)(nil), // 253: proto.HighlyStructuredMessage.HSMLocalizableParameter - (*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime)(nil), // 254: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime - (*HighlyStructuredMessage_HSMLocalizableParameter_HSMCurrency)(nil), // 255: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency - (*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeUnixEpoch)(nil), // 256: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch - (*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent)(nil), // 257: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent - (*ButtonsMessage_Button)(nil), // 258: proto.ButtonsMessage.Button - (*ButtonsMessage_Button_NativeFlowInfo)(nil), // 259: proto.ButtonsMessage.Button.NativeFlowInfo - (*ButtonsMessage_Button_ButtonText)(nil), // 260: proto.ButtonsMessage.Button.ButtonText - (*HydratedTemplateButton_HydratedURLButton)(nil), // 261: proto.HydratedTemplateButton.HydratedURLButton - (*HydratedTemplateButton_HydratedQuickReplyButton)(nil), // 262: proto.HydratedTemplateButton.HydratedQuickReplyButton - (*HydratedTemplateButton_HydratedCallButton)(nil), // 263: proto.HydratedTemplateButton.HydratedCallButton - (*ContextInfo_UTMInfo)(nil), // 264: proto.ContextInfo.UTMInfo - (*ContextInfo_ExternalAdReplyInfo)(nil), // 265: proto.ContextInfo.ExternalAdReplyInfo - (*ContextInfo_AdReplyInfo)(nil), // 266: proto.ContextInfo.AdReplyInfo - (*TemplateButton_URLButton)(nil), // 267: proto.TemplateButton.URLButton - (*TemplateButton_QuickReplyButton)(nil), // 268: proto.TemplateButton.QuickReplyButton - (*TemplateButton_CallButton)(nil), // 269: proto.TemplateButton.CallButton - (*PaymentBackground_MediaData)(nil), // 270: proto.PaymentBackground.MediaData - (*TemplateMessage_HydratedFourRowTemplate)(nil), // 271: proto.TemplateMessage.HydratedFourRowTemplate - (*TemplateMessage_FourRowTemplate)(nil), // 272: proto.TemplateMessage.FourRowTemplate - (*ProductMessage_ProductSnapshot)(nil), // 273: proto.ProductMessage.ProductSnapshot - (*ProductMessage_CatalogSnapshot)(nil), // 274: proto.ProductMessage.CatalogSnapshot - (*PollCreationMessage_Option)(nil), // 275: proto.PollCreationMessage.Option - (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult)(nil), // 276: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult - (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_PlaceholderMessageResendResponse)(nil), // 277: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse - (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse)(nil), // 278: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse - (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse_LinkPreviewHighQualityThumbnail)(nil), // 279: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail - (*PeerDataOperationRequestMessage_RequestUrlPreview)(nil), // 280: proto.PeerDataOperationRequestMessage.RequestUrlPreview - (*PeerDataOperationRequestMessage_RequestStickerReupload)(nil), // 281: proto.PeerDataOperationRequestMessage.RequestStickerReupload - (*PeerDataOperationRequestMessage_PlaceholderMessageResendRequest)(nil), // 282: proto.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest - (*PeerDataOperationRequestMessage_HistorySyncOnDemandRequest)(nil), // 283: proto.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest - (*MsgOpaqueData_PollOption)(nil), // 284: proto.MsgOpaqueData.PollOption - (*VerifiedNameCertificate_Details)(nil), // 285: proto.VerifiedNameCertificate.Details - (*ClientPayload_WebInfo)(nil), // 286: proto.ClientPayload.WebInfo - (*ClientPayload_UserAgent)(nil), // 287: proto.ClientPayload.UserAgent - (*ClientPayload_InteropData)(nil), // 288: proto.ClientPayload.InteropData - (*ClientPayload_DevicePairingRegistrationData)(nil), // 289: proto.ClientPayload.DevicePairingRegistrationData - (*ClientPayload_DNSSource)(nil), // 290: proto.ClientPayload.DNSSource - (*ClientPayload_WebInfo_WebdPayload)(nil), // 291: proto.ClientPayload.WebInfo.WebdPayload - (*ClientPayload_UserAgent_AppVersion)(nil), // 292: proto.ClientPayload.UserAgent.AppVersion - (*NoiseCertificate_Details)(nil), // 293: proto.NoiseCertificate.Details - (*CertChain_NoiseCertificate)(nil), // 294: proto.CertChain.NoiseCertificate - (*CertChain_NoiseCertificate_Details)(nil), // 295: proto.CertChain.NoiseCertificate.Details + (PaymentInviteMessage_ServiceType)(0), // 32: proto.PaymentInviteMessage.ServiceType + (PastParticipant_LeaveReason)(0), // 33: proto.PastParticipant.LeaveReason + (HistorySync_HistorySyncType)(0), // 34: proto.HistorySync.HistorySyncType + (GroupParticipant_Rank)(0), // 35: proto.GroupParticipant.Rank + (Conversation_EndOfHistoryTransferType)(0), // 36: proto.Conversation.EndOfHistoryTransferType + (MediaRetryNotification_ResultType)(0), // 37: proto.MediaRetryNotification.ResultType + (SyncdMutation_SyncdOperation)(0), // 38: proto.SyncdMutation.SyncdOperation + (MarketingMessageAction_MarketingMessagePrototypeType)(0), // 39: proto.MarketingMessageAction.MarketingMessagePrototypeType + (BizIdentityInfo_VerifiedLevelValue)(0), // 40: proto.BizIdentityInfo.VerifiedLevelValue + (BizIdentityInfo_HostStorageType)(0), // 41: proto.BizIdentityInfo.HostStorageType + (BizIdentityInfo_ActualActorsType)(0), // 42: proto.BizIdentityInfo.ActualActorsType + (BizAccountLinkInfo_HostStorageType)(0), // 43: proto.BizAccountLinkInfo.HostStorageType + (BizAccountLinkInfo_AccountType)(0), // 44: proto.BizAccountLinkInfo.AccountType + (ClientPayload_Product)(0), // 45: proto.ClientPayload.Product + (ClientPayload_IOSAppExtension)(0), // 46: proto.ClientPayload.IOSAppExtension + (ClientPayload_ConnectType)(0), // 47: proto.ClientPayload.ConnectType + (ClientPayload_ConnectReason)(0), // 48: proto.ClientPayload.ConnectReason + (ClientPayload_WebInfo_WebSubPlatform)(0), // 49: proto.ClientPayload.WebInfo.WebSubPlatform + (ClientPayload_UserAgent_ReleaseChannel)(0), // 50: proto.ClientPayload.UserAgent.ReleaseChannel + (ClientPayload_UserAgent_Platform)(0), // 51: proto.ClientPayload.UserAgent.Platform + (ClientPayload_UserAgent_DeviceType)(0), // 52: proto.ClientPayload.UserAgent.DeviceType + (ClientPayload_DNSSource_DNSResolutionMethod)(0), // 53: proto.ClientPayload.DNSSource.DNSResolutionMethod + (WebMessageInfo_StubType)(0), // 54: proto.WebMessageInfo.StubType + (WebMessageInfo_Status)(0), // 55: proto.WebMessageInfo.Status + (WebMessageInfo_BizPrivacyStatus)(0), // 56: proto.WebMessageInfo.BizPrivacyStatus + (WebFeatures_Flag)(0), // 57: proto.WebFeatures.Flag + (PinInChat_Type)(0), // 58: proto.PinInChat.Type + (PaymentInfo_TxnStatus)(0), // 59: proto.PaymentInfo.TxnStatus + (PaymentInfo_Status)(0), // 60: proto.PaymentInfo.Status + (PaymentInfo_Currency)(0), // 61: proto.PaymentInfo.Currency + (*ADVSignedKeyIndexList)(nil), // 62: proto.ADVSignedKeyIndexList + (*ADVSignedDeviceIdentity)(nil), // 63: proto.ADVSignedDeviceIdentity + (*ADVSignedDeviceIdentityHMAC)(nil), // 64: proto.ADVSignedDeviceIdentityHMAC + (*ADVKeyIndexList)(nil), // 65: proto.ADVKeyIndexList + (*ADVDeviceIdentity)(nil), // 66: proto.ADVDeviceIdentity + (*DeviceProps)(nil), // 67: proto.DeviceProps + (*OrderMessage)(nil), // 68: proto.OrderMessage + (*LocationMessage)(nil), // 69: proto.LocationMessage + (*LiveLocationMessage)(nil), // 70: proto.LiveLocationMessage + (*ListResponseMessage)(nil), // 71: proto.ListResponseMessage + (*ListMessage)(nil), // 72: proto.ListMessage + (*KeepInChatMessage)(nil), // 73: proto.KeepInChatMessage + (*InvoiceMessage)(nil), // 74: proto.InvoiceMessage + (*InteractiveResponseMessage)(nil), // 75: proto.InteractiveResponseMessage + (*InteractiveMessage)(nil), // 76: proto.InteractiveMessage + (*InitialSecurityNotificationSettingSync)(nil), // 77: proto.InitialSecurityNotificationSettingSync + (*ImageMessage)(nil), // 78: proto.ImageMessage + (*HistorySyncNotification)(nil), // 79: proto.HistorySyncNotification + (*HighlyStructuredMessage)(nil), // 80: proto.HighlyStructuredMessage + (*GroupInviteMessage)(nil), // 81: proto.GroupInviteMessage + (*FutureProofMessage)(nil), // 82: proto.FutureProofMessage + (*ExtendedTextMessage)(nil), // 83: proto.ExtendedTextMessage + (*EncReactionMessage)(nil), // 84: proto.EncReactionMessage + (*DocumentMessage)(nil), // 85: proto.DocumentMessage + (*DeviceSentMessage)(nil), // 86: proto.DeviceSentMessage + (*DeclinePaymentRequestMessage)(nil), // 87: proto.DeclinePaymentRequestMessage + (*ContactsArrayMessage)(nil), // 88: proto.ContactsArrayMessage + (*ContactMessage)(nil), // 89: proto.ContactMessage + (*Chat)(nil), // 90: proto.Chat + (*CancelPaymentRequestMessage)(nil), // 91: proto.CancelPaymentRequestMessage + (*Call)(nil), // 92: proto.Call + (*ButtonsResponseMessage)(nil), // 93: proto.ButtonsResponseMessage + (*ButtonsMessage)(nil), // 94: proto.ButtonsMessage + (*BotFeedbackMessage)(nil), // 95: proto.BotFeedbackMessage + (*AudioMessage)(nil), // 96: proto.AudioMessage + (*AppStateSyncKey)(nil), // 97: proto.AppStateSyncKey + (*AppStateSyncKeyShare)(nil), // 98: proto.AppStateSyncKeyShare + (*AppStateSyncKeyRequest)(nil), // 99: proto.AppStateSyncKeyRequest + (*AppStateSyncKeyId)(nil), // 100: proto.AppStateSyncKeyId + (*AppStateSyncKeyFingerprint)(nil), // 101: proto.AppStateSyncKeyFingerprint + (*AppStateSyncKeyData)(nil), // 102: proto.AppStateSyncKeyData + (*AppStateFatalExceptionNotification)(nil), // 103: proto.AppStateFatalExceptionNotification + (*Location)(nil), // 104: proto.Location + (*InteractiveAnnotation)(nil), // 105: proto.InteractiveAnnotation + (*HydratedTemplateButton)(nil), // 106: proto.HydratedTemplateButton + (*GroupMention)(nil), // 107: proto.GroupMention + (*DisappearingMode)(nil), // 108: proto.DisappearingMode + (*DeviceListMetadata)(nil), // 109: proto.DeviceListMetadata + (*ContextInfo)(nil), // 110: proto.ContextInfo + (*BotMetadata)(nil), // 111: proto.BotMetadata + (*BotAvatarMetadata)(nil), // 112: proto.BotAvatarMetadata + (*ActionLink)(nil), // 113: proto.ActionLink + (*TemplateButton)(nil), // 114: proto.TemplateButton + (*Point)(nil), // 115: proto.Point + (*PaymentBackground)(nil), // 116: proto.PaymentBackground + (*Money)(nil), // 117: proto.Money + (*Message)(nil), // 118: proto.Message + (*MessageSecretMessage)(nil), // 119: proto.MessageSecretMessage + (*MessageContextInfo)(nil), // 120: proto.MessageContextInfo + (*VideoMessage)(nil), // 121: proto.VideoMessage + (*TemplateMessage)(nil), // 122: proto.TemplateMessage + (*TemplateButtonReplyMessage)(nil), // 123: proto.TemplateButtonReplyMessage + (*StickerSyncRMRMessage)(nil), // 124: proto.StickerSyncRMRMessage + (*StickerMessage)(nil), // 125: proto.StickerMessage + (*SenderKeyDistributionMessage)(nil), // 126: proto.SenderKeyDistributionMessage + (*SendPaymentMessage)(nil), // 127: proto.SendPaymentMessage + (*ScheduledCallEditMessage)(nil), // 128: proto.ScheduledCallEditMessage + (*ScheduledCallCreationMessage)(nil), // 129: proto.ScheduledCallCreationMessage + (*RequestPhoneNumberMessage)(nil), // 130: proto.RequestPhoneNumberMessage + (*RequestPaymentMessage)(nil), // 131: proto.RequestPaymentMessage + (*ReactionMessage)(nil), // 132: proto.ReactionMessage + (*ProtocolMessage)(nil), // 133: proto.ProtocolMessage + (*ProductMessage)(nil), // 134: proto.ProductMessage + (*PollVoteMessage)(nil), // 135: proto.PollVoteMessage + (*PollUpdateMessage)(nil), // 136: proto.PollUpdateMessage + (*PollUpdateMessageMetadata)(nil), // 137: proto.PollUpdateMessageMetadata + (*PollEncValue)(nil), // 138: proto.PollEncValue + (*PollCreationMessage)(nil), // 139: proto.PollCreationMessage + (*PinInChatMessage)(nil), // 140: proto.PinInChatMessage + (*PeerDataOperationRequestResponseMessage)(nil), // 141: proto.PeerDataOperationRequestResponseMessage + (*PeerDataOperationRequestMessage)(nil), // 142: proto.PeerDataOperationRequestMessage + (*PaymentInviteMessage)(nil), // 143: proto.PaymentInviteMessage + (*EphemeralSetting)(nil), // 144: proto.EphemeralSetting + (*WallpaperSettings)(nil), // 145: proto.WallpaperSettings + (*StickerMetadata)(nil), // 146: proto.StickerMetadata + (*Pushname)(nil), // 147: proto.Pushname + (*PastParticipants)(nil), // 148: proto.PastParticipants + (*PastParticipant)(nil), // 149: proto.PastParticipant + (*NotificationSettings)(nil), // 150: proto.NotificationSettings + (*HistorySync)(nil), // 151: proto.HistorySync + (*HistorySyncMsg)(nil), // 152: proto.HistorySyncMsg + (*GroupParticipant)(nil), // 153: proto.GroupParticipant + (*GlobalSettings)(nil), // 154: proto.GlobalSettings + (*Conversation)(nil), // 155: proto.Conversation + (*AvatarUserSettings)(nil), // 156: proto.AvatarUserSettings + (*AutoDownloadSettings)(nil), // 157: proto.AutoDownloadSettings + (*ServerErrorReceipt)(nil), // 158: proto.ServerErrorReceipt + (*MediaRetryNotification)(nil), // 159: proto.MediaRetryNotification + (*MessageKey)(nil), // 160: proto.MessageKey + (*SyncdVersion)(nil), // 161: proto.SyncdVersion + (*SyncdValue)(nil), // 162: proto.SyncdValue + (*SyncdSnapshot)(nil), // 163: proto.SyncdSnapshot + (*SyncdRecord)(nil), // 164: proto.SyncdRecord + (*SyncdPatch)(nil), // 165: proto.SyncdPatch + (*SyncdMutations)(nil), // 166: proto.SyncdMutations + (*SyncdMutation)(nil), // 167: proto.SyncdMutation + (*SyncdIndex)(nil), // 168: proto.SyncdIndex + (*KeyId)(nil), // 169: proto.KeyId + (*ExternalBlobReference)(nil), // 170: proto.ExternalBlobReference + (*ExitCode)(nil), // 171: proto.ExitCode + (*SyncActionValue)(nil), // 172: proto.SyncActionValue + (*UserStatusMuteAction)(nil), // 173: proto.UserStatusMuteAction + (*UnarchiveChatsSetting)(nil), // 174: proto.UnarchiveChatsSetting + (*TimeFormatAction)(nil), // 175: proto.TimeFormatAction + (*SyncActionMessage)(nil), // 176: proto.SyncActionMessage + (*SyncActionMessageRange)(nil), // 177: proto.SyncActionMessageRange + (*SubscriptionAction)(nil), // 178: proto.SubscriptionAction + (*StickerAction)(nil), // 179: proto.StickerAction + (*StarAction)(nil), // 180: proto.StarAction + (*SecurityNotificationSetting)(nil), // 181: proto.SecurityNotificationSetting + (*RemoveRecentStickerAction)(nil), // 182: proto.RemoveRecentStickerAction + (*RecentEmojiWeightsAction)(nil), // 183: proto.RecentEmojiWeightsAction + (*QuickReplyAction)(nil), // 184: proto.QuickReplyAction + (*PushNameSetting)(nil), // 185: proto.PushNameSetting + (*PrivacySettingRelayAllCalls)(nil), // 186: proto.PrivacySettingRelayAllCalls + (*PrimaryVersionAction)(nil), // 187: proto.PrimaryVersionAction + (*PrimaryFeature)(nil), // 188: proto.PrimaryFeature + (*PnForLidChatAction)(nil), // 189: proto.PnForLidChatAction + (*PinAction)(nil), // 190: proto.PinAction + (*NuxAction)(nil), // 191: proto.NuxAction + (*MuteAction)(nil), // 192: proto.MuteAction + (*MarketingMessageBroadcastAction)(nil), // 193: proto.MarketingMessageBroadcastAction + (*MarketingMessageAction)(nil), // 194: proto.MarketingMessageAction + (*MarkChatAsReadAction)(nil), // 195: proto.MarkChatAsReadAction + (*LocaleSetting)(nil), // 196: proto.LocaleSetting + (*LabelEditAction)(nil), // 197: proto.LabelEditAction + (*LabelAssociationAction)(nil), // 198: proto.LabelAssociationAction + (*KeyExpiration)(nil), // 199: proto.KeyExpiration + (*ExternalWebBetaAction)(nil), // 200: proto.ExternalWebBetaAction + (*DeleteMessageForMeAction)(nil), // 201: proto.DeleteMessageForMeAction + (*DeleteChatAction)(nil), // 202: proto.DeleteChatAction + (*ContactAction)(nil), // 203: proto.ContactAction + (*ClearChatAction)(nil), // 204: proto.ClearChatAction + (*ChatAssignmentOpenedStatusAction)(nil), // 205: proto.ChatAssignmentOpenedStatusAction + (*ChatAssignmentAction)(nil), // 206: proto.ChatAssignmentAction + (*ArchiveChatAction)(nil), // 207: proto.ArchiveChatAction + (*AndroidUnsupportedActions)(nil), // 208: proto.AndroidUnsupportedActions + (*AgentAction)(nil), // 209: proto.AgentAction + (*SyncActionData)(nil), // 210: proto.SyncActionData + (*RecentEmojiWeight)(nil), // 211: proto.RecentEmojiWeight + (*VerifiedNameCertificate)(nil), // 212: proto.VerifiedNameCertificate + (*LocalizedName)(nil), // 213: proto.LocalizedName + (*BizIdentityInfo)(nil), // 214: proto.BizIdentityInfo + (*BizAccountPayload)(nil), // 215: proto.BizAccountPayload + (*BizAccountLinkInfo)(nil), // 216: proto.BizAccountLinkInfo + (*HandshakeMessage)(nil), // 217: proto.HandshakeMessage + (*HandshakeServerHello)(nil), // 218: proto.HandshakeServerHello + (*HandshakeClientHello)(nil), // 219: proto.HandshakeClientHello + (*HandshakeClientFinish)(nil), // 220: proto.HandshakeClientFinish + (*ClientPayload)(nil), // 221: proto.ClientPayload + (*WebNotificationsInfo)(nil), // 222: proto.WebNotificationsInfo + (*WebMessageInfo)(nil), // 223: proto.WebMessageInfo + (*WebFeatures)(nil), // 224: proto.WebFeatures + (*UserReceipt)(nil), // 225: proto.UserReceipt + (*StatusPSA)(nil), // 226: proto.StatusPSA + (*Reaction)(nil), // 227: proto.Reaction + (*PollUpdate)(nil), // 228: proto.PollUpdate + (*PollAdditionalMetadata)(nil), // 229: proto.PollAdditionalMetadata + (*PinInChat)(nil), // 230: proto.PinInChat + (*PhotoChange)(nil), // 231: proto.PhotoChange + (*PaymentInfo)(nil), // 232: proto.PaymentInfo + (*NotificationMessageInfo)(nil), // 233: proto.NotificationMessageInfo + (*MessageAddOnContextInfo)(nil), // 234: proto.MessageAddOnContextInfo + (*MediaData)(nil), // 235: proto.MediaData + (*KeepInChat)(nil), // 236: proto.KeepInChat + (*FutureproofMessageSecretMessage)(nil), // 237: proto.FutureproofMessageSecretMessage + (*FutureMessageData)(nil), // 238: proto.FutureMessageData + (*BotData)(nil), // 239: proto.BotData + (*NoiseCertificate)(nil), // 240: proto.NoiseCertificate + (*CertChain)(nil), // 241: proto.CertChain + (*DeviceProps_HistorySyncConfig)(nil), // 242: proto.DeviceProps.HistorySyncConfig + (*DeviceProps_AppVersion)(nil), // 243: proto.DeviceProps.AppVersion + (*ListResponseMessage_SingleSelectReply)(nil), // 244: proto.ListResponseMessage.SingleSelectReply + (*ListMessage_Section)(nil), // 245: proto.ListMessage.Section + (*ListMessage_Row)(nil), // 246: proto.ListMessage.Row + (*ListMessage_Product)(nil), // 247: proto.ListMessage.Product + (*ListMessage_ProductSection)(nil), // 248: proto.ListMessage.ProductSection + (*ListMessage_ProductListInfo)(nil), // 249: proto.ListMessage.ProductListInfo + (*ListMessage_ProductListHeaderImage)(nil), // 250: proto.ListMessage.ProductListHeaderImage + (*InteractiveResponseMessage_NativeFlowResponseMessage)(nil), // 251: proto.InteractiveResponseMessage.NativeFlowResponseMessage + (*InteractiveResponseMessage_Body)(nil), // 252: proto.InteractiveResponseMessage.Body + (*InteractiveMessage_ShopMessage)(nil), // 253: proto.InteractiveMessage.ShopMessage + (*InteractiveMessage_NativeFlowMessage)(nil), // 254: proto.InteractiveMessage.NativeFlowMessage + (*InteractiveMessage_Header)(nil), // 255: proto.InteractiveMessage.Header + (*InteractiveMessage_Footer)(nil), // 256: proto.InteractiveMessage.Footer + (*InteractiveMessage_CollectionMessage)(nil), // 257: proto.InteractiveMessage.CollectionMessage + (*InteractiveMessage_CarouselMessage)(nil), // 258: proto.InteractiveMessage.CarouselMessage + (*InteractiveMessage_Body)(nil), // 259: proto.InteractiveMessage.Body + (*InteractiveMessage_NativeFlowMessage_NativeFlowButton)(nil), // 260: proto.InteractiveMessage.NativeFlowMessage.NativeFlowButton + (*HighlyStructuredMessage_HSMLocalizableParameter)(nil), // 261: proto.HighlyStructuredMessage.HSMLocalizableParameter + (*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime)(nil), // 262: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime + (*HighlyStructuredMessage_HSMLocalizableParameter_HSMCurrency)(nil), // 263: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency + (*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeUnixEpoch)(nil), // 264: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch + (*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent)(nil), // 265: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent + (*ButtonsMessage_Button)(nil), // 266: proto.ButtonsMessage.Button + (*ButtonsMessage_Button_NativeFlowInfo)(nil), // 267: proto.ButtonsMessage.Button.NativeFlowInfo + (*ButtonsMessage_Button_ButtonText)(nil), // 268: proto.ButtonsMessage.Button.ButtonText + (*HydratedTemplateButton_HydratedURLButton)(nil), // 269: proto.HydratedTemplateButton.HydratedURLButton + (*HydratedTemplateButton_HydratedQuickReplyButton)(nil), // 270: proto.HydratedTemplateButton.HydratedQuickReplyButton + (*HydratedTemplateButton_HydratedCallButton)(nil), // 271: proto.HydratedTemplateButton.HydratedCallButton + (*ContextInfo_UTMInfo)(nil), // 272: proto.ContextInfo.UTMInfo + (*ContextInfo_ExternalAdReplyInfo)(nil), // 273: proto.ContextInfo.ExternalAdReplyInfo + (*ContextInfo_AdReplyInfo)(nil), // 274: proto.ContextInfo.AdReplyInfo + (*BotAvatarMetadata_PlaybackMetadata)(nil), // 275: proto.BotAvatarMetadata.PlaybackMetadata + (*TemplateButton_URLButton)(nil), // 276: proto.TemplateButton.URLButton + (*TemplateButton_QuickReplyButton)(nil), // 277: proto.TemplateButton.QuickReplyButton + (*TemplateButton_CallButton)(nil), // 278: proto.TemplateButton.CallButton + (*PaymentBackground_MediaData)(nil), // 279: proto.PaymentBackground.MediaData + (*TemplateMessage_HydratedFourRowTemplate)(nil), // 280: proto.TemplateMessage.HydratedFourRowTemplate + (*TemplateMessage_FourRowTemplate)(nil), // 281: proto.TemplateMessage.FourRowTemplate + (*ProductMessage_ProductSnapshot)(nil), // 282: proto.ProductMessage.ProductSnapshot + (*ProductMessage_CatalogSnapshot)(nil), // 283: proto.ProductMessage.CatalogSnapshot + (*PollCreationMessage_Option)(nil), // 284: proto.PollCreationMessage.Option + (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult)(nil), // 285: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult + (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_PlaceholderMessageResendResponse)(nil), // 286: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse + (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse)(nil), // 287: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse + (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse_LinkPreviewHighQualityThumbnail)(nil), // 288: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail + (*PeerDataOperationRequestMessage_RequestUrlPreview)(nil), // 289: proto.PeerDataOperationRequestMessage.RequestUrlPreview + (*PeerDataOperationRequestMessage_RequestStickerReupload)(nil), // 290: proto.PeerDataOperationRequestMessage.RequestStickerReupload + (*PeerDataOperationRequestMessage_PlaceholderMessageResendRequest)(nil), // 291: proto.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest + (*PeerDataOperationRequestMessage_HistorySyncOnDemandRequest)(nil), // 292: proto.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest + (*VerifiedNameCertificate_Details)(nil), // 293: proto.VerifiedNameCertificate.Details + (*ClientPayload_WebInfo)(nil), // 294: proto.ClientPayload.WebInfo + (*ClientPayload_UserAgent)(nil), // 295: proto.ClientPayload.UserAgent + (*ClientPayload_InteropData)(nil), // 296: proto.ClientPayload.InteropData + (*ClientPayload_DevicePairingRegistrationData)(nil), // 297: proto.ClientPayload.DevicePairingRegistrationData + (*ClientPayload_DNSSource)(nil), // 298: proto.ClientPayload.DNSSource + (*ClientPayload_WebInfo_WebdPayload)(nil), // 299: proto.ClientPayload.WebInfo.WebdPayload + (*ClientPayload_UserAgent_AppVersion)(nil), // 300: proto.ClientPayload.UserAgent.AppVersion + (*NoiseCertificate_Details)(nil), // 301: proto.NoiseCertificate.Details + (*CertChain_NoiseCertificate)(nil), // 302: proto.CertChain.NoiseCertificate + (*CertChain_NoiseCertificate_Details)(nil), // 303: proto.CertChain.NoiseCertificate.Details } var file_binary_proto_def_proto_depIdxs = []int32{ 0, // 0: proto.ADVKeyIndexList.accountType:type_name -> proto.ADVEncryptionType 0, // 1: proto.ADVDeviceIdentity.accountType:type_name -> proto.ADVEncryptionType 0, // 2: proto.ADVDeviceIdentity.deviceType:type_name -> proto.ADVEncryptionType - 236, // 3: proto.DeviceProps.version:type_name -> proto.DeviceProps.AppVersion + 243, // 3: proto.DeviceProps.version:type_name -> proto.DeviceProps.AppVersion 4, // 4: proto.DeviceProps.platformType:type_name -> proto.DeviceProps.PlatformType - 235, // 5: proto.DeviceProps.historySyncConfig:type_name -> proto.DeviceProps.HistorySyncConfig - 5, // 6: proto.PaymentInviteMessage.serviceType:type_name -> proto.PaymentInviteMessage.ServiceType - 7, // 7: proto.OrderMessage.status:type_name -> proto.OrderMessage.OrderStatus - 6, // 8: proto.OrderMessage.surface:type_name -> proto.OrderMessage.OrderSurface - 108, // 9: proto.OrderMessage.contextInfo:type_name -> proto.ContextInfo - 108, // 10: proto.LocationMessage.contextInfo:type_name -> proto.ContextInfo - 108, // 11: proto.LiveLocationMessage.contextInfo:type_name -> proto.ContextInfo - 8, // 12: proto.ListResponseMessage.listType:type_name -> proto.ListResponseMessage.ListType - 237, // 13: proto.ListResponseMessage.singleSelectReply:type_name -> proto.ListResponseMessage.SingleSelectReply - 108, // 14: proto.ListResponseMessage.contextInfo:type_name -> proto.ContextInfo - 9, // 15: proto.ListMessage.listType:type_name -> proto.ListMessage.ListType - 238, // 16: proto.ListMessage.sections:type_name -> proto.ListMessage.Section - 242, // 17: proto.ListMessage.productListInfo:type_name -> proto.ListMessage.ProductListInfo - 108, // 18: proto.ListMessage.contextInfo:type_name -> proto.ContextInfo - 156, // 19: proto.KeepInChatMessage.key:type_name -> proto.MessageKey - 1, // 20: proto.KeepInChatMessage.keepType:type_name -> proto.KeepType - 10, // 21: proto.InvoiceMessage.attachmentType:type_name -> proto.InvoiceMessage.AttachmentType - 245, // 22: proto.InteractiveResponseMessage.body:type_name -> proto.InteractiveResponseMessage.Body - 108, // 23: proto.InteractiveResponseMessage.contextInfo:type_name -> proto.ContextInfo - 244, // 24: proto.InteractiveResponseMessage.nativeFlowResponseMessage:type_name -> proto.InteractiveResponseMessage.NativeFlowResponseMessage - 248, // 25: proto.InteractiveMessage.header:type_name -> proto.InteractiveMessage.Header - 251, // 26: proto.InteractiveMessage.body:type_name -> proto.InteractiveMessage.Body - 249, // 27: proto.InteractiveMessage.footer:type_name -> proto.InteractiveMessage.Footer - 108, // 28: proto.InteractiveMessage.contextInfo:type_name -> proto.ContextInfo - 246, // 29: proto.InteractiveMessage.shopStorefrontMessage:type_name -> proto.InteractiveMessage.ShopMessage - 250, // 30: proto.InteractiveMessage.collectionMessage:type_name -> proto.InteractiveMessage.CollectionMessage - 247, // 31: proto.InteractiveMessage.nativeFlowMessage:type_name -> proto.InteractiveMessage.NativeFlowMessage - 103, // 32: proto.ImageMessage.interactiveAnnotations:type_name -> proto.InteractiveAnnotation - 108, // 33: proto.ImageMessage.contextInfo:type_name -> proto.ContextInfo - 13, // 34: proto.HistorySyncNotification.syncType:type_name -> proto.HistorySyncNotification.HistorySyncType - 253, // 35: proto.HighlyStructuredMessage.localizableParams:type_name -> proto.HighlyStructuredMessage.HSMLocalizableParameter - 117, // 36: proto.HighlyStructuredMessage.hydratedHsm:type_name -> proto.TemplateMessage - 108, // 37: proto.GroupInviteMessage.contextInfo:type_name -> proto.ContextInfo - 16, // 38: proto.GroupInviteMessage.groupType:type_name -> proto.GroupInviteMessage.GroupType - 114, // 39: proto.FutureProofMessage.message:type_name -> proto.Message - 19, // 40: proto.ExtendedTextMessage.font:type_name -> proto.ExtendedTextMessage.FontType - 17, // 41: proto.ExtendedTextMessage.previewType:type_name -> proto.ExtendedTextMessage.PreviewType - 108, // 42: proto.ExtendedTextMessage.contextInfo:type_name -> proto.ContextInfo - 18, // 43: proto.ExtendedTextMessage.inviteLinkGroupType:type_name -> proto.ExtendedTextMessage.InviteLinkGroupType - 18, // 44: proto.ExtendedTextMessage.inviteLinkGroupTypeV2:type_name -> proto.ExtendedTextMessage.InviteLinkGroupType - 156, // 45: proto.EncReactionMessage.targetMessageKey:type_name -> proto.MessageKey - 108, // 46: proto.DocumentMessage.contextInfo:type_name -> proto.ContextInfo - 114, // 47: proto.DeviceSentMessage.message:type_name -> proto.Message - 156, // 48: proto.DeclinePaymentRequestMessage.key:type_name -> proto.MessageKey - 88, // 49: proto.ContactsArrayMessage.contacts:type_name -> proto.ContactMessage - 108, // 50: proto.ContactsArrayMessage.contextInfo:type_name -> proto.ContextInfo - 108, // 51: proto.ContactMessage.contextInfo:type_name -> proto.ContextInfo - 156, // 52: proto.CancelPaymentRequestMessage.key:type_name -> proto.MessageKey - 108, // 53: proto.ButtonsResponseMessage.contextInfo:type_name -> proto.ContextInfo - 20, // 54: proto.ButtonsResponseMessage.type:type_name -> proto.ButtonsResponseMessage.Type - 108, // 55: proto.ButtonsMessage.contextInfo:type_name -> proto.ContextInfo - 258, // 56: proto.ButtonsMessage.buttons:type_name -> proto.ButtonsMessage.Button - 21, // 57: proto.ButtonsMessage.headerType:type_name -> proto.ButtonsMessage.HeaderType - 84, // 58: proto.ButtonsMessage.documentMessage:type_name -> proto.DocumentMessage - 77, // 59: proto.ButtonsMessage.imageMessage:type_name -> proto.ImageMessage - 116, // 60: proto.ButtonsMessage.videoMessage:type_name -> proto.VideoMessage - 68, // 61: proto.ButtonsMessage.locationMessage:type_name -> proto.LocationMessage - 108, // 62: proto.AudioMessage.contextInfo:type_name -> proto.ContextInfo - 98, // 63: proto.AppStateSyncKey.keyId:type_name -> proto.AppStateSyncKeyId - 100, // 64: proto.AppStateSyncKey.keyData:type_name -> proto.AppStateSyncKeyData - 95, // 65: proto.AppStateSyncKeyShare.keys:type_name -> proto.AppStateSyncKey - 98, // 66: proto.AppStateSyncKeyRequest.keyIds:type_name -> proto.AppStateSyncKeyId - 99, // 67: proto.AppStateSyncKeyData.fingerprint:type_name -> proto.AppStateSyncKeyFingerprint - 111, // 68: proto.InteractiveAnnotation.polygonVertices:type_name -> proto.Point - 102, // 69: proto.InteractiveAnnotation.location:type_name -> proto.Location - 262, // 70: proto.HydratedTemplateButton.quickReplyButton:type_name -> proto.HydratedTemplateButton.HydratedQuickReplyButton - 261, // 71: proto.HydratedTemplateButton.urlButton:type_name -> proto.HydratedTemplateButton.HydratedURLButton - 263, // 72: proto.HydratedTemplateButton.callButton:type_name -> proto.HydratedTemplateButton.HydratedCallButton - 23, // 73: proto.DisappearingMode.initiator:type_name -> proto.DisappearingMode.Initiator - 114, // 74: proto.ContextInfo.quotedMessage:type_name -> proto.Message - 266, // 75: proto.ContextInfo.quotedAd:type_name -> proto.ContextInfo.AdReplyInfo - 156, // 76: proto.ContextInfo.placeholderKey:type_name -> proto.MessageKey - 265, // 77: proto.ContextInfo.externalAdReply:type_name -> proto.ContextInfo.ExternalAdReplyInfo - 106, // 78: proto.ContextInfo.disappearingMode:type_name -> proto.DisappearingMode - 109, // 79: proto.ContextInfo.actionLink:type_name -> proto.ActionLink - 105, // 80: proto.ContextInfo.groupMentions:type_name -> proto.GroupMention - 264, // 81: proto.ContextInfo.utm:type_name -> proto.ContextInfo.UTMInfo - 268, // 82: proto.TemplateButton.quickReplyButton:type_name -> proto.TemplateButton.QuickReplyButton - 267, // 83: proto.TemplateButton.urlButton:type_name -> proto.TemplateButton.URLButton - 269, // 84: proto.TemplateButton.callButton:type_name -> proto.TemplateButton.CallButton - 270, // 85: proto.PaymentBackground.mediaData:type_name -> proto.PaymentBackground.MediaData - 26, // 86: proto.PaymentBackground.type:type_name -> proto.PaymentBackground.Type - 121, // 87: proto.Message.senderKeyDistributionMessage:type_name -> proto.SenderKeyDistributionMessage - 77, // 88: proto.Message.imageMessage:type_name -> proto.ImageMessage - 88, // 89: proto.Message.contactMessage:type_name -> proto.ContactMessage - 68, // 90: proto.Message.locationMessage:type_name -> proto.LocationMessage - 82, // 91: proto.Message.extendedTextMessage:type_name -> proto.ExtendedTextMessage - 84, // 92: proto.Message.documentMessage:type_name -> proto.DocumentMessage - 94, // 93: proto.Message.audioMessage:type_name -> proto.AudioMessage - 116, // 94: proto.Message.videoMessage:type_name -> proto.VideoMessage - 91, // 95: proto.Message.call:type_name -> proto.Call - 89, // 96: proto.Message.chat:type_name -> proto.Chat - 128, // 97: proto.Message.protocolMessage:type_name -> proto.ProtocolMessage - 87, // 98: proto.Message.contactsArrayMessage:type_name -> proto.ContactsArrayMessage - 79, // 99: proto.Message.highlyStructuredMessage:type_name -> proto.HighlyStructuredMessage - 121, // 100: proto.Message.fastRatchetKeySenderKeyDistributionMessage:type_name -> proto.SenderKeyDistributionMessage - 122, // 101: proto.Message.sendPaymentMessage:type_name -> proto.SendPaymentMessage - 69, // 102: proto.Message.liveLocationMessage:type_name -> proto.LiveLocationMessage - 126, // 103: proto.Message.requestPaymentMessage:type_name -> proto.RequestPaymentMessage - 86, // 104: proto.Message.declinePaymentRequestMessage:type_name -> proto.DeclinePaymentRequestMessage - 90, // 105: proto.Message.cancelPaymentRequestMessage:type_name -> proto.CancelPaymentRequestMessage - 117, // 106: proto.Message.templateMessage:type_name -> proto.TemplateMessage - 120, // 107: proto.Message.stickerMessage:type_name -> proto.StickerMessage - 80, // 108: proto.Message.groupInviteMessage:type_name -> proto.GroupInviteMessage - 118, // 109: proto.Message.templateButtonReplyMessage:type_name -> proto.TemplateButtonReplyMessage - 129, // 110: proto.Message.productMessage:type_name -> proto.ProductMessage - 85, // 111: proto.Message.deviceSentMessage:type_name -> proto.DeviceSentMessage - 115, // 112: proto.Message.messageContextInfo:type_name -> proto.MessageContextInfo - 71, // 113: proto.Message.listMessage:type_name -> proto.ListMessage - 81, // 114: proto.Message.viewOnceMessage:type_name -> proto.FutureProofMessage - 67, // 115: proto.Message.orderMessage:type_name -> proto.OrderMessage - 70, // 116: proto.Message.listResponseMessage:type_name -> proto.ListResponseMessage - 81, // 117: proto.Message.ephemeralMessage:type_name -> proto.FutureProofMessage - 73, // 118: proto.Message.invoiceMessage:type_name -> proto.InvoiceMessage - 93, // 119: proto.Message.buttonsMessage:type_name -> proto.ButtonsMessage - 92, // 120: proto.Message.buttonsResponseMessage:type_name -> proto.ButtonsResponseMessage - 66, // 121: proto.Message.paymentInviteMessage:type_name -> proto.PaymentInviteMessage - 75, // 122: proto.Message.interactiveMessage:type_name -> proto.InteractiveMessage - 127, // 123: proto.Message.reactionMessage:type_name -> proto.ReactionMessage - 119, // 124: proto.Message.stickerSyncRmrMessage:type_name -> proto.StickerSyncRMRMessage - 74, // 125: proto.Message.interactiveResponseMessage:type_name -> proto.InteractiveResponseMessage - 134, // 126: proto.Message.pollCreationMessage:type_name -> proto.PollCreationMessage - 131, // 127: proto.Message.pollUpdateMessage:type_name -> proto.PollUpdateMessage - 72, // 128: proto.Message.keepInChatMessage:type_name -> proto.KeepInChatMessage - 81, // 129: proto.Message.documentWithCaptionMessage:type_name -> proto.FutureProofMessage - 125, // 130: proto.Message.requestPhoneNumberMessage:type_name -> proto.RequestPhoneNumberMessage - 81, // 131: proto.Message.viewOnceMessageV2:type_name -> proto.FutureProofMessage - 83, // 132: proto.Message.encReactionMessage:type_name -> proto.EncReactionMessage - 81, // 133: proto.Message.editedMessage:type_name -> proto.FutureProofMessage - 81, // 134: proto.Message.viewOnceMessageV2Extension:type_name -> proto.FutureProofMessage - 134, // 135: proto.Message.pollCreationMessageV2:type_name -> proto.PollCreationMessage - 124, // 136: proto.Message.scheduledCallCreationMessage:type_name -> proto.ScheduledCallCreationMessage - 81, // 137: proto.Message.groupMentionedMessage:type_name -> proto.FutureProofMessage - 135, // 138: proto.Message.pinInChatMessage:type_name -> proto.PinInChatMessage - 134, // 139: proto.Message.pollCreationMessageV3:type_name -> proto.PollCreationMessage - 123, // 140: proto.Message.scheduledCallEditMessage:type_name -> proto.ScheduledCallEditMessage - 116, // 141: proto.Message.ptvMessage:type_name -> proto.VideoMessage - 107, // 142: proto.MessageContextInfo.deviceListMetadata:type_name -> proto.DeviceListMetadata - 103, // 143: proto.VideoMessage.interactiveAnnotations:type_name -> proto.InteractiveAnnotation - 108, // 144: proto.VideoMessage.contextInfo:type_name -> proto.ContextInfo - 27, // 145: proto.VideoMessage.gifAttribution:type_name -> proto.VideoMessage.Attribution - 108, // 146: proto.TemplateMessage.contextInfo:type_name -> proto.ContextInfo - 271, // 147: proto.TemplateMessage.hydratedTemplate:type_name -> proto.TemplateMessage.HydratedFourRowTemplate - 272, // 148: proto.TemplateMessage.fourRowTemplate:type_name -> proto.TemplateMessage.FourRowTemplate - 271, // 149: proto.TemplateMessage.hydratedFourRowTemplate:type_name -> proto.TemplateMessage.HydratedFourRowTemplate - 75, // 150: proto.TemplateMessage.interactiveMessageTemplate:type_name -> proto.InteractiveMessage - 108, // 151: proto.TemplateButtonReplyMessage.contextInfo:type_name -> proto.ContextInfo - 108, // 152: proto.StickerMessage.contextInfo:type_name -> proto.ContextInfo - 114, // 153: proto.SendPaymentMessage.noteMessage:type_name -> proto.Message - 156, // 154: proto.SendPaymentMessage.requestMessageKey:type_name -> proto.MessageKey - 112, // 155: proto.SendPaymentMessage.background:type_name -> proto.PaymentBackground - 156, // 156: proto.ScheduledCallEditMessage.key:type_name -> proto.MessageKey - 28, // 157: proto.ScheduledCallEditMessage.editType:type_name -> proto.ScheduledCallEditMessage.EditType - 29, // 158: proto.ScheduledCallCreationMessage.callType:type_name -> proto.ScheduledCallCreationMessage.CallType - 108, // 159: proto.RequestPhoneNumberMessage.contextInfo:type_name -> proto.ContextInfo - 114, // 160: proto.RequestPaymentMessage.noteMessage:type_name -> proto.Message - 113, // 161: proto.RequestPaymentMessage.amount:type_name -> proto.Money - 112, // 162: proto.RequestPaymentMessage.background:type_name -> proto.PaymentBackground - 156, // 163: proto.ReactionMessage.key:type_name -> proto.MessageKey - 156, // 164: proto.ProtocolMessage.key:type_name -> proto.MessageKey - 30, // 165: proto.ProtocolMessage.type:type_name -> proto.ProtocolMessage.Type - 78, // 166: proto.ProtocolMessage.historySyncNotification:type_name -> proto.HistorySyncNotification - 96, // 167: proto.ProtocolMessage.appStateSyncKeyShare:type_name -> proto.AppStateSyncKeyShare - 97, // 168: proto.ProtocolMessage.appStateSyncKeyRequest:type_name -> proto.AppStateSyncKeyRequest - 76, // 169: proto.ProtocolMessage.initialSecurityNotificationSettingSync:type_name -> proto.InitialSecurityNotificationSettingSync - 101, // 170: proto.ProtocolMessage.appStateFatalExceptionNotification:type_name -> proto.AppStateFatalExceptionNotification - 106, // 171: proto.ProtocolMessage.disappearingMode:type_name -> proto.DisappearingMode - 114, // 172: proto.ProtocolMessage.editedMessage:type_name -> proto.Message - 137, // 173: proto.ProtocolMessage.peerDataOperationRequestMessage:type_name -> proto.PeerDataOperationRequestMessage - 136, // 174: proto.ProtocolMessage.peerDataOperationRequestResponseMessage:type_name -> proto.PeerDataOperationRequestResponseMessage - 273, // 175: proto.ProductMessage.product:type_name -> proto.ProductMessage.ProductSnapshot - 274, // 176: proto.ProductMessage.catalog:type_name -> proto.ProductMessage.CatalogSnapshot - 108, // 177: proto.ProductMessage.contextInfo:type_name -> proto.ContextInfo - 156, // 178: proto.PollUpdateMessage.pollCreationMessageKey:type_name -> proto.MessageKey - 133, // 179: proto.PollUpdateMessage.vote:type_name -> proto.PollEncValue - 132, // 180: proto.PollUpdateMessage.metadata:type_name -> proto.PollUpdateMessageMetadata - 275, // 181: proto.PollCreationMessage.options:type_name -> proto.PollCreationMessage.Option - 108, // 182: proto.PollCreationMessage.contextInfo:type_name -> proto.ContextInfo - 156, // 183: proto.PinInChatMessage.key:type_name -> proto.MessageKey - 31, // 184: proto.PinInChatMessage.type:type_name -> proto.PinInChatMessage.Type - 2, // 185: proto.PeerDataOperationRequestResponseMessage.peerDataOperationRequestType:type_name -> proto.PeerDataOperationRequestType - 276, // 186: proto.PeerDataOperationRequestResponseMessage.peerDataOperationResult:type_name -> proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult - 2, // 187: proto.PeerDataOperationRequestMessage.peerDataOperationRequestType:type_name -> proto.PeerDataOperationRequestType - 281, // 188: proto.PeerDataOperationRequestMessage.requestStickerReupload:type_name -> proto.PeerDataOperationRequestMessage.RequestStickerReupload - 280, // 189: proto.PeerDataOperationRequestMessage.requestUrlPreview:type_name -> proto.PeerDataOperationRequestMessage.RequestUrlPreview - 283, // 190: proto.PeerDataOperationRequestMessage.historySyncOnDemandRequest:type_name -> proto.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest - 282, // 191: proto.PeerDataOperationRequestMessage.placeholderMessageResendRequest:type_name -> proto.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest - 143, // 192: proto.PastParticipants.pastParticipants:type_name -> proto.PastParticipant - 32, // 193: proto.PastParticipant.leaveReason:type_name -> proto.PastParticipant.LeaveReason - 33, // 194: proto.HistorySync.syncType:type_name -> proto.HistorySync.HistorySyncType - 149, // 195: proto.HistorySync.conversations:type_name -> proto.Conversation - 219, // 196: proto.HistorySync.statusV3Messages:type_name -> proto.WebMessageInfo - 141, // 197: proto.HistorySync.pushnames:type_name -> proto.Pushname - 148, // 198: proto.HistorySync.globalSettings:type_name -> proto.GlobalSettings - 140, // 199: proto.HistorySync.recentStickers:type_name -> proto.StickerMetadata - 142, // 200: proto.HistorySync.pastParticipants:type_name -> proto.PastParticipants - 219, // 201: proto.HistorySyncMsg.message:type_name -> proto.WebMessageInfo - 34, // 202: proto.GroupParticipant.rank:type_name -> proto.GroupParticipant.Rank - 139, // 203: proto.GlobalSettings.lightThemeWallpaper:type_name -> proto.WallpaperSettings - 3, // 204: proto.GlobalSettings.mediaVisibility:type_name -> proto.MediaVisibility - 139, // 205: proto.GlobalSettings.darkThemeWallpaper:type_name -> proto.WallpaperSettings - 151, // 206: proto.GlobalSettings.autoDownloadWiFi:type_name -> proto.AutoDownloadSettings - 151, // 207: proto.GlobalSettings.autoDownloadCellular:type_name -> proto.AutoDownloadSettings - 151, // 208: proto.GlobalSettings.autoDownloadRoaming:type_name -> proto.AutoDownloadSettings - 150, // 209: proto.GlobalSettings.avatarUserSettings:type_name -> proto.AvatarUserSettings - 144, // 210: proto.GlobalSettings.individualNotificationSettings:type_name -> proto.NotificationSettings - 144, // 211: proto.GlobalSettings.groupNotificationSettings:type_name -> proto.NotificationSettings - 146, // 212: proto.Conversation.messages:type_name -> proto.HistorySyncMsg - 35, // 213: proto.Conversation.endOfHistoryTransferType:type_name -> proto.Conversation.EndOfHistoryTransferType - 106, // 214: proto.Conversation.disappearingMode:type_name -> proto.DisappearingMode - 147, // 215: proto.Conversation.participant:type_name -> proto.GroupParticipant - 139, // 216: proto.Conversation.wallpaper:type_name -> proto.WallpaperSettings - 3, // 217: proto.Conversation.mediaVisibility:type_name -> proto.MediaVisibility - 153, // 218: proto.MsgRowOpaqueData.currentMsg:type_name -> proto.MsgOpaqueData - 153, // 219: proto.MsgRowOpaqueData.quotedMsg:type_name -> proto.MsgOpaqueData - 284, // 220: proto.MsgOpaqueData.pollOptions:type_name -> proto.MsgOpaqueData.PollOption - 133, // 221: proto.MsgOpaqueData.encPollVote:type_name -> proto.PollEncValue - 36, // 222: proto.MediaRetryNotification.result:type_name -> proto.MediaRetryNotification.ResultType - 157, // 223: proto.SyncdSnapshot.version:type_name -> proto.SyncdVersion - 160, // 224: proto.SyncdSnapshot.records:type_name -> proto.SyncdRecord - 165, // 225: proto.SyncdSnapshot.keyId:type_name -> proto.KeyId - 164, // 226: proto.SyncdRecord.index:type_name -> proto.SyncdIndex - 158, // 227: proto.SyncdRecord.value:type_name -> proto.SyncdValue - 165, // 228: proto.SyncdRecord.keyId:type_name -> proto.KeyId - 157, // 229: proto.SyncdPatch.version:type_name -> proto.SyncdVersion - 163, // 230: proto.SyncdPatch.mutations:type_name -> proto.SyncdMutation - 166, // 231: proto.SyncdPatch.externalMutations:type_name -> proto.ExternalBlobReference - 165, // 232: proto.SyncdPatch.keyId:type_name -> proto.KeyId - 167, // 233: proto.SyncdPatch.exitCode:type_name -> proto.ExitCode - 163, // 234: proto.SyncdMutations.mutations:type_name -> proto.SyncdMutation - 37, // 235: proto.SyncdMutation.operation:type_name -> proto.SyncdMutation.SyncdOperation - 160, // 236: proto.SyncdMutation.record:type_name -> proto.SyncdRecord - 176, // 237: proto.SyncActionValue.starAction:type_name -> proto.StarAction - 199, // 238: proto.SyncActionValue.contactAction:type_name -> proto.ContactAction - 188, // 239: proto.SyncActionValue.muteAction:type_name -> proto.MuteAction - 186, // 240: proto.SyncActionValue.pinAction:type_name -> proto.PinAction - 177, // 241: proto.SyncActionValue.securityNotificationSetting:type_name -> proto.SecurityNotificationSetting - 181, // 242: proto.SyncActionValue.pushNameSetting:type_name -> proto.PushNameSetting - 180, // 243: proto.SyncActionValue.quickReplyAction:type_name -> proto.QuickReplyAction - 179, // 244: proto.SyncActionValue.recentEmojiWeightsAction:type_name -> proto.RecentEmojiWeightsAction - 193, // 245: proto.SyncActionValue.labelEditAction:type_name -> proto.LabelEditAction - 194, // 246: proto.SyncActionValue.labelAssociationAction:type_name -> proto.LabelAssociationAction - 192, // 247: proto.SyncActionValue.localeSetting:type_name -> proto.LocaleSetting - 203, // 248: proto.SyncActionValue.archiveChatAction:type_name -> proto.ArchiveChatAction - 197, // 249: proto.SyncActionValue.deleteMessageForMeAction:type_name -> proto.DeleteMessageForMeAction - 195, // 250: proto.SyncActionValue.keyExpiration:type_name -> proto.KeyExpiration - 191, // 251: proto.SyncActionValue.markChatAsReadAction:type_name -> proto.MarkChatAsReadAction - 200, // 252: proto.SyncActionValue.clearChatAction:type_name -> proto.ClearChatAction - 198, // 253: proto.SyncActionValue.deleteChatAction:type_name -> proto.DeleteChatAction - 170, // 254: proto.SyncActionValue.unarchiveChatsSetting:type_name -> proto.UnarchiveChatsSetting - 184, // 255: proto.SyncActionValue.primaryFeature:type_name -> proto.PrimaryFeature - 204, // 256: proto.SyncActionValue.androidUnsupportedActions:type_name -> proto.AndroidUnsupportedActions - 205, // 257: proto.SyncActionValue.agentAction:type_name -> proto.AgentAction - 174, // 258: proto.SyncActionValue.subscriptionAction:type_name -> proto.SubscriptionAction - 169, // 259: proto.SyncActionValue.userStatusMuteAction:type_name -> proto.UserStatusMuteAction - 171, // 260: proto.SyncActionValue.timeFormatAction:type_name -> proto.TimeFormatAction - 187, // 261: proto.SyncActionValue.nuxAction:type_name -> proto.NuxAction - 183, // 262: proto.SyncActionValue.primaryVersionAction:type_name -> proto.PrimaryVersionAction - 175, // 263: proto.SyncActionValue.stickerAction:type_name -> proto.StickerAction - 178, // 264: proto.SyncActionValue.removeRecentStickerAction:type_name -> proto.RemoveRecentStickerAction - 202, // 265: proto.SyncActionValue.chatAssignment:type_name -> proto.ChatAssignmentAction - 201, // 266: proto.SyncActionValue.chatAssignmentOpenedStatus:type_name -> proto.ChatAssignmentOpenedStatusAction - 185, // 267: proto.SyncActionValue.pnForLidChatAction:type_name -> proto.PnForLidChatAction - 190, // 268: proto.SyncActionValue.marketingMessageAction:type_name -> proto.MarketingMessageAction - 189, // 269: proto.SyncActionValue.marketingMessageBroadcastAction:type_name -> proto.MarketingMessageBroadcastAction - 196, // 270: proto.SyncActionValue.externalWebBetaAction:type_name -> proto.ExternalWebBetaAction - 182, // 271: proto.SyncActionValue.privacySettingRelayAllCalls:type_name -> proto.PrivacySettingRelayAllCalls - 156, // 272: proto.SyncActionMessage.key:type_name -> proto.MessageKey - 172, // 273: proto.SyncActionMessageRange.messages:type_name -> proto.SyncActionMessage - 207, // 274: proto.RecentEmojiWeightsAction.weights:type_name -> proto.RecentEmojiWeight - 38, // 275: proto.MarketingMessageAction.type:type_name -> proto.MarketingMessageAction.MarketingMessagePrototypeType - 173, // 276: proto.MarkChatAsReadAction.messageRange:type_name -> proto.SyncActionMessageRange - 173, // 277: proto.DeleteChatAction.messageRange:type_name -> proto.SyncActionMessageRange - 173, // 278: proto.ClearChatAction.messageRange:type_name -> proto.SyncActionMessageRange - 173, // 279: proto.ArchiveChatAction.messageRange:type_name -> proto.SyncActionMessageRange - 168, // 280: proto.SyncActionData.value:type_name -> proto.SyncActionValue - 39, // 281: proto.BizIdentityInfo.vlevel:type_name -> proto.BizIdentityInfo.VerifiedLevelValue - 208, // 282: proto.BizIdentityInfo.vnameCert:type_name -> proto.VerifiedNameCertificate - 40, // 283: proto.BizIdentityInfo.hostStorage:type_name -> proto.BizIdentityInfo.HostStorageType - 41, // 284: proto.BizIdentityInfo.actualActors:type_name -> proto.BizIdentityInfo.ActualActorsType - 208, // 285: proto.BizAccountPayload.vnameCert:type_name -> proto.VerifiedNameCertificate - 42, // 286: proto.BizAccountLinkInfo.hostStorage:type_name -> proto.BizAccountLinkInfo.HostStorageType - 43, // 287: proto.BizAccountLinkInfo.accountType:type_name -> proto.BizAccountLinkInfo.AccountType - 215, // 288: proto.HandshakeMessage.clientHello:type_name -> proto.HandshakeClientHello - 214, // 289: proto.HandshakeMessage.serverHello:type_name -> proto.HandshakeServerHello - 216, // 290: proto.HandshakeMessage.clientFinish:type_name -> proto.HandshakeClientFinish - 287, // 291: proto.ClientPayload.userAgent:type_name -> proto.ClientPayload.UserAgent - 286, // 292: proto.ClientPayload.webInfo:type_name -> proto.ClientPayload.WebInfo - 46, // 293: proto.ClientPayload.connectType:type_name -> proto.ClientPayload.ConnectType - 47, // 294: proto.ClientPayload.connectReason:type_name -> proto.ClientPayload.ConnectReason - 290, // 295: proto.ClientPayload.dnsSource:type_name -> proto.ClientPayload.DNSSource - 289, // 296: proto.ClientPayload.devicePairingData:type_name -> proto.ClientPayload.DevicePairingRegistrationData - 44, // 297: proto.ClientPayload.product:type_name -> proto.ClientPayload.Product - 45, // 298: proto.ClientPayload.iosAppExtension:type_name -> proto.ClientPayload.IOSAppExtension - 288, // 299: proto.ClientPayload.interopData:type_name -> proto.ClientPayload.InteropData - 219, // 300: proto.WebNotificationsInfo.notifyMessages:type_name -> proto.WebMessageInfo - 156, // 301: proto.WebMessageInfo.key:type_name -> proto.MessageKey - 114, // 302: proto.WebMessageInfo.message:type_name -> proto.Message - 53, // 303: proto.WebMessageInfo.status:type_name -> proto.WebMessageInfo.Status - 52, // 304: proto.WebMessageInfo.messageStubType:type_name -> proto.WebMessageInfo.StubType - 228, // 305: proto.WebMessageInfo.paymentInfo:type_name -> proto.PaymentInfo - 69, // 306: proto.WebMessageInfo.finalLiveLocation:type_name -> proto.LiveLocationMessage - 228, // 307: proto.WebMessageInfo.quotedPaymentInfo:type_name -> proto.PaymentInfo - 54, // 308: proto.WebMessageInfo.bizPrivacyStatus:type_name -> proto.WebMessageInfo.BizPrivacyStatus - 231, // 309: proto.WebMessageInfo.mediaData:type_name -> proto.MediaData - 227, // 310: proto.WebMessageInfo.photoChange:type_name -> proto.PhotoChange - 221, // 311: proto.WebMessageInfo.userReceipt:type_name -> proto.UserReceipt - 223, // 312: proto.WebMessageInfo.reactions:type_name -> proto.Reaction - 231, // 313: proto.WebMessageInfo.quotedStickerData:type_name -> proto.MediaData - 222, // 314: proto.WebMessageInfo.statusPsa:type_name -> proto.StatusPSA - 224, // 315: proto.WebMessageInfo.pollUpdates:type_name -> proto.PollUpdate - 225, // 316: proto.WebMessageInfo.pollAdditionalMetadata:type_name -> proto.PollAdditionalMetadata - 232, // 317: proto.WebMessageInfo.keepInChat:type_name -> proto.KeepInChat - 226, // 318: proto.WebMessageInfo.pinInChat:type_name -> proto.PinInChat - 55, // 319: proto.WebFeatures.labelsDisplay:type_name -> proto.WebFeatures.Flag - 55, // 320: proto.WebFeatures.voipIndividualOutgoing:type_name -> proto.WebFeatures.Flag - 55, // 321: proto.WebFeatures.groupsV3:type_name -> proto.WebFeatures.Flag - 55, // 322: proto.WebFeatures.groupsV3Create:type_name -> proto.WebFeatures.Flag - 55, // 323: proto.WebFeatures.changeNumberV2:type_name -> proto.WebFeatures.Flag - 55, // 324: proto.WebFeatures.queryStatusV3Thumbnail:type_name -> proto.WebFeatures.Flag - 55, // 325: proto.WebFeatures.liveLocations:type_name -> proto.WebFeatures.Flag - 55, // 326: proto.WebFeatures.queryVname:type_name -> proto.WebFeatures.Flag - 55, // 327: proto.WebFeatures.voipIndividualIncoming:type_name -> proto.WebFeatures.Flag - 55, // 328: proto.WebFeatures.quickRepliesQuery:type_name -> proto.WebFeatures.Flag - 55, // 329: proto.WebFeatures.payments:type_name -> proto.WebFeatures.Flag - 55, // 330: proto.WebFeatures.stickerPackQuery:type_name -> proto.WebFeatures.Flag - 55, // 331: proto.WebFeatures.liveLocationsFinal:type_name -> proto.WebFeatures.Flag - 55, // 332: proto.WebFeatures.labelsEdit:type_name -> proto.WebFeatures.Flag - 55, // 333: proto.WebFeatures.mediaUpload:type_name -> proto.WebFeatures.Flag - 55, // 334: proto.WebFeatures.mediaUploadRichQuickReplies:type_name -> proto.WebFeatures.Flag - 55, // 335: proto.WebFeatures.vnameV2:type_name -> proto.WebFeatures.Flag - 55, // 336: proto.WebFeatures.videoPlaybackUrl:type_name -> proto.WebFeatures.Flag - 55, // 337: proto.WebFeatures.statusRanking:type_name -> proto.WebFeatures.Flag - 55, // 338: proto.WebFeatures.voipIndividualVideo:type_name -> proto.WebFeatures.Flag - 55, // 339: proto.WebFeatures.thirdPartyStickers:type_name -> proto.WebFeatures.Flag - 55, // 340: proto.WebFeatures.frequentlyForwardedSetting:type_name -> proto.WebFeatures.Flag - 55, // 341: proto.WebFeatures.groupsV4JoinPermission:type_name -> proto.WebFeatures.Flag - 55, // 342: proto.WebFeatures.recentStickers:type_name -> proto.WebFeatures.Flag - 55, // 343: proto.WebFeatures.catalog:type_name -> proto.WebFeatures.Flag - 55, // 344: proto.WebFeatures.starredStickers:type_name -> proto.WebFeatures.Flag - 55, // 345: proto.WebFeatures.voipGroupCall:type_name -> proto.WebFeatures.Flag - 55, // 346: proto.WebFeatures.templateMessage:type_name -> proto.WebFeatures.Flag - 55, // 347: proto.WebFeatures.templateMessageInteractivity:type_name -> proto.WebFeatures.Flag - 55, // 348: proto.WebFeatures.ephemeralMessages:type_name -> proto.WebFeatures.Flag - 55, // 349: proto.WebFeatures.e2ENotificationSync:type_name -> proto.WebFeatures.Flag - 55, // 350: proto.WebFeatures.recentStickersV2:type_name -> proto.WebFeatures.Flag - 55, // 351: proto.WebFeatures.recentStickersV3:type_name -> proto.WebFeatures.Flag - 55, // 352: proto.WebFeatures.userNotice:type_name -> proto.WebFeatures.Flag - 55, // 353: proto.WebFeatures.support:type_name -> proto.WebFeatures.Flag - 55, // 354: proto.WebFeatures.groupUiiCleanup:type_name -> proto.WebFeatures.Flag - 55, // 355: proto.WebFeatures.groupDogfoodingInternalOnly:type_name -> proto.WebFeatures.Flag - 55, // 356: proto.WebFeatures.settingsSync:type_name -> proto.WebFeatures.Flag - 55, // 357: proto.WebFeatures.archiveV2:type_name -> proto.WebFeatures.Flag - 55, // 358: proto.WebFeatures.ephemeralAllowGroupMembers:type_name -> proto.WebFeatures.Flag - 55, // 359: proto.WebFeatures.ephemeral24HDuration:type_name -> proto.WebFeatures.Flag - 55, // 360: proto.WebFeatures.mdForceUpgrade:type_name -> proto.WebFeatures.Flag - 55, // 361: proto.WebFeatures.disappearingMode:type_name -> proto.WebFeatures.Flag - 55, // 362: proto.WebFeatures.externalMdOptInAvailable:type_name -> proto.WebFeatures.Flag - 55, // 363: proto.WebFeatures.noDeleteMessageTimeLimit:type_name -> proto.WebFeatures.Flag - 156, // 364: proto.Reaction.key:type_name -> proto.MessageKey - 156, // 365: proto.PollUpdate.pollUpdateMessageKey:type_name -> proto.MessageKey - 130, // 366: proto.PollUpdate.vote:type_name -> proto.PollVoteMessage - 56, // 367: proto.PinInChat.type:type_name -> proto.PinInChat.Type - 156, // 368: proto.PinInChat.key:type_name -> proto.MessageKey - 230, // 369: proto.PinInChat.messageAddOnContextInfo:type_name -> proto.MessageAddOnContextInfo - 59, // 370: proto.PaymentInfo.currencyDeprecated:type_name -> proto.PaymentInfo.Currency - 58, // 371: proto.PaymentInfo.status:type_name -> proto.PaymentInfo.Status - 156, // 372: proto.PaymentInfo.requestMessageKey:type_name -> proto.MessageKey - 57, // 373: proto.PaymentInfo.txnStatus:type_name -> proto.PaymentInfo.TxnStatus - 113, // 374: proto.PaymentInfo.primaryAmount:type_name -> proto.Money - 113, // 375: proto.PaymentInfo.exchangeAmount:type_name -> proto.Money - 156, // 376: proto.NotificationMessageInfo.key:type_name -> proto.MessageKey - 114, // 377: proto.NotificationMessageInfo.message:type_name -> proto.Message - 1, // 378: proto.KeepInChat.keepType:type_name -> proto.KeepType - 156, // 379: proto.KeepInChat.key:type_name -> proto.MessageKey - 294, // 380: proto.CertChain.leaf:type_name -> proto.CertChain.NoiseCertificate - 294, // 381: proto.CertChain.intermediate:type_name -> proto.CertChain.NoiseCertificate - 239, // 382: proto.ListMessage.Section.rows:type_name -> proto.ListMessage.Row - 240, // 383: proto.ListMessage.ProductSection.products:type_name -> proto.ListMessage.Product - 241, // 384: proto.ListMessage.ProductListInfo.productSections:type_name -> proto.ListMessage.ProductSection - 243, // 385: proto.ListMessage.ProductListInfo.headerImage:type_name -> proto.ListMessage.ProductListHeaderImage - 11, // 386: proto.InteractiveResponseMessage.Body.format:type_name -> proto.InteractiveResponseMessage.Body.Format - 12, // 387: proto.InteractiveMessage.ShopMessage.surface:type_name -> proto.InteractiveMessage.ShopMessage.Surface - 252, // 388: proto.InteractiveMessage.NativeFlowMessage.buttons:type_name -> proto.InteractiveMessage.NativeFlowMessage.NativeFlowButton - 84, // 389: proto.InteractiveMessage.Header.documentMessage:type_name -> proto.DocumentMessage - 77, // 390: proto.InteractiveMessage.Header.imageMessage:type_name -> proto.ImageMessage - 116, // 391: proto.InteractiveMessage.Header.videoMessage:type_name -> proto.VideoMessage - 68, // 392: proto.InteractiveMessage.Header.locationMessage:type_name -> proto.LocationMessage - 255, // 393: proto.HighlyStructuredMessage.HSMLocalizableParameter.currency:type_name -> proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency - 254, // 394: proto.HighlyStructuredMessage.HSMLocalizableParameter.dateTime:type_name -> proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime - 257, // 395: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.component:type_name -> proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent - 256, // 396: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.unixEpoch:type_name -> proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch - 14, // 397: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.dayOfWeek:type_name -> proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.DayOfWeekType - 15, // 398: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.calendar:type_name -> proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.CalendarType - 260, // 399: proto.ButtonsMessage.Button.buttonText:type_name -> proto.ButtonsMessage.Button.ButtonText - 22, // 400: proto.ButtonsMessage.Button.type:type_name -> proto.ButtonsMessage.Button.Type - 259, // 401: proto.ButtonsMessage.Button.nativeFlowInfo:type_name -> proto.ButtonsMessage.Button.NativeFlowInfo - 24, // 402: proto.ContextInfo.ExternalAdReplyInfo.mediaType:type_name -> proto.ContextInfo.ExternalAdReplyInfo.MediaType - 25, // 403: proto.ContextInfo.AdReplyInfo.mediaType:type_name -> proto.ContextInfo.AdReplyInfo.MediaType - 79, // 404: proto.TemplateButton.URLButton.displayText:type_name -> proto.HighlyStructuredMessage - 79, // 405: proto.TemplateButton.URLButton.url:type_name -> proto.HighlyStructuredMessage - 79, // 406: proto.TemplateButton.QuickReplyButton.displayText:type_name -> proto.HighlyStructuredMessage - 79, // 407: proto.TemplateButton.CallButton.displayText:type_name -> proto.HighlyStructuredMessage - 79, // 408: proto.TemplateButton.CallButton.phoneNumber:type_name -> proto.HighlyStructuredMessage - 104, // 409: proto.TemplateMessage.HydratedFourRowTemplate.hydratedButtons:type_name -> proto.HydratedTemplateButton - 84, // 410: proto.TemplateMessage.HydratedFourRowTemplate.documentMessage:type_name -> proto.DocumentMessage - 77, // 411: proto.TemplateMessage.HydratedFourRowTemplate.imageMessage:type_name -> proto.ImageMessage - 116, // 412: proto.TemplateMessage.HydratedFourRowTemplate.videoMessage:type_name -> proto.VideoMessage - 68, // 413: proto.TemplateMessage.HydratedFourRowTemplate.locationMessage:type_name -> proto.LocationMessage - 79, // 414: proto.TemplateMessage.FourRowTemplate.content:type_name -> proto.HighlyStructuredMessage - 79, // 415: proto.TemplateMessage.FourRowTemplate.footer:type_name -> proto.HighlyStructuredMessage - 110, // 416: proto.TemplateMessage.FourRowTemplate.buttons:type_name -> proto.TemplateButton - 84, // 417: proto.TemplateMessage.FourRowTemplate.documentMessage:type_name -> proto.DocumentMessage - 79, // 418: proto.TemplateMessage.FourRowTemplate.highlyStructuredMessage:type_name -> proto.HighlyStructuredMessage - 77, // 419: proto.TemplateMessage.FourRowTemplate.imageMessage:type_name -> proto.ImageMessage - 116, // 420: proto.TemplateMessage.FourRowTemplate.videoMessage:type_name -> proto.VideoMessage - 68, // 421: proto.TemplateMessage.FourRowTemplate.locationMessage:type_name -> proto.LocationMessage - 77, // 422: proto.ProductMessage.ProductSnapshot.productImage:type_name -> proto.ImageMessage - 77, // 423: proto.ProductMessage.CatalogSnapshot.catalogImage:type_name -> proto.ImageMessage - 36, // 424: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.mediaUploadResult:type_name -> proto.MediaRetryNotification.ResultType - 120, // 425: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.stickerMessage:type_name -> proto.StickerMessage - 278, // 426: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.linkPreviewResponse:type_name -> proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse - 277, // 427: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.placeholderMessageResendResponse:type_name -> proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse - 279, // 428: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.hqThumbnail:type_name -> proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail - 156, // 429: proto.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest.messageKey:type_name -> proto.MessageKey - 209, // 430: proto.VerifiedNameCertificate.Details.localizedNames:type_name -> proto.LocalizedName - 291, // 431: proto.ClientPayload.WebInfo.webdPayload:type_name -> proto.ClientPayload.WebInfo.WebdPayload - 48, // 432: proto.ClientPayload.WebInfo.webSubPlatform:type_name -> proto.ClientPayload.WebInfo.WebSubPlatform - 50, // 433: proto.ClientPayload.UserAgent.platform:type_name -> proto.ClientPayload.UserAgent.Platform - 292, // 434: proto.ClientPayload.UserAgent.appVersion:type_name -> proto.ClientPayload.UserAgent.AppVersion - 49, // 435: proto.ClientPayload.UserAgent.releaseChannel:type_name -> proto.ClientPayload.UserAgent.ReleaseChannel - 51, // 436: proto.ClientPayload.DNSSource.dnsMethod:type_name -> proto.ClientPayload.DNSSource.DNSResolutionMethod - 437, // [437:437] is the sub-list for method output_type - 437, // [437:437] is the sub-list for method input_type - 437, // [437:437] is the sub-list for extension type_name - 437, // [437:437] is the sub-list for extension extendee - 0, // [0:437] is the sub-list for field type_name + 242, // 5: proto.DeviceProps.historySyncConfig:type_name -> proto.DeviceProps.HistorySyncConfig + 6, // 6: proto.OrderMessage.status:type_name -> proto.OrderMessage.OrderStatus + 5, // 7: proto.OrderMessage.surface:type_name -> proto.OrderMessage.OrderSurface + 110, // 8: proto.OrderMessage.contextInfo:type_name -> proto.ContextInfo + 110, // 9: proto.LocationMessage.contextInfo:type_name -> proto.ContextInfo + 110, // 10: proto.LiveLocationMessage.contextInfo:type_name -> proto.ContextInfo + 7, // 11: proto.ListResponseMessage.listType:type_name -> proto.ListResponseMessage.ListType + 244, // 12: proto.ListResponseMessage.singleSelectReply:type_name -> proto.ListResponseMessage.SingleSelectReply + 110, // 13: proto.ListResponseMessage.contextInfo:type_name -> proto.ContextInfo + 8, // 14: proto.ListMessage.listType:type_name -> proto.ListMessage.ListType + 245, // 15: proto.ListMessage.sections:type_name -> proto.ListMessage.Section + 249, // 16: proto.ListMessage.productListInfo:type_name -> proto.ListMessage.ProductListInfo + 110, // 17: proto.ListMessage.contextInfo:type_name -> proto.ContextInfo + 160, // 18: proto.KeepInChatMessage.key:type_name -> proto.MessageKey + 1, // 19: proto.KeepInChatMessage.keepType:type_name -> proto.KeepType + 9, // 20: proto.InvoiceMessage.attachmentType:type_name -> proto.InvoiceMessage.AttachmentType + 252, // 21: proto.InteractiveResponseMessage.body:type_name -> proto.InteractiveResponseMessage.Body + 110, // 22: proto.InteractiveResponseMessage.contextInfo:type_name -> proto.ContextInfo + 251, // 23: proto.InteractiveResponseMessage.nativeFlowResponseMessage:type_name -> proto.InteractiveResponseMessage.NativeFlowResponseMessage + 255, // 24: proto.InteractiveMessage.header:type_name -> proto.InteractiveMessage.Header + 259, // 25: proto.InteractiveMessage.body:type_name -> proto.InteractiveMessage.Body + 256, // 26: proto.InteractiveMessage.footer:type_name -> proto.InteractiveMessage.Footer + 110, // 27: proto.InteractiveMessage.contextInfo:type_name -> proto.ContextInfo + 253, // 28: proto.InteractiveMessage.shopStorefrontMessage:type_name -> proto.InteractiveMessage.ShopMessage + 257, // 29: proto.InteractiveMessage.collectionMessage:type_name -> proto.InteractiveMessage.CollectionMessage + 254, // 30: proto.InteractiveMessage.nativeFlowMessage:type_name -> proto.InteractiveMessage.NativeFlowMessage + 258, // 31: proto.InteractiveMessage.carouselMessage:type_name -> proto.InteractiveMessage.CarouselMessage + 105, // 32: proto.ImageMessage.interactiveAnnotations:type_name -> proto.InteractiveAnnotation + 110, // 33: proto.ImageMessage.contextInfo:type_name -> proto.ContextInfo + 12, // 34: proto.HistorySyncNotification.syncType:type_name -> proto.HistorySyncNotification.HistorySyncType + 261, // 35: proto.HighlyStructuredMessage.localizableParams:type_name -> proto.HighlyStructuredMessage.HSMLocalizableParameter + 122, // 36: proto.HighlyStructuredMessage.hydratedHsm:type_name -> proto.TemplateMessage + 110, // 37: proto.GroupInviteMessage.contextInfo:type_name -> proto.ContextInfo + 15, // 38: proto.GroupInviteMessage.groupType:type_name -> proto.GroupInviteMessage.GroupType + 118, // 39: proto.FutureProofMessage.message:type_name -> proto.Message + 18, // 40: proto.ExtendedTextMessage.font:type_name -> proto.ExtendedTextMessage.FontType + 16, // 41: proto.ExtendedTextMessage.previewType:type_name -> proto.ExtendedTextMessage.PreviewType + 110, // 42: proto.ExtendedTextMessage.contextInfo:type_name -> proto.ContextInfo + 17, // 43: proto.ExtendedTextMessage.inviteLinkGroupType:type_name -> proto.ExtendedTextMessage.InviteLinkGroupType + 17, // 44: proto.ExtendedTextMessage.inviteLinkGroupTypeV2:type_name -> proto.ExtendedTextMessage.InviteLinkGroupType + 160, // 45: proto.EncReactionMessage.targetMessageKey:type_name -> proto.MessageKey + 110, // 46: proto.DocumentMessage.contextInfo:type_name -> proto.ContextInfo + 118, // 47: proto.DeviceSentMessage.message:type_name -> proto.Message + 160, // 48: proto.DeclinePaymentRequestMessage.key:type_name -> proto.MessageKey + 89, // 49: proto.ContactsArrayMessage.contacts:type_name -> proto.ContactMessage + 110, // 50: proto.ContactsArrayMessage.contextInfo:type_name -> proto.ContextInfo + 110, // 51: proto.ContactMessage.contextInfo:type_name -> proto.ContextInfo + 160, // 52: proto.CancelPaymentRequestMessage.key:type_name -> proto.MessageKey + 110, // 53: proto.ButtonsResponseMessage.contextInfo:type_name -> proto.ContextInfo + 19, // 54: proto.ButtonsResponseMessage.type:type_name -> proto.ButtonsResponseMessage.Type + 110, // 55: proto.ButtonsMessage.contextInfo:type_name -> proto.ContextInfo + 266, // 56: proto.ButtonsMessage.buttons:type_name -> proto.ButtonsMessage.Button + 20, // 57: proto.ButtonsMessage.headerType:type_name -> proto.ButtonsMessage.HeaderType + 85, // 58: proto.ButtonsMessage.documentMessage:type_name -> proto.DocumentMessage + 78, // 59: proto.ButtonsMessage.imageMessage:type_name -> proto.ImageMessage + 121, // 60: proto.ButtonsMessage.videoMessage:type_name -> proto.VideoMessage + 69, // 61: proto.ButtonsMessage.locationMessage:type_name -> proto.LocationMessage + 160, // 62: proto.BotFeedbackMessage.messageKey:type_name -> proto.MessageKey + 22, // 63: proto.BotFeedbackMessage.kind:type_name -> proto.BotFeedbackMessage.BotFeedbackKind + 110, // 64: proto.AudioMessage.contextInfo:type_name -> proto.ContextInfo + 100, // 65: proto.AppStateSyncKey.keyId:type_name -> proto.AppStateSyncKeyId + 102, // 66: proto.AppStateSyncKey.keyData:type_name -> proto.AppStateSyncKeyData + 97, // 67: proto.AppStateSyncKeyShare.keys:type_name -> proto.AppStateSyncKey + 100, // 68: proto.AppStateSyncKeyRequest.keyIds:type_name -> proto.AppStateSyncKeyId + 101, // 69: proto.AppStateSyncKeyData.fingerprint:type_name -> proto.AppStateSyncKeyFingerprint + 115, // 70: proto.InteractiveAnnotation.polygonVertices:type_name -> proto.Point + 104, // 71: proto.InteractiveAnnotation.location:type_name -> proto.Location + 270, // 72: proto.HydratedTemplateButton.quickReplyButton:type_name -> proto.HydratedTemplateButton.HydratedQuickReplyButton + 269, // 73: proto.HydratedTemplateButton.urlButton:type_name -> proto.HydratedTemplateButton.HydratedURLButton + 271, // 74: proto.HydratedTemplateButton.callButton:type_name -> proto.HydratedTemplateButton.HydratedCallButton + 23, // 75: proto.DisappearingMode.initiator:type_name -> proto.DisappearingMode.Initiator + 118, // 76: proto.ContextInfo.quotedMessage:type_name -> proto.Message + 274, // 77: proto.ContextInfo.quotedAd:type_name -> proto.ContextInfo.AdReplyInfo + 160, // 78: proto.ContextInfo.placeholderKey:type_name -> proto.MessageKey + 273, // 79: proto.ContextInfo.externalAdReply:type_name -> proto.ContextInfo.ExternalAdReplyInfo + 108, // 80: proto.ContextInfo.disappearingMode:type_name -> proto.DisappearingMode + 113, // 81: proto.ContextInfo.actionLink:type_name -> proto.ActionLink + 107, // 82: proto.ContextInfo.groupMentions:type_name -> proto.GroupMention + 272, // 83: proto.ContextInfo.utm:type_name -> proto.ContextInfo.UTMInfo + 112, // 84: proto.BotMetadata.avatarMetadata:type_name -> proto.BotAvatarMetadata + 275, // 85: proto.BotAvatarMetadata.dynamicVideoList:type_name -> proto.BotAvatarMetadata.PlaybackMetadata + 277, // 86: proto.TemplateButton.quickReplyButton:type_name -> proto.TemplateButton.QuickReplyButton + 276, // 87: proto.TemplateButton.urlButton:type_name -> proto.TemplateButton.URLButton + 278, // 88: proto.TemplateButton.callButton:type_name -> proto.TemplateButton.CallButton + 279, // 89: proto.PaymentBackground.mediaData:type_name -> proto.PaymentBackground.MediaData + 26, // 90: proto.PaymentBackground.type:type_name -> proto.PaymentBackground.Type + 126, // 91: proto.Message.senderKeyDistributionMessage:type_name -> proto.SenderKeyDistributionMessage + 78, // 92: proto.Message.imageMessage:type_name -> proto.ImageMessage + 89, // 93: proto.Message.contactMessage:type_name -> proto.ContactMessage + 69, // 94: proto.Message.locationMessage:type_name -> proto.LocationMessage + 83, // 95: proto.Message.extendedTextMessage:type_name -> proto.ExtendedTextMessage + 85, // 96: proto.Message.documentMessage:type_name -> proto.DocumentMessage + 96, // 97: proto.Message.audioMessage:type_name -> proto.AudioMessage + 121, // 98: proto.Message.videoMessage:type_name -> proto.VideoMessage + 92, // 99: proto.Message.call:type_name -> proto.Call + 90, // 100: proto.Message.chat:type_name -> proto.Chat + 133, // 101: proto.Message.protocolMessage:type_name -> proto.ProtocolMessage + 88, // 102: proto.Message.contactsArrayMessage:type_name -> proto.ContactsArrayMessage + 80, // 103: proto.Message.highlyStructuredMessage:type_name -> proto.HighlyStructuredMessage + 126, // 104: proto.Message.fastRatchetKeySenderKeyDistributionMessage:type_name -> proto.SenderKeyDistributionMessage + 127, // 105: proto.Message.sendPaymentMessage:type_name -> proto.SendPaymentMessage + 70, // 106: proto.Message.liveLocationMessage:type_name -> proto.LiveLocationMessage + 131, // 107: proto.Message.requestPaymentMessage:type_name -> proto.RequestPaymentMessage + 87, // 108: proto.Message.declinePaymentRequestMessage:type_name -> proto.DeclinePaymentRequestMessage + 91, // 109: proto.Message.cancelPaymentRequestMessage:type_name -> proto.CancelPaymentRequestMessage + 122, // 110: proto.Message.templateMessage:type_name -> proto.TemplateMessage + 125, // 111: proto.Message.stickerMessage:type_name -> proto.StickerMessage + 81, // 112: proto.Message.groupInviteMessage:type_name -> proto.GroupInviteMessage + 123, // 113: proto.Message.templateButtonReplyMessage:type_name -> proto.TemplateButtonReplyMessage + 134, // 114: proto.Message.productMessage:type_name -> proto.ProductMessage + 86, // 115: proto.Message.deviceSentMessage:type_name -> proto.DeviceSentMessage + 120, // 116: proto.Message.messageContextInfo:type_name -> proto.MessageContextInfo + 72, // 117: proto.Message.listMessage:type_name -> proto.ListMessage + 82, // 118: proto.Message.viewOnceMessage:type_name -> proto.FutureProofMessage + 68, // 119: proto.Message.orderMessage:type_name -> proto.OrderMessage + 71, // 120: proto.Message.listResponseMessage:type_name -> proto.ListResponseMessage + 82, // 121: proto.Message.ephemeralMessage:type_name -> proto.FutureProofMessage + 74, // 122: proto.Message.invoiceMessage:type_name -> proto.InvoiceMessage + 94, // 123: proto.Message.buttonsMessage:type_name -> proto.ButtonsMessage + 93, // 124: proto.Message.buttonsResponseMessage:type_name -> proto.ButtonsResponseMessage + 143, // 125: proto.Message.paymentInviteMessage:type_name -> proto.PaymentInviteMessage + 76, // 126: proto.Message.interactiveMessage:type_name -> proto.InteractiveMessage + 132, // 127: proto.Message.reactionMessage:type_name -> proto.ReactionMessage + 124, // 128: proto.Message.stickerSyncRmrMessage:type_name -> proto.StickerSyncRMRMessage + 75, // 129: proto.Message.interactiveResponseMessage:type_name -> proto.InteractiveResponseMessage + 139, // 130: proto.Message.pollCreationMessage:type_name -> proto.PollCreationMessage + 136, // 131: proto.Message.pollUpdateMessage:type_name -> proto.PollUpdateMessage + 73, // 132: proto.Message.keepInChatMessage:type_name -> proto.KeepInChatMessage + 82, // 133: proto.Message.documentWithCaptionMessage:type_name -> proto.FutureProofMessage + 130, // 134: proto.Message.requestPhoneNumberMessage:type_name -> proto.RequestPhoneNumberMessage + 82, // 135: proto.Message.viewOnceMessageV2:type_name -> proto.FutureProofMessage + 84, // 136: proto.Message.encReactionMessage:type_name -> proto.EncReactionMessage + 82, // 137: proto.Message.editedMessage:type_name -> proto.FutureProofMessage + 82, // 138: proto.Message.viewOnceMessageV2Extension:type_name -> proto.FutureProofMessage + 139, // 139: proto.Message.pollCreationMessageV2:type_name -> proto.PollCreationMessage + 129, // 140: proto.Message.scheduledCallCreationMessage:type_name -> proto.ScheduledCallCreationMessage + 82, // 141: proto.Message.groupMentionedMessage:type_name -> proto.FutureProofMessage + 140, // 142: proto.Message.pinInChatMessage:type_name -> proto.PinInChatMessage + 139, // 143: proto.Message.pollCreationMessageV3:type_name -> proto.PollCreationMessage + 128, // 144: proto.Message.scheduledCallEditMessage:type_name -> proto.ScheduledCallEditMessage + 121, // 145: proto.Message.ptvMessage:type_name -> proto.VideoMessage + 82, // 146: proto.Message.botInvokeMessage:type_name -> proto.FutureProofMessage + 109, // 147: proto.MessageContextInfo.deviceListMetadata:type_name -> proto.DeviceListMetadata + 111, // 148: proto.MessageContextInfo.botMetadata:type_name -> proto.BotMetadata + 105, // 149: proto.VideoMessage.interactiveAnnotations:type_name -> proto.InteractiveAnnotation + 110, // 150: proto.VideoMessage.contextInfo:type_name -> proto.ContextInfo + 27, // 151: proto.VideoMessage.gifAttribution:type_name -> proto.VideoMessage.Attribution + 110, // 152: proto.TemplateMessage.contextInfo:type_name -> proto.ContextInfo + 280, // 153: proto.TemplateMessage.hydratedTemplate:type_name -> proto.TemplateMessage.HydratedFourRowTemplate + 281, // 154: proto.TemplateMessage.fourRowTemplate:type_name -> proto.TemplateMessage.FourRowTemplate + 280, // 155: proto.TemplateMessage.hydratedFourRowTemplate:type_name -> proto.TemplateMessage.HydratedFourRowTemplate + 76, // 156: proto.TemplateMessage.interactiveMessageTemplate:type_name -> proto.InteractiveMessage + 110, // 157: proto.TemplateButtonReplyMessage.contextInfo:type_name -> proto.ContextInfo + 110, // 158: proto.StickerMessage.contextInfo:type_name -> proto.ContextInfo + 118, // 159: proto.SendPaymentMessage.noteMessage:type_name -> proto.Message + 160, // 160: proto.SendPaymentMessage.requestMessageKey:type_name -> proto.MessageKey + 116, // 161: proto.SendPaymentMessage.background:type_name -> proto.PaymentBackground + 160, // 162: proto.ScheduledCallEditMessage.key:type_name -> proto.MessageKey + 28, // 163: proto.ScheduledCallEditMessage.editType:type_name -> proto.ScheduledCallEditMessage.EditType + 29, // 164: proto.ScheduledCallCreationMessage.callType:type_name -> proto.ScheduledCallCreationMessage.CallType + 110, // 165: proto.RequestPhoneNumberMessage.contextInfo:type_name -> proto.ContextInfo + 118, // 166: proto.RequestPaymentMessage.noteMessage:type_name -> proto.Message + 117, // 167: proto.RequestPaymentMessage.amount:type_name -> proto.Money + 116, // 168: proto.RequestPaymentMessage.background:type_name -> proto.PaymentBackground + 160, // 169: proto.ReactionMessage.key:type_name -> proto.MessageKey + 160, // 170: proto.ProtocolMessage.key:type_name -> proto.MessageKey + 30, // 171: proto.ProtocolMessage.type:type_name -> proto.ProtocolMessage.Type + 79, // 172: proto.ProtocolMessage.historySyncNotification:type_name -> proto.HistorySyncNotification + 98, // 173: proto.ProtocolMessage.appStateSyncKeyShare:type_name -> proto.AppStateSyncKeyShare + 99, // 174: proto.ProtocolMessage.appStateSyncKeyRequest:type_name -> proto.AppStateSyncKeyRequest + 77, // 175: proto.ProtocolMessage.initialSecurityNotificationSettingSync:type_name -> proto.InitialSecurityNotificationSettingSync + 103, // 176: proto.ProtocolMessage.appStateFatalExceptionNotification:type_name -> proto.AppStateFatalExceptionNotification + 108, // 177: proto.ProtocolMessage.disappearingMode:type_name -> proto.DisappearingMode + 118, // 178: proto.ProtocolMessage.editedMessage:type_name -> proto.Message + 142, // 179: proto.ProtocolMessage.peerDataOperationRequestMessage:type_name -> proto.PeerDataOperationRequestMessage + 141, // 180: proto.ProtocolMessage.peerDataOperationRequestResponseMessage:type_name -> proto.PeerDataOperationRequestResponseMessage + 95, // 181: proto.ProtocolMessage.botFeedbackMessage:type_name -> proto.BotFeedbackMessage + 282, // 182: proto.ProductMessage.product:type_name -> proto.ProductMessage.ProductSnapshot + 283, // 183: proto.ProductMessage.catalog:type_name -> proto.ProductMessage.CatalogSnapshot + 110, // 184: proto.ProductMessage.contextInfo:type_name -> proto.ContextInfo + 160, // 185: proto.PollUpdateMessage.pollCreationMessageKey:type_name -> proto.MessageKey + 138, // 186: proto.PollUpdateMessage.vote:type_name -> proto.PollEncValue + 137, // 187: proto.PollUpdateMessage.metadata:type_name -> proto.PollUpdateMessageMetadata + 284, // 188: proto.PollCreationMessage.options:type_name -> proto.PollCreationMessage.Option + 110, // 189: proto.PollCreationMessage.contextInfo:type_name -> proto.ContextInfo + 160, // 190: proto.PinInChatMessage.key:type_name -> proto.MessageKey + 31, // 191: proto.PinInChatMessage.type:type_name -> proto.PinInChatMessage.Type + 2, // 192: proto.PeerDataOperationRequestResponseMessage.peerDataOperationRequestType:type_name -> proto.PeerDataOperationRequestType + 285, // 193: proto.PeerDataOperationRequestResponseMessage.peerDataOperationResult:type_name -> proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult + 2, // 194: proto.PeerDataOperationRequestMessage.peerDataOperationRequestType:type_name -> proto.PeerDataOperationRequestType + 290, // 195: proto.PeerDataOperationRequestMessage.requestStickerReupload:type_name -> proto.PeerDataOperationRequestMessage.RequestStickerReupload + 289, // 196: proto.PeerDataOperationRequestMessage.requestUrlPreview:type_name -> proto.PeerDataOperationRequestMessage.RequestUrlPreview + 292, // 197: proto.PeerDataOperationRequestMessage.historySyncOnDemandRequest:type_name -> proto.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest + 291, // 198: proto.PeerDataOperationRequestMessage.placeholderMessageResendRequest:type_name -> proto.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest + 32, // 199: proto.PaymentInviteMessage.serviceType:type_name -> proto.PaymentInviteMessage.ServiceType + 149, // 200: proto.PastParticipants.pastParticipants:type_name -> proto.PastParticipant + 33, // 201: proto.PastParticipant.leaveReason:type_name -> proto.PastParticipant.LeaveReason + 34, // 202: proto.HistorySync.syncType:type_name -> proto.HistorySync.HistorySyncType + 155, // 203: proto.HistorySync.conversations:type_name -> proto.Conversation + 223, // 204: proto.HistorySync.statusV3Messages:type_name -> proto.WebMessageInfo + 147, // 205: proto.HistorySync.pushnames:type_name -> proto.Pushname + 154, // 206: proto.HistorySync.globalSettings:type_name -> proto.GlobalSettings + 146, // 207: proto.HistorySync.recentStickers:type_name -> proto.StickerMetadata + 148, // 208: proto.HistorySync.pastParticipants:type_name -> proto.PastParticipants + 223, // 209: proto.HistorySyncMsg.message:type_name -> proto.WebMessageInfo + 35, // 210: proto.GroupParticipant.rank:type_name -> proto.GroupParticipant.Rank + 145, // 211: proto.GlobalSettings.lightThemeWallpaper:type_name -> proto.WallpaperSettings + 3, // 212: proto.GlobalSettings.mediaVisibility:type_name -> proto.MediaVisibility + 145, // 213: proto.GlobalSettings.darkThemeWallpaper:type_name -> proto.WallpaperSettings + 157, // 214: proto.GlobalSettings.autoDownloadWiFi:type_name -> proto.AutoDownloadSettings + 157, // 215: proto.GlobalSettings.autoDownloadCellular:type_name -> proto.AutoDownloadSettings + 157, // 216: proto.GlobalSettings.autoDownloadRoaming:type_name -> proto.AutoDownloadSettings + 156, // 217: proto.GlobalSettings.avatarUserSettings:type_name -> proto.AvatarUserSettings + 150, // 218: proto.GlobalSettings.individualNotificationSettings:type_name -> proto.NotificationSettings + 150, // 219: proto.GlobalSettings.groupNotificationSettings:type_name -> proto.NotificationSettings + 152, // 220: proto.Conversation.messages:type_name -> proto.HistorySyncMsg + 36, // 221: proto.Conversation.endOfHistoryTransferType:type_name -> proto.Conversation.EndOfHistoryTransferType + 108, // 222: proto.Conversation.disappearingMode:type_name -> proto.DisappearingMode + 153, // 223: proto.Conversation.participant:type_name -> proto.GroupParticipant + 145, // 224: proto.Conversation.wallpaper:type_name -> proto.WallpaperSettings + 3, // 225: proto.Conversation.mediaVisibility:type_name -> proto.MediaVisibility + 37, // 226: proto.MediaRetryNotification.result:type_name -> proto.MediaRetryNotification.ResultType + 161, // 227: proto.SyncdSnapshot.version:type_name -> proto.SyncdVersion + 164, // 228: proto.SyncdSnapshot.records:type_name -> proto.SyncdRecord + 169, // 229: proto.SyncdSnapshot.keyId:type_name -> proto.KeyId + 168, // 230: proto.SyncdRecord.index:type_name -> proto.SyncdIndex + 162, // 231: proto.SyncdRecord.value:type_name -> proto.SyncdValue + 169, // 232: proto.SyncdRecord.keyId:type_name -> proto.KeyId + 161, // 233: proto.SyncdPatch.version:type_name -> proto.SyncdVersion + 167, // 234: proto.SyncdPatch.mutations:type_name -> proto.SyncdMutation + 170, // 235: proto.SyncdPatch.externalMutations:type_name -> proto.ExternalBlobReference + 169, // 236: proto.SyncdPatch.keyId:type_name -> proto.KeyId + 171, // 237: proto.SyncdPatch.exitCode:type_name -> proto.ExitCode + 167, // 238: proto.SyncdMutations.mutations:type_name -> proto.SyncdMutation + 38, // 239: proto.SyncdMutation.operation:type_name -> proto.SyncdMutation.SyncdOperation + 164, // 240: proto.SyncdMutation.record:type_name -> proto.SyncdRecord + 180, // 241: proto.SyncActionValue.starAction:type_name -> proto.StarAction + 203, // 242: proto.SyncActionValue.contactAction:type_name -> proto.ContactAction + 192, // 243: proto.SyncActionValue.muteAction:type_name -> proto.MuteAction + 190, // 244: proto.SyncActionValue.pinAction:type_name -> proto.PinAction + 181, // 245: proto.SyncActionValue.securityNotificationSetting:type_name -> proto.SecurityNotificationSetting + 185, // 246: proto.SyncActionValue.pushNameSetting:type_name -> proto.PushNameSetting + 184, // 247: proto.SyncActionValue.quickReplyAction:type_name -> proto.QuickReplyAction + 183, // 248: proto.SyncActionValue.recentEmojiWeightsAction:type_name -> proto.RecentEmojiWeightsAction + 197, // 249: proto.SyncActionValue.labelEditAction:type_name -> proto.LabelEditAction + 198, // 250: proto.SyncActionValue.labelAssociationAction:type_name -> proto.LabelAssociationAction + 196, // 251: proto.SyncActionValue.localeSetting:type_name -> proto.LocaleSetting + 207, // 252: proto.SyncActionValue.archiveChatAction:type_name -> proto.ArchiveChatAction + 201, // 253: proto.SyncActionValue.deleteMessageForMeAction:type_name -> proto.DeleteMessageForMeAction + 199, // 254: proto.SyncActionValue.keyExpiration:type_name -> proto.KeyExpiration + 195, // 255: proto.SyncActionValue.markChatAsReadAction:type_name -> proto.MarkChatAsReadAction + 204, // 256: proto.SyncActionValue.clearChatAction:type_name -> proto.ClearChatAction + 202, // 257: proto.SyncActionValue.deleteChatAction:type_name -> proto.DeleteChatAction + 174, // 258: proto.SyncActionValue.unarchiveChatsSetting:type_name -> proto.UnarchiveChatsSetting + 188, // 259: proto.SyncActionValue.primaryFeature:type_name -> proto.PrimaryFeature + 208, // 260: proto.SyncActionValue.androidUnsupportedActions:type_name -> proto.AndroidUnsupportedActions + 209, // 261: proto.SyncActionValue.agentAction:type_name -> proto.AgentAction + 178, // 262: proto.SyncActionValue.subscriptionAction:type_name -> proto.SubscriptionAction + 173, // 263: proto.SyncActionValue.userStatusMuteAction:type_name -> proto.UserStatusMuteAction + 175, // 264: proto.SyncActionValue.timeFormatAction:type_name -> proto.TimeFormatAction + 191, // 265: proto.SyncActionValue.nuxAction:type_name -> proto.NuxAction + 187, // 266: proto.SyncActionValue.primaryVersionAction:type_name -> proto.PrimaryVersionAction + 179, // 267: proto.SyncActionValue.stickerAction:type_name -> proto.StickerAction + 182, // 268: proto.SyncActionValue.removeRecentStickerAction:type_name -> proto.RemoveRecentStickerAction + 206, // 269: proto.SyncActionValue.chatAssignment:type_name -> proto.ChatAssignmentAction + 205, // 270: proto.SyncActionValue.chatAssignmentOpenedStatus:type_name -> proto.ChatAssignmentOpenedStatusAction + 189, // 271: proto.SyncActionValue.pnForLidChatAction:type_name -> proto.PnForLidChatAction + 194, // 272: proto.SyncActionValue.marketingMessageAction:type_name -> proto.MarketingMessageAction + 193, // 273: proto.SyncActionValue.marketingMessageBroadcastAction:type_name -> proto.MarketingMessageBroadcastAction + 200, // 274: proto.SyncActionValue.externalWebBetaAction:type_name -> proto.ExternalWebBetaAction + 186, // 275: proto.SyncActionValue.privacySettingRelayAllCalls:type_name -> proto.PrivacySettingRelayAllCalls + 160, // 276: proto.SyncActionMessage.key:type_name -> proto.MessageKey + 176, // 277: proto.SyncActionMessageRange.messages:type_name -> proto.SyncActionMessage + 211, // 278: proto.RecentEmojiWeightsAction.weights:type_name -> proto.RecentEmojiWeight + 39, // 279: proto.MarketingMessageAction.type:type_name -> proto.MarketingMessageAction.MarketingMessagePrototypeType + 177, // 280: proto.MarkChatAsReadAction.messageRange:type_name -> proto.SyncActionMessageRange + 177, // 281: proto.DeleteChatAction.messageRange:type_name -> proto.SyncActionMessageRange + 177, // 282: proto.ClearChatAction.messageRange:type_name -> proto.SyncActionMessageRange + 177, // 283: proto.ArchiveChatAction.messageRange:type_name -> proto.SyncActionMessageRange + 172, // 284: proto.SyncActionData.value:type_name -> proto.SyncActionValue + 40, // 285: proto.BizIdentityInfo.vlevel:type_name -> proto.BizIdentityInfo.VerifiedLevelValue + 212, // 286: proto.BizIdentityInfo.vnameCert:type_name -> proto.VerifiedNameCertificate + 41, // 287: proto.BizIdentityInfo.hostStorage:type_name -> proto.BizIdentityInfo.HostStorageType + 42, // 288: proto.BizIdentityInfo.actualActors:type_name -> proto.BizIdentityInfo.ActualActorsType + 212, // 289: proto.BizAccountPayload.vnameCert:type_name -> proto.VerifiedNameCertificate + 43, // 290: proto.BizAccountLinkInfo.hostStorage:type_name -> proto.BizAccountLinkInfo.HostStorageType + 44, // 291: proto.BizAccountLinkInfo.accountType:type_name -> proto.BizAccountLinkInfo.AccountType + 219, // 292: proto.HandshakeMessage.clientHello:type_name -> proto.HandshakeClientHello + 218, // 293: proto.HandshakeMessage.serverHello:type_name -> proto.HandshakeServerHello + 220, // 294: proto.HandshakeMessage.clientFinish:type_name -> proto.HandshakeClientFinish + 295, // 295: proto.ClientPayload.userAgent:type_name -> proto.ClientPayload.UserAgent + 294, // 296: proto.ClientPayload.webInfo:type_name -> proto.ClientPayload.WebInfo + 47, // 297: proto.ClientPayload.connectType:type_name -> proto.ClientPayload.ConnectType + 48, // 298: proto.ClientPayload.connectReason:type_name -> proto.ClientPayload.ConnectReason + 298, // 299: proto.ClientPayload.dnsSource:type_name -> proto.ClientPayload.DNSSource + 297, // 300: proto.ClientPayload.devicePairingData:type_name -> proto.ClientPayload.DevicePairingRegistrationData + 45, // 301: proto.ClientPayload.product:type_name -> proto.ClientPayload.Product + 46, // 302: proto.ClientPayload.iosAppExtension:type_name -> proto.ClientPayload.IOSAppExtension + 296, // 303: proto.ClientPayload.interopData:type_name -> proto.ClientPayload.InteropData + 223, // 304: proto.WebNotificationsInfo.notifyMessages:type_name -> proto.WebMessageInfo + 160, // 305: proto.WebMessageInfo.key:type_name -> proto.MessageKey + 118, // 306: proto.WebMessageInfo.message:type_name -> proto.Message + 55, // 307: proto.WebMessageInfo.status:type_name -> proto.WebMessageInfo.Status + 54, // 308: proto.WebMessageInfo.messageStubType:type_name -> proto.WebMessageInfo.StubType + 232, // 309: proto.WebMessageInfo.paymentInfo:type_name -> proto.PaymentInfo + 70, // 310: proto.WebMessageInfo.finalLiveLocation:type_name -> proto.LiveLocationMessage + 232, // 311: proto.WebMessageInfo.quotedPaymentInfo:type_name -> proto.PaymentInfo + 56, // 312: proto.WebMessageInfo.bizPrivacyStatus:type_name -> proto.WebMessageInfo.BizPrivacyStatus + 235, // 313: proto.WebMessageInfo.mediaData:type_name -> proto.MediaData + 231, // 314: proto.WebMessageInfo.photoChange:type_name -> proto.PhotoChange + 225, // 315: proto.WebMessageInfo.userReceipt:type_name -> proto.UserReceipt + 227, // 316: proto.WebMessageInfo.reactions:type_name -> proto.Reaction + 235, // 317: proto.WebMessageInfo.quotedStickerData:type_name -> proto.MediaData + 226, // 318: proto.WebMessageInfo.statusPsa:type_name -> proto.StatusPSA + 228, // 319: proto.WebMessageInfo.pollUpdates:type_name -> proto.PollUpdate + 229, // 320: proto.WebMessageInfo.pollAdditionalMetadata:type_name -> proto.PollAdditionalMetadata + 236, // 321: proto.WebMessageInfo.keepInChat:type_name -> proto.KeepInChat + 230, // 322: proto.WebMessageInfo.pinInChat:type_name -> proto.PinInChat + 237, // 323: proto.WebMessageInfo.futureproofMessageSecretMessage:type_name -> proto.FutureproofMessageSecretMessage + 57, // 324: proto.WebFeatures.labelsDisplay:type_name -> proto.WebFeatures.Flag + 57, // 325: proto.WebFeatures.voipIndividualOutgoing:type_name -> proto.WebFeatures.Flag + 57, // 326: proto.WebFeatures.groupsV3:type_name -> proto.WebFeatures.Flag + 57, // 327: proto.WebFeatures.groupsV3Create:type_name -> proto.WebFeatures.Flag + 57, // 328: proto.WebFeatures.changeNumberV2:type_name -> proto.WebFeatures.Flag + 57, // 329: proto.WebFeatures.queryStatusV3Thumbnail:type_name -> proto.WebFeatures.Flag + 57, // 330: proto.WebFeatures.liveLocations:type_name -> proto.WebFeatures.Flag + 57, // 331: proto.WebFeatures.queryVname:type_name -> proto.WebFeatures.Flag + 57, // 332: proto.WebFeatures.voipIndividualIncoming:type_name -> proto.WebFeatures.Flag + 57, // 333: proto.WebFeatures.quickRepliesQuery:type_name -> proto.WebFeatures.Flag + 57, // 334: proto.WebFeatures.payments:type_name -> proto.WebFeatures.Flag + 57, // 335: proto.WebFeatures.stickerPackQuery:type_name -> proto.WebFeatures.Flag + 57, // 336: proto.WebFeatures.liveLocationsFinal:type_name -> proto.WebFeatures.Flag + 57, // 337: proto.WebFeatures.labelsEdit:type_name -> proto.WebFeatures.Flag + 57, // 338: proto.WebFeatures.mediaUpload:type_name -> proto.WebFeatures.Flag + 57, // 339: proto.WebFeatures.mediaUploadRichQuickReplies:type_name -> proto.WebFeatures.Flag + 57, // 340: proto.WebFeatures.vnameV2:type_name -> proto.WebFeatures.Flag + 57, // 341: proto.WebFeatures.videoPlaybackUrl:type_name -> proto.WebFeatures.Flag + 57, // 342: proto.WebFeatures.statusRanking:type_name -> proto.WebFeatures.Flag + 57, // 343: proto.WebFeatures.voipIndividualVideo:type_name -> proto.WebFeatures.Flag + 57, // 344: proto.WebFeatures.thirdPartyStickers:type_name -> proto.WebFeatures.Flag + 57, // 345: proto.WebFeatures.frequentlyForwardedSetting:type_name -> proto.WebFeatures.Flag + 57, // 346: proto.WebFeatures.groupsV4JoinPermission:type_name -> proto.WebFeatures.Flag + 57, // 347: proto.WebFeatures.recentStickers:type_name -> proto.WebFeatures.Flag + 57, // 348: proto.WebFeatures.catalog:type_name -> proto.WebFeatures.Flag + 57, // 349: proto.WebFeatures.starredStickers:type_name -> proto.WebFeatures.Flag + 57, // 350: proto.WebFeatures.voipGroupCall:type_name -> proto.WebFeatures.Flag + 57, // 351: proto.WebFeatures.templateMessage:type_name -> proto.WebFeatures.Flag + 57, // 352: proto.WebFeatures.templateMessageInteractivity:type_name -> proto.WebFeatures.Flag + 57, // 353: proto.WebFeatures.ephemeralMessages:type_name -> proto.WebFeatures.Flag + 57, // 354: proto.WebFeatures.e2ENotificationSync:type_name -> proto.WebFeatures.Flag + 57, // 355: proto.WebFeatures.recentStickersV2:type_name -> proto.WebFeatures.Flag + 57, // 356: proto.WebFeatures.recentStickersV3:type_name -> proto.WebFeatures.Flag + 57, // 357: proto.WebFeatures.userNotice:type_name -> proto.WebFeatures.Flag + 57, // 358: proto.WebFeatures.support:type_name -> proto.WebFeatures.Flag + 57, // 359: proto.WebFeatures.groupUiiCleanup:type_name -> proto.WebFeatures.Flag + 57, // 360: proto.WebFeatures.groupDogfoodingInternalOnly:type_name -> proto.WebFeatures.Flag + 57, // 361: proto.WebFeatures.settingsSync:type_name -> proto.WebFeatures.Flag + 57, // 362: proto.WebFeatures.archiveV2:type_name -> proto.WebFeatures.Flag + 57, // 363: proto.WebFeatures.ephemeralAllowGroupMembers:type_name -> proto.WebFeatures.Flag + 57, // 364: proto.WebFeatures.ephemeral24HDuration:type_name -> proto.WebFeatures.Flag + 57, // 365: proto.WebFeatures.mdForceUpgrade:type_name -> proto.WebFeatures.Flag + 57, // 366: proto.WebFeatures.disappearingMode:type_name -> proto.WebFeatures.Flag + 57, // 367: proto.WebFeatures.externalMdOptInAvailable:type_name -> proto.WebFeatures.Flag + 57, // 368: proto.WebFeatures.noDeleteMessageTimeLimit:type_name -> proto.WebFeatures.Flag + 160, // 369: proto.Reaction.key:type_name -> proto.MessageKey + 160, // 370: proto.PollUpdate.pollUpdateMessageKey:type_name -> proto.MessageKey + 135, // 371: proto.PollUpdate.vote:type_name -> proto.PollVoteMessage + 58, // 372: proto.PinInChat.type:type_name -> proto.PinInChat.Type + 160, // 373: proto.PinInChat.key:type_name -> proto.MessageKey + 234, // 374: proto.PinInChat.messageAddOnContextInfo:type_name -> proto.MessageAddOnContextInfo + 61, // 375: proto.PaymentInfo.currencyDeprecated:type_name -> proto.PaymentInfo.Currency + 60, // 376: proto.PaymentInfo.status:type_name -> proto.PaymentInfo.Status + 160, // 377: proto.PaymentInfo.requestMessageKey:type_name -> proto.MessageKey + 59, // 378: proto.PaymentInfo.txnStatus:type_name -> proto.PaymentInfo.TxnStatus + 117, // 379: proto.PaymentInfo.primaryAmount:type_name -> proto.Money + 117, // 380: proto.PaymentInfo.exchangeAmount:type_name -> proto.Money + 160, // 381: proto.NotificationMessageInfo.key:type_name -> proto.MessageKey + 118, // 382: proto.NotificationMessageInfo.message:type_name -> proto.Message + 1, // 383: proto.KeepInChat.keepType:type_name -> proto.KeepType + 160, // 384: proto.KeepInChat.key:type_name -> proto.MessageKey + 119, // 385: proto.FutureproofMessageSecretMessage.messageSecretMessage:type_name -> proto.MessageSecretMessage + 238, // 386: proto.FutureproofMessageSecretMessage.futureMessageData:type_name -> proto.FutureMessageData + 239, // 387: proto.FutureMessageData.botData:type_name -> proto.BotData + 160, // 388: proto.BotData.targetMessageKey:type_name -> proto.MessageKey + 302, // 389: proto.CertChain.leaf:type_name -> proto.CertChain.NoiseCertificate + 302, // 390: proto.CertChain.intermediate:type_name -> proto.CertChain.NoiseCertificate + 246, // 391: proto.ListMessage.Section.rows:type_name -> proto.ListMessage.Row + 247, // 392: proto.ListMessage.ProductSection.products:type_name -> proto.ListMessage.Product + 248, // 393: proto.ListMessage.ProductListInfo.productSections:type_name -> proto.ListMessage.ProductSection + 250, // 394: proto.ListMessage.ProductListInfo.headerImage:type_name -> proto.ListMessage.ProductListHeaderImage + 10, // 395: proto.InteractiveResponseMessage.Body.format:type_name -> proto.InteractiveResponseMessage.Body.Format + 11, // 396: proto.InteractiveMessage.ShopMessage.surface:type_name -> proto.InteractiveMessage.ShopMessage.Surface + 260, // 397: proto.InteractiveMessage.NativeFlowMessage.buttons:type_name -> proto.InteractiveMessage.NativeFlowMessage.NativeFlowButton + 85, // 398: proto.InteractiveMessage.Header.documentMessage:type_name -> proto.DocumentMessage + 78, // 399: proto.InteractiveMessage.Header.imageMessage:type_name -> proto.ImageMessage + 121, // 400: proto.InteractiveMessage.Header.videoMessage:type_name -> proto.VideoMessage + 69, // 401: proto.InteractiveMessage.Header.locationMessage:type_name -> proto.LocationMessage + 76, // 402: proto.InteractiveMessage.CarouselMessage.cards:type_name -> proto.InteractiveMessage + 263, // 403: proto.HighlyStructuredMessage.HSMLocalizableParameter.currency:type_name -> proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency + 262, // 404: proto.HighlyStructuredMessage.HSMLocalizableParameter.dateTime:type_name -> proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime + 265, // 405: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.component:type_name -> proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent + 264, // 406: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.unixEpoch:type_name -> proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch + 13, // 407: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.dayOfWeek:type_name -> proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.DayOfWeekType + 14, // 408: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.calendar:type_name -> proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.CalendarType + 268, // 409: proto.ButtonsMessage.Button.buttonText:type_name -> proto.ButtonsMessage.Button.ButtonText + 21, // 410: proto.ButtonsMessage.Button.type:type_name -> proto.ButtonsMessage.Button.Type + 267, // 411: proto.ButtonsMessage.Button.nativeFlowInfo:type_name -> proto.ButtonsMessage.Button.NativeFlowInfo + 24, // 412: proto.ContextInfo.ExternalAdReplyInfo.mediaType:type_name -> proto.ContextInfo.ExternalAdReplyInfo.MediaType + 25, // 413: proto.ContextInfo.AdReplyInfo.mediaType:type_name -> proto.ContextInfo.AdReplyInfo.MediaType + 80, // 414: proto.TemplateButton.URLButton.displayText:type_name -> proto.HighlyStructuredMessage + 80, // 415: proto.TemplateButton.URLButton.url:type_name -> proto.HighlyStructuredMessage + 80, // 416: proto.TemplateButton.QuickReplyButton.displayText:type_name -> proto.HighlyStructuredMessage + 80, // 417: proto.TemplateButton.CallButton.displayText:type_name -> proto.HighlyStructuredMessage + 80, // 418: proto.TemplateButton.CallButton.phoneNumber:type_name -> proto.HighlyStructuredMessage + 106, // 419: proto.TemplateMessage.HydratedFourRowTemplate.hydratedButtons:type_name -> proto.HydratedTemplateButton + 85, // 420: proto.TemplateMessage.HydratedFourRowTemplate.documentMessage:type_name -> proto.DocumentMessage + 78, // 421: proto.TemplateMessage.HydratedFourRowTemplate.imageMessage:type_name -> proto.ImageMessage + 121, // 422: proto.TemplateMessage.HydratedFourRowTemplate.videoMessage:type_name -> proto.VideoMessage + 69, // 423: proto.TemplateMessage.HydratedFourRowTemplate.locationMessage:type_name -> proto.LocationMessage + 80, // 424: proto.TemplateMessage.FourRowTemplate.content:type_name -> proto.HighlyStructuredMessage + 80, // 425: proto.TemplateMessage.FourRowTemplate.footer:type_name -> proto.HighlyStructuredMessage + 114, // 426: proto.TemplateMessage.FourRowTemplate.buttons:type_name -> proto.TemplateButton + 85, // 427: proto.TemplateMessage.FourRowTemplate.documentMessage:type_name -> proto.DocumentMessage + 80, // 428: proto.TemplateMessage.FourRowTemplate.highlyStructuredMessage:type_name -> proto.HighlyStructuredMessage + 78, // 429: proto.TemplateMessage.FourRowTemplate.imageMessage:type_name -> proto.ImageMessage + 121, // 430: proto.TemplateMessage.FourRowTemplate.videoMessage:type_name -> proto.VideoMessage + 69, // 431: proto.TemplateMessage.FourRowTemplate.locationMessage:type_name -> proto.LocationMessage + 78, // 432: proto.ProductMessage.ProductSnapshot.productImage:type_name -> proto.ImageMessage + 78, // 433: proto.ProductMessage.CatalogSnapshot.catalogImage:type_name -> proto.ImageMessage + 37, // 434: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.mediaUploadResult:type_name -> proto.MediaRetryNotification.ResultType + 125, // 435: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.stickerMessage:type_name -> proto.StickerMessage + 287, // 436: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.linkPreviewResponse:type_name -> proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse + 286, // 437: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.placeholderMessageResendResponse:type_name -> proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse + 288, // 438: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.hqThumbnail:type_name -> proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail + 160, // 439: proto.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest.messageKey:type_name -> proto.MessageKey + 213, // 440: proto.VerifiedNameCertificate.Details.localizedNames:type_name -> proto.LocalizedName + 299, // 441: proto.ClientPayload.WebInfo.webdPayload:type_name -> proto.ClientPayload.WebInfo.WebdPayload + 49, // 442: proto.ClientPayload.WebInfo.webSubPlatform:type_name -> proto.ClientPayload.WebInfo.WebSubPlatform + 51, // 443: proto.ClientPayload.UserAgent.platform:type_name -> proto.ClientPayload.UserAgent.Platform + 300, // 444: proto.ClientPayload.UserAgent.appVersion:type_name -> proto.ClientPayload.UserAgent.AppVersion + 50, // 445: proto.ClientPayload.UserAgent.releaseChannel:type_name -> proto.ClientPayload.UserAgent.ReleaseChannel + 52, // 446: proto.ClientPayload.UserAgent.deviceType:type_name -> proto.ClientPayload.UserAgent.DeviceType + 53, // 447: proto.ClientPayload.DNSSource.dnsMethod:type_name -> proto.ClientPayload.DNSSource.DNSResolutionMethod + 448, // [448:448] is the sub-list for method output_type + 448, // [448:448] is the sub-list for method input_type + 448, // [448:448] is the sub-list for extension type_name + 448, // [448:448] is the sub-list for extension extendee + 0, // [0:448] is the sub-list for field type_name } func init() { file_binary_proto_def_proto_init() } @@ -24877,18 +25268,6 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PaymentInviteMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_binary_proto_def_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OrderMessage); i { case 0: return &v.state @@ -24900,7 +25279,7 @@ func file_binary_proto_def_proto_init() { return nil } } - file_binary_proto_def_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_binary_proto_def_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LocationMessage); i { case 0: return &v.state @@ -24912,7 +25291,7 @@ func file_binary_proto_def_proto_init() { return nil } } - file_binary_proto_def_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_binary_proto_def_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LiveLocationMessage); i { case 0: return &v.state @@ -24924,7 +25303,7 @@ func file_binary_proto_def_proto_init() { return nil } } - file_binary_proto_def_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_binary_proto_def_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListResponseMessage); i { case 0: return &v.state @@ -24936,7 +25315,7 @@ func file_binary_proto_def_proto_init() { return nil } } - file_binary_proto_def_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_binary_proto_def_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListMessage); i { case 0: return &v.state @@ -24948,7 +25327,7 @@ func file_binary_proto_def_proto_init() { return nil } } - file_binary_proto_def_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_binary_proto_def_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*KeepInChatMessage); i { case 0: return &v.state @@ -24960,7 +25339,7 @@ func file_binary_proto_def_proto_init() { return nil } } - file_binary_proto_def_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_binary_proto_def_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InvoiceMessage); i { case 0: return &v.state @@ -24972,7 +25351,7 @@ func file_binary_proto_def_proto_init() { return nil } } - file_binary_proto_def_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_binary_proto_def_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InteractiveResponseMessage); i { case 0: return &v.state @@ -24984,7 +25363,7 @@ func file_binary_proto_def_proto_init() { return nil } } - file_binary_proto_def_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_binary_proto_def_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InteractiveMessage); i { case 0: return &v.state @@ -24996,7 +25375,7 @@ func file_binary_proto_def_proto_init() { return nil } } - file_binary_proto_def_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_binary_proto_def_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InitialSecurityNotificationSettingSync); i { case 0: return &v.state @@ -25008,7 +25387,7 @@ func file_binary_proto_def_proto_init() { return nil } } - file_binary_proto_def_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_binary_proto_def_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ImageMessage); i { case 0: return &v.state @@ -25020,7 +25399,7 @@ func file_binary_proto_def_proto_init() { return nil } } - file_binary_proto_def_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_binary_proto_def_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HistorySyncNotification); i { case 0: return &v.state @@ -25032,7 +25411,7 @@ func file_binary_proto_def_proto_init() { return nil } } - file_binary_proto_def_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_binary_proto_def_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HighlyStructuredMessage); i { case 0: return &v.state @@ -25044,7 +25423,7 @@ func file_binary_proto_def_proto_init() { return nil } } - file_binary_proto_def_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + file_binary_proto_def_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GroupInviteMessage); i { case 0: return &v.state @@ -25056,7 +25435,7 @@ func file_binary_proto_def_proto_init() { return nil } } - file_binary_proto_def_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + file_binary_proto_def_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FutureProofMessage); i { case 0: return &v.state @@ -25068,7 +25447,7 @@ func file_binary_proto_def_proto_init() { return nil } } - file_binary_proto_def_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + file_binary_proto_def_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExtendedTextMessage); i { case 0: return &v.state @@ -25080,7 +25459,7 @@ func file_binary_proto_def_proto_init() { return nil } } - file_binary_proto_def_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + file_binary_proto_def_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EncReactionMessage); i { case 0: return &v.state @@ -25092,7 +25471,7 @@ func file_binary_proto_def_proto_init() { return nil } } - file_binary_proto_def_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + file_binary_proto_def_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DocumentMessage); i { case 0: return &v.state @@ -25104,7 +25483,7 @@ func file_binary_proto_def_proto_init() { return nil } } - file_binary_proto_def_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + file_binary_proto_def_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeviceSentMessage); i { case 0: return &v.state @@ -25116,7 +25495,7 @@ func file_binary_proto_def_proto_init() { return nil } } - file_binary_proto_def_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + file_binary_proto_def_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeclinePaymentRequestMessage); i { case 0: return &v.state @@ -25128,7 +25507,7 @@ func file_binary_proto_def_proto_init() { return nil } } - file_binary_proto_def_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + file_binary_proto_def_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ContactsArrayMessage); i { case 0: return &v.state @@ -25140,7 +25519,7 @@ func file_binary_proto_def_proto_init() { return nil } } - file_binary_proto_def_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + file_binary_proto_def_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ContactMessage); i { case 0: return &v.state @@ -25152,7 +25531,7 @@ func file_binary_proto_def_proto_init() { return nil } } - file_binary_proto_def_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + file_binary_proto_def_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Chat); i { case 0: return &v.state @@ -25164,7 +25543,7 @@ func file_binary_proto_def_proto_init() { return nil } } - file_binary_proto_def_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + file_binary_proto_def_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CancelPaymentRequestMessage); i { case 0: return &v.state @@ -25176,7 +25555,7 @@ func file_binary_proto_def_proto_init() { return nil } } - file_binary_proto_def_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + file_binary_proto_def_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Call); i { case 0: return &v.state @@ -25188,7 +25567,7 @@ func file_binary_proto_def_proto_init() { return nil } } - file_binary_proto_def_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + file_binary_proto_def_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ButtonsResponseMessage); i { case 0: return &v.state @@ -25200,7 +25579,7 @@ func file_binary_proto_def_proto_init() { return nil } } - file_binary_proto_def_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + file_binary_proto_def_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ButtonsMessage); i { case 0: return &v.state @@ -25212,6 +25591,18 @@ func file_binary_proto_def_proto_init() { return nil } } + file_binary_proto_def_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BotFeedbackMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } file_binary_proto_def_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AudioMessage); i { case 0: @@ -25393,7 +25784,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ActionLink); i { + switch v := v.(*BotMetadata); i { case 0: return &v.state case 1: @@ -25405,7 +25796,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TemplateButton); i { + switch v := v.(*BotAvatarMetadata); i { case 0: return &v.state case 1: @@ -25417,7 +25808,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Point); i { + switch v := v.(*ActionLink); i { case 0: return &v.state case 1: @@ -25429,7 +25820,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PaymentBackground); i { + switch v := v.(*TemplateButton); i { case 0: return &v.state case 1: @@ -25441,7 +25832,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Money); i { + switch v := v.(*Point); i { case 0: return &v.state case 1: @@ -25453,7 +25844,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Message); i { + switch v := v.(*PaymentBackground); i { case 0: return &v.state case 1: @@ -25465,7 +25856,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MessageContextInfo); i { + switch v := v.(*Money); i { case 0: return &v.state case 1: @@ -25477,7 +25868,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VideoMessage); i { + switch v := v.(*Message); i { case 0: return &v.state case 1: @@ -25489,7 +25880,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TemplateMessage); i { + switch v := v.(*MessageSecretMessage); i { case 0: return &v.state case 1: @@ -25501,7 +25892,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TemplateButtonReplyMessage); i { + switch v := v.(*MessageContextInfo); i { case 0: return &v.state case 1: @@ -25513,7 +25904,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StickerSyncRMRMessage); i { + switch v := v.(*VideoMessage); i { case 0: return &v.state case 1: @@ -25525,7 +25916,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StickerMessage); i { + switch v := v.(*TemplateMessage); i { case 0: return &v.state case 1: @@ -25537,7 +25928,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SenderKeyDistributionMessage); i { + switch v := v.(*TemplateButtonReplyMessage); i { case 0: return &v.state case 1: @@ -25549,7 +25940,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SendPaymentMessage); i { + switch v := v.(*StickerSyncRMRMessage); i { case 0: return &v.state case 1: @@ -25561,7 +25952,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ScheduledCallEditMessage); i { + switch v := v.(*StickerMessage); i { case 0: return &v.state case 1: @@ -25573,7 +25964,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[64].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ScheduledCallCreationMessage); i { + switch v := v.(*SenderKeyDistributionMessage); i { case 0: return &v.state case 1: @@ -25585,7 +25976,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[65].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RequestPhoneNumberMessage); i { + switch v := v.(*SendPaymentMessage); i { case 0: return &v.state case 1: @@ -25597,7 +25988,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RequestPaymentMessage); i { + switch v := v.(*ScheduledCallEditMessage); i { case 0: return &v.state case 1: @@ -25609,7 +26000,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[67].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReactionMessage); i { + switch v := v.(*ScheduledCallCreationMessage); i { case 0: return &v.state case 1: @@ -25621,7 +26012,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[68].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtocolMessage); i { + switch v := v.(*RequestPhoneNumberMessage); i { case 0: return &v.state case 1: @@ -25633,7 +26024,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[69].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProductMessage); i { + switch v := v.(*RequestPaymentMessage); i { case 0: return &v.state case 1: @@ -25645,7 +26036,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[70].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PollVoteMessage); i { + switch v := v.(*ReactionMessage); i { case 0: return &v.state case 1: @@ -25657,7 +26048,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[71].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PollUpdateMessage); i { + switch v := v.(*ProtocolMessage); i { case 0: return &v.state case 1: @@ -25669,7 +26060,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[72].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PollUpdateMessageMetadata); i { + switch v := v.(*ProductMessage); i { case 0: return &v.state case 1: @@ -25681,7 +26072,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[73].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PollEncValue); i { + switch v := v.(*PollVoteMessage); i { case 0: return &v.state case 1: @@ -25693,7 +26084,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[74].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PollCreationMessage); i { + switch v := v.(*PollUpdateMessage); i { case 0: return &v.state case 1: @@ -25705,7 +26096,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[75].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PinInChatMessage); i { + switch v := v.(*PollUpdateMessageMetadata); i { case 0: return &v.state case 1: @@ -25717,7 +26108,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[76].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PeerDataOperationRequestResponseMessage); i { + switch v := v.(*PollEncValue); i { case 0: return &v.state case 1: @@ -25729,7 +26120,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[77].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PeerDataOperationRequestMessage); i { + switch v := v.(*PollCreationMessage); i { case 0: return &v.state case 1: @@ -25741,7 +26132,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[78].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EphemeralSetting); i { + switch v := v.(*PinInChatMessage); i { case 0: return &v.state case 1: @@ -25753,7 +26144,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[79].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WallpaperSettings); i { + switch v := v.(*PeerDataOperationRequestResponseMessage); i { case 0: return &v.state case 1: @@ -25765,7 +26156,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[80].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StickerMetadata); i { + switch v := v.(*PeerDataOperationRequestMessage); i { case 0: return &v.state case 1: @@ -25777,7 +26168,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[81].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Pushname); i { + switch v := v.(*PaymentInviteMessage); i { case 0: return &v.state case 1: @@ -25789,7 +26180,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[82].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PastParticipants); i { + switch v := v.(*EphemeralSetting); i { case 0: return &v.state case 1: @@ -25801,7 +26192,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[83].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PastParticipant); i { + switch v := v.(*WallpaperSettings); i { case 0: return &v.state case 1: @@ -25813,7 +26204,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[84].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NotificationSettings); i { + switch v := v.(*StickerMetadata); i { case 0: return &v.state case 1: @@ -25825,7 +26216,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[85].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HistorySync); i { + switch v := v.(*Pushname); i { case 0: return &v.state case 1: @@ -25837,7 +26228,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[86].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HistorySyncMsg); i { + switch v := v.(*PastParticipants); i { case 0: return &v.state case 1: @@ -25849,7 +26240,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[87].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GroupParticipant); i { + switch v := v.(*PastParticipant); i { case 0: return &v.state case 1: @@ -25861,7 +26252,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[88].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GlobalSettings); i { + switch v := v.(*NotificationSettings); i { case 0: return &v.state case 1: @@ -25873,7 +26264,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[89].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Conversation); i { + switch v := v.(*HistorySync); i { case 0: return &v.state case 1: @@ -25885,7 +26276,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[90].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AvatarUserSettings); i { + switch v := v.(*HistorySyncMsg); i { case 0: return &v.state case 1: @@ -25897,7 +26288,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[91].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AutoDownloadSettings); i { + switch v := v.(*GroupParticipant); i { case 0: return &v.state case 1: @@ -25909,7 +26300,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[92].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgRowOpaqueData); i { + switch v := v.(*GlobalSettings); i { case 0: return &v.state case 1: @@ -25921,7 +26312,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[93].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgOpaqueData); i { + switch v := v.(*Conversation); i { case 0: return &v.state case 1: @@ -25933,7 +26324,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[94].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServerErrorReceipt); i { + switch v := v.(*AvatarUserSettings); i { case 0: return &v.state case 1: @@ -25945,7 +26336,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[95].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MediaRetryNotification); i { + switch v := v.(*AutoDownloadSettings); i { case 0: return &v.state case 1: @@ -25957,7 +26348,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[96].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MessageKey); i { + switch v := v.(*ServerErrorReceipt); i { case 0: return &v.state case 1: @@ -25969,7 +26360,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[97].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncdVersion); i { + switch v := v.(*MediaRetryNotification); i { case 0: return &v.state case 1: @@ -25981,7 +26372,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[98].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncdValue); i { + switch v := v.(*MessageKey); i { case 0: return &v.state case 1: @@ -25993,7 +26384,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[99].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncdSnapshot); i { + switch v := v.(*SyncdVersion); i { case 0: return &v.state case 1: @@ -26005,7 +26396,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[100].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncdRecord); i { + switch v := v.(*SyncdValue); i { case 0: return &v.state case 1: @@ -26017,7 +26408,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[101].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncdPatch); i { + switch v := v.(*SyncdSnapshot); i { case 0: return &v.state case 1: @@ -26029,7 +26420,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[102].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncdMutations); i { + switch v := v.(*SyncdRecord); i { case 0: return &v.state case 1: @@ -26041,7 +26432,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[103].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncdMutation); i { + switch v := v.(*SyncdPatch); i { case 0: return &v.state case 1: @@ -26053,7 +26444,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[104].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncdIndex); i { + switch v := v.(*SyncdMutations); i { case 0: return &v.state case 1: @@ -26065,7 +26456,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[105].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KeyId); i { + switch v := v.(*SyncdMutation); i { case 0: return &v.state case 1: @@ -26077,7 +26468,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[106].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExternalBlobReference); i { + switch v := v.(*SyncdIndex); i { case 0: return &v.state case 1: @@ -26089,7 +26480,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[107].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExitCode); i { + switch v := v.(*KeyId); i { case 0: return &v.state case 1: @@ -26101,7 +26492,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[108].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncActionValue); i { + switch v := v.(*ExternalBlobReference); i { case 0: return &v.state case 1: @@ -26113,7 +26504,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[109].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserStatusMuteAction); i { + switch v := v.(*ExitCode); i { case 0: return &v.state case 1: @@ -26125,7 +26516,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[110].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UnarchiveChatsSetting); i { + switch v := v.(*SyncActionValue); i { case 0: return &v.state case 1: @@ -26137,7 +26528,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[111].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TimeFormatAction); i { + switch v := v.(*UserStatusMuteAction); i { case 0: return &v.state case 1: @@ -26149,7 +26540,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[112].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncActionMessage); i { + switch v := v.(*UnarchiveChatsSetting); i { case 0: return &v.state case 1: @@ -26161,7 +26552,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[113].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncActionMessageRange); i { + switch v := v.(*TimeFormatAction); i { case 0: return &v.state case 1: @@ -26173,7 +26564,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[114].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SubscriptionAction); i { + switch v := v.(*SyncActionMessage); i { case 0: return &v.state case 1: @@ -26185,7 +26576,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[115].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StickerAction); i { + switch v := v.(*SyncActionMessageRange); i { case 0: return &v.state case 1: @@ -26197,7 +26588,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[116].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StarAction); i { + switch v := v.(*SubscriptionAction); i { case 0: return &v.state case 1: @@ -26209,7 +26600,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[117].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SecurityNotificationSetting); i { + switch v := v.(*StickerAction); i { case 0: return &v.state case 1: @@ -26221,7 +26612,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[118].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveRecentStickerAction); i { + switch v := v.(*StarAction); i { case 0: return &v.state case 1: @@ -26233,7 +26624,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[119].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RecentEmojiWeightsAction); i { + switch v := v.(*SecurityNotificationSetting); i { case 0: return &v.state case 1: @@ -26245,7 +26636,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[120].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QuickReplyAction); i { + switch v := v.(*RemoveRecentStickerAction); i { case 0: return &v.state case 1: @@ -26257,7 +26648,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[121].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PushNameSetting); i { + switch v := v.(*RecentEmojiWeightsAction); i { case 0: return &v.state case 1: @@ -26269,7 +26660,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[122].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PrivacySettingRelayAllCalls); i { + switch v := v.(*QuickReplyAction); i { case 0: return &v.state case 1: @@ -26281,7 +26672,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[123].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PrimaryVersionAction); i { + switch v := v.(*PushNameSetting); i { case 0: return &v.state case 1: @@ -26293,7 +26684,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[124].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PrimaryFeature); i { + switch v := v.(*PrivacySettingRelayAllCalls); i { case 0: return &v.state case 1: @@ -26305,7 +26696,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[125].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PnForLidChatAction); i { + switch v := v.(*PrimaryVersionAction); i { case 0: return &v.state case 1: @@ -26317,7 +26708,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[126].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PinAction); i { + switch v := v.(*PrimaryFeature); i { case 0: return &v.state case 1: @@ -26329,7 +26720,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[127].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NuxAction); i { + switch v := v.(*PnForLidChatAction); i { case 0: return &v.state case 1: @@ -26341,7 +26732,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[128].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MuteAction); i { + switch v := v.(*PinAction); i { case 0: return &v.state case 1: @@ -26353,7 +26744,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[129].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MarketingMessageBroadcastAction); i { + switch v := v.(*NuxAction); i { case 0: return &v.state case 1: @@ -26365,7 +26756,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[130].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MarketingMessageAction); i { + switch v := v.(*MuteAction); i { case 0: return &v.state case 1: @@ -26377,7 +26768,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[131].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MarkChatAsReadAction); i { + switch v := v.(*MarketingMessageBroadcastAction); i { case 0: return &v.state case 1: @@ -26389,7 +26780,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[132].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LocaleSetting); i { + switch v := v.(*MarketingMessageAction); i { case 0: return &v.state case 1: @@ -26401,7 +26792,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[133].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LabelEditAction); i { + switch v := v.(*MarkChatAsReadAction); i { case 0: return &v.state case 1: @@ -26413,7 +26804,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[134].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LabelAssociationAction); i { + switch v := v.(*LocaleSetting); i { case 0: return &v.state case 1: @@ -26425,7 +26816,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[135].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KeyExpiration); i { + switch v := v.(*LabelEditAction); i { case 0: return &v.state case 1: @@ -26437,7 +26828,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[136].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExternalWebBetaAction); i { + switch v := v.(*LabelAssociationAction); i { case 0: return &v.state case 1: @@ -26449,7 +26840,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[137].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteMessageForMeAction); i { + switch v := v.(*KeyExpiration); i { case 0: return &v.state case 1: @@ -26461,7 +26852,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[138].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteChatAction); i { + switch v := v.(*ExternalWebBetaAction); i { case 0: return &v.state case 1: @@ -26473,7 +26864,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[139].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContactAction); i { + switch v := v.(*DeleteMessageForMeAction); i { case 0: return &v.state case 1: @@ -26485,7 +26876,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[140].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClearChatAction); i { + switch v := v.(*DeleteChatAction); i { case 0: return &v.state case 1: @@ -26497,7 +26888,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[141].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChatAssignmentOpenedStatusAction); i { + switch v := v.(*ContactAction); i { case 0: return &v.state case 1: @@ -26509,7 +26900,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[142].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChatAssignmentAction); i { + switch v := v.(*ClearChatAction); i { case 0: return &v.state case 1: @@ -26521,7 +26912,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[143].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ArchiveChatAction); i { + switch v := v.(*ChatAssignmentOpenedStatusAction); i { case 0: return &v.state case 1: @@ -26533,7 +26924,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[144].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AndroidUnsupportedActions); i { + switch v := v.(*ChatAssignmentAction); i { case 0: return &v.state case 1: @@ -26545,7 +26936,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[145].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AgentAction); i { + switch v := v.(*ArchiveChatAction); i { case 0: return &v.state case 1: @@ -26557,7 +26948,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[146].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncActionData); i { + switch v := v.(*AndroidUnsupportedActions); i { case 0: return &v.state case 1: @@ -26569,7 +26960,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[147].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RecentEmojiWeight); i { + switch v := v.(*AgentAction); i { case 0: return &v.state case 1: @@ -26581,7 +26972,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[148].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VerifiedNameCertificate); i { + switch v := v.(*SyncActionData); i { case 0: return &v.state case 1: @@ -26593,7 +26984,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[149].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LocalizedName); i { + switch v := v.(*RecentEmojiWeight); i { case 0: return &v.state case 1: @@ -26605,7 +26996,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[150].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BizIdentityInfo); i { + switch v := v.(*VerifiedNameCertificate); i { case 0: return &v.state case 1: @@ -26617,7 +27008,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[151].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BizAccountPayload); i { + switch v := v.(*LocalizedName); i { case 0: return &v.state case 1: @@ -26629,7 +27020,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[152].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BizAccountLinkInfo); i { + switch v := v.(*BizIdentityInfo); i { case 0: return &v.state case 1: @@ -26641,7 +27032,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[153].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HandshakeMessage); i { + switch v := v.(*BizAccountPayload); i { case 0: return &v.state case 1: @@ -26653,7 +27044,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[154].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HandshakeServerHello); i { + switch v := v.(*BizAccountLinkInfo); i { case 0: return &v.state case 1: @@ -26665,7 +27056,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[155].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HandshakeClientHello); i { + switch v := v.(*HandshakeMessage); i { case 0: return &v.state case 1: @@ -26677,7 +27068,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[156].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HandshakeClientFinish); i { + switch v := v.(*HandshakeServerHello); i { case 0: return &v.state case 1: @@ -26689,7 +27080,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[157].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientPayload); i { + switch v := v.(*HandshakeClientHello); i { case 0: return &v.state case 1: @@ -26701,7 +27092,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[158].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WebNotificationsInfo); i { + switch v := v.(*HandshakeClientFinish); i { case 0: return &v.state case 1: @@ -26713,7 +27104,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[159].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WebMessageInfo); i { + switch v := v.(*ClientPayload); i { case 0: return &v.state case 1: @@ -26725,7 +27116,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[160].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WebFeatures); i { + switch v := v.(*WebNotificationsInfo); i { case 0: return &v.state case 1: @@ -26737,7 +27128,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[161].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserReceipt); i { + switch v := v.(*WebMessageInfo); i { case 0: return &v.state case 1: @@ -26749,7 +27140,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[162].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StatusPSA); i { + switch v := v.(*WebFeatures); i { case 0: return &v.state case 1: @@ -26761,7 +27152,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[163].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Reaction); i { + switch v := v.(*UserReceipt); i { case 0: return &v.state case 1: @@ -26773,7 +27164,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[164].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PollUpdate); i { + switch v := v.(*StatusPSA); i { case 0: return &v.state case 1: @@ -26785,7 +27176,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[165].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PollAdditionalMetadata); i { + switch v := v.(*Reaction); i { case 0: return &v.state case 1: @@ -26797,7 +27188,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[166].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PinInChat); i { + switch v := v.(*PollUpdate); i { case 0: return &v.state case 1: @@ -26809,7 +27200,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[167].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PhotoChange); i { + switch v := v.(*PollAdditionalMetadata); i { case 0: return &v.state case 1: @@ -26821,7 +27212,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[168].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PaymentInfo); i { + switch v := v.(*PinInChat); i { case 0: return &v.state case 1: @@ -26833,7 +27224,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[169].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NotificationMessageInfo); i { + switch v := v.(*PhotoChange); i { case 0: return &v.state case 1: @@ -26845,7 +27236,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[170].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MessageAddOnContextInfo); i { + switch v := v.(*PaymentInfo); i { case 0: return &v.state case 1: @@ -26857,7 +27248,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[171].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MediaData); i { + switch v := v.(*NotificationMessageInfo); i { case 0: return &v.state case 1: @@ -26869,7 +27260,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[172].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KeepInChat); i { + switch v := v.(*MessageAddOnContextInfo); i { case 0: return &v.state case 1: @@ -26881,7 +27272,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[173].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NoiseCertificate); i { + switch v := v.(*MediaData); i { case 0: return &v.state case 1: @@ -26893,7 +27284,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[174].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CertChain); i { + switch v := v.(*KeepInChat); i { case 0: return &v.state case 1: @@ -26905,7 +27296,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[175].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeviceProps_HistorySyncConfig); i { + switch v := v.(*FutureproofMessageSecretMessage); i { case 0: return &v.state case 1: @@ -26917,7 +27308,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[176].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeviceProps_AppVersion); i { + switch v := v.(*FutureMessageData); i { case 0: return &v.state case 1: @@ -26929,7 +27320,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[177].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListResponseMessage_SingleSelectReply); i { + switch v := v.(*BotData); i { case 0: return &v.state case 1: @@ -26941,7 +27332,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[178].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListMessage_Section); i { + switch v := v.(*NoiseCertificate); i { case 0: return &v.state case 1: @@ -26953,7 +27344,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[179].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListMessage_Row); i { + switch v := v.(*CertChain); i { case 0: return &v.state case 1: @@ -26965,7 +27356,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[180].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListMessage_Product); i { + switch v := v.(*DeviceProps_HistorySyncConfig); i { case 0: return &v.state case 1: @@ -26977,7 +27368,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[181].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListMessage_ProductSection); i { + switch v := v.(*DeviceProps_AppVersion); i { case 0: return &v.state case 1: @@ -26989,7 +27380,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[182].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListMessage_ProductListInfo); i { + switch v := v.(*ListResponseMessage_SingleSelectReply); i { case 0: return &v.state case 1: @@ -27001,7 +27392,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[183].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListMessage_ProductListHeaderImage); i { + switch v := v.(*ListMessage_Section); i { case 0: return &v.state case 1: @@ -27013,7 +27404,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[184].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InteractiveResponseMessage_NativeFlowResponseMessage); i { + switch v := v.(*ListMessage_Row); i { case 0: return &v.state case 1: @@ -27025,7 +27416,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[185].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InteractiveResponseMessage_Body); i { + switch v := v.(*ListMessage_Product); i { case 0: return &v.state case 1: @@ -27037,7 +27428,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[186].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InteractiveMessage_ShopMessage); i { + switch v := v.(*ListMessage_ProductSection); i { case 0: return &v.state case 1: @@ -27049,7 +27440,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[187].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InteractiveMessage_NativeFlowMessage); i { + switch v := v.(*ListMessage_ProductListInfo); i { case 0: return &v.state case 1: @@ -27061,7 +27452,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[188].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InteractiveMessage_Header); i { + switch v := v.(*ListMessage_ProductListHeaderImage); i { case 0: return &v.state case 1: @@ -27073,7 +27464,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[189].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InteractiveMessage_Footer); i { + switch v := v.(*InteractiveResponseMessage_NativeFlowResponseMessage); i { case 0: return &v.state case 1: @@ -27085,7 +27476,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[190].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InteractiveMessage_CollectionMessage); i { + switch v := v.(*InteractiveResponseMessage_Body); i { case 0: return &v.state case 1: @@ -27097,7 +27488,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[191].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InteractiveMessage_Body); i { + switch v := v.(*InteractiveMessage_ShopMessage); i { case 0: return &v.state case 1: @@ -27109,7 +27500,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[192].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InteractiveMessage_NativeFlowMessage_NativeFlowButton); i { + switch v := v.(*InteractiveMessage_NativeFlowMessage); i { case 0: return &v.state case 1: @@ -27121,7 +27512,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[193].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HighlyStructuredMessage_HSMLocalizableParameter); i { + switch v := v.(*InteractiveMessage_Header); i { case 0: return &v.state case 1: @@ -27133,7 +27524,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[194].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime); i { + switch v := v.(*InteractiveMessage_Footer); i { case 0: return &v.state case 1: @@ -27145,7 +27536,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[195].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HighlyStructuredMessage_HSMLocalizableParameter_HSMCurrency); i { + switch v := v.(*InteractiveMessage_CollectionMessage); i { case 0: return &v.state case 1: @@ -27157,7 +27548,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[196].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeUnixEpoch); i { + switch v := v.(*InteractiveMessage_CarouselMessage); i { case 0: return &v.state case 1: @@ -27169,7 +27560,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[197].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent); i { + switch v := v.(*InteractiveMessage_Body); i { case 0: return &v.state case 1: @@ -27181,7 +27572,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[198].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ButtonsMessage_Button); i { + switch v := v.(*InteractiveMessage_NativeFlowMessage_NativeFlowButton); i { case 0: return &v.state case 1: @@ -27193,7 +27584,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[199].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ButtonsMessage_Button_NativeFlowInfo); i { + switch v := v.(*HighlyStructuredMessage_HSMLocalizableParameter); i { case 0: return &v.state case 1: @@ -27205,7 +27596,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[200].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ButtonsMessage_Button_ButtonText); i { + switch v := v.(*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime); i { case 0: return &v.state case 1: @@ -27217,7 +27608,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[201].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HydratedTemplateButton_HydratedURLButton); i { + switch v := v.(*HighlyStructuredMessage_HSMLocalizableParameter_HSMCurrency); i { case 0: return &v.state case 1: @@ -27229,7 +27620,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[202].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HydratedTemplateButton_HydratedQuickReplyButton); i { + switch v := v.(*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeUnixEpoch); i { case 0: return &v.state case 1: @@ -27241,7 +27632,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[203].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HydratedTemplateButton_HydratedCallButton); i { + switch v := v.(*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent); i { case 0: return &v.state case 1: @@ -27253,7 +27644,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[204].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContextInfo_UTMInfo); i { + switch v := v.(*ButtonsMessage_Button); i { case 0: return &v.state case 1: @@ -27265,7 +27656,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[205].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContextInfo_ExternalAdReplyInfo); i { + switch v := v.(*ButtonsMessage_Button_NativeFlowInfo); i { case 0: return &v.state case 1: @@ -27277,7 +27668,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[206].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContextInfo_AdReplyInfo); i { + switch v := v.(*ButtonsMessage_Button_ButtonText); i { case 0: return &v.state case 1: @@ -27289,7 +27680,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[207].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TemplateButton_URLButton); i { + switch v := v.(*HydratedTemplateButton_HydratedURLButton); i { case 0: return &v.state case 1: @@ -27301,7 +27692,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[208].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TemplateButton_QuickReplyButton); i { + switch v := v.(*HydratedTemplateButton_HydratedQuickReplyButton); i { case 0: return &v.state case 1: @@ -27313,7 +27704,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[209].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TemplateButton_CallButton); i { + switch v := v.(*HydratedTemplateButton_HydratedCallButton); i { case 0: return &v.state case 1: @@ -27325,7 +27716,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[210].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PaymentBackground_MediaData); i { + switch v := v.(*ContextInfo_UTMInfo); i { case 0: return &v.state case 1: @@ -27337,7 +27728,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[211].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TemplateMessage_HydratedFourRowTemplate); i { + switch v := v.(*ContextInfo_ExternalAdReplyInfo); i { case 0: return &v.state case 1: @@ -27349,7 +27740,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[212].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TemplateMessage_FourRowTemplate); i { + switch v := v.(*ContextInfo_AdReplyInfo); i { case 0: return &v.state case 1: @@ -27361,7 +27752,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[213].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProductMessage_ProductSnapshot); i { + switch v := v.(*BotAvatarMetadata_PlaybackMetadata); i { case 0: return &v.state case 1: @@ -27373,7 +27764,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[214].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProductMessage_CatalogSnapshot); i { + switch v := v.(*TemplateButton_URLButton); i { case 0: return &v.state case 1: @@ -27385,7 +27776,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[215].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PollCreationMessage_Option); i { + switch v := v.(*TemplateButton_QuickReplyButton); i { case 0: return &v.state case 1: @@ -27397,7 +27788,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[216].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PeerDataOperationRequestResponseMessage_PeerDataOperationResult); i { + switch v := v.(*TemplateButton_CallButton); i { case 0: return &v.state case 1: @@ -27409,7 +27800,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[217].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_PlaceholderMessageResendResponse); i { + switch v := v.(*PaymentBackground_MediaData); i { case 0: return &v.state case 1: @@ -27421,7 +27812,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[218].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse); i { + switch v := v.(*TemplateMessage_HydratedFourRowTemplate); i { case 0: return &v.state case 1: @@ -27433,7 +27824,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[219].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse_LinkPreviewHighQualityThumbnail); i { + switch v := v.(*TemplateMessage_FourRowTemplate); i { case 0: return &v.state case 1: @@ -27445,7 +27836,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[220].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PeerDataOperationRequestMessage_RequestUrlPreview); i { + switch v := v.(*ProductMessage_ProductSnapshot); i { case 0: return &v.state case 1: @@ -27457,7 +27848,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[221].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PeerDataOperationRequestMessage_RequestStickerReupload); i { + switch v := v.(*ProductMessage_CatalogSnapshot); i { case 0: return &v.state case 1: @@ -27469,7 +27860,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[222].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PeerDataOperationRequestMessage_PlaceholderMessageResendRequest); i { + switch v := v.(*PollCreationMessage_Option); i { case 0: return &v.state case 1: @@ -27481,7 +27872,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[223].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PeerDataOperationRequestMessage_HistorySyncOnDemandRequest); i { + switch v := v.(*PeerDataOperationRequestResponseMessage_PeerDataOperationResult); i { case 0: return &v.state case 1: @@ -27493,7 +27884,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[224].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgOpaqueData_PollOption); i { + switch v := v.(*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_PlaceholderMessageResendResponse); i { case 0: return &v.state case 1: @@ -27505,7 +27896,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[225].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VerifiedNameCertificate_Details); i { + switch v := v.(*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse); i { case 0: return &v.state case 1: @@ -27517,7 +27908,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[226].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientPayload_WebInfo); i { + switch v := v.(*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse_LinkPreviewHighQualityThumbnail); i { case 0: return &v.state case 1: @@ -27529,7 +27920,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[227].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientPayload_UserAgent); i { + switch v := v.(*PeerDataOperationRequestMessage_RequestUrlPreview); i { case 0: return &v.state case 1: @@ -27541,7 +27932,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[228].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientPayload_InteropData); i { + switch v := v.(*PeerDataOperationRequestMessage_RequestStickerReupload); i { case 0: return &v.state case 1: @@ -27553,7 +27944,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[229].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientPayload_DevicePairingRegistrationData); i { + switch v := v.(*PeerDataOperationRequestMessage_PlaceholderMessageResendRequest); i { case 0: return &v.state case 1: @@ -27565,7 +27956,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[230].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientPayload_DNSSource); i { + switch v := v.(*PeerDataOperationRequestMessage_HistorySyncOnDemandRequest); i { case 0: return &v.state case 1: @@ -27577,7 +27968,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[231].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientPayload_WebInfo_WebdPayload); i { + switch v := v.(*VerifiedNameCertificate_Details); i { case 0: return &v.state case 1: @@ -27589,7 +27980,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[232].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientPayload_UserAgent_AppVersion); i { + switch v := v.(*ClientPayload_WebInfo); i { case 0: return &v.state case 1: @@ -27601,7 +27992,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[233].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NoiseCertificate_Details); i { + switch v := v.(*ClientPayload_UserAgent); i { case 0: return &v.state case 1: @@ -27613,7 +28004,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[234].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CertChain_NoiseCertificate); i { + switch v := v.(*ClientPayload_InteropData); i { case 0: return &v.state case 1: @@ -27625,6 +28016,78 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[235].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClientPayload_DevicePairingRegistrationData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_binary_proto_def_proto_msgTypes[236].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClientPayload_DNSSource); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_binary_proto_def_proto_msgTypes[237].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClientPayload_WebInfo_WebdPayload); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_binary_proto_def_proto_msgTypes[238].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClientPayload_UserAgent_AppVersion); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_binary_proto_def_proto_msgTypes[239].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NoiseCertificate_Details); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_binary_proto_def_proto_msgTypes[240].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CertChain_NoiseCertificate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_binary_proto_def_proto_msgTypes[241].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CertChain_NoiseCertificate_Details); i { case 0: return &v.state @@ -27637,18 +28100,19 @@ func file_binary_proto_def_proto_init() { } } } - file_binary_proto_def_proto_msgTypes[14].OneofWrappers = []interface{}{ + file_binary_proto_def_proto_msgTypes[13].OneofWrappers = []interface{}{ (*InteractiveResponseMessage_NativeFlowResponseMessage_)(nil), } - file_binary_proto_def_proto_msgTypes[15].OneofWrappers = []interface{}{ + file_binary_proto_def_proto_msgTypes[14].OneofWrappers = []interface{}{ (*InteractiveMessage_ShopStorefrontMessage)(nil), (*InteractiveMessage_CollectionMessage_)(nil), (*InteractiveMessage_NativeFlowMessage_)(nil), + (*InteractiveMessage_CarouselMessage_)(nil), } - file_binary_proto_def_proto_msgTypes[32].OneofWrappers = []interface{}{ + file_binary_proto_def_proto_msgTypes[31].OneofWrappers = []interface{}{ (*ButtonsResponseMessage_SelectedDisplayText)(nil), } - file_binary_proto_def_proto_msgTypes[33].OneofWrappers = []interface{}{ + file_binary_proto_def_proto_msgTypes[32].OneofWrappers = []interface{}{ (*ButtonsMessage_Text)(nil), (*ButtonsMessage_DocumentMessage)(nil), (*ButtonsMessage_ImageMessage)(nil), @@ -27663,39 +28127,39 @@ func file_binary_proto_def_proto_init() { (*HydratedTemplateButton_UrlButton)(nil), (*HydratedTemplateButton_CallButton)(nil), } - file_binary_proto_def_proto_msgTypes[50].OneofWrappers = []interface{}{ + file_binary_proto_def_proto_msgTypes[52].OneofWrappers = []interface{}{ (*TemplateButton_QuickReplyButton_)(nil), (*TemplateButton_UrlButton)(nil), (*TemplateButton_CallButton_)(nil), } - file_binary_proto_def_proto_msgTypes[57].OneofWrappers = []interface{}{ + file_binary_proto_def_proto_msgTypes[60].OneofWrappers = []interface{}{ (*TemplateMessage_FourRowTemplate_)(nil), (*TemplateMessage_HydratedFourRowTemplate_)(nil), (*TemplateMessage_InteractiveMessageTemplate)(nil), } - file_binary_proto_def_proto_msgTypes[188].OneofWrappers = []interface{}{ + file_binary_proto_def_proto_msgTypes[193].OneofWrappers = []interface{}{ (*InteractiveMessage_Header_DocumentMessage)(nil), (*InteractiveMessage_Header_ImageMessage)(nil), (*InteractiveMessage_Header_JpegThumbnail)(nil), (*InteractiveMessage_Header_VideoMessage)(nil), (*InteractiveMessage_Header_LocationMessage)(nil), } - file_binary_proto_def_proto_msgTypes[193].OneofWrappers = []interface{}{ + file_binary_proto_def_proto_msgTypes[199].OneofWrappers = []interface{}{ (*HighlyStructuredMessage_HSMLocalizableParameter_Currency)(nil), (*HighlyStructuredMessage_HSMLocalizableParameter_DateTime)(nil), } - file_binary_proto_def_proto_msgTypes[194].OneofWrappers = []interface{}{ + file_binary_proto_def_proto_msgTypes[200].OneofWrappers = []interface{}{ (*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_Component)(nil), (*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_UnixEpoch)(nil), } - file_binary_proto_def_proto_msgTypes[211].OneofWrappers = []interface{}{ + file_binary_proto_def_proto_msgTypes[218].OneofWrappers = []interface{}{ (*TemplateMessage_HydratedFourRowTemplate_DocumentMessage)(nil), (*TemplateMessage_HydratedFourRowTemplate_HydratedTitleText)(nil), (*TemplateMessage_HydratedFourRowTemplate_ImageMessage)(nil), (*TemplateMessage_HydratedFourRowTemplate_VideoMessage)(nil), (*TemplateMessage_HydratedFourRowTemplate_LocationMessage)(nil), } - file_binary_proto_def_proto_msgTypes[212].OneofWrappers = []interface{}{ + file_binary_proto_def_proto_msgTypes[219].OneofWrappers = []interface{}{ (*TemplateMessage_FourRowTemplate_DocumentMessage)(nil), (*TemplateMessage_FourRowTemplate_HighlyStructuredMessage)(nil), (*TemplateMessage_FourRowTemplate_ImageMessage)(nil), @@ -27707,8 +28171,8 @@ func file_binary_proto_def_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_binary_proto_def_proto_rawDesc, - NumEnums: 60, - NumMessages: 236, + NumEnums: 62, + NumMessages: 242, NumExtensions: 0, NumServices: 0, }, diff --git a/vendor/go.mau.fi/whatsmeow/binary/proto/def.pb.raw b/vendor/go.mau.fi/whatsmeow/binary/proto/def.pb.raw index 1d251694..4727bbaa 100644 Binary files a/vendor/go.mau.fi/whatsmeow/binary/proto/def.pb.raw and b/vendor/go.mau.fi/whatsmeow/binary/proto/def.pb.raw differ diff --git a/vendor/go.mau.fi/whatsmeow/binary/proto/def.proto b/vendor/go.mau.fi/whatsmeow/binary/proto/def.proto index 0eb06ff2..01e0e5e8 100644 --- a/vendor/go.mau.fi/whatsmeow/binary/proto/def.proto +++ b/vendor/go.mau.fi/whatsmeow/binary/proto/def.proto @@ -61,6 +61,7 @@ message DeviceProps { WEAR_OS = 18; AR_WRIST = 19; AR_DEVICE = 20; + UWP = 21; } message HistorySyncConfig { optional uint32 fullSyncDaysLimit = 1; @@ -85,17 +86,6 @@ message DeviceProps { optional HistorySyncConfig historySyncConfig = 5; } -message PaymentInviteMessage { - enum ServiceType { - UNKNOWN = 0; - FBPAY = 1; - NOVI = 2; - UPI = 3; - } - optional ServiceType serviceType = 1; - optional int64 expiryTimestamp = 2; -} - message OrderMessage { enum OrderSurface { CATALOG = 1; @@ -301,6 +291,10 @@ message InteractiveMessage { optional int32 messageVersion = 3; } + message CarouselMessage { + repeated InteractiveMessage cards = 1; + } + message Body { optional string text = 1; } @@ -313,6 +307,7 @@ message InteractiveMessage { ShopMessage shopStorefrontMessage = 4; CollectionMessage collectionMessage = 5; NativeFlowMessage nativeFlowMessage = 6; + CarouselMessage carouselMessage = 7; } } @@ -626,6 +621,21 @@ message ButtonsMessage { } } +message BotFeedbackMessage { + enum BotFeedbackKind { + BOT_FEEDBACK_POSITIVE = 0; + BOT_FEEDBACK_NEGATIVE_GENERIC = 1; + BOT_FEEDBACK_NEGATIVE_HELPFUL = 2; + BOT_FEEDBACK_NEGATIVE_INTERESTING = 3; + BOT_FEEDBACK_NEGATIVE_ACCURATE = 4; + BOT_FEEDBACK_NEGATIVE_SAFE = 5; + BOT_FEEDBACK_NEGATIVE_OTHER = 6; + } + optional MessageKey messageKey = 1; + optional BotFeedbackKind kind = 2; + optional string text = 3; +} + message AudioMessage { optional string url = 1; optional string mimetype = 2; @@ -813,6 +823,24 @@ message ContextInfo { optional UTMInfo utm = 41; } +message BotMetadata { + optional BotAvatarMetadata avatarMetadata = 1; +} + +message BotAvatarMetadata { + message PlaybackMetadata { + optional string sdProgressiveUrl = 1; + optional string hdProgressiveUrl = 2; + optional string dashManifest = 3; + optional uint32 sentiment = 4; + optional uint32 durationMs = 5; + optional int64 videoID = 6; + } + + optional uint32 sentiment = 1; + repeated PlaybackMetadata dynamicVideoList = 2; +} + message ActionLink { optional string url = 1; optional string buttonTitle = 2; @@ -937,6 +965,13 @@ message Message { optional PollCreationMessage pollCreationMessageV3 = 64; optional ScheduledCallEditMessage scheduledCallEditMessage = 65; optional VideoMessage ptvMessage = 66; + optional FutureProofMessage botInvokeMessage = 67; +} + +message MessageSecretMessage { + optional sfixed32 version = 1; + optional bytes encIv = 2; + optional bytes encPayload = 3; } message MessageContextInfo { @@ -945,6 +980,8 @@ message MessageContextInfo { optional bytes messageSecret = 3; optional bytes paddingBytes = 4; optional uint32 messageAddOnDurationInSecs = 5; + optional bytes botMessageSecret = 6; + optional BotMetadata botMetadata = 7; } message VideoMessage { @@ -1116,6 +1153,8 @@ message ProtocolMessage { MESSAGE_EDIT = 14; PEER_DATA_OPERATION_REQUEST_MESSAGE = 16; PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE = 17; + REQUEST_WELCOME_MESSAGE = 18; + BOT_FEEDBACK_MESSAGE = 19; } optional MessageKey key = 1; optional Type type = 2; @@ -1131,6 +1170,7 @@ message ProtocolMessage { optional int64 timestampMs = 15; optional PeerDataOperationRequestMessage peerDataOperationRequestMessage = 16; optional PeerDataOperationRequestResponseMessage peerDataOperationRequestResponseMessage = 17; + optional BotFeedbackMessage botFeedbackMessage = 18; } message ProductMessage { @@ -1278,6 +1318,17 @@ message PeerDataOperationRequestMessage { repeated PlaceholderMessageResendRequest placeholderMessageResendRequest = 5; } +message PaymentInviteMessage { + enum ServiceType { + UNKNOWN = 0; + FBPAY = 1; + NOVI = 2; + UPI = 3; + } + optional ServiceType serviceType = 1; + optional int64 expiryTimestamp = 2; +} + message EphemeralSetting { optional sfixed32 duration = 1; optional sfixed64 timestamp = 2; @@ -1457,50 +1508,6 @@ message AutoDownloadSettings { optional bool downloadDocuments = 4; } -// Duplicate type omitted -//message PollEncValue { -// optional bytes encPayload = 1; -// optional bytes encIv = 2; -//} - -message MsgRowOpaqueData { - optional MsgOpaqueData currentMsg = 1; - optional MsgOpaqueData quotedMsg = 2; -} - -message MsgOpaqueData { - message PollOption { - optional string name = 1; - } - - optional string body = 1; - optional string caption = 3; - optional double lng = 5; - optional bool isLive = 6; - optional double lat = 7; - optional int32 paymentAmount1000 = 8; - optional string paymentNoteMsgBody = 9; - optional string canonicalUrl = 10; - optional string matchedText = 11; - optional string title = 12; - optional string description = 13; - optional bytes futureproofBuffer = 14; - optional string clientUrl = 15; - optional string loc = 16; - optional string pollName = 17; - repeated PollOption pollOptions = 18; - optional uint32 pollSelectableOptionsCount = 20; - optional bytes messageSecret = 21; - optional string originalSelfAuthor = 51; - optional int64 senderTimestampMs = 22; - optional string pollUpdateParentKey = 23; - optional PollEncValue encPollVote = 24; - optional bool isSentCagPollCreation = 28; - optional string encReactionTargetMessageKey = 25; - optional bytes encReactionEncPayload = 26; - optional bytes encReactionEncIv = 27; -} - message ServerErrorReceipt { optional string stanzaId = 1; } @@ -1996,6 +2003,13 @@ message ClientPayload { BLUE_WEB = 32; IPAD = 33; } + enum DeviceType { + PHONE = 0; + TABLET = 1; + DESKTOP = 2; + WEARABLE = 3; + VR = 4; + } message AppVersion { optional uint32 primary = 1; optional uint32 secondary = 2; @@ -2018,6 +2032,7 @@ message ClientPayload { optional string localeCountryIso31661Alpha2 = 12; optional string deviceBoard = 13; optional string deviceExpId = 14; + optional DeviceType deviceType = 15; } enum Product { @@ -2306,6 +2321,7 @@ message WebMessageInfo { PAYMENT_INVITE_SETUP_INVITEE_SEND_AND_RECEIVE = 180; LINKED_GROUP_CALL_START = 181; REPORT_TO_ADMIN_ENABLED_STATUS = 182; + EMPTY_SUBGROUP_CREATE = 183; } enum Status { ERROR = 0; @@ -2365,6 +2381,7 @@ message WebMessageInfo { optional string originalSelfAuthorUserJidString = 51; optional uint64 revokeMessageTimestamp = 52; optional PinInChat pinInChat = 54; + optional FutureproofMessageSecretMessage futureproofMessageSecretMessage = 55; } message WebFeatures { @@ -2566,6 +2583,19 @@ message KeepInChat { optional int64 serverTimestampMs = 6; } +message FutureproofMessageSecretMessage { + required MessageSecretMessage messageSecretMessage = 1; + required FutureMessageData futureMessageData = 2; +} + +message FutureMessageData { + optional BotData botData = 1; +} + +message BotData { + required MessageKey targetMessageKey = 1; +} + message NoiseCertificate { message Details { optional uint32 serial = 1; diff --git a/vendor/go.mau.fi/whatsmeow/client.go b/vendor/go.mau.fi/whatsmeow/client.go index 86581198..57311152 100644 --- a/vendor/go.mau.fi/whatsmeow/client.go +++ b/vendor/go.mau.fi/whatsmeow/client.go @@ -547,17 +547,46 @@ func (cli *Client) handleFrame(data []byte) { cli.handlerQueue <- node }() } - } else { + } else if node.Tag != "ack" { cli.Log.Debugf("Didn't handle WhatsApp node %s", node.Tag) } } +func stopAndDrainTimer(timer *time.Timer) { + if !timer.Stop() { + select { + case <-timer.C: + default: + } + } +} + func (cli *Client) handlerQueueLoop(ctx context.Context) { + timer := time.NewTimer(5 * time.Minute) + stopAndDrainTimer(timer) + cli.Log.Debugf("Starting handler queue loop") for { select { case node := <-cli.handlerQueue: - cli.nodeHandlers[node.Tag](node) + doneChan := make(chan struct{}, 1) + go func() { + start := time.Now() + cli.nodeHandlers[node.Tag](node) + duration := time.Since(start) + doneChan <- struct{}{} + if duration > 5*time.Second { + cli.Log.Warnf("Node handling took %s for %s", duration, node.XMLString()) + } + }() + timer.Reset(5 * time.Minute) + select { + case <-doneChan: + stopAndDrainTimer(timer) + case <-timer.C: + cli.Log.Warnf("Node handling is taking long for %s - continuing in background", node.XMLString()) + } case <-ctx.Done(): + cli.Log.Debugf("Closing handler queue loop") return } } diff --git a/vendor/go.mau.fi/whatsmeow/connectionevents.go b/vendor/go.mau.fi/whatsmeow/connectionevents.go index 3a6d9e29..617222e6 100644 --- a/vendor/go.mau.fi/whatsmeow/connectionevents.go +++ b/vendor/go.mau.fi/whatsmeow/connectionevents.go @@ -11,6 +11,7 @@ import ( "time" waBinary "go.mau.fi/whatsmeow/binary" + "go.mau.fi/whatsmeow/store" "go.mau.fi/whatsmeow/types" "go.mau.fi/whatsmeow/types/events" ) @@ -97,7 +98,7 @@ func (cli *Client) handleConnectFailure(node *waBinary.Node) { Expire: time.Duration(ag.Int("expire")) * time.Second, }) } else if reason == events.ConnectFailureClientOutdated { - cli.Log.Errorf("Client outdated (405) connect failure") + cli.Log.Errorf("Client outdated (405) connect failure (client version: %s)", store.GetWAVersion().String()) go cli.dispatchEvent(&events.ClientOutdated{}) } else if reason == events.ConnectFailureServiceUnavailable { cli.Log.Warnf("Got 503 connect failure, assuming automatic reconnect will handle it") diff --git a/vendor/go.mau.fi/whatsmeow/download.go b/vendor/go.mau.fi/whatsmeow/download.go index 84e78886..3e510be6 100644 --- a/vendor/go.mau.fi/whatsmeow/download.go +++ b/vendor/go.mau.fi/whatsmeow/download.go @@ -12,8 +12,10 @@ import ( "encoding/base64" "fmt" "io" + "net" "net/http" "strings" + "time" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" @@ -233,7 +235,7 @@ func (cli *Client) DownloadMediaWithPath(directPath string, encFileHash, fileHas func (cli *Client) downloadAndDecrypt(url string, mediaKey []byte, appInfo MediaType, fileLength int, fileEncSha256, fileSha256 []byte) (data []byte, err error) { iv, cipherKey, macKey, _ := getMediaKeys(mediaKey, appInfo) var ciphertext, mac []byte - if ciphertext, mac, err = cli.downloadEncryptedMedia(url, fileEncSha256); err != nil { + if ciphertext, mac, err = cli.downloadEncryptedMediaWithRetries(url, fileEncSha256); err != nil { } else if err = validateMedia(iv, ciphertext, macKey, mac); err != nil { @@ -252,6 +254,23 @@ func getMediaKeys(mediaKey []byte, appInfo MediaType) (iv, cipherKey, macKey, re return mediaKeyExpanded[:16], mediaKeyExpanded[16:48], mediaKeyExpanded[48:80], mediaKeyExpanded[80:] } +func (cli *Client) downloadEncryptedMediaWithRetries(url string, checksum []byte) (file, mac []byte, err error) { + for retryNum := 0; retryNum < 5; retryNum++ { + file, mac, err = cli.downloadEncryptedMedia(url, checksum) + if err == nil { + return + } + netErr, ok := err.(net.Error) + if !ok { + // Not a network error, don't retry + return + } + cli.Log.Warnf("Failed to download media due to network error: %w, retrying...", netErr) + time.Sleep(time.Duration(retryNum+1) * time.Second) + } + return +} + func (cli *Client) downloadEncryptedMedia(url string, checksum []byte) (file, mac []byte, err error) { var req *http.Request req, err = http.NewRequest(http.MethodGet, url, nil) diff --git a/vendor/go.mau.fi/whatsmeow/message.go b/vendor/go.mau.fi/whatsmeow/message.go index 8945ce4c..98cf8b46 100644 --- a/vendor/go.mau.fi/whatsmeow/message.go +++ b/vendor/go.mau.fi/whatsmeow/message.go @@ -157,7 +157,12 @@ func (cli *Client) decryptMessages(info *types.MessageInfo, node *waBinary.Node) cli.Log.Warnf("Error decrypting message from %s: %v", info.SourceString(), err) isUnavailable := encType == "skmsg" && !containsDirectMsg && errors.Is(err, signalerror.ErrNoSenderKeyForUser) go cli.sendRetryReceipt(node, isUnavailable) - cli.dispatchEvent(&events.UndecryptableMessage{Info: *info, IsUnavailable: isUnavailable}) + decryptFailMode, _ := child.Attrs["decrypt-fail"].(string) + cli.dispatchEvent(&events.UndecryptableMessage{ + Info: *info, + IsUnavailable: isUnavailable, + DecryptFailMode: events.DecryptFailMode(decryptFailMode), + }) return } diff --git a/vendor/go.mau.fi/whatsmeow/send.go b/vendor/go.mau.fi/whatsmeow/send.go index d2b379b0..7a09d78a 100644 --- a/vendor/go.mau.fi/whatsmeow/send.go +++ b/vendor/go.mau.fi/whatsmeow/send.go @@ -30,6 +30,7 @@ import ( waBinary "go.mau.fi/whatsmeow/binary" waProto "go.mau.fi/whatsmeow/binary/proto" "go.mau.fi/whatsmeow/types" + "go.mau.fi/whatsmeow/types/events" ) // GenerateMessageID generates a random string that can be used as a message ID on WhatsApp. @@ -691,10 +692,10 @@ func (cli *Client) prepareMessageNode(ctx context.Context, to, ownID types.JID, } if editAttr := getEditAttribute(message); editAttr != "" { attrs["edit"] = editAttr - encAttrs["decrypt-fail"] = "hide" + encAttrs["decrypt-fail"] = string(events.DecryptFailHide) } if msgType == "reaction" { - encAttrs["decrypt-fail"] = "hide" + encAttrs["decrypt-fail"] = string(events.DecryptFailHide) } start = time.Now() diff --git a/vendor/go.mau.fi/whatsmeow/store/clientpayload.go b/vendor/go.mau.fi/whatsmeow/store/clientpayload.go index 777b5e53..f2f7c6f8 100644 --- a/vendor/go.mau.fi/whatsmeow/store/clientpayload.go +++ b/vendor/go.mau.fi/whatsmeow/store/clientpayload.go @@ -74,7 +74,7 @@ func (vc WAVersionContainer) ProtoAppVersion() *waProto.ClientPayload_UserAgent_ } // waVersion is the WhatsApp web client version -var waVersion = WAVersionContainer{2, 2322, 15} +var waVersion = WAVersionContainer{2, 2325, 3} // waVersionHash is the md5 hash of a dot-separated waVersion var waVersionHash [16]byte diff --git a/vendor/go.mau.fi/whatsmeow/types/events/events.go b/vendor/go.mau.fi/whatsmeow/types/events/events.go index 4ec38d20..97d0babe 100644 --- a/vendor/go.mau.fi/whatsmeow/types/events/events.go +++ b/vendor/go.mau.fi/whatsmeow/types/events/events.go @@ -199,6 +199,13 @@ type HistorySync struct { Data *waProto.HistorySync } +type DecryptFailMode string + +const ( + DecryptFailShow DecryptFailMode = "" + DecryptFailHide DecryptFailMode = "hide" +) + // UndecryptableMessage is emitted when receiving a new message that failed to decrypt. // // The library will automatically ask the sender to retry. If the sender resends the message, @@ -211,6 +218,8 @@ type UndecryptableMessage struct { // IsUnavailable is true if the recipient device didn't send a ciphertext to this device at all // (as opposed to sending a ciphertext, but the ciphertext not being decryptable). IsUnavailable bool + + DecryptFailMode DecryptFailMode } // Message is emitted when receiving a new message. diff --git a/vendor/golang.org/x/net/http2/server.go b/vendor/golang.org/x/net/http2/server.go index cd057f39..033b6e6d 100644 --- a/vendor/golang.org/x/net/http2/server.go +++ b/vendor/golang.org/x/net/http2/server.go @@ -441,7 +441,7 @@ func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) { if s.NewWriteScheduler != nil { sc.writeSched = s.NewWriteScheduler() } else { - sc.writeSched = NewPriorityWriteScheduler(nil) + sc.writeSched = newRoundRobinWriteScheduler() } // These start at the RFC-specified defaults. If there is a higher @@ -2429,7 +2429,7 @@ type requestBody struct { conn *serverConn closeOnce sync.Once // for use by Close only sawEOF bool // for use by Read only - pipe *pipe // non-nil if we have a HTTP entity message body + pipe *pipe // non-nil if we have an HTTP entity message body needsContinue bool // need to send a 100-continue } @@ -2569,7 +2569,8 @@ func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) { clen = "" } } - if clen == "" && rws.handlerDone && bodyAllowedForStatus(rws.status) && (len(p) > 0 || !isHeadResp) { + _, hasContentLength := rws.snapHeader["Content-Length"] + if !hasContentLength && clen == "" && rws.handlerDone && bodyAllowedForStatus(rws.status) && (len(p) > 0 || !isHeadResp) { clen = strconv.Itoa(len(p)) } _, hasContentType := rws.snapHeader["Content-Type"] @@ -2774,7 +2775,7 @@ func (w *responseWriter) FlushError() error { err = rws.bw.Flush() } else { // The bufio.Writer won't call chunkWriter.Write - // (writeChunk with zero bytes, so we have to do it + // (writeChunk with zero bytes), so we have to do it // ourselves to force the HTTP response header and/or // final DATA frame (with END_STREAM) to be sent. _, err = chunkWriter{rws}.Write(nil) diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go index ac90a263..4f08ccba 100644 --- a/vendor/golang.org/x/net/http2/transport.go +++ b/vendor/golang.org/x/net/http2/transport.go @@ -1268,8 +1268,8 @@ func (cc *ClientConn) RoundTrip(req *http.Request) (*http.Response, error) { cancelRequest := func(cs *clientStream, err error) error { cs.cc.mu.Lock() - defer cs.cc.mu.Unlock() cs.abortStreamLocked(err) + bodyClosed := cs.reqBodyClosed if cs.ID != 0 { // This request may have failed because of a problem with the connection, // or for some unrelated reason. (For example, the user might have canceled @@ -1284,6 +1284,23 @@ func (cc *ClientConn) RoundTrip(req *http.Request) (*http.Response, error) { // will not help. cs.cc.doNotReuse = true } + cs.cc.mu.Unlock() + // Wait for the request body to be closed. + // + // If nothing closed the body before now, abortStreamLocked + // will have started a goroutine to close it. + // + // Closing the body before returning avoids a race condition + // with net/http checking its readTrackingBody to see if the + // body was read from or closed. See golang/go#60041. + // + // The body is closed in a separate goroutine without the + // connection mutex held, but dropping the mutex before waiting + // will keep us from holding it indefinitely if the body + // close is slow for some reason. + if bodyClosed != nil { + <-bodyClosed + } return err } @@ -1899,7 +1916,7 @@ func (cc *ClientConn) encodeHeaders(req *http.Request, addGzipHeader bool, trail // 8.1.2.3 Request Pseudo-Header Fields // The :path pseudo-header field includes the path and query parts of the // target URI (the path-absolute production and optionally a '?' character - // followed by the query production (see Sections 3.3 and 3.4 of + // followed by the query production, see Sections 3.3 and 3.4 of // [RFC3986]). f(":authority", host) m := req.Method diff --git a/vendor/golang.org/x/net/http2/writesched.go b/vendor/golang.org/x/net/http2/writesched.go index c7cd0017..cc893adc 100644 --- a/vendor/golang.org/x/net/http2/writesched.go +++ b/vendor/golang.org/x/net/http2/writesched.go @@ -184,7 +184,8 @@ func (wr *FrameWriteRequest) replyToWriter(err error) { // writeQueue is used by implementations of WriteScheduler. type writeQueue struct { - s []FrameWriteRequest + s []FrameWriteRequest + prev, next *writeQueue } func (q *writeQueue) empty() bool { return len(q.s) == 0 } diff --git a/vendor/golang.org/x/net/http2/writesched_roundrobin.go b/vendor/golang.org/x/net/http2/writesched_roundrobin.go new file mode 100644 index 00000000..54fe8632 --- /dev/null +++ b/vendor/golang.org/x/net/http2/writesched_roundrobin.go @@ -0,0 +1,119 @@ +// Copyright 2023 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 http2 + +import ( + "fmt" + "math" +) + +type roundRobinWriteScheduler struct { + // control contains control frames (SETTINGS, PING, etc.). + control writeQueue + + // streams maps stream ID to a queue. + streams map[uint32]*writeQueue + + // stream queues are stored in a circular linked list. + // head is the next stream to write, or nil if there are no streams open. + head *writeQueue + + // pool of empty queues for reuse. + queuePool writeQueuePool +} + +// newRoundRobinWriteScheduler constructs a new write scheduler. +// The round robin scheduler priorizes control frames +// like SETTINGS and PING over DATA frames. +// When there are no control frames to send, it performs a round-robin +// selection from the ready streams. +func newRoundRobinWriteScheduler() WriteScheduler { + ws := &roundRobinWriteScheduler{ + streams: make(map[uint32]*writeQueue), + } + return ws +} + +func (ws *roundRobinWriteScheduler) OpenStream(streamID uint32, options OpenStreamOptions) { + if ws.streams[streamID] != nil { + panic(fmt.Errorf("stream %d already opened", streamID)) + } + q := ws.queuePool.get() + ws.streams[streamID] = q + if ws.head == nil { + ws.head = q + q.next = q + q.prev = q + } else { + // Queues are stored in a ring. + // Insert the new stream before ws.head, putting it at the end of the list. + q.prev = ws.head.prev + q.next = ws.head + q.prev.next = q + q.next.prev = q + } +} + +func (ws *roundRobinWriteScheduler) CloseStream(streamID uint32) { + q := ws.streams[streamID] + if q == nil { + return + } + if q.next == q { + // This was the only open stream. + ws.head = nil + } else { + q.prev.next = q.next + q.next.prev = q.prev + if ws.head == q { + ws.head = q.next + } + } + delete(ws.streams, streamID) + ws.queuePool.put(q) +} + +func (ws *roundRobinWriteScheduler) AdjustStream(streamID uint32, priority PriorityParam) {} + +func (ws *roundRobinWriteScheduler) Push(wr FrameWriteRequest) { + if wr.isControl() { + ws.control.push(wr) + return + } + q := ws.streams[wr.StreamID()] + if q == nil { + // This is a closed stream. + // wr should not be a HEADERS or DATA frame. + // We push the request onto the control queue. + if wr.DataSize() > 0 { + panic("add DATA on non-open stream") + } + ws.control.push(wr) + return + } + q.push(wr) +} + +func (ws *roundRobinWriteScheduler) Pop() (FrameWriteRequest, bool) { + // Control and RST_STREAM frames first. + if !ws.control.empty() { + return ws.control.shift(), true + } + if ws.head == nil { + return FrameWriteRequest{}, false + } + q := ws.head + for { + if wr, ok := q.consume(math.MaxInt32); ok { + ws.head = q.next + return wr, true + } + q = q.next + if q == ws.head { + break + } + } + return FrameWriteRequest{}, false +} diff --git a/vendor/golang.org/x/sync/errgroup/errgroup.go b/vendor/golang.org/x/sync/errgroup/errgroup.go index cbee7a4e..b18efb74 100644 --- a/vendor/golang.org/x/sync/errgroup/errgroup.go +++ b/vendor/golang.org/x/sync/errgroup/errgroup.go @@ -20,7 +20,7 @@ type token struct{} // A zero Group is valid, has no limit on the number of active goroutines, // and does not cancel on error. type Group struct { - cancel func() + cancel func(error) wg sync.WaitGroup @@ -43,7 +43,7 @@ func (g *Group) done() { // returns a non-nil error or the first time Wait returns, whichever occurs // first. func WithContext(ctx context.Context) (*Group, context.Context) { - ctx, cancel := context.WithCancel(ctx) + ctx, cancel := withCancelCause(ctx) return &Group{cancel: cancel}, ctx } @@ -52,7 +52,7 @@ func WithContext(ctx context.Context) (*Group, context.Context) { func (g *Group) Wait() error { g.wg.Wait() if g.cancel != nil { - g.cancel() + g.cancel(g.err) } return g.err } @@ -76,7 +76,7 @@ func (g *Group) Go(f func() error) { g.errOnce.Do(func() { g.err = err if g.cancel != nil { - g.cancel() + g.cancel(g.err) } }) } @@ -105,7 +105,7 @@ func (g *Group) TryGo(f func() error) bool { g.errOnce.Do(func() { g.err = err if g.cancel != nil { - g.cancel() + g.cancel(g.err) } }) } diff --git a/vendor/golang.org/x/sync/errgroup/go120.go b/vendor/golang.org/x/sync/errgroup/go120.go new file mode 100644 index 00000000..7d419d37 --- /dev/null +++ b/vendor/golang.org/x/sync/errgroup/go120.go @@ -0,0 +1,14 @@ +// Copyright 2023 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. + +//go:build go1.20 +// +build go1.20 + +package errgroup + +import "context" + +func withCancelCause(parent context.Context) (context.Context, func(error)) { + return context.WithCancelCause(parent) +} diff --git a/vendor/golang.org/x/sync/errgroup/pre_go120.go b/vendor/golang.org/x/sync/errgroup/pre_go120.go new file mode 100644 index 00000000..1795c18a --- /dev/null +++ b/vendor/golang.org/x/sync/errgroup/pre_go120.go @@ -0,0 +1,15 @@ +// Copyright 2023 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. + +//go:build !go1.20 +// +build !go1.20 + +package errgroup + +import "context" + +func withCancelCause(parent context.Context) (context.Context, func(error)) { + ctx, cancel := context.WithCancel(parent) + return ctx, func(error) { cancel() } +} diff --git a/vendor/golang.org/x/sys/cpu/endian_little.go b/vendor/golang.org/x/sys/cpu/endian_little.go index fe545966..55db853e 100644 --- a/vendor/golang.org/x/sys/cpu/endian_little.go +++ b/vendor/golang.org/x/sys/cpu/endian_little.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh -// +build 386 amd64 amd64p32 alpha arm arm64 loong64 mipsle mips64le mips64p32le nios2 ppc64le riscv riscv64 sh +//go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh || wasm +// +build 386 amd64 amd64p32 alpha arm arm64 loong64 mipsle mips64le mips64p32le nios2 ppc64le riscv riscv64 sh wasm package cpu diff --git a/vendor/golang.org/x/sys/unix/mkall.sh b/vendor/golang.org/x/sys/unix/mkall.sh index 8e3947c3..e6f31d37 100644 --- a/vendor/golang.org/x/sys/unix/mkall.sh +++ b/vendor/golang.org/x/sys/unix/mkall.sh @@ -50,7 +50,7 @@ if [[ "$GOOS" = "linux" ]]; then # Use the Docker-based build system # Files generated through docker (use $cmd so you can Ctl-C the build or run) $cmd docker build --tag generate:$GOOS $GOOS - $cmd docker run --interactive --tty --volume $(cd -- "$(dirname -- "$0")/.." && /bin/pwd):/build generate:$GOOS + $cmd docker run --interactive --tty --volume $(cd -- "$(dirname -- "$0")/.." && pwd):/build generate:$GOOS exit fi diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh index be0423e6..31564627 100644 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -741,7 +741,8 @@ main(void) e = errors[i].num; if(i > 0 && errors[i-1].num == e) continue; - strcpy(buf, strerror(e)); + strncpy(buf, strerror(e), sizeof(buf) - 1); + buf[sizeof(buf) - 1] = '\0'; // lowercase first letter: Bad -> bad, but STREAM -> STREAM. if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z) buf[0] += a - A; @@ -760,7 +761,8 @@ main(void) e = signals[i].num; if(i > 0 && signals[i-1].num == e) continue; - strcpy(buf, strsignal(e)); + strncpy(buf, strsignal(e), sizeof(buf) - 1); + buf[sizeof(buf) - 1] = '\0'; // lowercase first letter: Bad -> bad, but STREAM -> STREAM. if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z) buf[0] += a - A; diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go index fbaeb5ff..6de486be 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -1699,12 +1699,23 @@ func PtracePokeUser(pid int, addr uintptr, data []byte) (count int, err error) { return ptracePoke(PTRACE_POKEUSR, PTRACE_PEEKUSR, pid, addr, data) } +// elfNT_PRSTATUS is a copy of the debug/elf.NT_PRSTATUS constant so +// x/sys/unix doesn't need to depend on debug/elf and thus +// compress/zlib, debug/dwarf, and other packages. +const elfNT_PRSTATUS = 1 + func PtraceGetRegs(pid int, regsout *PtraceRegs) (err error) { - return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) + var iov Iovec + iov.Base = (*byte)(unsafe.Pointer(regsout)) + iov.SetLen(int(unsafe.Sizeof(*regsout))) + return ptracePtr(PTRACE_GETREGSET, pid, uintptr(elfNT_PRSTATUS), unsafe.Pointer(&iov)) } func PtraceSetRegs(pid int, regs *PtraceRegs) (err error) { - return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) + var iov Iovec + iov.Base = (*byte)(unsafe.Pointer(regs)) + iov.SetLen(int(unsafe.Sizeof(*regs))) + return ptracePtr(PTRACE_SETREGSET, pid, uintptr(elfNT_PRSTATUS), unsafe.Pointer(&iov)) } func PtraceSetOptions(pid int, options int) (err error) { @@ -2420,6 +2431,21 @@ func PthreadSigmask(how int, set, oldset *Sigset_t) error { return rtSigprocmask(how, set, oldset, _C__NSIG/8) } +//sysnb getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) +//sysnb getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) + +func Getresuid() (ruid, euid, suid int) { + var r, e, s _C_int + getresuid(&r, &e, &s) + return int(r), int(e), int(s) +} + +func Getresgid() (rgid, egid, sgid int) { + var r, e, s _C_int + getresgid(&r, &e, &s) + return int(r), int(e), int(s) +} + /* * Unimplemented */ diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd.go b/vendor/golang.org/x/sys/unix/syscall_openbsd.go index f9c7a966..c5f166a1 100644 --- a/vendor/golang.org/x/sys/unix/syscall_openbsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_openbsd.go @@ -151,6 +151,21 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { return } +//sysnb getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) +//sysnb getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) + +func Getresuid() (ruid, euid, suid int) { + var r, e, s _C_int + getresuid(&r, &e, &s) + return int(r), int(e), int(s) +} + +func Getresgid() (rgid, egid, sgid int) { + var r, e, s _C_int + getresgid(&r, &e, &s) + return int(r), int(e), int(s) +} + //sys ioctl(fd int, req uint, arg uintptr) (err error) //sys ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) = SYS_IOCTL @@ -338,8 +353,6 @@ func Uname(uname *Utsname) error { // getgid // getitimer // getlogin -// getresgid -// getresuid // getthrid // ktrace // lfs_bmapv diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go index f6192526..48984202 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go @@ -329,6 +329,54 @@ const ( SCM_WIFI_STATUS = 0x25 SFD_CLOEXEC = 0x400000 SFD_NONBLOCK = 0x4000 + SF_FP = 0x38 + SF_I0 = 0x20 + SF_I1 = 0x24 + SF_I2 = 0x28 + SF_I3 = 0x2c + SF_I4 = 0x30 + SF_I5 = 0x34 + SF_L0 = 0x0 + SF_L1 = 0x4 + SF_L2 = 0x8 + SF_L3 = 0xc + SF_L4 = 0x10 + SF_L5 = 0x14 + SF_L6 = 0x18 + SF_L7 = 0x1c + SF_PC = 0x3c + SF_RETP = 0x40 + SF_V9_FP = 0x70 + SF_V9_I0 = 0x40 + SF_V9_I1 = 0x48 + SF_V9_I2 = 0x50 + SF_V9_I3 = 0x58 + SF_V9_I4 = 0x60 + SF_V9_I5 = 0x68 + SF_V9_L0 = 0x0 + SF_V9_L1 = 0x8 + SF_V9_L2 = 0x10 + SF_V9_L3 = 0x18 + SF_V9_L4 = 0x20 + SF_V9_L5 = 0x28 + SF_V9_L6 = 0x30 + SF_V9_L7 = 0x38 + SF_V9_PC = 0x78 + SF_V9_RETP = 0x80 + SF_V9_XARG0 = 0x88 + SF_V9_XARG1 = 0x90 + SF_V9_XARG2 = 0x98 + SF_V9_XARG3 = 0xa0 + SF_V9_XARG4 = 0xa8 + SF_V9_XARG5 = 0xb0 + SF_V9_XXARG = 0xb8 + SF_XARG0 = 0x44 + SF_XARG1 = 0x48 + SF_XARG2 = 0x4c + SF_XARG3 = 0x50 + SF_XARG4 = 0x54 + SF_XARG5 = 0x58 + SF_XXARG = 0x5c SIOCATMARK = 0x8905 SIOCGPGRP = 0x8904 SIOCGSTAMPNS_NEW = 0x40108907 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux.go b/vendor/golang.org/x/sys/unix/zsyscall_linux.go index da63d9d7..722c29a0 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux.go @@ -2172,3 +2172,17 @@ func rtSigprocmask(how int, set *Sigset_t, oldset *Sigset_t, sigsetsize uintptr) } return } + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) { + RawSyscallNoError(SYS_GETRESUID, uintptr(unsafe.Pointer(ruid)), uintptr(unsafe.Pointer(euid)), uintptr(unsafe.Pointer(suid))) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) { + RawSyscallNoError(SYS_GETRESGID, uintptr(unsafe.Pointer(rgid)), uintptr(unsafe.Pointer(egid)), uintptr(unsafe.Pointer(sgid))) + return +} diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go index 6699a783..9ab9abf7 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go @@ -519,6 +519,28 @@ var libc_getcwd_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) { + syscall_rawSyscall(libc_getresuid_trampoline_addr, uintptr(unsafe.Pointer(ruid)), uintptr(unsafe.Pointer(euid)), uintptr(unsafe.Pointer(suid))) + return +} + +var libc_getresuid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getresuid getresuid "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) { + syscall_rawSyscall(libc_getresgid_trampoline_addr, uintptr(unsafe.Pointer(rgid)), uintptr(unsafe.Pointer(egid)), uintptr(unsafe.Pointer(sgid))) + return +} + +var libc_getresgid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getresgid getresgid "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s index 04f0de34..3dcacd30 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s @@ -158,6 +158,16 @@ TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $4 DATA ·libc_getcwd_trampoline_addr(SB)/4, $libc_getcwd_trampoline<>(SB) +TEXT libc_getresuid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getresuid(SB) +GLOBL ·libc_getresuid_trampoline_addr(SB), RODATA, $4 +DATA ·libc_getresuid_trampoline_addr(SB)/4, $libc_getresuid_trampoline<>(SB) + +TEXT libc_getresgid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getresgid(SB) +GLOBL ·libc_getresgid_trampoline_addr(SB), RODATA, $4 +DATA ·libc_getresgid_trampoline_addr(SB)/4, $libc_getresgid_trampoline<>(SB) + TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ioctl(SB) GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $4 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go index 1e775fe0..915761ea 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go @@ -519,15 +519,29 @@ var libc_getcwd_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func ioctl(fd int, req uint, arg uintptr) (err error) { - _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg)) - if e1 != 0 { - err = errnoErr(e1) - } +func getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) { + syscall_rawSyscall(libc_getresuid_trampoline_addr, uintptr(unsafe.Pointer(ruid)), uintptr(unsafe.Pointer(euid)), uintptr(unsafe.Pointer(suid))) return } -func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { +var libc_getresuid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getresuid getresuid "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) { + syscall_rawSyscall(libc_getresgid_trampoline_addr, uintptr(unsafe.Pointer(rgid)), uintptr(unsafe.Pointer(egid)), uintptr(unsafe.Pointer(sgid))) + return +} + +var libc_getresgid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getresgid getresgid "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) @@ -541,6 +555,16 @@ var libc_ioctl_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { + _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s index 27b6f4df..2763620b 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s @@ -158,6 +158,16 @@ TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $8 DATA ·libc_getcwd_trampoline_addr(SB)/8, $libc_getcwd_trampoline<>(SB) +TEXT libc_getresuid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getresuid(SB) +GLOBL ·libc_getresuid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getresuid_trampoline_addr(SB)/8, $libc_getresuid_trampoline<>(SB) + +TEXT libc_getresgid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getresgid(SB) +GLOBL ·libc_getresgid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getresgid_trampoline_addr(SB)/8, $libc_getresgid_trampoline<>(SB) + TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ioctl(SB) GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go index 7f642789..8e87fdf1 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go @@ -519,6 +519,28 @@ var libc_getcwd_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) { + syscall_rawSyscall(libc_getresuid_trampoline_addr, uintptr(unsafe.Pointer(ruid)), uintptr(unsafe.Pointer(euid)), uintptr(unsafe.Pointer(suid))) + return +} + +var libc_getresuid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getresuid getresuid "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) { + syscall_rawSyscall(libc_getresgid_trampoline_addr, uintptr(unsafe.Pointer(rgid)), uintptr(unsafe.Pointer(egid)), uintptr(unsafe.Pointer(sgid))) + return +} + +var libc_getresgid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getresgid getresgid "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s index b797045f..c9223140 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s @@ -158,6 +158,16 @@ TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $4 DATA ·libc_getcwd_trampoline_addr(SB)/4, $libc_getcwd_trampoline<>(SB) +TEXT libc_getresuid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getresuid(SB) +GLOBL ·libc_getresuid_trampoline_addr(SB), RODATA, $4 +DATA ·libc_getresuid_trampoline_addr(SB)/4, $libc_getresuid_trampoline<>(SB) + +TEXT libc_getresgid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getresgid(SB) +GLOBL ·libc_getresgid_trampoline_addr(SB), RODATA, $4 +DATA ·libc_getresgid_trampoline_addr(SB)/4, $libc_getresgid_trampoline<>(SB) + TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ioctl(SB) GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $4 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go index 756ef7b1..12a7a216 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go @@ -519,6 +519,28 @@ var libc_getcwd_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) { + syscall_rawSyscall(libc_getresuid_trampoline_addr, uintptr(unsafe.Pointer(ruid)), uintptr(unsafe.Pointer(euid)), uintptr(unsafe.Pointer(suid))) + return +} + +var libc_getresuid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getresuid getresuid "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) { + syscall_rawSyscall(libc_getresgid_trampoline_addr, uintptr(unsafe.Pointer(rgid)), uintptr(unsafe.Pointer(egid)), uintptr(unsafe.Pointer(sgid))) + return +} + +var libc_getresgid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getresgid getresgid "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s index a8712662..a6bc32c9 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s @@ -158,6 +158,16 @@ TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $8 DATA ·libc_getcwd_trampoline_addr(SB)/8, $libc_getcwd_trampoline<>(SB) +TEXT libc_getresuid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getresuid(SB) +GLOBL ·libc_getresuid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getresuid_trampoline_addr(SB)/8, $libc_getresuid_trampoline<>(SB) + +TEXT libc_getresgid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getresgid(SB) +GLOBL ·libc_getresgid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getresgid_trampoline_addr(SB)/8, $libc_getresgid_trampoline<>(SB) + TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ioctl(SB) GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go index 7bc2e24e..b19e8aa0 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go @@ -519,6 +519,28 @@ var libc_getcwd_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) { + syscall_rawSyscall(libc_getresuid_trampoline_addr, uintptr(unsafe.Pointer(ruid)), uintptr(unsafe.Pointer(euid)), uintptr(unsafe.Pointer(suid))) + return +} + +var libc_getresuid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getresuid getresuid "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) { + syscall_rawSyscall(libc_getresgid_trampoline_addr, uintptr(unsafe.Pointer(rgid)), uintptr(unsafe.Pointer(egid)), uintptr(unsafe.Pointer(sgid))) + return +} + +var libc_getresgid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getresgid getresgid "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s index 05d4bffd..b4e7bcea 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s @@ -158,6 +158,16 @@ TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $8 DATA ·libc_getcwd_trampoline_addr(SB)/8, $libc_getcwd_trampoline<>(SB) +TEXT libc_getresuid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getresuid(SB) +GLOBL ·libc_getresuid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getresuid_trampoline_addr(SB)/8, $libc_getresuid_trampoline<>(SB) + +TEXT libc_getresgid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getresgid(SB) +GLOBL ·libc_getresgid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getresgid_trampoline_addr(SB)/8, $libc_getresgid_trampoline<>(SB) + TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ioctl(SB) GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go index 739be621..fb99594c 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go @@ -519,6 +519,28 @@ var libc_getcwd_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) { + syscall_rawSyscall(libc_getresuid_trampoline_addr, uintptr(unsafe.Pointer(ruid)), uintptr(unsafe.Pointer(euid)), uintptr(unsafe.Pointer(suid))) + return +} + +var libc_getresuid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getresuid getresuid "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) { + syscall_rawSyscall(libc_getresgid_trampoline_addr, uintptr(unsafe.Pointer(rgid)), uintptr(unsafe.Pointer(egid)), uintptr(unsafe.Pointer(sgid))) + return +} + +var libc_getresgid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getresgid getresgid "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s index 74a25f8d..ca3f7660 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s @@ -189,6 +189,18 @@ TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $8 DATA ·libc_getcwd_trampoline_addr(SB)/8, $libc_getcwd_trampoline<>(SB) +TEXT libc_getresuid_trampoline<>(SB),NOSPLIT,$0-0 + CALL libc_getresuid(SB) + RET +GLOBL ·libc_getresuid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getresuid_trampoline_addr(SB)/8, $libc_getresuid_trampoline<>(SB) + +TEXT libc_getresgid_trampoline<>(SB),NOSPLIT,$0-0 + CALL libc_getresgid(SB) + RET +GLOBL ·libc_getresgid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getresgid_trampoline_addr(SB)/8, $libc_getresgid_trampoline<>(SB) + TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_ioctl(SB) RET diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go index 7d95a197..32cbbbc5 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go @@ -519,6 +519,28 @@ var libc_getcwd_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) { + syscall_rawSyscall(libc_getresuid_trampoline_addr, uintptr(unsafe.Pointer(ruid)), uintptr(unsafe.Pointer(euid)), uintptr(unsafe.Pointer(suid))) + return +} + +var libc_getresuid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getresuid getresuid "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) { + syscall_rawSyscall(libc_getresgid_trampoline_addr, uintptr(unsafe.Pointer(rgid)), uintptr(unsafe.Pointer(egid)), uintptr(unsafe.Pointer(sgid))) + return +} + +var libc_getresgid_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getresgid getresgid "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s index 990be245..477a7d5b 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s @@ -158,6 +158,16 @@ TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $8 DATA ·libc_getcwd_trampoline_addr(SB)/8, $libc_getcwd_trampoline<>(SB) +TEXT libc_getresuid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getresuid(SB) +GLOBL ·libc_getresuid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getresuid_trampoline_addr(SB)/8, $libc_getresuid_trampoline<>(SB) + +TEXT libc_getresgid_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getresgid(SB) +GLOBL ·libc_getresgid_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getresgid_trampoline_addr(SB)/8, $libc_getresgid_trampoline<>(SB) + TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ioctl(SB) GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go index ca84727c..00c3b8c2 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -2555,6 +2555,11 @@ const ( BPF_REG_8 = 0x8 BPF_REG_9 = 0x9 BPF_REG_10 = 0xa + BPF_CGROUP_ITER_ORDER_UNSPEC = 0x0 + BPF_CGROUP_ITER_SELF_ONLY = 0x1 + BPF_CGROUP_ITER_DESCENDANTS_PRE = 0x2 + BPF_CGROUP_ITER_DESCENDANTS_POST = 0x3 + BPF_CGROUP_ITER_ANCESTORS_UP = 0x4 BPF_MAP_CREATE = 0x0 BPF_MAP_LOOKUP_ELEM = 0x1 BPF_MAP_UPDATE_ELEM = 0x2 @@ -2566,6 +2571,7 @@ const ( BPF_PROG_ATTACH = 0x8 BPF_PROG_DETACH = 0x9 BPF_PROG_TEST_RUN = 0xa + BPF_PROG_RUN = 0xa BPF_PROG_GET_NEXT_ID = 0xb BPF_MAP_GET_NEXT_ID = 0xc BPF_PROG_GET_FD_BY_ID = 0xd @@ -2610,6 +2616,7 @@ const ( BPF_MAP_TYPE_CPUMAP = 0x10 BPF_MAP_TYPE_XSKMAP = 0x11 BPF_MAP_TYPE_SOCKHASH = 0x12 + BPF_MAP_TYPE_CGROUP_STORAGE_DEPRECATED = 0x13 BPF_MAP_TYPE_CGROUP_STORAGE = 0x13 BPF_MAP_TYPE_REUSEPORT_SOCKARRAY = 0x14 BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE = 0x15 @@ -2620,6 +2627,10 @@ const ( BPF_MAP_TYPE_STRUCT_OPS = 0x1a BPF_MAP_TYPE_RINGBUF = 0x1b BPF_MAP_TYPE_INODE_STORAGE = 0x1c + BPF_MAP_TYPE_TASK_STORAGE = 0x1d + BPF_MAP_TYPE_BLOOM_FILTER = 0x1e + BPF_MAP_TYPE_USER_RINGBUF = 0x1f + BPF_MAP_TYPE_CGRP_STORAGE = 0x20 BPF_PROG_TYPE_UNSPEC = 0x0 BPF_PROG_TYPE_SOCKET_FILTER = 0x1 BPF_PROG_TYPE_KPROBE = 0x2 @@ -2651,6 +2662,7 @@ const ( BPF_PROG_TYPE_EXT = 0x1c BPF_PROG_TYPE_LSM = 0x1d BPF_PROG_TYPE_SK_LOOKUP = 0x1e + BPF_PROG_TYPE_SYSCALL = 0x1f BPF_CGROUP_INET_INGRESS = 0x0 BPF_CGROUP_INET_EGRESS = 0x1 BPF_CGROUP_INET_SOCK_CREATE = 0x2 @@ -2689,6 +2701,12 @@ const ( BPF_XDP_CPUMAP = 0x23 BPF_SK_LOOKUP = 0x24 BPF_XDP = 0x25 + BPF_SK_SKB_VERDICT = 0x26 + BPF_SK_REUSEPORT_SELECT = 0x27 + BPF_SK_REUSEPORT_SELECT_OR_MIGRATE = 0x28 + BPF_PERF_EVENT = 0x29 + BPF_TRACE_KPROBE_MULTI = 0x2a + BPF_LSM_CGROUP = 0x2b BPF_LINK_TYPE_UNSPEC = 0x0 BPF_LINK_TYPE_RAW_TRACEPOINT = 0x1 BPF_LINK_TYPE_TRACING = 0x2 @@ -2696,6 +2714,9 @@ const ( BPF_LINK_TYPE_ITER = 0x4 BPF_LINK_TYPE_NETNS = 0x5 BPF_LINK_TYPE_XDP = 0x6 + BPF_LINK_TYPE_PERF_EVENT = 0x7 + BPF_LINK_TYPE_KPROBE_MULTI = 0x8 + BPF_LINK_TYPE_STRUCT_OPS = 0x9 BPF_ANY = 0x0 BPF_NOEXIST = 0x1 BPF_EXIST = 0x2 @@ -2733,6 +2754,7 @@ const ( BPF_F_ZERO_CSUM_TX = 0x2 BPF_F_DONT_FRAGMENT = 0x4 BPF_F_SEQ_NUMBER = 0x8 + BPF_F_TUNINFO_FLAGS = 0x10 BPF_F_INDEX_MASK = 0xffffffff BPF_F_CURRENT_CPU = 0xffffffff BPF_F_CTXLEN_MASK = 0xfffff00000000 @@ -2747,6 +2769,7 @@ const ( BPF_F_ADJ_ROOM_ENCAP_L4_GRE = 0x8 BPF_F_ADJ_ROOM_ENCAP_L4_UDP = 0x10 BPF_F_ADJ_ROOM_NO_CSUM_RESET = 0x20 + BPF_F_ADJ_ROOM_ENCAP_L2_ETH = 0x40 BPF_ADJ_ROOM_ENCAP_L2_MASK = 0xff BPF_ADJ_ROOM_ENCAP_L2_SHIFT = 0x38 BPF_F_SYSCTL_BASE_NAME = 0x1 @@ -2771,10 +2794,16 @@ const ( BPF_LWT_ENCAP_SEG6 = 0x0 BPF_LWT_ENCAP_SEG6_INLINE = 0x1 BPF_LWT_ENCAP_IP = 0x2 + BPF_F_BPRM_SECUREEXEC = 0x1 + BPF_F_BROADCAST = 0x8 + BPF_F_EXCLUDE_INGRESS = 0x10 + BPF_SKB_TSTAMP_UNSPEC = 0x0 + BPF_SKB_TSTAMP_DELIVERY_MONO = 0x1 BPF_OK = 0x0 BPF_DROP = 0x2 BPF_REDIRECT = 0x7 BPF_LWT_REROUTE = 0x80 + BPF_FLOW_DISSECTOR_CONTINUE = 0x81 BPF_SOCK_OPS_RTO_CB_FLAG = 0x1 BPF_SOCK_OPS_RETRANS_CB_FLAG = 0x2 BPF_SOCK_OPS_STATE_CB_FLAG = 0x4 @@ -2838,6 +2867,10 @@ const ( BPF_FIB_LKUP_RET_UNSUPP_LWT = 0x6 BPF_FIB_LKUP_RET_NO_NEIGH = 0x7 BPF_FIB_LKUP_RET_FRAG_NEEDED = 0x8 + BPF_MTU_CHK_SEGS = 0x1 + BPF_MTU_CHK_RET_SUCCESS = 0x0 + BPF_MTU_CHK_RET_FRAG_NEEDED = 0x1 + BPF_MTU_CHK_RET_SEGS_TOOBIG = 0x2 BPF_FD_TYPE_RAW_TRACEPOINT = 0x0 BPF_FD_TYPE_TRACEPOINT = 0x1 BPF_FD_TYPE_KPROBE = 0x2 @@ -2847,6 +2880,19 @@ const ( BPF_FLOW_DISSECTOR_F_PARSE_1ST_FRAG = 0x1 BPF_FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL = 0x2 BPF_FLOW_DISSECTOR_F_STOP_AT_ENCAP = 0x4 + BPF_CORE_FIELD_BYTE_OFFSET = 0x0 + BPF_CORE_FIELD_BYTE_SIZE = 0x1 + BPF_CORE_FIELD_EXISTS = 0x2 + BPF_CORE_FIELD_SIGNED = 0x3 + BPF_CORE_FIELD_LSHIFT_U64 = 0x4 + BPF_CORE_FIELD_RSHIFT_U64 = 0x5 + BPF_CORE_TYPE_ID_LOCAL = 0x6 + BPF_CORE_TYPE_ID_TARGET = 0x7 + BPF_CORE_TYPE_EXISTS = 0x8 + BPF_CORE_TYPE_SIZE = 0x9 + BPF_CORE_ENUMVAL_EXISTS = 0xa + BPF_CORE_ENUMVAL_VALUE = 0xb + BPF_CORE_TYPE_MATCHES = 0xc ) const ( diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go index 3723b2c2..96459007 100644 --- a/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -405,7 +405,7 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys VerQueryValue(block unsafe.Pointer, subBlock string, pointerToBufferPointer unsafe.Pointer, bufSize *uint32) (err error) = version.VerQueryValueW // Process Status API (PSAPI) -//sys EnumProcesses(processIds []uint32, bytesReturned *uint32) (err error) = psapi.EnumProcesses +//sys enumProcesses(processIds *uint32, nSize uint32, bytesReturned *uint32) (err error) = psapi.EnumProcesses //sys EnumProcessModules(process Handle, module *Handle, cb uint32, cbNeeded *uint32) (err error) = psapi.EnumProcessModules //sys EnumProcessModulesEx(process Handle, module *Handle, cb uint32, cbNeeded *uint32, filterFlag uint32) (err error) = psapi.EnumProcessModulesEx //sys GetModuleInformation(process Handle, module Handle, modinfo *ModuleInfo, cb uint32) (err error) = psapi.GetModuleInformation @@ -1354,6 +1354,17 @@ func SetsockoptIPv6Mreq(fd Handle, level, opt int, mreq *IPv6Mreq) (err error) { return syscall.EWINDOWS } +func EnumProcesses(processIds []uint32, bytesReturned *uint32) error { + // EnumProcesses syscall expects the size parameter to be in bytes, but the code generated with mksyscall uses + // the length of the processIds slice instead. Hence, this wrapper function is added to fix the discrepancy. + var p *uint32 + if len(processIds) > 0 { + p = &processIds[0] + } + size := uint32(len(processIds) * 4) + return enumProcesses(p, size, bytesReturned) +} + func Getpid() (pid int) { return int(GetCurrentProcessId()) } func FindFirstFile(name *uint16, data *Win32finddata) (handle Handle, err error) { diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go index a81ea2c7..566dd3e3 100644 --- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go +++ b/vendor/golang.org/x/sys/windows/zsyscall_windows.go @@ -3516,12 +3516,8 @@ func EnumProcessModulesEx(process Handle, module *Handle, cb uint32, cbNeeded *u return } -func EnumProcesses(processIds []uint32, bytesReturned *uint32) (err error) { - var _p0 *uint32 - if len(processIds) > 0 { - _p0 = &processIds[0] - } - r1, _, e1 := syscall.Syscall(procEnumProcesses.Addr(), 3, uintptr(unsafe.Pointer(_p0)), uintptr(len(processIds)), uintptr(unsafe.Pointer(bytesReturned))) +func enumProcesses(processIds *uint32, nSize uint32, bytesReturned *uint32) (err error) { + r1, _, e1 := syscall.Syscall(procEnumProcesses.Addr(), 3, uintptr(unsafe.Pointer(processIds)), uintptr(nSize), uintptr(unsafe.Pointer(bytesReturned))) if r1 == 0 { err = errnoErr(e1) } diff --git a/vendor/google.golang.org/grpc/attributes/attributes.go b/vendor/google.golang.org/grpc/attributes/attributes.go index 02f5dc53..3efca459 100644 --- a/vendor/google.golang.org/grpc/attributes/attributes.go +++ b/vendor/google.golang.org/grpc/attributes/attributes.go @@ -25,6 +25,11 @@ // later release. package attributes +import ( + "fmt" + "strings" +) + // Attributes is an immutable struct for storing and retrieving generic // key/value pairs. Keys must be hashable, and users should define their own // types for keys. Values should not be modified after they are added to an @@ -99,3 +104,27 @@ func (a *Attributes) Equal(o *Attributes) bool { } return true } + +// String prints the attribute map. If any key or values throughout the map +// implement fmt.Stringer, it calls that method and appends. +func (a *Attributes) String() string { + var sb strings.Builder + sb.WriteString("{") + first := true + for k, v := range a.m { + var key, val string + if str, ok := k.(interface{ String() string }); ok { + key = str.String() + } + if str, ok := v.(interface{ String() string }); ok { + val = str.String() + } + if !first { + sb.WriteString(", ") + } + sb.WriteString(fmt.Sprintf("%q: %q, ", key, val)) + first = false + } + sb.WriteString("}") + return sb.String() +} diff --git a/vendor/google.golang.org/grpc/balancer/balancer.go b/vendor/google.golang.org/grpc/balancer/balancer.go index 09d61dd1..8f00523c 100644 --- a/vendor/google.golang.org/grpc/balancer/balancer.go +++ b/vendor/google.golang.org/grpc/balancer/balancer.go @@ -286,7 +286,7 @@ type PickResult struct { // // LB policies with child policies are responsible for propagating metadata // injected by their children to the ClientConn, as part of Pick(). - Metatada metadata.MD + Metadata metadata.MD } // TransientFailureError returns e. It exists for backward compatibility and diff --git a/vendor/google.golang.org/grpc/balancer_conn_wrappers.go b/vendor/google.golang.org/grpc/balancer_conn_wrappers.go index 0359956d..04b9ad41 100644 --- a/vendor/google.golang.org/grpc/balancer_conn_wrappers.go +++ b/vendor/google.golang.org/grpc/balancer_conn_wrappers.go @@ -25,14 +25,20 @@ import ( "sync" "google.golang.org/grpc/balancer" - "google.golang.org/grpc/codes" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/internal/balancer/gracefulswitch" - "google.golang.org/grpc/internal/buffer" "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/internal/grpcsync" "google.golang.org/grpc/resolver" - "google.golang.org/grpc/status" +) + +type ccbMode int + +const ( + ccbModeActive = iota + ccbModeIdle + ccbModeClosed + ccbModeExitingIdle ) // ccBalancerWrapper sits between the ClientConn and the Balancer. @@ -49,192 +55,101 @@ import ( // It uses the gracefulswitch.Balancer internally to ensure that balancer // switches happen in a graceful manner. type ccBalancerWrapper struct { - cc *ClientConn + // The following fields are initialized when the wrapper is created and are + // read-only afterwards, and therefore can be accessed without a mutex. + cc *ClientConn + opts balancer.BuildOptions - // Since these fields are accessed only from handleXxx() methods which are - // synchronized by the watcher goroutine, we do not need a mutex to protect - // these fields. + // Outgoing (gRPC --> balancer) calls are guaranteed to execute in a + // mutually exclusive manner as they are scheduled in the serializer. Fields + // accessed *only* in these serializer callbacks, can therefore be accessed + // without a mutex. balancer *gracefulswitch.Balancer curBalancerName string - updateCh *buffer.Unbounded // Updates written on this channel are processed by watcher(). - resultCh *buffer.Unbounded // Results of calls to UpdateClientConnState() are pushed here. - closed *grpcsync.Event // Indicates if close has been called. - done *grpcsync.Event // Indicates if close has completed its work. + // mu guards access to the below fields. Access to the serializer and its + // cancel function needs to be mutex protected because they are overwritten + // when the wrapper exits idle mode. + mu sync.Mutex + serializer *grpcsync.CallbackSerializer // To serialize all outoing calls. + serializerCancel context.CancelFunc // To close the seralizer at close/enterIdle time. + mode ccbMode // Tracks the current mode of the wrapper. } // newCCBalancerWrapper creates a new balancer wrapper. The underlying balancer // is not created until the switchTo() method is invoked. func newCCBalancerWrapper(cc *ClientConn, bopts balancer.BuildOptions) *ccBalancerWrapper { + ctx, cancel := context.WithCancel(context.Background()) ccb := &ccBalancerWrapper{ - cc: cc, - updateCh: buffer.NewUnbounded(), - resultCh: buffer.NewUnbounded(), - closed: grpcsync.NewEvent(), - done: grpcsync.NewEvent(), + cc: cc, + opts: bopts, + serializer: grpcsync.NewCallbackSerializer(ctx), + serializerCancel: cancel, } - go ccb.watcher() ccb.balancer = gracefulswitch.NewBalancer(ccb, bopts) return ccb } -// The following xxxUpdate structs wrap the arguments received as part of the -// corresponding update. The watcher goroutine uses the 'type' of the update to -// invoke the appropriate handler routine to handle the update. - -type ccStateUpdate struct { - ccs *balancer.ClientConnState -} - -type scStateUpdate struct { - sc balancer.SubConn - state connectivity.State - err error -} - -type exitIdleUpdate struct{} - -type resolverErrorUpdate struct { - err error -} - -type switchToUpdate struct { - name string -} - -type subConnUpdate struct { - acbw *acBalancerWrapper -} - -// watcher is a long-running goroutine which reads updates from a channel and -// invokes corresponding methods on the underlying balancer. It ensures that -// these methods are invoked in a synchronous fashion. It also ensures that -// these methods are invoked in the order in which the updates were received. -func (ccb *ccBalancerWrapper) watcher() { - for { - select { - case u := <-ccb.updateCh.Get(): - ccb.updateCh.Load() - if ccb.closed.HasFired() { - break - } - switch update := u.(type) { - case *ccStateUpdate: - ccb.handleClientConnStateChange(update.ccs) - case *scStateUpdate: - ccb.handleSubConnStateChange(update) - case *exitIdleUpdate: - ccb.handleExitIdle() - case *resolverErrorUpdate: - ccb.handleResolverError(update.err) - case *switchToUpdate: - ccb.handleSwitchTo(update.name) - case *subConnUpdate: - ccb.handleRemoveSubConn(update.acbw) - default: - logger.Errorf("ccBalancerWrapper.watcher: unknown update %+v, type %T", update, update) - } - case <-ccb.closed.Done(): - } - - if ccb.closed.HasFired() { - ccb.handleClose() - return - } - } -} - // updateClientConnState is invoked by grpc to push a ClientConnState update to // the underlying balancer. -// -// Unlike other methods invoked by grpc to push updates to the underlying -// balancer, this method cannot simply push the update onto the update channel -// and return. It needs to return the error returned by the underlying balancer -// back to grpc which propagates that to the resolver. func (ccb *ccBalancerWrapper) updateClientConnState(ccs *balancer.ClientConnState) error { - ccb.updateCh.Put(&ccStateUpdate{ccs: ccs}) - - var res interface{} - select { - case res = <-ccb.resultCh.Get(): - ccb.resultCh.Load() - case <-ccb.closed.Done(): - // Return early if the balancer wrapper is closed while we are waiting for - // the underlying balancer to process a ClientConnState update. - return nil - } - // If the returned error is nil, attempting to type assert to error leads to - // panic. So, this needs to handled separately. - if res == nil { - return nil - } - return res.(error) -} - -// handleClientConnStateChange handles a ClientConnState update from the update -// channel and invokes the appropriate method on the underlying balancer. -// -// If the addresses specified in the update contain addresses of type "grpclb" -// and the selected LB policy is not "grpclb", these addresses will be filtered -// out and ccs will be modified with the updated address list. -func (ccb *ccBalancerWrapper) handleClientConnStateChange(ccs *balancer.ClientConnState) { - if ccb.curBalancerName != grpclbName { - // Filter any grpclb addresses since we don't have the grpclb balancer. - var addrs []resolver.Address - for _, addr := range ccs.ResolverState.Addresses { - if addr.Type == resolver.GRPCLB { - continue + ccb.mu.Lock() + errCh := make(chan error, 1) + // Here and everywhere else where Schedule() is called, it is done with the + // lock held. But the lock guards only the scheduling part. The actual + // callback is called asynchronously without the lock being held. + ok := ccb.serializer.Schedule(func(_ context.Context) { + // If the addresses specified in the update contain addresses of type + // "grpclb" and the selected LB policy is not "grpclb", these addresses + // will be filtered out and ccs will be modified with the updated + // address list. + if ccb.curBalancerName != grpclbName { + var addrs []resolver.Address + for _, addr := range ccs.ResolverState.Addresses { + if addr.Type == resolver.GRPCLB { + continue + } + addrs = append(addrs, addr) } - addrs = append(addrs, addr) + ccs.ResolverState.Addresses = addrs } - ccs.ResolverState.Addresses = addrs + errCh <- ccb.balancer.UpdateClientConnState(*ccs) + }) + if !ok { + // If we are unable to schedule a function with the serializer, it + // indicates that it has been closed. A serializer is only closed when + // the wrapper is closed or is in idle. + ccb.mu.Unlock() + return fmt.Errorf("grpc: cannot send state update to a closed or idle balancer") } - ccb.resultCh.Put(ccb.balancer.UpdateClientConnState(*ccs)) + ccb.mu.Unlock() + + // We get here only if the above call to Schedule succeeds, in which case it + // is guaranteed that the scheduled function will run. Therefore it is safe + // to block on this channel. + err := <-errCh + if logger.V(2) && err != nil { + logger.Infof("error from balancer.UpdateClientConnState: %v", err) + } + return err } // updateSubConnState is invoked by grpc to push a subConn state update to the // underlying balancer. func (ccb *ccBalancerWrapper) updateSubConnState(sc balancer.SubConn, s connectivity.State, err error) { - // When updating addresses for a SubConn, if the address in use is not in - // the new addresses, the old ac will be tearDown() and a new ac will be - // created. tearDown() generates a state change with Shutdown state, we - // don't want the balancer to receive this state change. So before - // tearDown() on the old ac, ac.acbw (acWrapper) will be set to nil, and - // this function will be called with (nil, Shutdown). We don't need to call - // balancer method in this case. - if sc == nil { - return - } - ccb.updateCh.Put(&scStateUpdate{ - sc: sc, - state: s, - err: err, + ccb.mu.Lock() + ccb.serializer.Schedule(func(_ context.Context) { + ccb.balancer.UpdateSubConnState(sc, balancer.SubConnState{ConnectivityState: s, ConnectionError: err}) }) -} - -// handleSubConnStateChange handles a SubConnState update from the update -// channel and invokes the appropriate method on the underlying balancer. -func (ccb *ccBalancerWrapper) handleSubConnStateChange(update *scStateUpdate) { - ccb.balancer.UpdateSubConnState(update.sc, balancer.SubConnState{ConnectivityState: update.state, ConnectionError: update.err}) -} - -func (ccb *ccBalancerWrapper) exitIdle() { - ccb.updateCh.Put(&exitIdleUpdate{}) -} - -func (ccb *ccBalancerWrapper) handleExitIdle() { - if ccb.cc.GetState() != connectivity.Idle { - return - } - ccb.balancer.ExitIdle() + ccb.mu.Unlock() } func (ccb *ccBalancerWrapper) resolverError(err error) { - ccb.updateCh.Put(&resolverErrorUpdate{err: err}) -} - -func (ccb *ccBalancerWrapper) handleResolverError(err error) { - ccb.balancer.ResolverError(err) + ccb.mu.Lock() + ccb.serializer.Schedule(func(_ context.Context) { + ccb.balancer.ResolverError(err) + }) + ccb.mu.Unlock() } // switchTo is invoked by grpc to instruct the balancer wrapper to switch to the @@ -248,24 +163,27 @@ func (ccb *ccBalancerWrapper) handleResolverError(err error) { // the ccBalancerWrapper keeps track of the current LB policy name, and skips // the graceful balancer switching process if the name does not change. func (ccb *ccBalancerWrapper) switchTo(name string) { - ccb.updateCh.Put(&switchToUpdate{name: name}) + ccb.mu.Lock() + ccb.serializer.Schedule(func(_ context.Context) { + // TODO: Other languages use case-sensitive balancer registries. We should + // switch as well. See: https://github.com/grpc/grpc-go/issues/5288. + if strings.EqualFold(ccb.curBalancerName, name) { + return + } + ccb.buildLoadBalancingPolicy(name) + }) + ccb.mu.Unlock() } -// handleSwitchTo handles a balancer switch update from the update channel. It -// calls the SwitchTo() method on the gracefulswitch.Balancer with a -// balancer.Builder corresponding to name. If no balancer.Builder is registered -// for the given name, it uses the default LB policy which is "pick_first". -func (ccb *ccBalancerWrapper) handleSwitchTo(name string) { - // TODO: Other languages use case-insensitive balancer registries. We should - // switch as well. See: https://github.com/grpc/grpc-go/issues/5288. - if strings.EqualFold(ccb.curBalancerName, name) { - return - } - - // TODO: Ensure that name is a registered LB policy when we get here. - // We currently only validate the `loadBalancingConfig` field. We need to do - // the same for the `loadBalancingPolicy` field and reject the service config - // if the specified policy is not registered. +// buildLoadBalancingPolicy performs the following: +// - retrieve a balancer builder for the given name. Use the default LB +// policy, pick_first, if no LB policy with name is found in the registry. +// - instruct the gracefulswitch balancer to switch to the above builder. This +// will actually build the new balancer. +// - update the `curBalancerName` field +// +// Must be called from a serializer callback. +func (ccb *ccBalancerWrapper) buildLoadBalancingPolicy(name string) { builder := balancer.Get(name) if builder == nil { channelz.Warningf(logger, ccb.cc.channelzID, "Channel switches to new LB policy %q, since the specified LB policy %q was not registered", PickFirstBalancerName, name) @@ -281,26 +199,114 @@ func (ccb *ccBalancerWrapper) handleSwitchTo(name string) { ccb.curBalancerName = builder.Name() } -// handleRemoveSucConn handles a request from the underlying balancer to remove -// a subConn. -// -// See comments in RemoveSubConn() for more details. -func (ccb *ccBalancerWrapper) handleRemoveSubConn(acbw *acBalancerWrapper) { - ccb.cc.removeAddrConn(acbw.getAddrConn(), errConnDrain) -} - func (ccb *ccBalancerWrapper) close() { - ccb.closed.Fire() - <-ccb.done.Done() + channelz.Info(logger, ccb.cc.channelzID, "ccBalancerWrapper: closing") + ccb.closeBalancer(ccbModeClosed) } -func (ccb *ccBalancerWrapper) handleClose() { - ccb.balancer.Close() - ccb.done.Fire() +// enterIdleMode is invoked by grpc when the channel enters idle mode upon +// expiry of idle_timeout. This call blocks until the balancer is closed. +func (ccb *ccBalancerWrapper) enterIdleMode() { + channelz.Info(logger, ccb.cc.channelzID, "ccBalancerWrapper: entering idle mode") + ccb.closeBalancer(ccbModeIdle) +} + +// closeBalancer is invoked when the channel is being closed or when it enters +// idle mode upon expiry of idle_timeout. +func (ccb *ccBalancerWrapper) closeBalancer(m ccbMode) { + ccb.mu.Lock() + if ccb.mode == ccbModeClosed || ccb.mode == ccbModeIdle { + ccb.mu.Unlock() + return + } + + ccb.mode = m + done := ccb.serializer.Done + b := ccb.balancer + ok := ccb.serializer.Schedule(func(_ context.Context) { + // Close the serializer to ensure that no more calls from gRPC are sent + // to the balancer. + ccb.serializerCancel() + // Empty the current balancer name because we don't have a balancer + // anymore and also so that we act on the next call to switchTo by + // creating a new balancer specified by the new resolver. + ccb.curBalancerName = "" + }) + if !ok { + ccb.mu.Unlock() + return + } + ccb.mu.Unlock() + + // Give enqueued callbacks a chance to finish. + <-done + // Spawn a goroutine to close the balancer (since it may block trying to + // cleanup all allocated resources) and return early. + go b.Close() +} + +// exitIdleMode is invoked by grpc when the channel exits idle mode either +// because of an RPC or because of an invocation of the Connect() API. This +// recreates the balancer that was closed previously when entering idle mode. +// +// If the channel is not in idle mode, we know for a fact that we are here as a +// result of the user calling the Connect() method on the ClientConn. In this +// case, we can simply forward the call to the underlying balancer, instructing +// it to reconnect to the backends. +func (ccb *ccBalancerWrapper) exitIdleMode() { + ccb.mu.Lock() + if ccb.mode == ccbModeClosed { + // Request to exit idle is a no-op when wrapper is already closed. + ccb.mu.Unlock() + return + } + + if ccb.mode == ccbModeIdle { + // Recreate the serializer which was closed when we entered idle. + ctx, cancel := context.WithCancel(context.Background()) + ccb.serializer = grpcsync.NewCallbackSerializer(ctx) + ccb.serializerCancel = cancel + } + + // The ClientConn guarantees that mutual exclusion between close() and + // exitIdleMode(), and since we just created a new serializer, we can be + // sure that the below function will be scheduled. + done := make(chan struct{}) + ccb.serializer.Schedule(func(_ context.Context) { + defer close(done) + + ccb.mu.Lock() + defer ccb.mu.Unlock() + + if ccb.mode != ccbModeIdle { + ccb.balancer.ExitIdle() + return + } + + // Gracefulswitch balancer does not support a switchTo operation after + // being closed. Hence we need to create a new one here. + ccb.balancer = gracefulswitch.NewBalancer(ccb, ccb.opts) + ccb.mode = ccbModeActive + channelz.Info(logger, ccb.cc.channelzID, "ccBalancerWrapper: exiting idle mode") + + }) + ccb.mu.Unlock() + + <-done +} + +func (ccb *ccBalancerWrapper) isIdleOrClosed() bool { + ccb.mu.Lock() + defer ccb.mu.Unlock() + return ccb.mode == ccbModeIdle || ccb.mode == ccbModeClosed } func (ccb *ccBalancerWrapper) NewSubConn(addrs []resolver.Address, opts balancer.NewSubConnOptions) (balancer.SubConn, error) { - if len(addrs) <= 0 { + if ccb.isIdleOrClosed() { + return nil, fmt.Errorf("grpc: cannot create SubConn when balancer is closed or idle") + } + + if len(addrs) == 0 { return nil, fmt.Errorf("grpc: cannot create SubConn with empty address list") } ac, err := ccb.cc.newAddrConn(addrs, opts) @@ -309,31 +315,35 @@ func (ccb *ccBalancerWrapper) NewSubConn(addrs []resolver.Address, opts balancer return nil, err } acbw := &acBalancerWrapper{ac: ac, producers: make(map[balancer.ProducerBuilder]*refCountedProducer)} - acbw.ac.mu.Lock() ac.acbw = acbw - acbw.ac.mu.Unlock() return acbw, nil } func (ccb *ccBalancerWrapper) RemoveSubConn(sc balancer.SubConn) { - // Before we switched the ccBalancerWrapper to use gracefulswitch.Balancer, it - // was required to handle the RemoveSubConn() method asynchronously by pushing - // the update onto the update channel. This was done to avoid a deadlock as - // switchBalancer() was holding cc.mu when calling Close() on the old - // balancer, which would in turn call RemoveSubConn(). - // - // With the use of gracefulswitch.Balancer in ccBalancerWrapper, handling this - // asynchronously is probably not required anymore since the switchTo() method - // handles the balancer switch by pushing the update onto the channel. - // TODO(easwars): Handle this inline. + if ccb.isIdleOrClosed() { + // It it safe to ignore this call when the balancer is closed or in idle + // because the ClientConn takes care of closing the connections. + // + // Not returning early from here when the balancer is closed or in idle + // leads to a deadlock though, because of the following sequence of + // calls when holding cc.mu: + // cc.exitIdleMode --> ccb.enterIdleMode --> gsw.Close --> + // ccb.RemoveAddrConn --> cc.removeAddrConn + return + } + acbw, ok := sc.(*acBalancerWrapper) if !ok { return } - ccb.updateCh.Put(&subConnUpdate{acbw: acbw}) + ccb.cc.removeAddrConn(acbw.ac, errConnDrain) } func (ccb *ccBalancerWrapper) UpdateAddresses(sc balancer.SubConn, addrs []resolver.Address) { + if ccb.isIdleOrClosed() { + return + } + acbw, ok := sc.(*acBalancerWrapper) if !ok { return @@ -342,6 +352,10 @@ func (ccb *ccBalancerWrapper) UpdateAddresses(sc balancer.SubConn, addrs []resol } func (ccb *ccBalancerWrapper) UpdateState(s balancer.State) { + if ccb.isIdleOrClosed() { + return + } + // Update picker before updating state. Even though the ordering here does // not matter, it can lead to multiple calls of Pick in the common start-up // case where we wait for ready and then perform an RPC. If the picker is @@ -352,6 +366,10 @@ func (ccb *ccBalancerWrapper) UpdateState(s balancer.State) { } func (ccb *ccBalancerWrapper) ResolveNow(o resolver.ResolveNowOptions) { + if ccb.isIdleOrClosed() { + return + } + ccb.cc.resolveNow(o) } @@ -362,71 +380,31 @@ func (ccb *ccBalancerWrapper) Target() string { // acBalancerWrapper is a wrapper on top of ac for balancers. // It implements balancer.SubConn interface. type acBalancerWrapper struct { + ac *addrConn // read-only + mu sync.Mutex - ac *addrConn producers map[balancer.ProducerBuilder]*refCountedProducer } +func (acbw *acBalancerWrapper) String() string { + return fmt.Sprintf("SubConn(id:%d)", acbw.ac.channelzID.Int()) +} + func (acbw *acBalancerWrapper) UpdateAddresses(addrs []resolver.Address) { - acbw.mu.Lock() - defer acbw.mu.Unlock() - if len(addrs) <= 0 { - acbw.ac.cc.removeAddrConn(acbw.ac, errConnDrain) - return - } - if !acbw.ac.tryUpdateAddrs(addrs) { - cc := acbw.ac.cc - opts := acbw.ac.scopts - acbw.ac.mu.Lock() - // Set old ac.acbw to nil so the Shutdown state update will be ignored - // by balancer. - // - // TODO(bar) the state transition could be wrong when tearDown() old ac - // and creating new ac, fix the transition. - acbw.ac.acbw = nil - acbw.ac.mu.Unlock() - acState := acbw.ac.getState() - acbw.ac.cc.removeAddrConn(acbw.ac, errConnDrain) - - if acState == connectivity.Shutdown { - return - } - - newAC, err := cc.newAddrConn(addrs, opts) - if err != nil { - channelz.Warningf(logger, acbw.ac.channelzID, "acBalancerWrapper: UpdateAddresses: failed to newAddrConn: %v", err) - return - } - acbw.ac = newAC - newAC.mu.Lock() - newAC.acbw = acbw - newAC.mu.Unlock() - if acState != connectivity.Idle { - go newAC.connect() - } - } + acbw.ac.updateAddrs(addrs) } func (acbw *acBalancerWrapper) Connect() { - acbw.mu.Lock() - defer acbw.mu.Unlock() go acbw.ac.connect() } -func (acbw *acBalancerWrapper) getAddrConn() *addrConn { - acbw.mu.Lock() - defer acbw.mu.Unlock() - return acbw.ac -} - -var errSubConnNotReady = status.Error(codes.Unavailable, "SubConn not currently connected") - // NewStream begins a streaming RPC on the addrConn. If the addrConn is not -// ready, returns errSubConnNotReady. +// ready, blocks until it is or ctx expires. Returns an error when the context +// expires or the addrConn is shut down. func (acbw *acBalancerWrapper) NewStream(ctx context.Context, desc *StreamDesc, method string, opts ...CallOption) (ClientStream, error) { - transport := acbw.ac.getReadyTransport() - if transport == nil { - return nil, errSubConnNotReady + transport, err := acbw.ac.getTransport(ctx) + if err != nil { + return nil, err } return newNonRetryClientStream(ctx, desc, method, transport, acbw.ac, opts...) } diff --git a/vendor/google.golang.org/grpc/call.go b/vendor/google.golang.org/grpc/call.go index 9e20e4d3..e6a1dc5d 100644 --- a/vendor/google.golang.org/grpc/call.go +++ b/vendor/google.golang.org/grpc/call.go @@ -27,6 +27,11 @@ import ( // // All errors returned by Invoke are compatible with the status package. func (cc *ClientConn) Invoke(ctx context.Context, method string, args, reply interface{}, opts ...CallOption) error { + if err := cc.idlenessMgr.onCallBegin(); err != nil { + return err + } + defer cc.idlenessMgr.onCallEnd() + // allow interceptor to see all applicable call options, which means those // configured as defaults from dial option as well as per-call options opts = combine(cc.dopts.callOptions, opts) diff --git a/vendor/google.golang.org/grpc/clientconn.go b/vendor/google.golang.org/grpc/clientconn.go index 3a761424..314addca 100644 --- a/vendor/google.golang.org/grpc/clientconn.go +++ b/vendor/google.golang.org/grpc/clientconn.go @@ -24,7 +24,6 @@ import ( "fmt" "math" "net/url" - "reflect" "strings" "sync" "sync/atomic" @@ -69,6 +68,9 @@ var ( errConnDrain = errors.New("grpc: the connection is drained") // errConnClosing indicates that the connection is closing. errConnClosing = errors.New("grpc: the connection is closing") + // errConnIdling indicates the the connection is being closed as the channel + // is moving to an idle mode due to inactivity. + errConnIdling = errors.New("grpc: the connection is closing due to channel idleness") // invalidDefaultServiceConfigErrPrefix is used to prefix the json parsing error for the default // service config. invalidDefaultServiceConfigErrPrefix = "grpc: the provided default service config is invalid" @@ -134,17 +136,29 @@ func (dcs *defaultConfigSelector) SelectConfig(rpcInfo iresolver.RPCInfo) (*ires // e.g. to use dns resolver, a "dns:///" prefix should be applied to the target. func DialContext(ctx context.Context, target string, opts ...DialOption) (conn *ClientConn, err error) { cc := &ClientConn{ - target: target, - csMgr: &connectivityStateManager{}, - conns: make(map[*addrConn]struct{}), - dopts: defaultDialOptions(), - blockingpicker: newPickerWrapper(), - czData: new(channelzData), - firstResolveEvent: grpcsync.NewEvent(), + target: target, + csMgr: &connectivityStateManager{}, + conns: make(map[*addrConn]struct{}), + dopts: defaultDialOptions(), + czData: new(channelzData), } + + // We start the channel off in idle mode, but kick it out of idle at the end + // of this method, instead of waiting for the first RPC. Other gRPC + // implementations do wait for the first RPC to kick the channel out of + // idle. But doing so would be a major behavior change for our users who are + // used to seeing the channel active after Dial. + // + // Taking this approach of kicking it out of idle at the end of this method + // allows us to share the code between channel creation and exiting idle + // mode. This will also make it easy for us to switch to starting the + // channel off in idle, if at all we ever get to do that. + cc.idlenessState = ccIdlenessStateIdle + cc.retryThrottler.Store((*retryThrottler)(nil)) cc.safeConfigSelector.UpdateConfigSelector(&defaultConfigSelector{nil}) cc.ctx, cc.cancel = context.WithCancel(context.Background()) + cc.exitIdleCond = sync.NewCond(&cc.mu) disableGlobalOpts := false for _, opt := range opts { @@ -173,40 +187,11 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn * } }() - pid := cc.dopts.channelzParentID - cc.channelzID = channelz.RegisterChannel(&channelzChannel{cc}, pid, target) - ted := &channelz.TraceEventDesc{ - Desc: "Channel created", - Severity: channelz.CtInfo, - } - if cc.dopts.channelzParentID != nil { - ted.Parent = &channelz.TraceEventDesc{ - Desc: fmt.Sprintf("Nested Channel(id:%d) created", cc.channelzID.Int()), - Severity: channelz.CtInfo, - } - } - channelz.AddTraceEvent(logger, cc.channelzID, 1, ted) - cc.csMgr.channelzID = cc.channelzID + // Register ClientConn with channelz. + cc.channelzRegistration(target) - if cc.dopts.copts.TransportCredentials == nil && cc.dopts.copts.CredsBundle == nil { - return nil, errNoTransportSecurity - } - if cc.dopts.copts.TransportCredentials != nil && cc.dopts.copts.CredsBundle != nil { - return nil, errTransportCredsAndBundle - } - if cc.dopts.copts.CredsBundle != nil && cc.dopts.copts.CredsBundle.TransportCredentials() == nil { - return nil, errNoTransportCredsInBundle - } - transportCreds := cc.dopts.copts.TransportCredentials - if transportCreds == nil { - transportCreds = cc.dopts.copts.CredsBundle.TransportCredentials() - } - if transportCreds.Info().SecurityProtocol == "insecure" { - for _, cd := range cc.dopts.copts.PerRPCCredentials { - if cd.RequireTransportSecurity() { - return nil, errTransportCredentialsMissing - } - } + if err := cc.validateTransportCredentials(); err != nil { + return nil, err } if cc.dopts.defaultServiceConfigRawJSON != nil { @@ -249,15 +234,12 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn * } // Determine the resolver to use. - resolverBuilder, err := cc.parseTargetAndFindResolver() - if err != nil { + if err := cc.parseTargetAndFindResolver(); err != nil { return nil, err } - cc.authority, err = determineAuthority(cc.parsedTarget.Endpoint(), cc.target, cc.dopts) - if err != nil { + if err = cc.determineAuthority(); err != nil { return nil, err } - channelz.Infof(logger, cc.channelzID, "Channel authority set to %q", cc.authority) if cc.dopts.scChan != nil { // Blocking wait for the initial service config. @@ -275,57 +257,224 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn * go cc.scWatcher() } + // This creates the name resolver, load balancer, blocking picker etc. + if err := cc.exitIdleMode(); err != nil { + return nil, err + } + + // Configure idleness support with configured idle timeout or default idle + // timeout duration. Idleness can be explicitly disabled by the user, by + // setting the dial option to 0. + cc.idlenessMgr = newIdlenessManager(cc, cc.dopts.idleTimeout) + + // Return early for non-blocking dials. + if !cc.dopts.block { + return cc, nil + } + + // A blocking dial blocks until the clientConn is ready. + for { + s := cc.GetState() + if s == connectivity.Idle { + cc.Connect() + } + if s == connectivity.Ready { + return cc, nil + } else if cc.dopts.copts.FailOnNonTempDialError && s == connectivity.TransientFailure { + if err = cc.connectionError(); err != nil { + terr, ok := err.(interface { + Temporary() bool + }) + if ok && !terr.Temporary() { + return nil, err + } + } + } + if !cc.WaitForStateChange(ctx, s) { + // ctx got timeout or canceled. + if err = cc.connectionError(); err != nil && cc.dopts.returnLastError { + return nil, err + } + return nil, ctx.Err() + } + } +} + +// addTraceEvent is a helper method to add a trace event on the channel. If the +// channel is a nested one, the same event is also added on the parent channel. +func (cc *ClientConn) addTraceEvent(msg string) { + ted := &channelz.TraceEventDesc{ + Desc: fmt.Sprintf("Channel %s", msg), + Severity: channelz.CtInfo, + } + if cc.dopts.channelzParentID != nil { + ted.Parent = &channelz.TraceEventDesc{ + Desc: fmt.Sprintf("Nested channel(id:%d) %s", cc.channelzID.Int(), msg), + Severity: channelz.CtInfo, + } + } + channelz.AddTraceEvent(logger, cc.channelzID, 0, ted) +} + +// exitIdleMode moves the channel out of idle mode by recreating the name +// resolver and load balancer. +func (cc *ClientConn) exitIdleMode() error { + cc.mu.Lock() + if cc.conns == nil { + cc.mu.Unlock() + return errConnClosing + } + if cc.idlenessState != ccIdlenessStateIdle { + cc.mu.Unlock() + logger.Info("ClientConn asked to exit idle mode when not in idle mode") + return nil + } + + defer func() { + // When Close() and exitIdleMode() race against each other, one of the + // following two can happen: + // - Close() wins the race and runs first. exitIdleMode() runs after, and + // sees that the ClientConn is already closed and hence returns early. + // - exitIdleMode() wins the race and runs first and recreates the balancer + // and releases the lock before recreating the resolver. If Close() runs + // in this window, it will wait for exitIdleMode to complete. + // + // We achieve this synchronization using the below condition variable. + cc.mu.Lock() + cc.idlenessState = ccIdlenessStateActive + cc.exitIdleCond.Signal() + cc.mu.Unlock() + }() + + cc.idlenessState = ccIdlenessStateExitingIdle + exitedIdle := false + if cc.blockingpicker == nil { + cc.blockingpicker = newPickerWrapper() + } else { + cc.blockingpicker.exitIdleMode() + exitedIdle = true + } + var credsClone credentials.TransportCredentials if creds := cc.dopts.copts.TransportCredentials; creds != nil { credsClone = creds.Clone() } - cc.balancerWrapper = newCCBalancerWrapper(cc, balancer.BuildOptions{ - DialCreds: credsClone, - CredsBundle: cc.dopts.copts.CredsBundle, - Dialer: cc.dopts.copts.Dialer, - Authority: cc.authority, - CustomUserAgent: cc.dopts.copts.UserAgent, - ChannelzParentID: cc.channelzID, - Target: cc.parsedTarget, - }) - - // Build the resolver. - rWrapper, err := newCCResolverWrapper(cc, resolverBuilder) - if err != nil { - return nil, fmt.Errorf("failed to build resolver: %v", err) + if cc.balancerWrapper == nil { + cc.balancerWrapper = newCCBalancerWrapper(cc, balancer.BuildOptions{ + DialCreds: credsClone, + CredsBundle: cc.dopts.copts.CredsBundle, + Dialer: cc.dopts.copts.Dialer, + Authority: cc.authority, + CustomUserAgent: cc.dopts.copts.UserAgent, + ChannelzParentID: cc.channelzID, + Target: cc.parsedTarget, + }) + } else { + cc.balancerWrapper.exitIdleMode() } - cc.mu.Lock() - cc.resolverWrapper = rWrapper + cc.firstResolveEvent = grpcsync.NewEvent() cc.mu.Unlock() - // A blocking dial blocks until the clientConn is ready. - if cc.dopts.block { - for { - cc.Connect() - s := cc.GetState() - if s == connectivity.Ready { - break - } else if cc.dopts.copts.FailOnNonTempDialError && s == connectivity.TransientFailure { - if err = cc.connectionError(); err != nil { - terr, ok := err.(interface { - Temporary() bool - }) - if ok && !terr.Temporary() { - return nil, err - } - } - } - if !cc.WaitForStateChange(ctx, s) { - // ctx got timeout or canceled. - if err = cc.connectionError(); err != nil && cc.dopts.returnLastError { - return nil, err - } - return nil, ctx.Err() + // This needs to be called without cc.mu because this builds a new resolver + // which might update state or report error inline which needs to be handled + // by cc.updateResolverState() which also grabs cc.mu. + if err := cc.initResolverWrapper(credsClone); err != nil { + return err + } + + if exitedIdle { + cc.addTraceEvent("exiting idle mode") + } + return nil +} + +// enterIdleMode puts the channel in idle mode, and as part of it shuts down the +// name resolver, load balancer and any subchannels. +func (cc *ClientConn) enterIdleMode() error { + cc.mu.Lock() + if cc.conns == nil { + cc.mu.Unlock() + return ErrClientConnClosing + } + if cc.idlenessState != ccIdlenessStateActive { + logger.Error("ClientConn asked to enter idle mode when not active") + return nil + } + + // cc.conns == nil is a proxy for the ClientConn being closed. So, instead + // of setting it to nil here, we recreate the map. This also means that we + // don't have to do this when exiting idle mode. + conns := cc.conns + cc.conns = make(map[*addrConn]struct{}) + + // TODO: Currently, we close the resolver wrapper upon entering idle mode + // and create a new one upon exiting idle mode. This means that the + // `cc.resolverWrapper` field would be overwritten everytime we exit idle + // mode. While this means that we need to hold `cc.mu` when accessing + // `cc.resolverWrapper`, it makes the code simpler in the wrapper. We should + // try to do the same for the balancer and picker wrappers too. + cc.resolverWrapper.close() + cc.blockingpicker.enterIdleMode() + cc.balancerWrapper.enterIdleMode() + cc.csMgr.updateState(connectivity.Idle) + cc.idlenessState = ccIdlenessStateIdle + cc.mu.Unlock() + + go func() { + cc.addTraceEvent("entering idle mode") + for ac := range conns { + ac.tearDown(errConnIdling) + } + }() + return nil +} + +// validateTransportCredentials performs a series of checks on the configured +// transport credentials. It returns a non-nil error if any of these conditions +// are met: +// - no transport creds and no creds bundle is configured +// - both transport creds and creds bundle are configured +// - creds bundle is configured, but it lacks a transport credentials +// - insecure transport creds configured alongside call creds that require +// transport level security +// +// If none of the above conditions are met, the configured credentials are +// deemed valid and a nil error is returned. +func (cc *ClientConn) validateTransportCredentials() error { + if cc.dopts.copts.TransportCredentials == nil && cc.dopts.copts.CredsBundle == nil { + return errNoTransportSecurity + } + if cc.dopts.copts.TransportCredentials != nil && cc.dopts.copts.CredsBundle != nil { + return errTransportCredsAndBundle + } + if cc.dopts.copts.CredsBundle != nil && cc.dopts.copts.CredsBundle.TransportCredentials() == nil { + return errNoTransportCredsInBundle + } + transportCreds := cc.dopts.copts.TransportCredentials + if transportCreds == nil { + transportCreds = cc.dopts.copts.CredsBundle.TransportCredentials() + } + if transportCreds.Info().SecurityProtocol == "insecure" { + for _, cd := range cc.dopts.copts.PerRPCCredentials { + if cd.RequireTransportSecurity() { + return errTransportCredentialsMissing } } } + return nil +} - return cc, nil +// channelzRegistration registers the newly created ClientConn with channelz and +// stores the returned identifier in `cc.channelzID` and `cc.csMgr.channelzID`. +// A channelz trace event is emitted for ClientConn creation. If the newly +// created ClientConn is a nested one, i.e a valid parent ClientConn ID is +// specified via a dial option, the trace event is also added to the parent. +// +// Doesn't grab cc.mu as this method is expected to be called only at Dial time. +func (cc *ClientConn) channelzRegistration(target string) { + cc.channelzID = channelz.RegisterChannel(&channelzChannel{cc}, cc.dopts.channelzParentID, target) + cc.addTraceEvent("created") + cc.csMgr.channelzID = cc.channelzID } // chainUnaryClientInterceptors chains all unary client interceptors into one. @@ -471,7 +620,9 @@ type ClientConn struct { authority string // See determineAuthority(). dopts dialOptions // Default and user specified dial options. channelzID *channelz.Identifier // Channelz identifier for the channel. + resolverBuilder resolver.Builder // See parseTargetAndFindResolver(). balancerWrapper *ccBalancerWrapper // Uses gracefulswitch.balancer underneath. + idlenessMgr idlenessManager // The following provide their own synchronization, and therefore don't // require cc.mu to be held to access them. @@ -492,11 +643,31 @@ type ClientConn struct { sc *ServiceConfig // Latest service config received from the resolver. conns map[*addrConn]struct{} // Set to nil on close. mkp keepalive.ClientParameters // May be updated upon receipt of a GoAway. + idlenessState ccIdlenessState // Tracks idleness state of the channel. + exitIdleCond *sync.Cond // Signalled when channel exits idle. lceMu sync.Mutex // protects lastConnectionError lastConnectionError error } +// ccIdlenessState tracks the idleness state of the channel. +// +// Channels start off in `active` and move to `idle` after a period of +// inactivity. When moving back to `active` upon an incoming RPC, they +// transition through `exiting_idle`. This state is useful for synchronization +// with Close(). +// +// This state tracking is mostly for self-protection. The idlenessManager is +// expected to keep track of the state as well, and is expected not to call into +// the ClientConn unnecessarily. +type ccIdlenessState int8 + +const ( + ccIdlenessStateActive ccIdlenessState = iota + ccIdlenessStateIdle + ccIdlenessStateExitingIdle +) + // WaitForStateChange waits until the connectivity.State of ClientConn changes from sourceState or // ctx expires. A true value is returned in former case and false in latter. // @@ -536,7 +707,10 @@ func (cc *ClientConn) GetState() connectivity.State { // Notice: This API is EXPERIMENTAL and may be changed or removed in a later // release. func (cc *ClientConn) Connect() { - cc.balancerWrapper.exitIdle() + cc.exitIdleMode() + // If the ClientConn was not in idle mode, we need to call ExitIdle on the + // LB policy so that connections can be created. + cc.balancerWrapper.exitIdleMode() } func (cc *ClientConn) scWatcher() { @@ -705,6 +879,7 @@ func (cc *ClientConn) newAddrConn(addrs []resolver.Address, opts balancer.NewSub dopts: cc.dopts, czData: new(channelzData), resetBackoff: make(chan struct{}), + stateChan: make(chan struct{}), } ac.ctx, ac.cancel = context.WithCancel(cc.ctx) // Track ac in cc. This needs to be done before any getTransport(...) is called. @@ -798,9 +973,6 @@ func (ac *addrConn) connect() error { ac.mu.Unlock() return nil } - // Update connectivity state within the lock to prevent subsequent or - // concurrent calls from resetting the transport more than once. - ac.updateConnectivityState(connectivity.Connecting, nil) ac.mu.Unlock() ac.resetTransport() @@ -819,58 +991,60 @@ func equalAddresses(a, b []resolver.Address) bool { return true } -// tryUpdateAddrs tries to update ac.addrs with the new addresses list. -// -// If ac is TransientFailure, it updates ac.addrs and returns true. The updated -// addresses will be picked up by retry in the next iteration after backoff. -// -// If ac is Shutdown or Idle, it updates ac.addrs and returns true. -// -// If the addresses is the same as the old list, it does nothing and returns -// true. -// -// If ac is Connecting, it returns false. The caller should tear down the ac and -// create a new one. Note that the backoff will be reset when this happens. -// -// If ac is Ready, it checks whether current connected address of ac is in the -// new addrs list. -// - If true, it updates ac.addrs and returns true. The ac will keep using -// the existing connection. -// - If false, it does nothing and returns false. -func (ac *addrConn) tryUpdateAddrs(addrs []resolver.Address) bool { +// updateAddrs updates ac.addrs with the new addresses list and handles active +// connections or connection attempts. +func (ac *addrConn) updateAddrs(addrs []resolver.Address) { ac.mu.Lock() - defer ac.mu.Unlock() - channelz.Infof(logger, ac.channelzID, "addrConn: tryUpdateAddrs curAddr: %v, addrs: %v", ac.curAddr, addrs) + channelz.Infof(logger, ac.channelzID, "addrConn: updateAddrs curAddr: %v, addrs: %v", ac.curAddr, addrs) + + if equalAddresses(ac.addrs, addrs) { + ac.mu.Unlock() + return + } + + ac.addrs = addrs + if ac.state == connectivity.Shutdown || ac.state == connectivity.TransientFailure || ac.state == connectivity.Idle { - ac.addrs = addrs - return true + // We were not connecting, so do nothing but update the addresses. + ac.mu.Unlock() + return } - if equalAddresses(ac.addrs, addrs) { - return true - } - - if ac.state == connectivity.Connecting { - return false - } - - // ac.state is Ready, try to find the connected address. - var curAddrFound bool - for _, a := range addrs { - a.ServerName = ac.cc.getServerName(a) - if reflect.DeepEqual(ac.curAddr, a) { - curAddrFound = true - break + if ac.state == connectivity.Ready { + // Try to find the connected address. + for _, a := range addrs { + a.ServerName = ac.cc.getServerName(a) + if a.Equal(ac.curAddr) { + // We are connected to a valid address, so do nothing but + // update the addresses. + ac.mu.Unlock() + return + } } } - channelz.Infof(logger, ac.channelzID, "addrConn: tryUpdateAddrs curAddrFound: %v", curAddrFound) - if curAddrFound { - ac.addrs = addrs + + // We are either connected to the wrong address or currently connecting. + // Stop the current iteration and restart. + + ac.cancel() + ac.ctx, ac.cancel = context.WithCancel(ac.cc.ctx) + + // We have to defer here because GracefulClose => Close => onClose, which + // requires locking ac.mu. + defer ac.transport.GracefulClose() + ac.transport = nil + + if len(addrs) == 0 { + ac.updateConnectivityState(connectivity.Idle, nil) } - return curAddrFound + ac.mu.Unlock() + + // Since we were connecting/connected, we should start a new connection + // attempt. + go ac.resetTransport() } // getServerName determines the serverName to be used in the connection @@ -1023,39 +1197,40 @@ func (cc *ClientConn) Close() error { cc.mu.Unlock() return ErrClientConnClosing } + + for cc.idlenessState == ccIdlenessStateExitingIdle { + cc.exitIdleCond.Wait() + } + conns := cc.conns cc.conns = nil cc.csMgr.updateState(connectivity.Shutdown) + pWrapper := cc.blockingpicker rWrapper := cc.resolverWrapper - cc.resolverWrapper = nil bWrapper := cc.balancerWrapper + idlenessMgr := cc.idlenessMgr cc.mu.Unlock() // The order of closing matters here since the balancer wrapper assumes the // picker is closed before it is closed. - cc.blockingpicker.close() + if pWrapper != nil { + pWrapper.close() + } if bWrapper != nil { bWrapper.close() } if rWrapper != nil { rWrapper.close() } + if idlenessMgr != nil { + idlenessMgr.close() + } for ac := range conns { ac.tearDown(ErrClientConnClosing) } - ted := &channelz.TraceEventDesc{ - Desc: "Channel deleted", - Severity: channelz.CtInfo, - } - if cc.dopts.channelzParentID != nil { - ted.Parent = &channelz.TraceEventDesc{ - Desc: fmt.Sprintf("Nested channel(id:%d) deleted", cc.channelzID.Int()), - Severity: channelz.CtInfo, - } - } - channelz.AddTraceEvent(logger, cc.channelzID, 0, ted) + cc.addTraceEvent("deleted") // TraceEvent needs to be called before RemoveEntry, as TraceEvent may add // trace reference to the entity being deleted, and thus prevent it from being // deleted right away. @@ -1085,7 +1260,8 @@ type addrConn struct { addrs []resolver.Address // All addresses that the resolver resolved to. // Use updateConnectivityState for updating addrConn's connectivity state. - state connectivity.State + state connectivity.State + stateChan chan struct{} // closed and recreated on every state change. backoffIdx int // Needs to be stateful for resetConnectBackoff. resetBackoff chan struct{} @@ -1099,6 +1275,9 @@ func (ac *addrConn) updateConnectivityState(s connectivity.State, lastErr error) if ac.state == s { return } + // When changing states, reset the state change channel. + close(ac.stateChan) + ac.stateChan = make(chan struct{}) ac.state = s if lastErr == nil { channelz.Infof(logger, ac.channelzID, "Subchannel Connectivity change to %v", s) @@ -1124,7 +1303,8 @@ func (ac *addrConn) adjustParams(r transport.GoAwayReason) { func (ac *addrConn) resetTransport() { ac.mu.Lock() - if ac.state == connectivity.Shutdown { + acCtx := ac.ctx + if acCtx.Err() != nil { ac.mu.Unlock() return } @@ -1152,15 +1332,14 @@ func (ac *addrConn) resetTransport() { ac.updateConnectivityState(connectivity.Connecting, nil) ac.mu.Unlock() - if err := ac.tryAllAddrs(addrs, connectDeadline); err != nil { + if err := ac.tryAllAddrs(acCtx, addrs, connectDeadline); err != nil { ac.cc.resolveNow(resolver.ResolveNowOptions{}) // After exhausting all addresses, the addrConn enters // TRANSIENT_FAILURE. - ac.mu.Lock() - if ac.state == connectivity.Shutdown { - ac.mu.Unlock() + if acCtx.Err() != nil { return } + ac.mu.Lock() ac.updateConnectivityState(connectivity.TransientFailure, err) // Backoff. @@ -1175,13 +1354,13 @@ func (ac *addrConn) resetTransport() { ac.mu.Unlock() case <-b: timer.Stop() - case <-ac.ctx.Done(): + case <-acCtx.Done(): timer.Stop() return } ac.mu.Lock() - if ac.state != connectivity.Shutdown { + if acCtx.Err() == nil { ac.updateConnectivityState(connectivity.Idle, err) } ac.mu.Unlock() @@ -1196,14 +1375,13 @@ func (ac *addrConn) resetTransport() { // tryAllAddrs tries to creates a connection to the addresses, and stop when at // the first successful one. It returns an error if no address was successfully // connected, or updates ac appropriately with the new transport. -func (ac *addrConn) tryAllAddrs(addrs []resolver.Address, connectDeadline time.Time) error { +func (ac *addrConn) tryAllAddrs(ctx context.Context, addrs []resolver.Address, connectDeadline time.Time) error { var firstConnErr error for _, addr := range addrs { - ac.mu.Lock() - if ac.state == connectivity.Shutdown { - ac.mu.Unlock() + if ctx.Err() != nil { return errConnClosing } + ac.mu.Lock() ac.cc.mu.RLock() ac.dopts.copts.KeepaliveParams = ac.cc.mkp @@ -1217,7 +1395,7 @@ func (ac *addrConn) tryAllAddrs(addrs []resolver.Address, connectDeadline time.T channelz.Infof(logger, ac.channelzID, "Subchannel picks a new address %q to connect", addr.Addr) - err := ac.createTransport(addr, copts, connectDeadline) + err := ac.createTransport(ctx, addr, copts, connectDeadline) if err == nil { return nil } @@ -1234,19 +1412,20 @@ func (ac *addrConn) tryAllAddrs(addrs []resolver.Address, connectDeadline time.T // createTransport creates a connection to addr. It returns an error if the // address was not successfully connected, or updates ac appropriately with the // new transport. -func (ac *addrConn) createTransport(addr resolver.Address, copts transport.ConnectOptions, connectDeadline time.Time) error { +func (ac *addrConn) createTransport(ctx context.Context, addr resolver.Address, copts transport.ConnectOptions, connectDeadline time.Time) error { addr.ServerName = ac.cc.getServerName(addr) - hctx, hcancel := context.WithCancel(ac.ctx) + hctx, hcancel := context.WithCancel(ctx) onClose := func(r transport.GoAwayReason) { ac.mu.Lock() defer ac.mu.Unlock() // adjust params based on GoAwayReason ac.adjustParams(r) - if ac.state == connectivity.Shutdown { - // Already shut down. tearDown() already cleared the transport and - // canceled hctx via ac.ctx, and we expected this connection to be - // closed, so do nothing here. + if ctx.Err() != nil { + // Already shut down or connection attempt canceled. tearDown() or + // updateAddrs() already cleared the transport and canceled hctx + // via ac.ctx, and we expected this connection to be closed, so do + // nothing here. return } hcancel() @@ -1265,7 +1444,7 @@ func (ac *addrConn) createTransport(addr resolver.Address, copts transport.Conne ac.updateConnectivityState(connectivity.Idle, nil) } - connectCtx, cancel := context.WithDeadline(ac.ctx, connectDeadline) + connectCtx, cancel := context.WithDeadline(ctx, connectDeadline) defer cancel() copts.ChannelzParentID = ac.channelzID @@ -1282,7 +1461,7 @@ func (ac *addrConn) createTransport(addr resolver.Address, copts transport.Conne ac.mu.Lock() defer ac.mu.Unlock() - if ac.state == connectivity.Shutdown { + if ctx.Err() != nil { // This can happen if the subConn was removed while in `Connecting` // state. tearDown() would have set the state to `Shutdown`, but // would not have closed the transport since ac.transport would not @@ -1294,6 +1473,9 @@ func (ac *addrConn) createTransport(addr resolver.Address, copts transport.Conne // The error we pass to Close() is immaterial since there are no open // streams at this point, so no trailers with error details will be sent // out. We just need to pass a non-nil error. + // + // This can also happen when updateAddrs is called during a connection + // attempt. go newTr.Close(transport.ErrConnClosing) return nil } @@ -1401,6 +1583,29 @@ func (ac *addrConn) getReadyTransport() transport.ClientTransport { return nil } +// getTransport waits until the addrconn is ready and returns the transport. +// If the context expires first, returns an appropriate status. If the +// addrConn is stopped first, returns an Unavailable status error. +func (ac *addrConn) getTransport(ctx context.Context) (transport.ClientTransport, error) { + for ctx.Err() == nil { + ac.mu.Lock() + t, state, sc := ac.transport, ac.state, ac.stateChan + ac.mu.Unlock() + if state == connectivity.Ready { + return t, nil + } + if state == connectivity.Shutdown { + return nil, status.Errorf(codes.Unavailable, "SubConn shutting down") + } + + select { + case <-ctx.Done(): + case <-sc: + } + } + return nil, status.FromContextError(ctx.Err()).Err() +} + // tearDown starts to tear down the addrConn. // // Note that tearDown doesn't remove ac from ac.cc.conns, so the addrConn struct @@ -1552,7 +1757,14 @@ func (cc *ClientConn) connectionError() error { return cc.lastConnectionError } -func (cc *ClientConn) parseTargetAndFindResolver() (resolver.Builder, error) { +// parseTargetAndFindResolver parses the user's dial target and stores the +// parsed target in `cc.parsedTarget`. +// +// The resolver to use is determined based on the scheme in the parsed target +// and the same is stored in `cc.resolverBuilder`. +// +// Doesn't grab cc.mu as this method is expected to be called only at Dial time. +func (cc *ClientConn) parseTargetAndFindResolver() error { channelz.Infof(logger, cc.channelzID, "original dial target is: %q", cc.target) var rb resolver.Builder @@ -1564,7 +1776,8 @@ func (cc *ClientConn) parseTargetAndFindResolver() (resolver.Builder, error) { rb = cc.getResolver(parsedTarget.URL.Scheme) if rb != nil { cc.parsedTarget = parsedTarget - return rb, nil + cc.resolverBuilder = rb + return nil } } @@ -1579,15 +1792,16 @@ func (cc *ClientConn) parseTargetAndFindResolver() (resolver.Builder, error) { parsedTarget, err = parseTarget(canonicalTarget) if err != nil { channelz.Infof(logger, cc.channelzID, "dial target %q parse failed: %v", canonicalTarget, err) - return nil, err + return err } channelz.Infof(logger, cc.channelzID, "parsed dial target is: %+v", parsedTarget) rb = cc.getResolver(parsedTarget.URL.Scheme) if rb == nil { - return nil, fmt.Errorf("could not get resolver for default scheme: %q", parsedTarget.URL.Scheme) + return fmt.Errorf("could not get resolver for default scheme: %q", parsedTarget.URL.Scheme) } cc.parsedTarget = parsedTarget - return rb, nil + cc.resolverBuilder = rb + return nil } // parseTarget uses RFC 3986 semantics to parse the given target into a @@ -1610,7 +1824,15 @@ func parseTarget(target string) (resolver.Target, error) { // - user specified authority override using `WithAuthority` dial option // - creds' notion of server name for the authentication handshake // - endpoint from dial target of the form "scheme://[authority]/endpoint" -func determineAuthority(endpoint, target string, dopts dialOptions) (string, error) { +// +// Stores the determined authority in `cc.authority`. +// +// Returns a non-nil error if the authority returned by the transport +// credentials do not match the authority configured through the dial option. +// +// Doesn't grab cc.mu as this method is expected to be called only at Dial time. +func (cc *ClientConn) determineAuthority() error { + dopts := cc.dopts // Historically, we had two options for users to specify the serverName or // authority for a channel. One was through the transport credentials // (either in its constructor, or through the OverrideServerName() method). @@ -1627,25 +1849,58 @@ func determineAuthority(endpoint, target string, dopts dialOptions) (string, err } authorityFromDialOption := dopts.authority if (authorityFromCreds != "" && authorityFromDialOption != "") && authorityFromCreds != authorityFromDialOption { - return "", fmt.Errorf("ClientConn's authority from transport creds %q and dial option %q don't match", authorityFromCreds, authorityFromDialOption) + return fmt.Errorf("ClientConn's authority from transport creds %q and dial option %q don't match", authorityFromCreds, authorityFromDialOption) } + endpoint := cc.parsedTarget.Endpoint() + target := cc.target switch { case authorityFromDialOption != "": - return authorityFromDialOption, nil + cc.authority = authorityFromDialOption case authorityFromCreds != "": - return authorityFromCreds, nil + cc.authority = authorityFromCreds case strings.HasPrefix(target, "unix:") || strings.HasPrefix(target, "unix-abstract:"): // TODO: remove when the unix resolver implements optional interface to // return channel authority. - return "localhost", nil + cc.authority = "localhost" case strings.HasPrefix(endpoint, ":"): - return "localhost" + endpoint, nil + cc.authority = "localhost" + endpoint default: // TODO: Define an optional interface on the resolver builder to return // the channel authority given the user's dial target. For resolvers // which don't implement this interface, we will use the endpoint from // "scheme://authority/endpoint" as the default authority. - return endpoint, nil + cc.authority = endpoint } + channelz.Infof(logger, cc.channelzID, "Channel authority set to %q", cc.authority) + return nil +} + +// initResolverWrapper creates a ccResolverWrapper, which builds the name +// resolver. This method grabs the lock to assign the newly built resolver +// wrapper to the cc.resolverWrapper field. +func (cc *ClientConn) initResolverWrapper(creds credentials.TransportCredentials) error { + rw, err := newCCResolverWrapper(cc, ccResolverWrapperOpts{ + target: cc.parsedTarget, + builder: cc.resolverBuilder, + bOpts: resolver.BuildOptions{ + DisableServiceConfig: cc.dopts.disableServiceConfig, + DialCreds: creds, + CredsBundle: cc.dopts.copts.CredsBundle, + Dialer: cc.dopts.copts.Dialer, + }, + channelzID: cc.channelzID, + }) + if err != nil { + return fmt.Errorf("failed to build resolver: %v", err) + } + // Resolver implementations may report state update or error inline when + // built (or right after), and this is handled in cc.updateResolverState. + // Also, an error from the resolver might lead to a re-resolution request + // from the balancer, which is handled in resolveNow() where + // `cc.resolverWrapper` is accessed. Hence, we need to hold the lock here. + cc.mu.Lock() + cc.resolverWrapper = rw + cc.mu.Unlock() + return nil } diff --git a/vendor/google.golang.org/grpc/dialoptions.go b/vendor/google.golang.org/grpc/dialoptions.go index cdc8263b..15a3d510 100644 --- a/vendor/google.golang.org/grpc/dialoptions.go +++ b/vendor/google.golang.org/grpc/dialoptions.go @@ -77,6 +77,7 @@ type dialOptions struct { defaultServiceConfig *ServiceConfig // defaultServiceConfig is parsed from defaultServiceConfigRawJSON. defaultServiceConfigRawJSON *string resolvers []resolver.Builder + idleTimeout time.Duration } // DialOption configures how we set up the connection. @@ -655,3 +656,23 @@ func WithResolvers(rs ...resolver.Builder) DialOption { o.resolvers = append(o.resolvers, rs...) }) } + +// WithIdleTimeout returns a DialOption that configures an idle timeout for the +// channel. If the channel is idle for the configured timeout, i.e there are no +// ongoing RPCs and no new RPCs are initiated, the channel will enter idle mode +// and as a result the name resolver and load balancer will be shut down. The +// channel will exit idle mode when the Connect() method is called or when an +// RPC is initiated. +// +// By default this feature is disabled, which can also be explicitly configured +// by passing zero to this function. +// +// # Experimental +// +// Notice: This API is EXPERIMENTAL and may be changed or removed in a +// later release. +func WithIdleTimeout(d time.Duration) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.idleTimeout = d + }) +} diff --git a/vendor/google.golang.org/grpc/idle.go b/vendor/google.golang.org/grpc/idle.go new file mode 100644 index 00000000..dc3dc72f --- /dev/null +++ b/vendor/google.golang.org/grpc/idle.go @@ -0,0 +1,287 @@ +/* + * + * Copyright 2023 gRPC authors. + * + * 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 grpc + +import ( + "fmt" + "math" + "sync" + "sync/atomic" + "time" +) + +// For overriding in unit tests. +var timeAfterFunc = func(d time.Duration, f func()) *time.Timer { + return time.AfterFunc(d, f) +} + +// idlenessEnforcer is the functionality provided by grpc.ClientConn to enter +// and exit from idle mode. +type idlenessEnforcer interface { + exitIdleMode() error + enterIdleMode() error +} + +// idlenessManager defines the functionality required to track RPC activity on a +// channel. +type idlenessManager interface { + onCallBegin() error + onCallEnd() + close() +} + +type noopIdlenessManager struct{} + +func (noopIdlenessManager) onCallBegin() error { return nil } +func (noopIdlenessManager) onCallEnd() {} +func (noopIdlenessManager) close() {} + +// idlenessManagerImpl implements the idlenessManager interface. It uses atomic +// operations to synchronize access to shared state and a mutex to guarantee +// mutual exclusion in a critical section. +type idlenessManagerImpl struct { + // State accessed atomically. + lastCallEndTime int64 // Unix timestamp in nanos; time when the most recent RPC completed. + activeCallsCount int32 // Count of active RPCs; -math.MaxInt32 means channel is idle or is trying to get there. + activeSinceLastTimerCheck int32 // Boolean; True if there was an RPC since the last timer callback. + closed int32 // Boolean; True when the manager is closed. + + // Can be accessed without atomics or mutex since these are set at creation + // time and read-only after that. + enforcer idlenessEnforcer // Functionality provided by grpc.ClientConn. + timeout int64 // Idle timeout duration nanos stored as an int64. + + // idleMu is used to guarantee mutual exclusion in two scenarios: + // - Opposing intentions: + // - a: Idle timeout has fired and handleIdleTimeout() is trying to put + // the channel in idle mode because the channel has been inactive. + // - b: At the same time an RPC is made on the channel, and onCallBegin() + // is trying to prevent the channel from going idle. + // - Competing intentions: + // - The channel is in idle mode and there are multiple RPCs starting at + // the same time, all trying to move the channel out of idle. Only one + // of them should succeed in doing so, while the other RPCs should + // piggyback on the first one and be successfully handled. + idleMu sync.RWMutex + actuallyIdle bool + timer *time.Timer +} + +// newIdlenessManager creates a new idleness manager implementation for the +// given idle timeout. +func newIdlenessManager(enforcer idlenessEnforcer, idleTimeout time.Duration) idlenessManager { + if idleTimeout == 0 { + return noopIdlenessManager{} + } + + i := &idlenessManagerImpl{ + enforcer: enforcer, + timeout: int64(idleTimeout), + } + i.timer = timeAfterFunc(idleTimeout, i.handleIdleTimeout) + return i +} + +// resetIdleTimer resets the idle timer to the given duration. This method +// should only be called from the timer callback. +func (i *idlenessManagerImpl) resetIdleTimer(d time.Duration) { + i.idleMu.Lock() + defer i.idleMu.Unlock() + + if i.timer == nil { + // Only close sets timer to nil. We are done. + return + } + + // It is safe to ignore the return value from Reset() because this method is + // only ever called from the timer callback, which means the timer has + // already fired. + i.timer.Reset(d) +} + +// handleIdleTimeout is the timer callback that is invoked upon expiry of the +// configured idle timeout. The channel is considered inactive if there are no +// ongoing calls and no RPC activity since the last time the timer fired. +func (i *idlenessManagerImpl) handleIdleTimeout() { + if i.isClosed() { + return + } + + if atomic.LoadInt32(&i.activeCallsCount) > 0 { + i.resetIdleTimer(time.Duration(i.timeout)) + return + } + + // There has been activity on the channel since we last got here. Reset the + // timer and return. + if atomic.LoadInt32(&i.activeSinceLastTimerCheck) == 1 { + // Set the timer to fire after a duration of idle timeout, calculated + // from the time the most recent RPC completed. + atomic.StoreInt32(&i.activeSinceLastTimerCheck, 0) + i.resetIdleTimer(time.Duration(atomic.LoadInt64(&i.lastCallEndTime) + i.timeout - time.Now().UnixNano())) + return + } + + // This CAS operation is extremely likely to succeed given that there has + // been no activity since the last time we were here. Setting the + // activeCallsCount to -math.MaxInt32 indicates to onCallBegin() that the + // channel is either in idle mode or is trying to get there. + if !atomic.CompareAndSwapInt32(&i.activeCallsCount, 0, -math.MaxInt32) { + // This CAS operation can fail if an RPC started after we checked for + // activity at the top of this method, or one was ongoing from before + // the last time we were here. In both case, reset the timer and return. + i.resetIdleTimer(time.Duration(i.timeout)) + return + } + + // Now that we've set the active calls count to -math.MaxInt32, it's time to + // actually move to idle mode. + if i.tryEnterIdleMode() { + // Successfully entered idle mode. No timer needed until we exit idle. + return + } + + // Failed to enter idle mode due to a concurrent RPC that kept the channel + // active, or because of an error from the channel. Undo the attempt to + // enter idle, and reset the timer to try again later. + atomic.AddInt32(&i.activeCallsCount, math.MaxInt32) + i.resetIdleTimer(time.Duration(i.timeout)) +} + +// tryEnterIdleMode instructs the channel to enter idle mode. But before +// that, it performs a last minute check to ensure that no new RPC has come in, +// making the channel active. +// +// Return value indicates whether or not the channel moved to idle mode. +// +// Holds idleMu which ensures mutual exclusion with exitIdleMode. +func (i *idlenessManagerImpl) tryEnterIdleMode() bool { + i.idleMu.Lock() + defer i.idleMu.Unlock() + + if atomic.LoadInt32(&i.activeCallsCount) != -math.MaxInt32 { + // We raced and lost to a new RPC. Very rare, but stop entering idle. + return false + } + if atomic.LoadInt32(&i.activeSinceLastTimerCheck) == 1 { + // An very short RPC could have come in (and also finished) after we + // checked for calls count and activity in handleIdleTimeout(), but + // before the CAS operation. So, we need to check for activity again. + return false + } + + // No new RPCs have come in since we last set the active calls count value + // -math.MaxInt32 in the timer callback. And since we have the lock, it is + // safe to enter idle mode now. + if err := i.enforcer.enterIdleMode(); err != nil { + logger.Errorf("Failed to enter idle mode: %v", err) + return false + } + + // Successfully entered idle mode. + i.actuallyIdle = true + return true +} + +// onCallBegin is invoked at the start of every RPC. +func (i *idlenessManagerImpl) onCallBegin() error { + if i.isClosed() { + return nil + } + + if atomic.AddInt32(&i.activeCallsCount, 1) > 0 { + // Channel is not idle now. Set the activity bit and allow the call. + atomic.StoreInt32(&i.activeSinceLastTimerCheck, 1) + return nil + } + + // Channel is either in idle mode or is in the process of moving to idle + // mode. Attempt to exit idle mode to allow this RPC. + if err := i.exitIdleMode(); err != nil { + // Undo the increment to calls count, and return an error causing the + // RPC to fail. + atomic.AddInt32(&i.activeCallsCount, -1) + return err + } + + atomic.StoreInt32(&i.activeSinceLastTimerCheck, 1) + return nil +} + +// exitIdleMode instructs the channel to exit idle mode. +// +// Holds idleMu which ensures mutual exclusion with tryEnterIdleMode. +func (i *idlenessManagerImpl) exitIdleMode() error { + i.idleMu.Lock() + defer i.idleMu.Unlock() + + if !i.actuallyIdle { + // This can happen in two scenarios: + // - handleIdleTimeout() set the calls count to -math.MaxInt32 and called + // tryEnterIdleMode(). But before the latter could grab the lock, an RPC + // came in and onCallBegin() noticed that the calls count is negative. + // - Channel is in idle mode, and multiple new RPCs come in at the same + // time, all of them notice a negative calls count in onCallBegin and get + // here. The first one to get the lock would got the channel to exit idle. + // + // Either way, nothing to do here. + return nil + } + + if err := i.enforcer.exitIdleMode(); err != nil { + return fmt.Errorf("channel failed to exit idle mode: %v", err) + } + + // Undo the idle entry process. This also respects any new RPC attempts. + atomic.AddInt32(&i.activeCallsCount, math.MaxInt32) + i.actuallyIdle = false + + // Start a new timer to fire after the configured idle timeout. + i.timer = timeAfterFunc(time.Duration(i.timeout), i.handleIdleTimeout) + return nil +} + +// onCallEnd is invoked at the end of every RPC. +func (i *idlenessManagerImpl) onCallEnd() { + if i.isClosed() { + return + } + + // Record the time at which the most recent call finished. + atomic.StoreInt64(&i.lastCallEndTime, time.Now().UnixNano()) + + // Decrement the active calls count. This count can temporarily go negative + // when the timer callback is in the process of moving the channel to idle + // mode, but one or more RPCs come in and complete before the timer callback + // can get done with the process of moving to idle mode. + atomic.AddInt32(&i.activeCallsCount, -1) +} + +func (i *idlenessManagerImpl) isClosed() bool { + return atomic.LoadInt32(&i.closed) == 1 +} + +func (i *idlenessManagerImpl) close() { + atomic.StoreInt32(&i.closed, 1) + + i.idleMu.Lock() + i.timer.Stop() + i.timer = nil + i.idleMu.Unlock() +} diff --git a/vendor/google.golang.org/grpc/internal/binarylog/binarylog.go b/vendor/google.golang.org/grpc/internal/binarylog/binarylog.go index af03a40d..755fdebc 100644 --- a/vendor/google.golang.org/grpc/internal/binarylog/binarylog.go +++ b/vendor/google.golang.org/grpc/internal/binarylog/binarylog.go @@ -32,6 +32,9 @@ var grpclogLogger = grpclog.Component("binarylog") // Logger specifies MethodLoggers for method names with a Log call that // takes a context. +// +// This is used in the 1.0 release of gcp/observability, and thus must not be +// deleted or changed. type Logger interface { GetMethodLogger(methodName string) MethodLogger } diff --git a/vendor/google.golang.org/grpc/internal/binarylog/method_logger.go b/vendor/google.golang.org/grpc/internal/binarylog/method_logger.go index 56fcf008..6c3f6322 100644 --- a/vendor/google.golang.org/grpc/internal/binarylog/method_logger.go +++ b/vendor/google.golang.org/grpc/internal/binarylog/method_logger.go @@ -49,6 +49,9 @@ func (g *callIDGenerator) reset() { var idGen callIDGenerator // MethodLogger is the sub-logger for each method. +// +// This is used in the 1.0 release of gcp/observability, and thus must not be +// deleted or changed. type MethodLogger interface { Log(context.Context, LogEntryConfig) } @@ -65,6 +68,9 @@ type TruncatingMethodLogger struct { } // NewTruncatingMethodLogger returns a new truncating method logger. +// +// This is used in the 1.0 release of gcp/observability, and thus must not be +// deleted or changed. func NewTruncatingMethodLogger(h, m uint64) *TruncatingMethodLogger { return &TruncatingMethodLogger{ headerMaxLen: h, @@ -145,6 +151,9 @@ func (ml *TruncatingMethodLogger) truncateMessage(msgPb *binlogpb.Message) (trun } // LogEntryConfig represents the configuration for binary log entry. +// +// This is used in the 1.0 release of gcp/observability, and thus must not be +// deleted or changed. type LogEntryConfig interface { toProto() *binlogpb.GrpcLogEntry } diff --git a/vendor/google.golang.org/grpc/internal/buffer/unbounded.go b/vendor/google.golang.org/grpc/internal/buffer/unbounded.go index 9f6a0c12..81c2f5fd 100644 --- a/vendor/google.golang.org/grpc/internal/buffer/unbounded.go +++ b/vendor/google.golang.org/grpc/internal/buffer/unbounded.go @@ -35,6 +35,7 @@ import "sync" // internal/transport/transport.go for an example of this. type Unbounded struct { c chan interface{} + closed bool mu sync.Mutex backlog []interface{} } @@ -47,16 +48,18 @@ func NewUnbounded() *Unbounded { // Put adds t to the unbounded buffer. func (b *Unbounded) Put(t interface{}) { b.mu.Lock() + defer b.mu.Unlock() + if b.closed { + return + } if len(b.backlog) == 0 { select { case b.c <- t: - b.mu.Unlock() return default: } } b.backlog = append(b.backlog, t) - b.mu.Unlock() } // Load sends the earliest buffered data, if any, onto the read channel @@ -64,6 +67,10 @@ func (b *Unbounded) Put(t interface{}) { // value from the read channel. func (b *Unbounded) Load() { b.mu.Lock() + defer b.mu.Unlock() + if b.closed { + return + } if len(b.backlog) > 0 { select { case b.c <- b.backlog[0]: @@ -72,7 +79,6 @@ func (b *Unbounded) Load() { default: } } - b.mu.Unlock() } // Get returns a read channel on which values added to the buffer, via Put(), @@ -80,6 +86,20 @@ func (b *Unbounded) Load() { // // Upon reading a value from this channel, users are expected to call Load() to // send the next buffered value onto the channel if there is any. +// +// If the unbounded buffer is closed, the read channel returned by this method +// is closed. func (b *Unbounded) Get() <-chan interface{} { return b.c } + +// Close closes the unbounded buffer. +func (b *Unbounded) Close() { + b.mu.Lock() + defer b.mu.Unlock() + if b.closed { + return + } + b.closed = true + close(b.c) +} diff --git a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go index 5ba9d94d..80fd5c7d 100644 --- a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go +++ b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go @@ -36,6 +36,10 @@ var ( // "GRPC_RING_HASH_CAP". This does not override the default bounds // checking which NACKs configs specifying ring sizes > 8*1024*1024 (~8M). RingHashCap = uint64FromEnv("GRPC_RING_HASH_CAP", 4096, 1, 8*1024*1024) + // PickFirstLBConfig is set if we should support configuration of the + // pick_first LB policy, which can be enabled by setting the environment + // variable "GRPC_EXPERIMENTAL_PICKFIRST_LB_CONFIG" to "true". + PickFirstLBConfig = boolFromEnv("GRPC_EXPERIMENTAL_PICKFIRST_LB_CONFIG", false) ) func boolFromEnv(envVar string, def bool) bool { diff --git a/vendor/google.golang.org/grpc/internal/envconfig/observability.go b/vendor/google.golang.org/grpc/internal/envconfig/observability.go index 821dd0a7..dd314cfb 100644 --- a/vendor/google.golang.org/grpc/internal/envconfig/observability.go +++ b/vendor/google.golang.org/grpc/internal/envconfig/observability.go @@ -28,9 +28,15 @@ const ( var ( // ObservabilityConfig is the json configuration for the gcp/observability // package specified directly in the envObservabilityConfig env var. + // + // This is used in the 1.0 release of gcp/observability, and thus must not be + // deleted or changed. ObservabilityConfig = os.Getenv(envObservabilityConfig) // ObservabilityConfigFile is the json configuration for the // gcp/observability specified in a file with the location specified in // envObservabilityConfigFile env var. + // + // This is used in the 1.0 release of gcp/observability, and thus must not be + // deleted or changed. ObservabilityConfigFile = os.Getenv(envObservabilityConfigFile) ) diff --git a/vendor/google.golang.org/grpc/internal/envconfig/xds.go b/vendor/google.golang.org/grpc/internal/envconfig/xds.go index 3b17705b..02b4b6a1 100644 --- a/vendor/google.golang.org/grpc/internal/envconfig/xds.go +++ b/vendor/google.golang.org/grpc/internal/envconfig/xds.go @@ -61,11 +61,10 @@ var ( // have a brand new API on the server-side and users explicitly need to use // the new API to get security integration on the server. XDSClientSideSecurity = boolFromEnv("GRPC_XDS_EXPERIMENTAL_SECURITY_SUPPORT", true) - // XDSAggregateAndDNS indicates whether processing of aggregated cluster - // and DNS cluster is enabled, which can be enabled by setting the - // environment variable - // "GRPC_XDS_EXPERIMENTAL_ENABLE_AGGREGATE_AND_LOGICAL_DNS_CLUSTER" to - // "true". + // XDSAggregateAndDNS indicates whether processing of aggregated cluster and + // DNS cluster is enabled, which can be disabled by setting the environment + // variable "GRPC_XDS_EXPERIMENTAL_ENABLE_AGGREGATE_AND_LOGICAL_DNS_CLUSTER" + // to "false". XDSAggregateAndDNS = boolFromEnv("GRPC_XDS_EXPERIMENTAL_ENABLE_AGGREGATE_AND_LOGICAL_DNS_CLUSTER", true) // XDSRBAC indicates whether xDS configured RBAC HTTP Filter is enabled, @@ -82,11 +81,15 @@ var ( XDSFederation = boolFromEnv("GRPC_EXPERIMENTAL_XDS_FEDERATION", true) // XDSRLS indicates whether processing of Cluster Specifier plugins and - // support for the RLS CLuster Specifier is enabled, which can be enabled by + // support for the RLS CLuster Specifier is enabled, which can be disabled by // setting the environment variable "GRPC_EXPERIMENTAL_XDS_RLS_LB" to - // "true". - XDSRLS = boolFromEnv("GRPC_EXPERIMENTAL_XDS_RLS_LB", false) + // "false". + XDSRLS = boolFromEnv("GRPC_EXPERIMENTAL_XDS_RLS_LB", true) // C2PResolverTestOnlyTrafficDirectorURI is the TD URI for testing. C2PResolverTestOnlyTrafficDirectorURI = os.Getenv("GRPC_TEST_ONLY_GOOGLE_C2P_RESOLVER_TRAFFIC_DIRECTOR_URI") + // XDSCustomLBPolicy indicates whether Custom LB Policies are enabled, which + // can be disabled by setting the environment variable + // "GRPC_EXPERIMENTAL_XDS_CUSTOM_LB_CONFIG" to "false". + XDSCustomLBPolicy = boolFromEnv("GRPC_EXPERIMENTAL_XDS_CUSTOM_LB_CONFIG", true) ) diff --git a/vendor/google.golang.org/grpc/internal/grpcrand/grpcrand.go b/vendor/google.golang.org/grpc/internal/grpcrand/grpcrand.go index 517ea706..d08e3e90 100644 --- a/vendor/google.golang.org/grpc/internal/grpcrand/grpcrand.go +++ b/vendor/google.golang.org/grpc/internal/grpcrand/grpcrand.go @@ -72,3 +72,17 @@ func Uint64() uint64 { defer mu.Unlock() return r.Uint64() } + +// Uint32 implements rand.Uint32 on the grpcrand global source. +func Uint32() uint32 { + mu.Lock() + defer mu.Unlock() + return r.Uint32() +} + +// Shuffle implements rand.Shuffle on the grpcrand global source. +var Shuffle = func(n int, f func(int, int)) { + mu.Lock() + defer mu.Unlock() + r.Shuffle(n, f) +} diff --git a/vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go b/vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go index 79993d34..37b8d411 100644 --- a/vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go +++ b/vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go @@ -20,6 +20,7 @@ package grpcsync import ( "context" + "sync" "google.golang.org/grpc/internal/buffer" ) @@ -31,15 +32,26 @@ import ( // // This type is safe for concurrent access. type CallbackSerializer struct { + // Done is closed once the serializer is shut down completely, i.e all + // scheduled callbacks are executed and the serializer has deallocated all + // its resources. + Done chan struct{} + callbacks *buffer.Unbounded + closedMu sync.Mutex + closed bool } // NewCallbackSerializer returns a new CallbackSerializer instance. The provided // context will be passed to the scheduled callbacks. Users should cancel the // provided context to shutdown the CallbackSerializer. It is guaranteed that no -// callbacks will be executed once this context is canceled. +// callbacks will be added once this context is canceled, and any pending un-run +// callbacks will be executed before the serializer is shut down. func NewCallbackSerializer(ctx context.Context) *CallbackSerializer { - t := &CallbackSerializer{callbacks: buffer.NewUnbounded()} + t := &CallbackSerializer{ + Done: make(chan struct{}), + callbacks: buffer.NewUnbounded(), + } go t.run(ctx) return t } @@ -48,18 +60,60 @@ func NewCallbackSerializer(ctx context.Context) *CallbackSerializer { // // Callbacks are expected to honor the context when performing any blocking // operations, and should return early when the context is canceled. -func (t *CallbackSerializer) Schedule(f func(ctx context.Context)) { +// +// Return value indicates if the callback was successfully added to the list of +// callbacks to be executed by the serializer. It is not possible to add +// callbacks once the context passed to NewCallbackSerializer is cancelled. +func (t *CallbackSerializer) Schedule(f func(ctx context.Context)) bool { + t.closedMu.Lock() + defer t.closedMu.Unlock() + + if t.closed { + return false + } t.callbacks.Put(f) + return true } func (t *CallbackSerializer) run(ctx context.Context) { + var backlog []func(context.Context) + + defer close(t.Done) for ctx.Err() == nil { select { case <-ctx.Done(): - return - case callback := <-t.callbacks.Get(): + // Do nothing here. Next iteration of the for loop will not happen, + // since ctx.Err() would be non-nil. + case callback, ok := <-t.callbacks.Get(): + if !ok { + return + } t.callbacks.Load() callback.(func(ctx context.Context))(ctx) } } + + // Fetch pending callbacks if any, and execute them before returning from + // this method and closing t.Done. + t.closedMu.Lock() + t.closed = true + backlog = t.fetchPendingCallbacks() + t.callbacks.Close() + t.closedMu.Unlock() + for _, b := range backlog { + b(ctx) + } +} + +func (t *CallbackSerializer) fetchPendingCallbacks() []func(context.Context) { + var backlog []func(context.Context) + for { + select { + case b := <-t.callbacks.Get(): + backlog = append(backlog, b.(func(context.Context))) + t.callbacks.Load() + default: + return backlog + } + } } diff --git a/vendor/google.golang.org/grpc/internal/internal.go b/vendor/google.golang.org/grpc/internal/internal.go index 836b6a3b..42ff39c8 100644 --- a/vendor/google.golang.org/grpc/internal/internal.go +++ b/vendor/google.golang.org/grpc/internal/internal.go @@ -60,6 +60,9 @@ var ( GetServerCredentials interface{} // func (*grpc.Server) credentials.TransportCredentials // CanonicalString returns the canonical string of the code defined here: // https://github.com/grpc/grpc/blob/master/doc/statuscodes.md. + // + // This is used in the 1.0 release of gcp/observability, and thus must not be + // deleted or changed. CanonicalString interface{} // func (codes.Code) string // DrainServerTransports initiates a graceful close of existing connections // on a gRPC server accepted on the provided listener address. An @@ -69,20 +72,35 @@ var ( // AddGlobalServerOptions adds an array of ServerOption that will be // effective globally for newly created servers. The priority will be: 1. // user-provided; 2. this method; 3. default values. + // + // This is used in the 1.0 release of gcp/observability, and thus must not be + // deleted or changed. AddGlobalServerOptions interface{} // func(opt ...ServerOption) // ClearGlobalServerOptions clears the array of extra ServerOption. This // method is useful in testing and benchmarking. + // + // This is used in the 1.0 release of gcp/observability, and thus must not be + // deleted or changed. ClearGlobalServerOptions func() // AddGlobalDialOptions adds an array of DialOption that will be effective // globally for newly created client channels. The priority will be: 1. // user-provided; 2. this method; 3. default values. + // + // This is used in the 1.0 release of gcp/observability, and thus must not be + // deleted or changed. AddGlobalDialOptions interface{} // func(opt ...DialOption) // DisableGlobalDialOptions returns a DialOption that prevents the // ClientConn from applying the global DialOptions (set via // AddGlobalDialOptions). + // + // This is used in the 1.0 release of gcp/observability, and thus must not be + // deleted or changed. DisableGlobalDialOptions interface{} // func() grpc.DialOption // ClearGlobalDialOptions clears the array of extra DialOption. This // method is useful in testing and benchmarking. + // + // This is used in the 1.0 release of gcp/observability, and thus must not be + // deleted or changed. ClearGlobalDialOptions func() // JoinDialOptions combines the dial options passed as arguments into a // single dial option. @@ -93,9 +111,15 @@ var ( // WithBinaryLogger returns a DialOption that specifies the binary logger // for a ClientConn. + // + // This is used in the 1.0 release of gcp/observability, and thus must not be + // deleted or changed. WithBinaryLogger interface{} // func(binarylog.Logger) grpc.DialOption // BinaryLogger returns a ServerOption that can set the binary logger for a // server. + // + // This is used in the 1.0 release of gcp/observability, and thus must not be + // deleted or changed. BinaryLogger interface{} // func(binarylog.Logger) grpc.ServerOption // NewXDSResolverWithConfigForTesting creates a new xds resolver builder using diff --git a/vendor/google.golang.org/grpc/internal/serviceconfig/duration.go b/vendor/google.golang.org/grpc/internal/serviceconfig/duration.go new file mode 100644 index 00000000..11d82afc --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/serviceconfig/duration.go @@ -0,0 +1,130 @@ +/* + * + * Copyright 2023 gRPC authors. + * + * 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 serviceconfig + +import ( + "encoding/json" + "fmt" + "math" + "strconv" + "strings" + "time" +) + +// Duration defines JSON marshal and unmarshal methods to conform to the +// protobuf JSON spec defined [here]. +// +// [here]: https://protobuf.dev/reference/protobuf/google.protobuf/#duration +type Duration time.Duration + +func (d Duration) String() string { + return fmt.Sprint(time.Duration(d)) +} + +// MarshalJSON converts from d to a JSON string output. +func (d Duration) MarshalJSON() ([]byte, error) { + ns := time.Duration(d).Nanoseconds() + sec := ns / int64(time.Second) + ns = ns % int64(time.Second) + + var sign string + if sec < 0 || ns < 0 { + sign, sec, ns = "-", -1*sec, -1*ns + } + + // Generated output always contains 0, 3, 6, or 9 fractional digits, + // depending on required precision. + str := fmt.Sprintf("%s%d.%09d", sign, sec, ns) + str = strings.TrimSuffix(str, "000") + str = strings.TrimSuffix(str, "000") + str = strings.TrimSuffix(str, ".000") + return []byte(fmt.Sprintf("\"%ss\"", str)), nil +} + +// UnmarshalJSON unmarshals b as a duration JSON string into d. +func (d *Duration) UnmarshalJSON(b []byte) error { + var s string + if err := json.Unmarshal(b, &s); err != nil { + return err + } + if !strings.HasSuffix(s, "s") { + return fmt.Errorf("malformed duration %q: missing seconds unit", s) + } + neg := false + if s[0] == '-' { + neg = true + s = s[1:] + } + ss := strings.SplitN(s[:len(s)-1], ".", 3) + if len(ss) > 2 { + return fmt.Errorf("malformed duration %q: too many decimals", s) + } + // hasDigits is set if either the whole or fractional part of the number is + // present, since both are optional but one is required. + hasDigits := false + var sec, ns int64 + if len(ss[0]) > 0 { + var err error + if sec, err = strconv.ParseInt(ss[0], 10, 64); err != nil { + return fmt.Errorf("malformed duration %q: %v", s, err) + } + // Maximum seconds value per the durationpb spec. + const maxProtoSeconds = 315_576_000_000 + if sec > maxProtoSeconds { + return fmt.Errorf("out of range: %q", s) + } + hasDigits = true + } + if len(ss) == 2 && len(ss[1]) > 0 { + if len(ss[1]) > 9 { + return fmt.Errorf("malformed duration %q: too many digits after decimal", s) + } + var err error + if ns, err = strconv.ParseInt(ss[1], 10, 64); err != nil { + return fmt.Errorf("malformed duration %q: %v", s, err) + } + for i := 9; i > len(ss[1]); i-- { + ns *= 10 + } + hasDigits = true + } + if !hasDigits { + return fmt.Errorf("malformed duration %q: contains no numbers", s) + } + + if neg { + sec *= -1 + ns *= -1 + } + + // Maximum/minimum seconds/nanoseconds representable by Go's time.Duration. + const maxSeconds = math.MaxInt64 / int64(time.Second) + const maxNanosAtMaxSeconds = math.MaxInt64 % int64(time.Second) + const minSeconds = math.MinInt64 / int64(time.Second) + const minNanosAtMinSeconds = math.MinInt64 % int64(time.Second) + + if sec > maxSeconds || (sec == maxSeconds && ns >= maxNanosAtMaxSeconds) { + *d = Duration(math.MaxInt64) + } else if sec < minSeconds || (sec == minSeconds && ns <= minNanosAtMinSeconds) { + *d = Duration(math.MinInt64) + } else { + *d = Duration(sec*int64(time.Second) + ns) + } + return nil +} diff --git a/vendor/google.golang.org/grpc/internal/transport/handler_server.go b/vendor/google.golang.org/grpc/internal/transport/handler_server.go index fbee581b..98f80e3f 100644 --- a/vendor/google.golang.org/grpc/internal/transport/handler_server.go +++ b/vendor/google.golang.org/grpc/internal/transport/handler_server.go @@ -453,7 +453,7 @@ func (ht *serverHandlerTransport) IncrMsgSent() {} func (ht *serverHandlerTransport) IncrMsgRecv() {} -func (ht *serverHandlerTransport) Drain() { +func (ht *serverHandlerTransport) Drain(debugData string) { panic("Drain() is not implemented") } diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_client.go b/vendor/google.golang.org/grpc/internal/transport/http2_client.go index 5216998a..326bf084 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_client.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_client.go @@ -1337,7 +1337,7 @@ func (t *http2Client) handleGoAway(f *http2.GoAwayFrame) { // setGoAwayReason sets the value of t.goAwayReason based // on the GoAway frame received. -// It expects a lock on transport's mutext to be held by +// It expects a lock on transport's mutex to be held by // the caller. func (t *http2Client) setGoAwayReason(f *http2.GoAwayFrame) { t.goAwayReason = GoAwayNoReason diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_server.go b/vendor/google.golang.org/grpc/internal/transport/http2_server.go index 4b406b8c..79e86ba0 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_server.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_server.go @@ -1166,12 +1166,12 @@ func (t *http2Server) keepalive() { if val <= 0 { // The connection has been idle for a duration of keepalive.MaxConnectionIdle or more. // Gracefully close the connection. - t.Drain() + t.Drain("max_idle") return } idleTimer.Reset(val) case <-ageTimer.C: - t.Drain() + t.Drain("max_age") ageTimer.Reset(t.kp.MaxConnectionAgeGrace) select { case <-ageTimer.C: @@ -1318,14 +1318,14 @@ func (t *http2Server) RemoteAddr() net.Addr { return t.remoteAddr } -func (t *http2Server) Drain() { +func (t *http2Server) Drain(debugData string) { t.mu.Lock() defer t.mu.Unlock() if t.drainEvent != nil { return } t.drainEvent = grpcsync.NewEvent() - t.controlBuf.put(&goAway{code: http2.ErrCodeNo, debugData: []byte{}, headsUp: true}) + t.controlBuf.put(&goAway{code: http2.ErrCodeNo, debugData: []byte(debugData), headsUp: true}) } var goAwayPing = &ping{data: [8]byte{1, 6, 1, 8, 0, 3, 3, 9}} @@ -1367,7 +1367,7 @@ func (t *http2Server) outgoingGoAwayHandler(g *goAway) (bool, error) { // originated before the GoAway reaches the client. // After getting the ack or timer expiration send out another GoAway this // time with an ID of the max stream server intends to process. - if err := t.framer.fr.WriteGoAway(math.MaxUint32, http2.ErrCodeNo, []byte{}); err != nil { + if err := t.framer.fr.WriteGoAway(math.MaxUint32, http2.ErrCodeNo, g.debugData); err != nil { return false, err } if err := t.framer.fr.WritePing(false, goAwayPing.data); err != nil { diff --git a/vendor/google.golang.org/grpc/internal/transport/transport.go b/vendor/google.golang.org/grpc/internal/transport/transport.go index 1b7d7fab..aa1c8965 100644 --- a/vendor/google.golang.org/grpc/internal/transport/transport.go +++ b/vendor/google.golang.org/grpc/internal/transport/transport.go @@ -726,7 +726,7 @@ type ServerTransport interface { RemoteAddr() net.Addr // Drain notifies the client this ServerTransport stops accepting new RPCs. - Drain() + Drain(debugData string) // IncrMsgSent increments the number of message sent through this transport. IncrMsgSent() diff --git a/vendor/google.golang.org/grpc/picker_wrapper.go b/vendor/google.golang.org/grpc/picker_wrapper.go index c525dc07..02f97595 100644 --- a/vendor/google.golang.org/grpc/picker_wrapper.go +++ b/vendor/google.golang.org/grpc/picker_wrapper.go @@ -36,6 +36,7 @@ import ( type pickerWrapper struct { mu sync.Mutex done bool + idle bool blockingCh chan struct{} picker balancer.Picker } @@ -47,7 +48,11 @@ func newPickerWrapper() *pickerWrapper { // updatePicker is called by UpdateBalancerState. It unblocks all blocked pick. func (pw *pickerWrapper) updatePicker(p balancer.Picker) { pw.mu.Lock() - if pw.done { + if pw.done || pw.idle { + // There is a small window where a picker update from the LB policy can + // race with the channel going to idle mode. If the picker is idle here, + // it is because the channel asked it to do so, and therefore it is sage + // to ignore the update from the LB policy. pw.mu.Unlock() return } @@ -63,10 +68,8 @@ func (pw *pickerWrapper) updatePicker(p balancer.Picker) { // - wraps the done function in the passed in result to increment the calls // failed or calls succeeded channelz counter before invoking the actual // done function. -func doneChannelzWrapper(acw *acBalancerWrapper, result *balancer.PickResult) { - acw.mu.Lock() - ac := acw.ac - acw.mu.Unlock() +func doneChannelzWrapper(acbw *acBalancerWrapper, result *balancer.PickResult) { + ac := acbw.ac ac.incrCallsStarted() done := result.Done result.Done = func(b balancer.DoneInfo) { @@ -152,14 +155,14 @@ func (pw *pickerWrapper) pick(ctx context.Context, failfast bool, info balancer. return nil, balancer.PickResult{}, status.Error(codes.Unavailable, err.Error()) } - acw, ok := pickResult.SubConn.(*acBalancerWrapper) + acbw, ok := pickResult.SubConn.(*acBalancerWrapper) if !ok { logger.Errorf("subconn returned from pick is type %T, not *acBalancerWrapper", pickResult.SubConn) continue } - if t := acw.getAddrConn().getReadyTransport(); t != nil { + if t := acbw.ac.getReadyTransport(); t != nil { if channelz.IsOn() { - doneChannelzWrapper(acw, &pickResult) + doneChannelzWrapper(acbw, &pickResult) return t, pickResult, nil } return t, pickResult, nil @@ -187,6 +190,25 @@ func (pw *pickerWrapper) close() { close(pw.blockingCh) } +func (pw *pickerWrapper) enterIdleMode() { + pw.mu.Lock() + defer pw.mu.Unlock() + if pw.done { + return + } + pw.idle = true +} + +func (pw *pickerWrapper) exitIdleMode() { + pw.mu.Lock() + defer pw.mu.Unlock() + if pw.done { + return + } + pw.blockingCh = make(chan struct{}) + pw.idle = false +} + // dropError is a wrapper error that indicates the LB policy wishes to drop the // RPC and not retry it. type dropError struct { diff --git a/vendor/google.golang.org/grpc/pickfirst.go b/vendor/google.golang.org/grpc/pickfirst.go index fc91b4d2..abe266b0 100644 --- a/vendor/google.golang.org/grpc/pickfirst.go +++ b/vendor/google.golang.org/grpc/pickfirst.go @@ -19,11 +19,15 @@ package grpc import ( + "encoding/json" "errors" "fmt" "google.golang.org/grpc/balancer" "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/internal/envconfig" + "google.golang.org/grpc/internal/grpcrand" + "google.golang.org/grpc/serviceconfig" ) // PickFirstBalancerName is the name of the pick_first balancer. @@ -43,10 +47,28 @@ func (*pickfirstBuilder) Name() string { return PickFirstBalancerName } +type pfConfig struct { + serviceconfig.LoadBalancingConfig `json:"-"` + + // If set to true, instructs the LB policy to shuffle the order of the list + // of addresses received from the name resolver before attempting to + // connect to them. + ShuffleAddressList bool `json:"shuffleAddressList"` +} + +func (*pickfirstBuilder) ParseConfig(js json.RawMessage) (serviceconfig.LoadBalancingConfig, error) { + cfg := &pfConfig{} + if err := json.Unmarshal(js, cfg); err != nil { + return nil, fmt.Errorf("pickfirst: unable to unmarshal LB policy config: %s, error: %v", string(js), err) + } + return cfg, nil +} + type pickfirstBalancer struct { state connectivity.State cc balancer.ClientConn subConn balancer.SubConn + cfg *pfConfig } func (b *pickfirstBalancer) ResolverError(err error) { @@ -69,7 +91,8 @@ func (b *pickfirstBalancer) ResolverError(err error) { } func (b *pickfirstBalancer) UpdateClientConnState(state balancer.ClientConnState) error { - if len(state.ResolverState.Addresses) == 0 { + addrs := state.ResolverState.Addresses + if len(addrs) == 0 { // The resolver reported an empty address list. Treat it like an error by // calling b.ResolverError. if b.subConn != nil { @@ -82,12 +105,23 @@ func (b *pickfirstBalancer) UpdateClientConnState(state balancer.ClientConnState return balancer.ErrBadResolverState } + if state.BalancerConfig != nil { + cfg, ok := state.BalancerConfig.(*pfConfig) + if !ok { + return fmt.Errorf("pickfirstBalancer: received nil or illegal BalancerConfig (type %T): %v", state.BalancerConfig, state.BalancerConfig) + } + b.cfg = cfg + } + + if envconfig.PickFirstLBConfig && b.cfg != nil && b.cfg.ShuffleAddressList { + grpcrand.Shuffle(len(addrs), func(i, j int) { addrs[i], addrs[j] = addrs[j], addrs[i] }) + } if b.subConn != nil { - b.cc.UpdateAddresses(b.subConn, state.ResolverState.Addresses) + b.cc.UpdateAddresses(b.subConn, addrs) return nil } - subConn, err := b.cc.NewSubConn(state.ResolverState.Addresses, balancer.NewSubConnOptions{}) + subConn, err := b.cc.NewSubConn(addrs, balancer.NewSubConnOptions{}) if err != nil { if logger.V(2) { logger.Errorf("pickfirstBalancer: failed to NewSubConn: %v", err) @@ -119,7 +153,6 @@ func (b *pickfirstBalancer) UpdateSubConnState(subConn balancer.SubConn, state b } return } - b.state = state.ConnectivityState if state.ConnectivityState == connectivity.Shutdown { b.subConn = nil return @@ -132,11 +165,21 @@ func (b *pickfirstBalancer) UpdateSubConnState(subConn balancer.SubConn, state b Picker: &picker{result: balancer.PickResult{SubConn: subConn}}, }) case connectivity.Connecting: + if b.state == connectivity.TransientFailure { + // We stay in TransientFailure until we are Ready. See A62. + return + } b.cc.UpdateState(balancer.State{ ConnectivityState: state.ConnectivityState, Picker: &picker{err: balancer.ErrNoSubConnAvailable}, }) case connectivity.Idle: + if b.state == connectivity.TransientFailure { + // We stay in TransientFailure until we are Ready. Also kick the + // subConn out of Idle into Connecting. See A62. + b.subConn.Connect() + return + } b.cc.UpdateState(balancer.State{ ConnectivityState: state.ConnectivityState, Picker: &idlePicker{subConn: subConn}, @@ -147,6 +190,7 @@ func (b *pickfirstBalancer) UpdateSubConnState(subConn balancer.SubConn, state b Picker: &picker{err: state.ConnectionError}, }) } + b.state = state.ConnectivityState } func (b *pickfirstBalancer) Close() { diff --git a/vendor/google.golang.org/grpc/resolver/resolver.go b/vendor/google.golang.org/grpc/resolver/resolver.go index 6215e5ef..353c10b6 100644 --- a/vendor/google.golang.org/grpc/resolver/resolver.go +++ b/vendor/google.golang.org/grpc/resolver/resolver.go @@ -22,13 +22,13 @@ package resolver import ( "context" + "fmt" "net" "net/url" "strings" "google.golang.org/grpc/attributes" "google.golang.org/grpc/credentials" - "google.golang.org/grpc/internal/pretty" "google.golang.org/grpc/serviceconfig" ) @@ -124,7 +124,7 @@ type Address struct { Attributes *attributes.Attributes // BalancerAttributes contains arbitrary data about this address intended - // for consumption by the LB policy. These attribes do not affect SubConn + // for consumption by the LB policy. These attributes do not affect SubConn // creation, connection establishment, handshaking, etc. BalancerAttributes *attributes.Attributes @@ -151,7 +151,17 @@ func (a Address) Equal(o Address) bool { // String returns JSON formatted string representation of the address. func (a Address) String() string { - return pretty.ToJSON(a) + var sb strings.Builder + sb.WriteString(fmt.Sprintf("{Addr: %q, ", a.Addr)) + sb.WriteString(fmt.Sprintf("ServerName: %q, ", a.ServerName)) + if a.Attributes != nil { + sb.WriteString(fmt.Sprintf("Attributes: %v, ", a.Attributes.String())) + } + if a.BalancerAttributes != nil { + sb.WriteString(fmt.Sprintf("BalancerAttributes: %v", a.BalancerAttributes.String())) + } + sb.WriteString("}") + return sb.String() } // BuildOptions includes additional information for the builder to create diff --git a/vendor/google.golang.org/grpc/resolver_conn_wrapper.go b/vendor/google.golang.org/grpc/resolver_conn_wrapper.go index 05a9d4e0..b408b368 100644 --- a/vendor/google.golang.org/grpc/resolver_conn_wrapper.go +++ b/vendor/google.golang.org/grpc/resolver_conn_wrapper.go @@ -19,11 +19,11 @@ package grpc import ( + "context" "strings" "sync" "google.golang.org/grpc/balancer" - "google.golang.org/grpc/credentials" "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/internal/grpcsync" "google.golang.org/grpc/internal/pretty" @@ -31,129 +31,192 @@ import ( "google.golang.org/grpc/serviceconfig" ) +// resolverStateUpdater wraps the single method used by ccResolverWrapper to +// report a state update from the actual resolver implementation. +type resolverStateUpdater interface { + updateResolverState(s resolver.State, err error) error +} + // ccResolverWrapper is a wrapper on top of cc for resolvers. // It implements resolver.ClientConn interface. type ccResolverWrapper struct { - cc *ClientConn - resolverMu sync.Mutex - resolver resolver.Resolver - done *grpcsync.Event - curState resolver.State + // The following fields are initialized when the wrapper is created and are + // read-only afterwards, and therefore can be accessed without a mutex. + cc resolverStateUpdater + channelzID *channelz.Identifier + ignoreServiceConfig bool + opts ccResolverWrapperOpts + serializer *grpcsync.CallbackSerializer // To serialize all incoming calls. + serializerCancel context.CancelFunc // To close the serializer, accessed only from close(). - incomingMu sync.Mutex // Synchronizes all the incoming calls. + // All incoming (resolver --> gRPC) calls are guaranteed to execute in a + // mutually exclusive manner as they are scheduled on the serializer. + // Fields accessed *only* in these serializer callbacks, can therefore be + // accessed without a mutex. + curState resolver.State + + // mu guards access to the below fields. + mu sync.Mutex + closed bool + resolver resolver.Resolver // Accessed only from outgoing calls. +} + +// ccResolverWrapperOpts wraps the arguments to be passed when creating a new +// ccResolverWrapper. +type ccResolverWrapperOpts struct { + target resolver.Target // User specified dial target to resolve. + builder resolver.Builder // Resolver builder to use. + bOpts resolver.BuildOptions // Resolver build options to use. + channelzID *channelz.Identifier // Channelz identifier for the channel. } // newCCResolverWrapper uses the resolver.Builder to build a Resolver and // returns a ccResolverWrapper object which wraps the newly built resolver. -func newCCResolverWrapper(cc *ClientConn, rb resolver.Builder) (*ccResolverWrapper, error) { +func newCCResolverWrapper(cc resolverStateUpdater, opts ccResolverWrapperOpts) (*ccResolverWrapper, error) { + ctx, cancel := context.WithCancel(context.Background()) ccr := &ccResolverWrapper{ - cc: cc, - done: grpcsync.NewEvent(), + cc: cc, + channelzID: opts.channelzID, + ignoreServiceConfig: opts.bOpts.DisableServiceConfig, + opts: opts, + serializer: grpcsync.NewCallbackSerializer(ctx), + serializerCancel: cancel, } - var credsClone credentials.TransportCredentials - if creds := cc.dopts.copts.TransportCredentials; creds != nil { - credsClone = creds.Clone() - } - rbo := resolver.BuildOptions{ - DisableServiceConfig: cc.dopts.disableServiceConfig, - DialCreds: credsClone, - CredsBundle: cc.dopts.copts.CredsBundle, - Dialer: cc.dopts.copts.Dialer, - } - - var err error - // We need to hold the lock here while we assign to the ccr.resolver field - // to guard against a data race caused by the following code path, - // rb.Build-->ccr.ReportError-->ccr.poll-->ccr.resolveNow, would end up - // accessing ccr.resolver which is being assigned here. - ccr.resolverMu.Lock() - defer ccr.resolverMu.Unlock() - ccr.resolver, err = rb.Build(cc.parsedTarget, ccr, rbo) + // Cannot hold the lock at build time because the resolver can send an + // update or error inline and these incoming calls grab the lock to schedule + // a callback in the serializer. + r, err := opts.builder.Build(opts.target, ccr, opts.bOpts) if err != nil { + cancel() return nil, err } + + // Any error reported by the resolver at build time that leads to a + // re-resolution request from the balancer is dropped by grpc until we + // return from this function. So, we don't have to handle pending resolveNow + // requests here. + ccr.mu.Lock() + ccr.resolver = r + ccr.mu.Unlock() + return ccr, nil } func (ccr *ccResolverWrapper) resolveNow(o resolver.ResolveNowOptions) { - ccr.resolverMu.Lock() - if !ccr.done.HasFired() { - ccr.resolver.ResolveNow(o) + ccr.mu.Lock() + defer ccr.mu.Unlock() + + // ccr.resolver field is set only after the call to Build() returns. But in + // the process of building, the resolver may send an error update which when + // propagated to the balancer may result in a re-resolution request. + if ccr.closed || ccr.resolver == nil { + return } - ccr.resolverMu.Unlock() + ccr.resolver.ResolveNow(o) } func (ccr *ccResolverWrapper) close() { - ccr.resolverMu.Lock() - ccr.resolver.Close() - ccr.done.Fire() - ccr.resolverMu.Unlock() + ccr.mu.Lock() + if ccr.closed { + ccr.mu.Unlock() + return + } + + channelz.Info(logger, ccr.channelzID, "Closing the name resolver") + + // Close the serializer to ensure that no more calls from the resolver are + // handled, before actually closing the resolver. + ccr.serializerCancel() + ccr.closed = true + r := ccr.resolver + ccr.mu.Unlock() + + // Give enqueued callbacks a chance to finish. + <-ccr.serializer.Done + + // Spawn a goroutine to close the resolver (since it may block trying to + // cleanup all allocated resources) and return early. + go r.Close() } +// serializerScheduleLocked is a convenience method to schedule a function to be +// run on the serializer while holding ccr.mu. +func (ccr *ccResolverWrapper) serializerScheduleLocked(f func(context.Context)) { + ccr.mu.Lock() + ccr.serializer.Schedule(f) + ccr.mu.Unlock() +} + +// UpdateState is called by resolver implementations to report new state to gRPC +// which includes addresses and service config. func (ccr *ccResolverWrapper) UpdateState(s resolver.State) error { - ccr.incomingMu.Lock() - defer ccr.incomingMu.Unlock() - if ccr.done.HasFired() { + errCh := make(chan error, 1) + ok := ccr.serializer.Schedule(func(context.Context) { + ccr.addChannelzTraceEvent(s) + ccr.curState = s + if err := ccr.cc.updateResolverState(ccr.curState, nil); err == balancer.ErrBadResolverState { + errCh <- balancer.ErrBadResolverState + return + } + errCh <- nil + }) + if !ok { + // The only time when Schedule() fail to add the callback to the + // serializer is when the serializer is closed, and this happens only + // when the resolver wrapper is closed. return nil } - ccr.addChannelzTraceEvent(s) - ccr.curState = s - if err := ccr.cc.updateResolverState(ccr.curState, nil); err == balancer.ErrBadResolverState { - return balancer.ErrBadResolverState - } - return nil + return <-errCh } +// ReportError is called by resolver implementations to report errors +// encountered during name resolution to gRPC. func (ccr *ccResolverWrapper) ReportError(err error) { - ccr.incomingMu.Lock() - defer ccr.incomingMu.Unlock() - if ccr.done.HasFired() { - return - } - channelz.Warningf(logger, ccr.cc.channelzID, "ccResolverWrapper: reporting error to cc: %v", err) - ccr.cc.updateResolverState(resolver.State{}, err) + ccr.serializerScheduleLocked(func(_ context.Context) { + channelz.Warningf(logger, ccr.channelzID, "ccResolverWrapper: reporting error to cc: %v", err) + ccr.cc.updateResolverState(resolver.State{}, err) + }) } -// NewAddress is called by the resolver implementation to send addresses to gRPC. +// NewAddress is called by the resolver implementation to send addresses to +// gRPC. func (ccr *ccResolverWrapper) NewAddress(addrs []resolver.Address) { - ccr.incomingMu.Lock() - defer ccr.incomingMu.Unlock() - if ccr.done.HasFired() { - return - } - ccr.addChannelzTraceEvent(resolver.State{Addresses: addrs, ServiceConfig: ccr.curState.ServiceConfig}) - ccr.curState.Addresses = addrs - ccr.cc.updateResolverState(ccr.curState, nil) + ccr.serializerScheduleLocked(func(_ context.Context) { + ccr.addChannelzTraceEvent(resolver.State{Addresses: addrs, ServiceConfig: ccr.curState.ServiceConfig}) + ccr.curState.Addresses = addrs + ccr.cc.updateResolverState(ccr.curState, nil) + }) } // NewServiceConfig is called by the resolver implementation to send service // configs to gRPC. func (ccr *ccResolverWrapper) NewServiceConfig(sc string) { - ccr.incomingMu.Lock() - defer ccr.incomingMu.Unlock() - if ccr.done.HasFired() { - return - } - channelz.Infof(logger, ccr.cc.channelzID, "ccResolverWrapper: got new service config: %s", sc) - if ccr.cc.dopts.disableServiceConfig { - channelz.Info(logger, ccr.cc.channelzID, "Service config lookups disabled; ignoring config") - return - } - scpr := parseServiceConfig(sc) - if scpr.Err != nil { - channelz.Warningf(logger, ccr.cc.channelzID, "ccResolverWrapper: error parsing service config: %v", scpr.Err) - return - } - ccr.addChannelzTraceEvent(resolver.State{Addresses: ccr.curState.Addresses, ServiceConfig: scpr}) - ccr.curState.ServiceConfig = scpr - ccr.cc.updateResolverState(ccr.curState, nil) + ccr.serializerScheduleLocked(func(_ context.Context) { + channelz.Infof(logger, ccr.channelzID, "ccResolverWrapper: got new service config: %s", sc) + if ccr.ignoreServiceConfig { + channelz.Info(logger, ccr.channelzID, "Service config lookups disabled; ignoring config") + return + } + scpr := parseServiceConfig(sc) + if scpr.Err != nil { + channelz.Warningf(logger, ccr.channelzID, "ccResolverWrapper: error parsing service config: %v", scpr.Err) + return + } + ccr.addChannelzTraceEvent(resolver.State{Addresses: ccr.curState.Addresses, ServiceConfig: scpr}) + ccr.curState.ServiceConfig = scpr + ccr.cc.updateResolverState(ccr.curState, nil) + }) } +// ParseServiceConfig is called by resolver implementations to parse a JSON +// representation of the service config. func (ccr *ccResolverWrapper) ParseServiceConfig(scJSON string) *serviceconfig.ParseResult { return parseServiceConfig(scJSON) } +// addChannelzTraceEvent adds a channelz trace event containing the new +// state received from resolver implementations. func (ccr *ccResolverWrapper) addChannelzTraceEvent(s resolver.State) { var updates []string var oldSC, newSC *ServiceConfig @@ -172,5 +235,5 @@ func (ccr *ccResolverWrapper) addChannelzTraceEvent(s resolver.State) { } else if len(ccr.curState.Addresses) == 0 && len(s.Addresses) > 0 { updates = append(updates, "resolver returned new addresses") } - channelz.Infof(logger, ccr.cc.channelzID, "Resolver state updated: %s (%v)", pretty.ToJSON(s), strings.Join(updates, "; ")) + channelz.Infof(logger, ccr.channelzID, "Resolver state updated: %s (%v)", pretty.ToJSON(s), strings.Join(updates, "; ")) } diff --git a/vendor/google.golang.org/grpc/server.go b/vendor/google.golang.org/grpc/server.go index 76d152a6..81969e7c 100644 --- a/vendor/google.golang.org/grpc/server.go +++ b/vendor/google.golang.org/grpc/server.go @@ -895,7 +895,7 @@ func (s *Server) drainServerTransports(addr string) { s.mu.Lock() conns := s.conns[addr] for st := range conns { - st.Drain() + st.Drain("") } s.mu.Unlock() } @@ -1046,7 +1046,7 @@ func (s *Server) addConn(addr string, st transport.ServerTransport) bool { if s.drain { // Transport added after we drained our existing conns: drain it // immediately. - st.Drain() + st.Drain("") } if s.conns[addr] == nil { @@ -1856,7 +1856,7 @@ func (s *Server) GracefulStop() { if !s.drain { for _, conns := range s.conns { for st := range conns { - st.Drain() + st.Drain("graceful_stop") } } s.drain = true diff --git a/vendor/google.golang.org/grpc/service_config.go b/vendor/google.golang.org/grpc/service_config.go index f22acace..0df11fc0 100644 --- a/vendor/google.golang.org/grpc/service_config.go +++ b/vendor/google.golang.org/grpc/service_config.go @@ -23,8 +23,6 @@ import ( "errors" "fmt" "reflect" - "strconv" - "strings" "time" "google.golang.org/grpc/codes" @@ -106,8 +104,8 @@ type healthCheckConfig struct { type jsonRetryPolicy struct { MaxAttempts int - InitialBackoff string - MaxBackoff string + InitialBackoff internalserviceconfig.Duration + MaxBackoff internalserviceconfig.Duration BackoffMultiplier float64 RetryableStatusCodes []codes.Code } @@ -129,50 +127,6 @@ type retryThrottlingPolicy struct { TokenRatio float64 } -func parseDuration(s *string) (*time.Duration, error) { - if s == nil { - return nil, nil - } - if !strings.HasSuffix(*s, "s") { - return nil, fmt.Errorf("malformed duration %q", *s) - } - ss := strings.SplitN((*s)[:len(*s)-1], ".", 3) - if len(ss) > 2 { - return nil, fmt.Errorf("malformed duration %q", *s) - } - // hasDigits is set if either the whole or fractional part of the number is - // present, since both are optional but one is required. - hasDigits := false - var d time.Duration - if len(ss[0]) > 0 { - i, err := strconv.ParseInt(ss[0], 10, 32) - if err != nil { - return nil, fmt.Errorf("malformed duration %q: %v", *s, err) - } - d = time.Duration(i) * time.Second - hasDigits = true - } - if len(ss) == 2 && len(ss[1]) > 0 { - if len(ss[1]) > 9 { - return nil, fmt.Errorf("malformed duration %q", *s) - } - f, err := strconv.ParseInt(ss[1], 10, 64) - if err != nil { - return nil, fmt.Errorf("malformed duration %q: %v", *s, err) - } - for i := 9; i > len(ss[1]); i-- { - f *= 10 - } - d += time.Duration(f) - hasDigits = true - } - if !hasDigits { - return nil, fmt.Errorf("malformed duration %q", *s) - } - - return &d, nil -} - type jsonName struct { Service string Method string @@ -201,7 +155,7 @@ func (j jsonName) generatePath() (string, error) { type jsonMC struct { Name *[]jsonName WaitForReady *bool - Timeout *string + Timeout *internalserviceconfig.Duration MaxRequestMessageBytes *int64 MaxResponseMessageBytes *int64 RetryPolicy *jsonRetryPolicy @@ -252,15 +206,10 @@ func parseServiceConfig(js string) *serviceconfig.ParseResult { if m.Name == nil { continue } - d, err := parseDuration(m.Timeout) - if err != nil { - logger.Warningf("grpc: unmarshaling service config %s: %v", js, err) - return &serviceconfig.ParseResult{Err: err} - } mc := MethodConfig{ WaitForReady: m.WaitForReady, - Timeout: d, + Timeout: (*time.Duration)(m.Timeout), } if mc.RetryPolicy, err = convertRetryPolicy(m.RetryPolicy); err != nil { logger.Warningf("grpc: unmarshaling service config %s: %v", js, err) @@ -312,18 +261,10 @@ func convertRetryPolicy(jrp *jsonRetryPolicy) (p *internalserviceconfig.RetryPol if jrp == nil { return nil, nil } - ib, err := parseDuration(&jrp.InitialBackoff) - if err != nil { - return nil, err - } - mb, err := parseDuration(&jrp.MaxBackoff) - if err != nil { - return nil, err - } if jrp.MaxAttempts <= 1 || - *ib <= 0 || - *mb <= 0 || + jrp.InitialBackoff <= 0 || + jrp.MaxBackoff <= 0 || jrp.BackoffMultiplier <= 0 || len(jrp.RetryableStatusCodes) == 0 { logger.Warningf("grpc: ignoring retry policy %v due to illegal configuration", jrp) @@ -332,8 +273,8 @@ func convertRetryPolicy(jrp *jsonRetryPolicy) (p *internalserviceconfig.RetryPol rp := &internalserviceconfig.RetryPolicy{ MaxAttempts: jrp.MaxAttempts, - InitialBackoff: *ib, - MaxBackoff: *mb, + InitialBackoff: time.Duration(jrp.InitialBackoff), + MaxBackoff: time.Duration(jrp.MaxBackoff), BackoffMultiplier: jrp.BackoffMultiplier, RetryableStatusCodes: make(map[codes.Code]bool), } diff --git a/vendor/google.golang.org/grpc/stream.go b/vendor/google.golang.org/grpc/stream.go index d1226a41..10092685 100644 --- a/vendor/google.golang.org/grpc/stream.go +++ b/vendor/google.golang.org/grpc/stream.go @@ -123,6 +123,9 @@ type ClientStream interface { // calling RecvMsg on the same stream at the same time, but it is not safe // to call SendMsg on the same stream in different goroutines. It is also // not safe to call CloseSend concurrently with SendMsg. + // + // It is not safe to modify the message after calling SendMsg. Tracing + // libraries and stats handlers may use the message lazily. SendMsg(m interface{}) error // RecvMsg blocks until it receives a message into m or the stream is // done. It returns io.EOF when the stream completes successfully. On @@ -152,6 +155,11 @@ type ClientStream interface { // If none of the above happen, a goroutine and a context will be leaked, and grpc // will not call the optionally-configured stats handler with a stats.End message. func (cc *ClientConn) NewStream(ctx context.Context, desc *StreamDesc, method string, opts ...CallOption) (ClientStream, error) { + if err := cc.idlenessMgr.onCallBegin(); err != nil { + return nil, err + } + defer cc.idlenessMgr.onCallEnd() + // allow interceptor to see all applicable call options, which means those // configured as defaults from dial option as well as per-call options opts = combine(cc.dopts.callOptions, opts) @@ -469,7 +477,7 @@ func (a *csAttempt) newStream() error { // It is safe to overwrite the csAttempt's context here, since all state // maintained in it are local to the attempt. When the attempt has to be // retried, a new instance of csAttempt will be created. - if a.pickResult.Metatada != nil { + if a.pickResult.Metadata != nil { // We currently do not have a function it the metadata package which // merges given metadata with existing metadata in a context. Existing // function `AppendToOutgoingContext()` takes a variadic argument of key @@ -479,7 +487,7 @@ func (a *csAttempt) newStream() error { // in a form passable to AppendToOutgoingContext(), or create a version // of AppendToOutgoingContext() that accepts a metadata.MD. md, _ := metadata.FromOutgoingContext(a.ctx) - md = metadata.Join(md, a.pickResult.Metatada) + md = metadata.Join(md, a.pickResult.Metadata) a.ctx = metadata.NewOutgoingContext(a.ctx, md) } @@ -1265,14 +1273,19 @@ func newNonRetryClientStream(ctx context.Context, desc *StreamDesc, method strin as.p = &parser{r: s} ac.incrCallsStarted() if desc != unaryStreamDesc { - // Listen on cc and stream contexts to cleanup when the user closes the - // ClientConn or cancels the stream context. In all other cases, an error - // should already be injected into the recv buffer by the transport, which - // the client will eventually receive, and then we will cancel the stream's - // context in clientStream.finish. + // Listen on stream context to cleanup when the stream context is + // canceled. Also listen for the addrConn's context in case the + // addrConn is closed or reconnects to a different address. In all + // other cases, an error should already be injected into the recv + // buffer by the transport, which the client will eventually receive, + // and then we will cancel the stream's context in + // addrConnStream.finish. go func() { + ac.mu.Lock() + acCtx := ac.ctx + ac.mu.Unlock() select { - case <-ac.ctx.Done(): + case <-acCtx.Done(): as.finish(status.Error(codes.Canceled, "grpc: the SubConn is closing")) case <-ctx.Done(): as.finish(toRPCErr(ctx.Err())) diff --git a/vendor/google.golang.org/grpc/version.go b/vendor/google.golang.org/grpc/version.go index 853ce0e3..d0460ec9 100644 --- a/vendor/google.golang.org/grpc/version.go +++ b/vendor/google.golang.org/grpc/version.go @@ -19,4 +19,4 @@ package grpc // Version is the current grpc version. -const Version = "1.55.0" +const Version = "1.56.0" diff --git a/vendor/gorm.io/driver/sqlserver/error_translator.go b/vendor/gorm.io/driver/sqlserver/error_translator.go index fed1e0b9..07e7d2e0 100644 --- a/vendor/gorm.io/driver/sqlserver/error_translator.go +++ b/vendor/gorm.io/driver/sqlserver/error_translator.go @@ -6,6 +6,7 @@ import ( "gorm.io/gorm" ) +// The error codes to map mssql errors to gorm errors, here is a reference about error codes for mssql https://learn.microsoft.com/en-us/sql/relational-databases/errors-events/database-engine-events-and-errors?view=sql-server-ver16 var errCodes = map[string]int32{ "uniqueConstraint": 2627, } @@ -17,7 +18,7 @@ type ErrMessage struct { // Translate it will translate the error to native gorm errors. func (dialector Dialector) Translate(err error) error { - if mssqlErr, ok := err.(*mssql.Error); ok { + if mssqlErr, ok := err.(mssql.Error); ok { if mssqlErr.Number == errCodes["uniqueConstraint"] { return gorm.ErrDuplicatedKey } diff --git a/vendor/gorm.io/driver/sqlserver/migrator.go b/vendor/gorm.io/driver/sqlserver/migrator.go index 34cb3030..75a288c7 100644 --- a/vendor/gorm.io/driver/sqlserver/migrator.go +++ b/vendor/gorm.io/driver/sqlserver/migrator.go @@ -158,7 +158,7 @@ func (m Migrator) AlterColumn(value interface{}, field string) error { return m.DB.Exec( "ALTER TABLE ? ALTER COLUMN ? ?", - clause.Table{Name: stmt.Table}, clause.Column{Name: field.DBName}, fieldType, + clause.Table{Name: getFullQualifiedTableName(stmt)}, clause.Column{Name: field.DBName}, fieldType, ).Error } } diff --git a/vendor/modules.txt b/vendor/modules.txt index d84381ac..34ccfb26 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -11,8 +11,8 @@ github.com/andybalholm/brotli # github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 ## explicit; go 1.13 github.com/asaskevich/govalidator -# github.com/camunda/zeebe/clients/go/v8 v8.2.5 -## explicit; go 1.17 +# github.com/camunda/zeebe/clients/go/v8 v8.2.7 +## explicit; go 1.19 github.com/camunda/zeebe/clients/go/v8/internal/embedded github.com/camunda/zeebe/clients/go/v8/internal/utils github.com/camunda/zeebe/clients/go/v8/pkg/commands @@ -70,7 +70,7 @@ github.com/go-ozzo/ozzo-validation/v4 github.com/go-ozzo/ozzo-validation/v4/is # github.com/go-test/deep v1.1.0 ## explicit; go 1.16 -# github.com/gofiber/fiber/v2 v2.46.0 +# github.com/gofiber/fiber/v2 v2.47.0 ## explicit; go 1.20 github.com/gofiber/fiber/v2 github.com/gofiber/fiber/v2/internal/schema @@ -191,16 +191,16 @@ github.com/jackc/pgtype ## explicit; go 1.13 github.com/jackc/pgx/v4 github.com/jackc/pgx/v4/internal/sanitize -# github.com/jackc/pgx/v5 v5.3.1 +# github.com/jackc/pgx/v5 v5.4.1 ## explicit; go 1.19 github.com/jackc/pgx/v5 github.com/jackc/pgx/v5/internal/anynil github.com/jackc/pgx/v5/internal/iobufpool -github.com/jackc/pgx/v5/internal/nbconn github.com/jackc/pgx/v5/internal/pgio github.com/jackc/pgx/v5/internal/sanitize github.com/jackc/pgx/v5/internal/stmtcache github.com/jackc/pgx/v5/pgconn +github.com/jackc/pgx/v5/pgconn/internal/bgreader github.com/jackc/pgx/v5/pgconn/internal/ctxwatch github.com/jackc/pgx/v5/pgproto3 github.com/jackc/pgx/v5/pgtype @@ -221,7 +221,7 @@ github.com/joho/godotenv # github.com/json-iterator/go v1.1.12 ## explicit; go 1.12 github.com/json-iterator/go -# github.com/klauspost/compress v1.16.5 +# github.com/klauspost/compress v1.16.6 ## explicit; go 1.18 github.com/klauspost/compress github.com/klauspost/compress/flate @@ -235,7 +235,7 @@ github.com/klauspost/compress/snappy github.com/klauspost/compress/zlib github.com/klauspost/compress/zstd github.com/klauspost/compress/zstd/internal/xxhash -# github.com/klauspost/cpuid/v2 v2.2.4 +# github.com/klauspost/cpuid/v2 v2.2.5 ## explicit; go 1.15 github.com/klauspost/cpuid/v2 # github.com/lib/pq v1.10.9 @@ -271,7 +271,7 @@ github.com/microsoft/go-mssqldb/msdsn # github.com/minio/md5-simd v1.1.2 ## explicit; go 1.14 github.com/minio/md5-simd -# github.com/minio/minio-go/v7 v7.0.56 +# github.com/minio/minio-go/v7 v7.0.57 ## explicit; go 1.17 github.com/minio/minio-go/v7 github.com/minio/minio-go/v7/pkg/credentials @@ -300,7 +300,7 @@ github.com/modern-go/reflect2 ## explicit; go 1.16 # github.com/nats-io/nats-server/v2 v2.8.4 ## explicit; go 1.17 -# github.com/nats-io/nats.go v1.26.0 +# github.com/nats-io/nats.go v1.27.0 ## explicit; go 1.19 github.com/nats-io/nats.go github.com/nats-io/nats.go/encoders/builtin @@ -315,7 +315,7 @@ github.com/nats-io/nuid # github.com/philhofer/fwd v1.1.2 ## explicit; go 1.15 github.com/philhofer/fwd -# github.com/pierrec/lz4/v4 v4.1.17 +# github.com/pierrec/lz4/v4 v4.1.18 ## explicit; go 1.14 github.com/pierrec/lz4/v4 github.com/pierrec/lz4/v4/internal/lz4block @@ -331,7 +331,7 @@ github.com/rivo/uniseg # github.com/rs/xid v1.5.0 ## explicit; go 1.12 github.com/rs/xid -# github.com/sashabaranov/go-openai v1.9.5 +# github.com/sashabaranov/go-openai v1.11.2 ## explicit; go 1.18 github.com/sashabaranov/go-openai github.com/sashabaranov/go-openai/internal @@ -393,7 +393,7 @@ github.com/segmentio/kafka-go/protocol/saslhandshake github.com/segmentio/kafka-go/protocol/syncgroup github.com/segmentio/kafka-go/protocol/txnoffsetcommit github.com/segmentio/kafka-go/sasl -# github.com/sirupsen/logrus v1.9.2 +# github.com/sirupsen/logrus v1.9.3 ## explicit; go 1.13 github.com/sirupsen/logrus # github.com/stretchr/testify v1.8.4 @@ -431,9 +431,11 @@ github.com/vmihailenco/tagparser/v2/internal/parser # github.com/xhit/go-simple-mail/v2 v2.13.0 ## explicit; go 1.13 github.com/xhit/go-simple-mail/v2 -# gitlab.aescorp.ru/dsp_dev/claim/common/object_model v1.0.171 -## explicit; go 1.17 +# gitlab.aescorp.ru/dsp_dev/claim/common/object_model v1.0.191 +## explicit; go 1.20 gitlab.aescorp.ru/dsp_dev/claim/common/object_model +gitlab.aescorp.ru/dsp_dev/claim/common/object_model/alias +gitlab.aescorp.ru/dsp_dev/claim/common/object_model/front/front_format gitlab.aescorp.ru/dsp_dev/claim/common/object_model/object_view # go.mau.fi/libsignal v0.1.0 ## explicit; go 1.18 @@ -463,7 +465,7 @@ go.mau.fi/libsignal/util/errorhelper go.mau.fi/libsignal/util/keyhelper go.mau.fi/libsignal/util/medium go.mau.fi/libsignal/util/optional -# go.mau.fi/whatsmeow v0.0.0-20230601124015-46f2ff088640 +# go.mau.fi/whatsmeow v0.0.0-20230616194828-be0edabb0bf3 ## explicit; go 1.19 go.mau.fi/whatsmeow go.mau.fi/whatsmeow/appstate @@ -505,7 +507,7 @@ go.uber.org/zap/internal/bufferpool go.uber.org/zap/internal/color go.uber.org/zap/internal/exit go.uber.org/zap/zapcore -# golang.org/x/crypto v0.9.0 +# golang.org/x/crypto v0.10.0 ## explicit; go 1.17 golang.org/x/crypto/argon2 golang.org/x/crypto/blake2b @@ -524,7 +526,7 @@ golang.org/x/crypto/ssh/terminal # golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 ## explicit; go 1.20 golang.org/x/exp/maps -# golang.org/x/net v0.10.0 +# golang.org/x/net v0.11.0 ## explicit; go 1.17 golang.org/x/net/context golang.org/x/net/http/httpguts @@ -536,26 +538,26 @@ golang.org/x/net/internal/timeseries golang.org/x/net/proxy golang.org/x/net/publicsuffix golang.org/x/net/trace -# golang.org/x/oauth2 v0.8.0 +# golang.org/x/oauth2 v0.9.0 ## explicit; go 1.17 golang.org/x/oauth2 golang.org/x/oauth2/clientcredentials golang.org/x/oauth2/internal -# golang.org/x/sync v0.2.0 -## explicit +# golang.org/x/sync v0.3.0 +## explicit; go 1.17 golang.org/x/sync/errgroup golang.org/x/sync/singleflight -# golang.org/x/sys v0.8.0 +# golang.org/x/sys v0.9.0 ## explicit; go 1.17 golang.org/x/sys/cpu golang.org/x/sys/internal/unsafeheader golang.org/x/sys/plan9 golang.org/x/sys/unix golang.org/x/sys/windows -# golang.org/x/term v0.8.0 +# golang.org/x/term v0.9.0 ## explicit; go 1.17 golang.org/x/term -# golang.org/x/text v0.9.0 +# golang.org/x/text v0.10.0 ## explicit; go 1.17 golang.org/x/text/cases golang.org/x/text/encoding @@ -584,7 +586,7 @@ google.golang.org/appengine/urlfetch # google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc ## explicit; go 1.19 google.golang.org/genproto/googleapis/rpc/status -# google.golang.org/grpc v1.55.0 +# google.golang.org/grpc v1.56.0 ## explicit; go 1.17 google.golang.org/grpc google.golang.org/grpc/attributes @@ -680,7 +682,7 @@ gopkg.in/yaml.v3 # gorm.io/driver/postgres v1.5.2 ## explicit; go 1.18 gorm.io/driver/postgres -# gorm.io/driver/sqlserver v1.5.0 +# gorm.io/driver/sqlserver v1.5.1 ## explicit; go 1.14 gorm.io/driver/sqlserver # gorm.io/gorm v1.25.1