diff --git a/.gitignore b/.gitignore index 37690a8..fbfa4f9 100644 --- a/.gitignore +++ b/.gitignore @@ -121,3 +121,4 @@ tmp .DS_Store cmd/main/__debug_bin* /test_files/ +.idea diff --git a/cmd/main/main.go b/cmd/main/main.go index 0dbae65..1fac385 100644 --- a/cmd/main/main.go +++ b/cmd/main/main.go @@ -15,8 +15,6 @@ import ( "time" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - influxdb2 "github.com/influxdata/influxdb-client-go/v2" - openfga "github.com/openfga/api/proto/openfga/v1" "github.com/redis/go-redis/v9" "go.opentelemetry.io/contrib/propagators/b3" "go.opentelemetry.io/otel" @@ -34,6 +32,8 @@ import ( grpcMiddleware "github.com/grpc-ecosystem/go-grpc-middleware" grpcZap "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap" grpcRecovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery" + influxdb2 "github.com/influxdata/influxdb-client-go/v2" + openfga "github.com/openfga/api/proto/openfga/v1" "github.com/instill-ai/artifact-backend/config" "github.com/instill-ai/artifact-backend/pkg/acl" @@ -42,8 +42,8 @@ import ( "github.com/instill-ai/artifact-backend/pkg/logger" "github.com/instill-ai/artifact-backend/pkg/middleware" "github.com/instill-ai/artifact-backend/pkg/milvus" + "github.com/instill-ai/artifact-backend/pkg/minio" "github.com/instill-ai/artifact-backend/pkg/repository" - servicePkg "github.com/instill-ai/artifact-backend/pkg/service" "github.com/instill-ai/artifact-backend/pkg/usage" "github.com/instill-ai/artifact-backend/pkg/utils" "github.com/instill-ai/artifact-backend/pkg/worker" @@ -52,7 +52,8 @@ import ( httpClient "github.com/instill-ai/artifact-backend/pkg/client/http" database "github.com/instill-ai/artifact-backend/pkg/db" customOtel "github.com/instill-ai/artifact-backend/pkg/logger/otel" - minio "github.com/instill-ai/artifact-backend/pkg/minio" + servicePkg "github.com/instill-ai/artifact-backend/pkg/service" + artifactPB "github.com/instill-ai/protogen-go/artifact/artifact/v1alpha" mgmtPB "github.com/instill-ai/protogen-go/core/mgmt/v1beta" pipelinePB "github.com/instill-ai/protogen-go/vdp/pipeline/v1beta" diff --git a/go.mod b/go.mod index 92f184a..f8c45c1 100644 --- a/go.mod +++ b/go.mod @@ -6,20 +6,21 @@ require ( github.com/frankban/quicktest v1.14.6 github.com/go-resty/resty/v2 v2.12.0 github.com/gofrs/uuid v4.4.0+incompatible - github.com/gojuno/minimock/v3 v3.3.6 + github.com/gojuno/minimock/v3 v3.4.0 github.com/golang-migrate/migrate/v4 v4.17.0 github.com/google/go-cmp v0.6.0 github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 github.com/influxdata/influxdb-client-go/v2 v2.12.3 - github.com/instill-ai/protogen-go v0.3.3-alpha.0.20240923163607-406de8626033 + github.com/instill-ai/protogen-go v0.3.3-alpha.0.20240926030437-7a1e3a9e0c46 github.com/instill-ai/usage-client v0.3.0-alpha.0.20240319060111-4a3a39f2fd61 - github.com/instill-ai/x v0.3.0-alpha.0.20231219052200-6230a89e386c + github.com/instill-ai/x v0.4.0-alpha.0.20240923052503-fd243919e005 github.com/knadh/koanf v1.5.0 github.com/milvus-io/milvus-sdk-go/v2 v2.4.1 github.com/minio/minio-go v6.0.14+incompatible github.com/openfga/api/proto v0.0.0-20240723155248-7e5be7b65c27 github.com/redis/go-redis/v9 v9.5.3 + go.einride.tech/aip v0.68.0 go.opentelemetry.io/contrib/propagators/b3 v1.17.0 go.opentelemetry.io/otel v1.16.0 go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.39.0 @@ -30,34 +31,43 @@ require ( go.opentelemetry.io/otel/sdk/metric v0.39.0 go.opentelemetry.io/otel/trace v1.16.0 go.uber.org/zap v1.26.0 - golang.org/x/net v0.26.0 - google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 - google.golang.org/grpc v1.64.1 - google.golang.org/protobuf v1.34.1 - gorm.io/driver/postgres v1.4.5 - gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11 + golang.org/x/net v0.28.0 + google.golang.org/genproto/googleapis/rpc v0.0.0-20240711142825-46eb208f015d + google.golang.org/grpc v1.65.0 + google.golang.org/protobuf v1.34.2 + gopkg.in/guregu/null.v4 v4.0.0 + gorm.io/datatypes v1.2.2 + gorm.io/driver/postgres v1.5.0 + gorm.io/gorm v1.25.11 ) require ( cloud.google.com/go/longrunning v0.5.4 // indirect + filippo.io/edwards25519 v1.1.0 // indirect github.com/cockroachdb/errors v1.9.1 // indirect github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f // indirect github.com/cockroachdb/redact v1.1.3 // indirect github.com/envoyproxy/protoc-gen-validate v1.0.4 // indirect github.com/getsentry/sentry-go v0.12.0 // indirect github.com/go-ini/ini v1.67.0 // indirect + github.com/go-sql-driver/mysql v1.8.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/jackc/pgx/v5 v5.5.5 // indirect + github.com/jackc/puddle/v2 v2.2.1 // indirect github.com/milvus-io/milvus-proto/go-api/v2 v2.4.3 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/tidwall/gjson v1.14.4 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.0 // indirect + golang.org/x/sync v0.8.0 // indirect + gorm.io/driver/mysql v1.5.6 // indirect ) require ( github.com/catalinc/hashcash v0.0.0-20220723060415-5e3ec3e24f67 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/deepmap/oapi-codegen v1.8.2 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect @@ -73,9 +83,7 @@ require ( github.com/jackc/pgio v1.0.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgproto3/v2 v2.3.3 // indirect - github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect - github.com/jackc/pgtype v1.14.0 // indirect - github.com/jackc/pgx/v4 v4.18.2 // indirect + github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect github.com/kr/pretty v0.3.1 // indirect @@ -88,7 +96,7 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rogpeppe/go-internal v1.10.0 // indirect - github.com/stretchr/testify v1.8.4 // indirect + github.com/stretchr/testify v1.9.0 go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.16.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.39.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.16.0 // indirect @@ -96,9 +104,9 @@ require ( go.opentelemetry.io/proto/otlp v0.19.0 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.10.0 // indirect - golang.org/x/crypto v0.24.0 - golang.org/x/sys v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect + golang.org/x/crypto v0.26.0 + golang.org/x/sys v0.24.0 // indirect + golang.org/x/text v0.17.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240711142825-46eb208f015d // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index f270339..40a09ec 100644 --- a/go.sum +++ b/go.sum @@ -33,6 +33,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= @@ -41,8 +43,6 @@ github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= -github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= -github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -85,8 +85,8 @@ github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyY github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -98,8 +98,6 @@ github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= -github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= @@ -112,11 +110,8 @@ github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -197,13 +192,15 @@ github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34 github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-resty/resty/v2 v2.12.0 h1:rsVL8P90LFvkUYq/V5BTVe203WfRIU4gvcf+yfzJzGA= github.com/go-resty/resty/v2 v2.12.0/go.mod h1:o0yGPrkS3lOe1+eFajk6kBW8ScXzwU3hD69/gt2yB/0= +github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= +github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y= +github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= @@ -213,11 +210,15 @@ github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= -github.com/gojuno/minimock/v3 v3.3.6 h1:tZQQaDgKSxsKiVia9vt6zZ/qsKNGBw2D0ubHQPr+mHc= -github.com/gojuno/minimock/v3 v3.3.6/go.mod h1:kjvubEBVT8aUQ9e+g8x/hPfAhiOoqW7WinzzJgzr4ws= +github.com/gojuno/minimock/v3 v3.4.0 h1:htPGQuFvmCaTygTnARPp5tSWZUZxOnu8A2RDVyl/LA8= +github.com/gojuno/minimock/v3 v3.4.0/go.mod h1:0PdkFMCugnywaAqwrdWMZMzHhSH3ZoXlMVHiRVdIrLk= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang-migrate/migrate/v4 v4.17.0 h1:rd40H3QXU0AA4IoLllFcEAEo9dYKRHYND2gB4p7xcaU= github.com/golang-migrate/migrate/v4 v4.17.0/go.mod h1:+Cp2mtLP4/aXDTKb9wmXYitdrNx2HGs45rbWAo6OsKM= +github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0ktxqI+Sida1w446QrXBRJ0nee3SNZlA= +github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= +github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A= +github.com/golang-sql/sqlexp v0.1.0/go.mod h1:J4ad9Vo8ZCWQ2GMrC4UCQy1JpCbwU9m3EOqtpKwwwHI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -280,6 +281,8 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -342,72 +345,41 @@ github.com/influxdata/influxdb-client-go/v2 v2.12.3 h1:28nRlNMRIV4QbtIUvxhWqaxn0 github.com/influxdata/influxdb-client-go/v2 v2.12.3/go.mod h1:IrrLUbCjjfkmRuaCiGQg4m2GbkaeJDcuWoxiWdQEbA0= github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 h1:W9WBk7wlPfJLvMCdtV4zPulc4uCPrlywQOmbFOhgQNU= github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= -github.com/instill-ai/protogen-go v0.3.3-alpha.0.20240923163607-406de8626033 h1:AQQbHOC9TXL08+KwaWkGDcIhGQbUhAGzJi9zIEuMDTg= -github.com/instill-ai/protogen-go v0.3.3-alpha.0.20240923163607-406de8626033/go.mod h1:rf0UY7VpEgpaLudYEcjx5rnbuwlBaaLyD4FQmWLtgAY= +github.com/instill-ai/protogen-go v0.3.3-alpha.0.20240926030437-7a1e3a9e0c46 h1:wGUnJgj9wMhcmKV5xgDCTrZ6z8u8RmhrznHn4yYTjhE= +github.com/instill-ai/protogen-go v0.3.3-alpha.0.20240926030437-7a1e3a9e0c46/go.mod h1:rf0UY7VpEgpaLudYEcjx5rnbuwlBaaLyD4FQmWLtgAY= github.com/instill-ai/usage-client v0.3.0-alpha.0.20240319060111-4a3a39f2fd61 h1:smPTvmXDhn/QC7y/TPXyMTqbbRd0gvzmFgWBChwTfhE= github.com/instill-ai/usage-client v0.3.0-alpha.0.20240319060111-4a3a39f2fd61/go.mod h1:/TAHs4ybuylk5icuy+MQtHRc4XUnIyXzeNKxX9qDFhw= -github.com/instill-ai/x v0.3.0-alpha.0.20231219052200-6230a89e386c h1:a2RVkpIV2QcrGnSHAou+t/L+vBsaIfFvk5inVg5Uh4s= -github.com/instill-ai/x v0.3.0-alpha.0.20231219052200-6230a89e386c/go.mod h1:L6jmDPrUou6XskaLXZuK/gDeitdoPa9yE8ONKt1ZwCw= +github.com/instill-ai/x v0.4.0-alpha.0.20240923052503-fd243919e005 h1:6iUpJs545Ivvv2joJCQoawRPr2YRPjux22k7t+gWg6s= +github.com/instill-ai/x v0.4.0-alpha.0.20240923052503-fd243919e005/go.mod h1:jkVtaq9T2zAFA5N46tlV4K5EEVE7FcOVNbqY4wFWYz8= github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= -github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= -github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= -github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= -github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= -github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= -github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= -github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= -github.com/jackc/pgconn v1.13.0/go.mod h1:AnowpAqO4CMIIJNZl2VJp+KrkAZciAkhEl0W0JIobpI= github.com/jackc/pgconn v1.14.3 h1:bVoTr12EGANZz66nZPkMInAV/KHD2TxH9npjXXgiB3w= github.com/jackc/pgconn v1.14.3/go.mod h1:RZbme4uasqzybK2RK5c65VsHxoyaml09lx3tXOcO/VM= github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= -github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= -github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5Wi/+Zz7xoE5ALHsRQlOctkOiHc= github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= -github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= -github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= -github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= -github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= -github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.3.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgproto3/v2 v2.3.3 h1:1HLSx5H+tXR9pW3in3zaztoEwQYRC9SQaYUHjTSUOag= github.com/jackc/pgproto3/v2 v2.3.3/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= -github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= -github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= -github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= -github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= -github.com/jackc/pgtype v1.12.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= -github.com/jackc/pgtype v1.14.0 h1:y+xUdabmyMkJLyApYuPj38mW+aAIqCe5uuBB51rH3Vw= -github.com/jackc/pgtype v1.14.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= -github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= -github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= -github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= -github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= -github.com/jackc/pgx/v4 v4.17.2/go.mod h1:lcxIZN44yMIrWI78a5CpucdD14hX0SBDbNRvjDBItsw= -github.com/jackc/pgx/v4 v4.18.2 h1:xVpYkNR5pk5bMCZGfClbO962UIqVABcAGt7ha1s/FeU= -github.com/jackc/pgx/v4 v4.18.2/go.mod h1:Ey4Oru5tH5sB6tV7hDmfWFahwF15Eb7DNXlRKx2CkVw= -github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.3.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 h1:L0QtFUgDarD7Fpv9jeVMgy/+Ec0mtnmYuImjTz6dtDA= +github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgx/v5 v5.3.0/go.mod h1:t3JDKnCBlYIc0ewLF0Q7B8MXmoIaBOZj/ic7iHozM/8= +github.com/jackc/pgx/v5 v5.5.5 h1:amBjrZVmksIdNjxGW/IiIMzxMKZFelXbUoPNb+8sjQw= +github.com/jackc/pgx/v5 v5.5.5/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A= +github.com/jackc/puddle/v2 v2.2.0/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= +github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk= +github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= @@ -438,26 +410,21 @@ github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgo github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs= github.com/knadh/koanf v1.5.0/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs= 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/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= github.com/labstack/echo/v4 v4.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -465,7 +432,6 @@ github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -473,7 +439,6 @@ github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= @@ -481,10 +446,14 @@ github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcME github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= +github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= +github.com/microsoft/go-mssqldb v1.0.0 h1:k2p2uuG8T5T/7Hp7/e3vMGTnnR0sU4h8d1CcC71iLHU= +github.com/microsoft/go-mssqldb v1.0.0/go.mod h1:+4wZTUnz/SV6nffv+RRRB/ss8jPng5Sho2SmM1l2ts4= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/milvus-io/milvus-proto/go-api/v2 v2.4.3 h1:KUSaWVePVlHMIluAXf2qmNffI1CMlGFLLiP+4iy9014= @@ -580,23 +549,15 @@ github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4 github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= -github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= -github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= -github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= -github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -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.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= @@ -612,10 +573,10 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= 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= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -623,8 +584,9 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tidwall/gjson v1.14.4 h1:uo0p8EbA09J7RQaflQ1aBRffTR7xedD2bcIVSYxLnkM= github.com/tidwall/gjson v1.14.4/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= @@ -655,7 +617,8 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= 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= +go.einride.tech/aip v0.68.0 h1:4seM66oLzTpz50u4K1zlJyOXQ3tCzcJN7I22tKkjipw= +go.einride.tech/aip v0.68.0/go.mod h1:7y9FF8VtPWqpxuAxl0KQWqaULxW4zFIesD6zF5RIHHg= go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= @@ -693,52 +656,39 @@ go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLk go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw= go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/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-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/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-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -792,7 +742,6 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -815,14 +764,13 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -842,8 +790,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -912,8 +860,8 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 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= @@ -927,15 +875,14 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -953,19 +900,15 @@ golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -973,7 +916,6 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1000,8 +942,6 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= -golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1064,10 +1004,12 @@ google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 h1:7whR9kGa5LUwFtpLm2ArCEejtnxlGeLbAyjFY8sGNFw= -google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157/go.mod h1:99sLkeliLXfdj2J75X3Ho+rrVCaJze0uwN7zDDkjPVU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/genproto v0.0.0-20240711142825-46eb208f015d h1:/hmn0Ku5kWij/kjGsrcJeC1T/MrJi2iNWwgAqrihFwc= +google.golang.org/genproto v0.0.0-20240711142825-46eb208f015d/go.mod h1:FfBgJBJg9GcpPvKIuHSZ/aE1g2ecGL74upMzGZjiGEY= +google.golang.org/genproto/googleapis/api v0.0.0-20240711142825-46eb208f015d h1:kHjw/5UfflP/L5EbledDrcG4C2597RtymmGRZvHiCuY= +google.golang.org/genproto/googleapis/api v0.0.0-20240711142825-46eb208f015d/go.mod h1:mw8MG/Qz5wfgYr6VqVCiZcHe/GJEfI+oGGDCohaVgB0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240711142825-46eb208f015d h1:JU0iKnSg02Gmb5ZdV8nYsKEKsP6o/FGVWTrw4i1DA9A= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240711142825-46eb208f015d/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -1088,8 +1030,8 @@ google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA= -google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0= +google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= +google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= google.golang.org/grpc/examples v0.0.0-20220617181431-3e7b97febc7f h1:rqzndB2lIQGivcXdTuY3Y9NBvr70X+y77woofSRluec= google.golang.org/grpc/examples v0.0.0-20220617181431-3e7b97febc7f/go.mod h1:gxndsbNG1n4TZcHGgsYEfVGnTxqfEdfiDv6/DADXX9o= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -1105,8 +1047,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1118,7 +1060,8 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= -gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= +gopkg.in/guregu/null.v4 v4.0.0 h1:1Wm3S1WEA2I26Kq+6vcW+w0gcDo44YKYD7YIEJNHDjg= +gopkg.in/guregu/null.v4 v4.0.0/go.mod h1:YoQhUrADuG3i9WqesrCmpNRwm1ypAgSHYqoOcTu/JrI= gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= @@ -1136,11 +1079,22 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/postgres v1.4.5 h1:mTeXTTtHAgnS9PgmhN2YeUbazYpLhUI1doLnw42XUZc= -gorm.io/driver/postgres v1.4.5/go.mod h1:GKNQYSJ14qvWkvPwXljMGehpKrhlDNsqYRr5HnYGncg= -gorm.io/gorm v1.24.1-0.20221019064659-5dd2bb482755/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA= -gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11 h1:9qNbmu21nNThCNnF5i2R3kw2aL27U8ZwbzccNjOmW0g= +gorm.io/datatypes v1.2.2 h1:sdn7ZmG4l7JWtMDUb3L98f2Ym7CO5F8mZLlrQJMfF9g= +gorm.io/datatypes v1.2.2/go.mod h1:f4BsLcFAX67szSv8svwLRjklArSHAvHLeE3pXAS5DZI= +gorm.io/driver/mysql v1.5.6 h1:Ld4mkIickM+EliaQZQx3uOJDJHtrd70MxAUqWqlx3Y8= +gorm.io/driver/mysql v1.5.6/go.mod h1:sEtPWMiqiN1N1cMXoXmBbd8C6/l+TESwriotuRRpkDM= +gorm.io/driver/postgres v1.5.0 h1:u2FXTy14l45qc3UeCJ7QaAXZmZfDDv0YrthvmRq1l0U= +gorm.io/driver/postgres v1.5.0/go.mod h1:FUZXzO+5Uqg5zzwzv4KK49R8lvGIyscBOqYrtI1Ce9A= +gorm.io/driver/sqlite v1.4.3 h1:HBBcZSDnWi5BW3B3rwvVTc510KGkBkexlOg0QrmLUuU= +gorm.io/driver/sqlite v1.4.3/go.mod h1:0Aq3iPO+v9ZKbcdiz8gLWRw5VOPcBOPUQJFLq5e2ecI= +gorm.io/driver/sqlserver v1.4.1 h1:t4r4r6Jam5E6ejqP7N82qAJIJAht27EGT41HyPfXRw0= +gorm.io/driver/sqlserver v1.4.1/go.mod h1:DJ4P+MeZbc5rvY58PnmN1Lnyvb5gw5NPzGshHDnJLig= gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= +gorm.io/gorm v1.25.7/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= +gorm.io/gorm v1.25.11 h1:/Wfyg1B/je1hnDx3sMkX+gAlxrlZpn6X0BXRlwXlvHg= +gorm.io/gorm v1.25.11/go.mod h1:xh7N7RHfYlNc5EmcI/El95gXusucDrQnHXe0+CgWcLQ= +gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= +gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/pkg/db/migration/000017_run_logging.down.sql b/pkg/db/migration/000017_run_logging.down.sql new file mode 100644 index 0000000..33255b4 --- /dev/null +++ b/pkg/db/migration/000017_run_logging.down.sql @@ -0,0 +1,8 @@ +BEGIN; + +DROP TABLE IF EXISTS catalog_run; +DROP TYPE IF EXISTS valid_run_source; +DROP TYPE IF EXISTS valid_run_status; +DROP TYPE IF EXISTS valid_catalog_action; + +COMMIT; diff --git a/pkg/db/migration/000017_run_logging.up.sql b/pkg/db/migration/000017_run_logging.up.sql new file mode 100644 index 0000000..5c9d24f --- /dev/null +++ b/pkg/db/migration/000017_run_logging.up.sql @@ -0,0 +1,34 @@ +BEGIN; + +create type valid_run_source as enum ('RUN_SOURCE_CONSOLE', 'RUN_SOURCE_API'); +create type valid_run_status as enum ('RUN_STATUS_COMPLETED', 'RUN_STATUS_FAILED', 'RUN_STATUS_PROCESSING', 'RUN_STATUS_QUEUED'); +create type valid_catalog_action as enum ( 'RUN_ACTION_CREATE', 'RUN_ACTION_UPDATE', 'RUN_ACTION_DELETE', 'RUN_ACTION_CREATE_FILE', 'RUN_ACTION_PROCESS_FILE', 'RUN_ACTION_DELETE_FILE'); + +CREATE TABLE IF NOT EXISTS catalog_run +( + uid UUID PRIMARY KEY DEFAULT gen_random_uuid(), + catalog_uid UUID NOT NULL, + status valid_run_status NOT NULL, + source valid_run_source NOT NULL, + action valid_catalog_action NOT NULL, + runner_uid UUID NOT NULL, + requester_uid UUID NOT NULL, + file_uids VARCHAR(255)[], + payload JSONB, + reference_uids VARCHAR(255)[], + started_time TIMESTAMP WITH TIME ZONE NOT NULL, + completed_time TIMESTAMP WITH TIME ZONE, + total_duration BIGINT, + error TEXT, + create_time TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL, + update_time TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL +); + +COMMENT ON COLUMN catalog_run.total_duration IS 'in milliseconds'; + +CREATE INDEX IF NOT EXISTS idx_catalog_run_catalog_uid ON catalog_run (catalog_uid); +CREATE INDEX IF NOT EXISTS idx_catalog_run_status ON catalog_run (status); +CREATE INDEX IF NOT EXISTS idx_catalog_run_started_time ON catalog_run (started_time); +CREATE INDEX IF NOT EXISTS idx_catalog_run_completed_time ON catalog_run (completed_time); + +COMMIT; diff --git a/pkg/handler/catalogrun.go b/pkg/handler/catalogrun.go new file mode 100644 index 0000000..a0f81e6 --- /dev/null +++ b/pkg/handler/catalogrun.go @@ -0,0 +1,81 @@ +package handler + +import ( + "context" + "time" + + "github.com/gofrs/uuid" + "go.uber.org/zap" + "gopkg.in/guregu/null.v4" + + "github.com/instill-ai/artifact-backend/pkg/logger" + "github.com/instill-ai/artifact-backend/pkg/repository" + "github.com/instill-ai/artifact-backend/pkg/resource" + + "github.com/instill-ai/x/constant" + + runpb "github.com/instill-ai/protogen-go/common/run/v1alpha" + resourcex "github.com/instill-ai/x/resource" +) + +func (ph *PublicHandler) logCatalogRunStart(ctx context.Context, catalogUID uuid.UUID, runAction repository.RunAction, startTime *time.Time, payload []byte) *repository.CatalogRun { + runSource := repository.RunSource(runpb.RunSource_RUN_SOURCE_API) + userAgentValue, ok := runpb.RunSource_value[resource.GetRequestSingleHeader(ctx, constant.HeaderUserAgent)] + if ok { + runSource = repository.RunSource(userAgentValue) + } + + requesterUID, userUID := resourcex.GetRequesterUIDAndUserUID(ctx) + + start := time.Now() + if startTime != nil { + start = *startTime + } + + catalogRun := &repository.CatalogRun{ + CatalogUID: catalogUID, + Status: repository.RunStatus(runpb.RunStatus_RUN_STATUS_PROCESSING), + Source: runSource, + Action: runAction, + RunnerUID: uuid.FromStringOrNil(userUID), + RequesterUID: uuid.FromStringOrNil(requesterUID), + Payload: payload, + StartedTime: start, + } + + created, err := ph.service.Repository.CreateCatalogRun(ctx, catalogRun) + if err != nil { + log, _ := logger.GetZapLogger(ctx) + log.Error("failed to log catalog run start", zap.String("catalogUID", catalogUID.String()), zap.Error(err), zap.String("action", string(runAction))) + } + return created +} + +func (ph *PublicHandler) logCatalogRunCompleted(ctx context.Context, catalogRunUID uuid.UUID, startTime time.Time) { + now := time.Now() + + catalogRunUpdates := &repository.CatalogRun{} + catalogRunUpdates.Status = repository.RunStatus(runpb.RunStatus_RUN_STATUS_COMPLETED) + catalogRunUpdates.CompletedTime = null.TimeFrom(now) + catalogRunUpdates.TotalDuration = null.IntFrom(now.Sub(startTime).Milliseconds()) + + if err := ph.service.Repository.UpdateCatalogRun(ctx, catalogRunUID, catalogRunUpdates); err != nil { + log, _ := logger.GetZapLogger(ctx) + log.Error("failed to log catalog run completed", zap.String("catalogUID", catalogRunUID.String()), zap.Error(err)) + } +} + +func (ph *PublicHandler) logCatalogRunError(ctx context.Context, catalogRunUID uuid.UUID, err error, startTime time.Time) { + now := time.Now() + catalogRunUpdates := &repository.CatalogRun{ + Status: repository.RunStatus(runpb.RunStatus_RUN_STATUS_FAILED), + CompletedTime: null.TimeFrom(now), + TotalDuration: null.IntFrom(now.Sub(startTime).Milliseconds()), + Error: null.StringFrom(err.Error()), + } + + if err = ph.service.Repository.UpdateCatalogRun(ctx, catalogRunUID, catalogRunUpdates); err != nil { + log, _ := logger.GetZapLogger(ctx) + log.Error("failed to log catalog run error", zap.String("catalogUID", catalogRunUID.String()), zap.Error(err)) + } +} diff --git a/pkg/handler/knowledgebase.go b/pkg/handler/knowledgebase.go index 3770d4a..776ea4a 100644 --- a/pkg/handler/knowledgebase.go +++ b/pkg/handler/knowledgebase.go @@ -5,17 +5,20 @@ import ( "fmt" "regexp" "strings" + "time" + "github.com/gofrs/uuid" "go.uber.org/zap" "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" - "github.com/gofrs/uuid" "github.com/instill-ai/artifact-backend/pkg/constant" "github.com/instill-ai/artifact-backend/pkg/customerror" "github.com/instill-ai/artifact-backend/pkg/logger" "github.com/instill-ai/artifact-backend/pkg/repository" "github.com/instill-ai/artifact-backend/pkg/service" "github.com/instill-ai/artifact-backend/pkg/utils" + artifactpb "github.com/instill-ai/protogen-go/artifact/artifact/v1alpha" ) @@ -36,6 +39,7 @@ func (ph *PublicHandler) CreateCatalog(ctx context.Context, req *artifactpb.Crea err := fmt.Errorf("failed to get user id from header: %v. err: %w", err, customerror.ErrUnauthenticated) return nil, err } + startTime := time.Now() // ACL check user's permission to create catalog in the user or org context(namespace) ns, err := ph.service.GetNamespaceByNsID(ctx, req.GetNamespaceId()) @@ -133,6 +137,13 @@ func (ph *PublicHandler) CreateCatalog(ctx context.Context, req *artifactpb.Crea return nil, err } + payload, err := protojson.Marshal(req) + if err != nil { + return nil, err + } + catalogRun := ph.logCatalogRunStart(ctx, dbData.UID, repository.RunAction(artifactpb.CatalogRunAction_CATALOG_RUN_ACTION_CREATE), &startTime, payload) + ph.logCatalogRunCompleted(ctx, catalogRun.UID, startTime) + return &artifactpb.CreateCatalogResponse{ Catalog: &artifactpb.Catalog{ Name: dbData.Name, @@ -243,6 +254,8 @@ func (ph *PublicHandler) UpdateCatalog(ctx context.Context, req *artifactpb.Upda return nil, fmt.Errorf("kb_id is empty. err: %w", ErrCheckRequiredFields) } + startTime := time.Now() + ns, err := ph.service.GetNamespaceByNsID(ctx, req.GetNamespaceId()) if err != nil { log.Error( @@ -268,6 +281,17 @@ func (ph *PublicHandler) UpdateCatalog(ctx context.Context, req *artifactpb.Upda return nil, fmt.Errorf(ErrorUpdateKnowledgeBaseMsg, customerror.ErrNoPermission) } + payload, err := protojson.Marshal(req) + if err != nil { + return nil, err + } + catalogRun := ph.logCatalogRunStart(ctx, kb.UID, repository.RunAction(artifactpb.CatalogRunAction_CATALOG_RUN_ACTION_UPDATE), &startTime, payload) + defer func() { + if err != nil { + ph.logCatalogRunError(ctx, catalogRun.UID, err, startTime) + } + }() + // update catalog kb, err = ph.service.Repository.UpdateKnowledgeBase( ctx, @@ -294,6 +318,8 @@ func (ph *PublicHandler) UpdateCatalog(ctx context.Context, req *artifactpb.Upda log.Error("failed to get token counts", zap.Error(err)) return nil, fmt.Errorf(ErrorListKnowledgeBasesMsg, err) } + + ph.logCatalogRunCompleted(ctx, catalogRun.UID, startTime) // populate response return &artifactpb.UpdateCatalogResponse{ Catalog: &artifactpb.Catalog{ @@ -324,6 +350,8 @@ func (ph *PublicHandler) DeleteCatalog(ctx context.Context, req *artifactpb.Dele return nil, err } + startTime := time.Now() + ns, err := ph.service.GetNamespaceByNsID(ctx, req.GetNamespaceId()) if err != nil { log.Error( @@ -349,6 +377,12 @@ func (ph *PublicHandler) DeleteCatalog(ctx context.Context, req *artifactpb.Dele return nil, fmt.Errorf(ErrorDeleteKnowledgeBaseMsg, customerror.ErrNoPermission) } + payload, err := protojson.Marshal(req) + if err != nil { + return nil, err + } + catalogRun := ph.logCatalogRunStart(ctx, kb.UID, repository.RunAction(artifactpb.CatalogRunAction_CATALOG_RUN_ACTION_DELETE), &startTime, payload) + startSignal := make(chan bool) // TODO: in the future, we should delete the catalog using clean up worker go utils.GoRecover(func() { @@ -362,6 +396,15 @@ func (ph *PublicHandler) DeleteCatalog(ctx context.Context, req *artifactpb.Dele } log.Info("DeleteCatalog starts in background", zap.String("catalog_id", kb.UID.String())) allPass := true + + defer func() { + if err != nil { + ph.logCatalogRunError(ctx, catalogRun.UID, err, startTime) + } else { + ph.logCatalogRunCompleted(ctx, catalogRun.UID, startTime) + + } + }() // delete files in minIO err = <-ph.service.MinIO.DeleteKnowledgeBase(ctx, kb.UID.String()) if err != nil { @@ -417,7 +460,8 @@ func (ph *PublicHandler) DeleteCatalog(ctx context.Context, req *artifactpb.Dele deletedKb, err := ph.service.Repository.DeleteKnowledgeBase(ctx, ns.NsUID.String(), req.CatalogId) if err != nil { log.Error("failed to delete catalog", zap.Error(err)) - startSignal <- false + startSignal <- false // todo: maybe only start the go routine when err == nil + ph.logCatalogRunError(ctx, catalogRun.UID, err, startTime) return nil, err } // start the background deletion diff --git a/pkg/handler/knowledgebasefiles.go b/pkg/handler/knowledgebasefiles.go index 4d95e68..af1d0fc 100644 --- a/pkg/handler/knowledgebasefiles.go +++ b/pkg/handler/knowledgebasefiles.go @@ -4,18 +4,22 @@ import ( "context" "fmt" "strings" + "time" "github.com/gofrs/uuid" + "go.uber.org/zap" + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/types/known/timestamppb" + "gorm.io/gorm" + "github.com/instill-ai/artifact-backend/pkg/constant" "github.com/instill-ai/artifact-backend/pkg/customerror" "github.com/instill-ai/artifact-backend/pkg/logger" // Add this import "github.com/instill-ai/artifact-backend/pkg/repository" "github.com/instill-ai/artifact-backend/pkg/resource" "github.com/instill-ai/artifact-backend/pkg/utils" + artifactpb "github.com/instill-ai/protogen-go/artifact/artifact/v1alpha" - "go.uber.org/zap" - "google.golang.org/protobuf/types/known/timestamppb" - "gorm.io/gorm" ) func (ph *PublicHandler) UploadCatalogFile(ctx context.Context, req *artifactpb.UploadCatalogFileRequest) (*artifactpb.UploadCatalogFileResponse, error) { @@ -40,6 +44,8 @@ func (ph *PublicHandler) UploadCatalogFile(ctx context.Context, req *artifactpb. if strings.Contains(req.File.Name, "/") { return nil, fmt.Errorf("file name cannot contain '/'. err: %w", customerror.ErrInvalidArgument) } + startTime := time.Now() + ns, err := ph.service.GetNamespaceByNsID(ctx, req.GetNamespaceId()) if err != nil { log.Error( @@ -65,6 +71,19 @@ func (ph *PublicHandler) UploadCatalogFile(ctx context.Context, req *artifactpb. return nil, fmt.Errorf("no permission to upload file. %w", customerror.ErrNoPermission) } + // requestBackup := req + // requestBackup.File.Content = "" + // payload, err := protojson.Marshal(requestBackup) + // if err != nil { + // return nil, err + // } + catalogRun := ph.logCatalogRunStart(ctx, kb.UID, repository.RunAction(artifactpb.CatalogRunAction_CATALOG_RUN_ACTION_CREATE_FILE), &startTime, nil) + defer func() { + if err != nil { + ph.logCatalogRunError(ctx, catalogRun.UID, err, startTime) + } + }() + // get all kbs in the namespace kbs, err := ph.service.Repository.ListKnowledgeBases(ctx, ns.NsUID.String()) if err != nil { @@ -119,6 +138,10 @@ func (ph *PublicHandler) UploadCatalogFile(ctx context.Context, req *artifactpb. ProcessStatus: artifactpb.FileProcessStatus_name[int32(artifactpb.FileProcessStatus_FILE_PROCESS_STATUS_NOTSTARTED)], Size: fileSize, } + catalogRun.FileUIDs = append(catalogRun.FileUIDs, kbFile.UID.String()) + if repoErr := ph.service.Repository.UpdateCatalogRun(ctx, catalogRun.UID, &repository.CatalogRun{FileUIDs: catalogRun.FileUIDs}); repoErr != nil { + log.Error("UpdateCatalogRun failed", zap.Error(repoErr), zap.String("catalogRunUID", catalogRun.UID.String())) + } // create catalog file in database res, err = ph.service.Repository.CreateKnowledgeBaseFile(ctx, kbFile, func(FileUID string) error { @@ -145,6 +168,8 @@ func (ph *PublicHandler) UploadCatalogFile(ctx context.Context, req *artifactpb. } } + ph.logCatalogRunCompleted(ctx, catalogRun.UID, startTime) + return &artifactpb.UploadCatalogFileResponse{ File: &artifactpb.File{ FileUid: res.UID.String(), @@ -344,6 +369,17 @@ func (ph *PublicHandler) DeleteCatalogFile( if err != nil { return nil, fmt.Errorf("failed to parse file uid. err: %w", customerror.ErrInvalidArgument) } + startTime := time.Now() + + payload, err := protojson.Marshal(req) + if err != nil { + return nil, err + } + catalogRun := ph.logCatalogRunStart(ctx, kbfs[0].KnowledgeBaseUID, repository.RunAction(artifactpb.CatalogRunAction_CATALOG_RUN_ACTION_DELETE_FILE), &startTime, payload) + catalogRun.FileUIDs = []string{fUID.String()} + if repoErr := ph.service.Repository.UpdateCatalogRun(ctx, catalogRun.UID, &repository.CatalogRun{FileUIDs: catalogRun.FileUIDs}); repoErr != nil { + log.Error("UpdateCatalogRun failed", zap.Error(repoErr), zap.String("catalogRunUID", catalogRun.UID.String())) + } // get the file by uid files, err := ph.service.Repository.GetKnowledgeBaseFilesByFileUIDs(ctx, []uuid.UUID{fUID}) @@ -365,6 +401,14 @@ func (ph *PublicHandler) DeleteCatalogFile( log.Info("DeleteCatalogFile: received stop signal") return } + defer func() { + if err != nil { + ph.logCatalogRunError(ctx, catalogRun.UID, err, startTime) + } else { + ph.logCatalogRunCompleted(ctx, catalogRun.UID, startTime) + } + }() + log.Info("DeleteCatalogFile: start deleting file from minio, database and milvus") allPass := true // Delete the file from MinIO @@ -442,6 +486,7 @@ func (ph *PublicHandler) DeleteCatalogFile( if err != nil { log.Error("failed to delete knowledge base file and decrease usage", zap.Error(err)) startSignal <- false + ph.logCatalogRunError(ctx, catalogRun.UID, err, startTime) return nil, err } // start the background deletion @@ -489,6 +534,21 @@ func (ph *PublicHandler) ProcessCatalogFiles(ctx context.Context, req *artifactp log.Error("failed to check requester permission", zap.Error(err)) return nil, fmt.Errorf("failed to check requester permission. err: %w", err) } + startTime := time.Now() + + payload, err := protojson.Marshal(req) + if err != nil { + return nil, err + } + catalogRun := ph.logCatalogRunStart(ctx, kbfs[0].KnowledgeBaseUID, repository.RunAction(artifactpb.CatalogRunAction_CATALOG_RUN_ACTION_PROCESS_FILE), &startTime, payload) + if repoErr := ph.service.Repository.UpdateCatalogRun(ctx, catalogRun.UID, &repository.CatalogRun{FileUIDs: req.FileUids}); repoErr != nil { + log.Error("UpdateCatalogRun failed", zap.Error(repoErr), zap.String("catalogRunUID", catalogRun.UID.String())) + } + defer func() { + if err != nil { + ph.logCatalogRunError(ctx, catalogRun.UID, err, startTime) + } + }() requesterUID := resource.GetRequestSingleHeader(ctx, constant.HeaderRequesterUIDKey) requesterUUID := uuid.FromStringOrNil(requesterUID) @@ -513,6 +573,8 @@ func (ph *PublicHandler) ProcessCatalogFiles(ctx context.Context, req *artifactp ProcessStatus: artifactpb.FileProcessStatus(artifactpb.FileProcessStatus_value[file.ProcessStatus]), }) } + + ph.logCatalogRunCompleted(ctx, catalogRun.UID, startTime) return &artifactpb.ProcessCatalogFilesResponse{ Files: resFiles, }, nil diff --git a/pkg/mock/registry_client_mock.gen.go b/pkg/mock/registry_client_mock.gen.go index 08c2ebb..6c9851e 100644 --- a/pkg/mock/registry_client_mock.gen.go +++ b/pkg/mock/registry_client_mock.gen.go @@ -1,4 +1,4 @@ -// Code generated by http://github.com/gojuno/minimock (v3.3.9). DO NOT EDIT. +// Code generated by http://github.com/gojuno/minimock (v3.3.13). DO NOT EDIT. package mock @@ -58,6 +58,7 @@ func NewRegistryClientMock(t minimock.Tester) *RegistryClientMock { } type mRegistryClientMockDeleteTag struct { + optional bool mock *RegistryClientMock defaultExpectation *RegistryClientMockDeleteTagExpectation expectations []*RegistryClientMockDeleteTagExpectation @@ -96,6 +97,16 @@ type RegistryClientMockDeleteTagResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmDeleteTag *mRegistryClientMockDeleteTag) Optional() *mRegistryClientMockDeleteTag { + mmDeleteTag.optional = true + return mmDeleteTag +} + // Expect sets up expected params for RegistryClient.DeleteTag func (mmDeleteTag *mRegistryClientMockDeleteTag) Expect(ctx context.Context, repository string, digest string) *mRegistryClientMockDeleteTag { if mmDeleteTag.mock.funcDeleteTag != nil { @@ -352,6 +363,11 @@ func (mmDeleteTag *mRegistryClientMockDeleteTag) Calls() []*RegistryClientMockDe // MinimockDeleteTagDone returns true if the count of the DeleteTag invocations corresponds // the number of defined expectations func (m *RegistryClientMock) MinimockDeleteTagDone() bool { + if m.DeleteTagMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.DeleteTagMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -390,6 +406,7 @@ func (m *RegistryClientMock) MinimockDeleteTagInspect() { } type mRegistryClientMockGetTagDigest struct { + optional bool mock *RegistryClientMock defaultExpectation *RegistryClientMockGetTagDigestExpectation expectations []*RegistryClientMockGetTagDigestExpectation @@ -429,6 +446,16 @@ type RegistryClientMockGetTagDigestResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmGetTagDigest *mRegistryClientMockGetTagDigest) Optional() *mRegistryClientMockGetTagDigest { + mmGetTagDigest.optional = true + return mmGetTagDigest +} + // Expect sets up expected params for RegistryClient.GetTagDigest func (mmGetTagDigest *mRegistryClientMockGetTagDigest) Expect(ctx context.Context, repository string, tag string) *mRegistryClientMockGetTagDigest { if mmGetTagDigest.mock.funcGetTagDigest != nil { @@ -685,6 +712,11 @@ func (mmGetTagDigest *mRegistryClientMockGetTagDigest) Calls() []*RegistryClient // MinimockGetTagDigestDone returns true if the count of the GetTagDigest invocations corresponds // the number of defined expectations func (m *RegistryClientMock) MinimockGetTagDigestDone() bool { + if m.GetTagDigestMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.GetTagDigestMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -723,6 +755,7 @@ func (m *RegistryClientMock) MinimockGetTagDigestInspect() { } type mRegistryClientMockListTags struct { + optional bool mock *RegistryClientMock defaultExpectation *RegistryClientMockListTagsExpectation expectations []*RegistryClientMockListTagsExpectation @@ -760,6 +793,16 @@ type RegistryClientMockListTagsResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmListTags *mRegistryClientMockListTags) Optional() *mRegistryClientMockListTags { + mmListTags.optional = true + return mmListTags +} + // Expect sets up expected params for RegistryClient.ListTags func (mmListTags *mRegistryClientMockListTags) Expect(ctx context.Context, repository string) *mRegistryClientMockListTags { if mmListTags.mock.funcListTags != nil { @@ -990,6 +1033,11 @@ func (mmListTags *mRegistryClientMockListTags) Calls() []*RegistryClientMockList // MinimockListTagsDone returns true if the count of the ListTags invocations corresponds // the number of defined expectations func (m *RegistryClientMock) MinimockListTagsDone() bool { + if m.ListTagsMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.ListTagsMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -1036,7 +1084,6 @@ func (m *RegistryClientMock) MinimockFinish() { m.MinimockGetTagDigestInspect() m.MinimockListTagsInspect() - m.t.FailNow() } }) } diff --git a/pkg/mock/repository_i_mock.gen.go b/pkg/mock/repository_i_mock.gen.go index 14ec839..beb13dc 100644 --- a/pkg/mock/repository_i_mock.gen.go +++ b/pkg/mock/repository_i_mock.gen.go @@ -1,4 +1,4 @@ -// Code generated by http://github.com/gojuno/minimock (v3.3.9). DO NOT EDIT. +// Code generated by http://github.com/gojuno/minimock (v3.3.13). DO NOT EDIT. package mock @@ -10,9 +10,14 @@ import ( "github.com/gofrs/uuid" "github.com/gojuno/minimock/v3" - mm_repository "github.com/instill-ai/artifact-backend/pkg/repository" - "github.com/instill-ai/artifact-backend/pkg/utils" + "go.einride.tech/aip/filtering" + "go.einride.tech/aip/ordering" "gorm.io/gorm" + + "github.com/instill-ai/artifact-backend/pkg/utils" + + mm_repository "github.com/instill-ai/artifact-backend/pkg/repository" + pb "github.com/instill-ai/protogen-go/artifact/artifact/v1alpha" ) @@ -270,6 +275,12 @@ type RepositoryIMock struct { beforeKnowledgeBaseFileTableNameCounter uint64 KnowledgeBaseFileTableNameMock mRepositoryIMockKnowledgeBaseFileTableName + funcListCatalogRuns func(ctx context.Context, pageSize int64, page int64, filter filtering.Filter, order ordering.OrderBy, catalogUID string, requesterUID string, isOwner bool) (modelTriggers []*mm_repository.CatalogRun, totalSize int64, err error) + inspectFuncListCatalogRuns func(ctx context.Context, pageSize int64, page int64, filter filtering.Filter, order ordering.OrderBy, catalogUID string, requesterUID string, isOwner bool) + afterListCatalogRunsCounter uint64 + beforeListCatalogRunsCounter uint64 + ListCatalogRunsMock mRepositoryIMockListCatalogRuns + funcListChunksByKbFileUID func(ctx context.Context, kbFileUID uuid.UUID) (ta1 []mm_repository.TextChunk, err error) inspectFuncListChunksByKbFileUID func(ctx context.Context, kbFileUID uuid.UUID) afterListChunksByKbFileUIDCounter uint64 @@ -306,6 +317,12 @@ type RepositoryIMock struct { beforeTextChunkTableNameCounter uint64 TextChunkTableNameMock mRepositoryIMockTextChunkTableName + funcUpdateCatalogRun func(ctx context.Context, runUID uuid.UUID, run *mm_repository.CatalogRun) (err error) + inspectFuncUpdateCatalogRun func(ctx context.Context, runUID uuid.UUID, run *mm_repository.CatalogRun) + afterUpdateCatalogRunCounter uint64 + beforeUpdateCatalogRunCounter uint64 + UpdateCatalogRunMock mRepositoryIMockUpdateCatalogRun + funcUpdateChunk func(ctx context.Context, chunkUID string, updates map[string]interface{}) (tp1 *mm_repository.TextChunk, err error) inspectFuncUpdateChunk func(ctx context.Context, chunkUID string, updates map[string]interface{}) afterUpdateChunkCounter uint64 @@ -330,6 +347,12 @@ type RepositoryIMock struct { beforeUpdateKnowledgeBaseFileCounter uint64 UpdateKnowledgeBaseFileMock mRepositoryIMockUpdateKnowledgeBaseFile + funcUpsertCatalogRun func(ctx context.Context, run *mm_repository.CatalogRun) (cp1 *mm_repository.CatalogRun, err error) + inspectFuncUpsertCatalogRun func(ctx context.Context, run *mm_repository.CatalogRun) + afterUpsertCatalogRunCounter uint64 + beforeUpsertCatalogRunCounter uint64 + UpsertCatalogRunMock mRepositoryIMockUpsertCatalogRun + funcUpsertEmbeddings func(ctx context.Context, embeddings []mm_repository.Embedding, externalServiceCall func(embUIDs []string) error) (ea1 []mm_repository.Embedding, err error) inspectFuncUpsertEmbeddings func(ctx context.Context, embeddings []mm_repository.Embedding, externalServiceCall func(embUIDs []string) error) afterUpsertEmbeddingsCounter uint64 @@ -466,6 +489,9 @@ func NewRepositoryIMock(t minimock.Tester) *RepositoryIMock { m.KnowledgeBaseFileTableNameMock = mRepositoryIMockKnowledgeBaseFileTableName{mock: m} + m.ListCatalogRunsMock = mRepositoryIMockListCatalogRuns{mock: m} + m.ListCatalogRunsMock.callArgs = []*RepositoryIMockListCatalogRunsParams{} + m.ListChunksByKbFileUIDMock = mRepositoryIMockListChunksByKbFileUID{mock: m} m.ListChunksByKbFileUIDMock.callArgs = []*RepositoryIMockListChunksByKbFileUIDParams{} @@ -483,6 +509,9 @@ func NewRepositoryIMock(t minimock.Tester) *RepositoryIMock { m.TextChunkTableNameMock = mRepositoryIMockTextChunkTableName{mock: m} + m.UpdateCatalogRunMock = mRepositoryIMockUpdateCatalogRun{mock: m} + m.UpdateCatalogRunMock.callArgs = []*RepositoryIMockUpdateCatalogRunParams{} + m.UpdateChunkMock = mRepositoryIMockUpdateChunk{mock: m} m.UpdateChunkMock.callArgs = []*RepositoryIMockUpdateChunkParams{} @@ -495,6 +524,9 @@ func NewRepositoryIMock(t minimock.Tester) *RepositoryIMock { m.UpdateKnowledgeBaseFileMock = mRepositoryIMockUpdateKnowledgeBaseFile{mock: m} m.UpdateKnowledgeBaseFileMock.callArgs = []*RepositoryIMockUpdateKnowledgeBaseFileParams{} + m.UpsertCatalogRunMock = mRepositoryIMockUpsertCatalogRun{mock: m} + m.UpsertCatalogRunMock.callArgs = []*RepositoryIMockUpsertCatalogRunParams{} + m.UpsertEmbeddingsMock = mRepositoryIMockUpsertEmbeddings{mock: m} m.UpsertEmbeddingsMock.callArgs = []*RepositoryIMockUpsertEmbeddingsParams{} @@ -507,6 +539,7 @@ func NewRepositoryIMock(t minimock.Tester) *RepositoryIMock { } type mRepositoryIMockConvertedFileTableName struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockConvertedFileTableNameExpectation expectations []*RepositoryIMockConvertedFileTableNameExpectation @@ -527,6 +560,16 @@ type RepositoryIMockConvertedFileTableNameResults struct { s1 string } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmConvertedFileTableName *mRepositoryIMockConvertedFileTableName) Optional() *mRepositoryIMockConvertedFileTableName { + mmConvertedFileTableName.optional = true + return mmConvertedFileTableName +} + // Expect sets up expected params for RepositoryI.ConvertedFileTableName func (mmConvertedFileTableName *mRepositoryIMockConvertedFileTableName) Expect() *mRepositoryIMockConvertedFileTableName { if mmConvertedFileTableName.mock.funcConvertedFileTableName != nil { @@ -636,6 +679,11 @@ func (mmConvertedFileTableName *RepositoryIMock) ConvertedFileTableNameBeforeCou // MinimockConvertedFileTableNameDone returns true if the count of the ConvertedFileTableName invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockConvertedFileTableNameDone() bool { + if m.ConvertedFileTableNameMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.ConvertedFileTableNameMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -670,6 +718,7 @@ func (m *RepositoryIMock) MinimockConvertedFileTableNameInspect() { } type mRepositoryIMockCreateConvertedFile struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockCreateConvertedFileExpectation expectations []*RepositoryIMockCreateConvertedFileExpectation @@ -709,6 +758,16 @@ type RepositoryIMockCreateConvertedFileResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmCreateConvertedFile *mRepositoryIMockCreateConvertedFile) Optional() *mRepositoryIMockCreateConvertedFile { + mmCreateConvertedFile.optional = true + return mmCreateConvertedFile +} + // Expect sets up expected params for RepositoryI.CreateConvertedFile func (mmCreateConvertedFile *mRepositoryIMockCreateConvertedFile) Expect(ctx context.Context, cf mm_repository.ConvertedFile, callExternalService func(convertedFileUID uuid.UUID) (map[string]any, error)) *mRepositoryIMockCreateConvertedFile { if mmCreateConvertedFile.mock.funcCreateConvertedFile != nil { @@ -965,6 +1024,11 @@ func (mmCreateConvertedFile *mRepositoryIMockCreateConvertedFile) Calls() []*Rep // MinimockCreateConvertedFileDone returns true if the count of the CreateConvertedFile invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockCreateConvertedFileDone() bool { + if m.CreateConvertedFileMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.CreateConvertedFileMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -1003,6 +1067,7 @@ func (m *RepositoryIMock) MinimockCreateConvertedFileInspect() { } type mRepositoryIMockCreateKnowledgeBase struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockCreateKnowledgeBaseExpectation expectations []*RepositoryIMockCreateKnowledgeBaseExpectation @@ -1042,6 +1107,16 @@ type RepositoryIMockCreateKnowledgeBaseResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmCreateKnowledgeBase *mRepositoryIMockCreateKnowledgeBase) Optional() *mRepositoryIMockCreateKnowledgeBase { + mmCreateKnowledgeBase.optional = true + return mmCreateKnowledgeBase +} + // Expect sets up expected params for RepositoryI.CreateKnowledgeBase func (mmCreateKnowledgeBase *mRepositoryIMockCreateKnowledgeBase) Expect(ctx context.Context, kb mm_repository.KnowledgeBase, externalService func(kbUID string) error) *mRepositoryIMockCreateKnowledgeBase { if mmCreateKnowledgeBase.mock.funcCreateKnowledgeBase != nil { @@ -1298,6 +1373,11 @@ func (mmCreateKnowledgeBase *mRepositoryIMockCreateKnowledgeBase) Calls() []*Rep // MinimockCreateKnowledgeBaseDone returns true if the count of the CreateKnowledgeBase invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockCreateKnowledgeBaseDone() bool { + if m.CreateKnowledgeBaseMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.CreateKnowledgeBaseMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -1336,6 +1416,7 @@ func (m *RepositoryIMock) MinimockCreateKnowledgeBaseInspect() { } type mRepositoryIMockCreateKnowledgeBaseFile struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockCreateKnowledgeBaseFileExpectation expectations []*RepositoryIMockCreateKnowledgeBaseFileExpectation @@ -1375,6 +1456,16 @@ type RepositoryIMockCreateKnowledgeBaseFileResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmCreateKnowledgeBaseFile *mRepositoryIMockCreateKnowledgeBaseFile) Optional() *mRepositoryIMockCreateKnowledgeBaseFile { + mmCreateKnowledgeBaseFile.optional = true + return mmCreateKnowledgeBaseFile +} + // Expect sets up expected params for RepositoryI.CreateKnowledgeBaseFile func (mmCreateKnowledgeBaseFile *mRepositoryIMockCreateKnowledgeBaseFile) Expect(ctx context.Context, kb mm_repository.KnowledgeBaseFile, externalServiceCall func(FileUID string) error) *mRepositoryIMockCreateKnowledgeBaseFile { if mmCreateKnowledgeBaseFile.mock.funcCreateKnowledgeBaseFile != nil { @@ -1631,6 +1722,11 @@ func (mmCreateKnowledgeBaseFile *mRepositoryIMockCreateKnowledgeBaseFile) Calls( // MinimockCreateKnowledgeBaseFileDone returns true if the count of the CreateKnowledgeBaseFile invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockCreateKnowledgeBaseFileDone() bool { + if m.CreateKnowledgeBaseFileMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.CreateKnowledgeBaseFileMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -1669,6 +1765,7 @@ func (m *RepositoryIMock) MinimockCreateKnowledgeBaseFileInspect() { } type mRepositoryIMockDeleteAllConvertedFilesInKb struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockDeleteAllConvertedFilesInKbExpectation expectations []*RepositoryIMockDeleteAllConvertedFilesInKbExpectation @@ -1705,6 +1802,16 @@ type RepositoryIMockDeleteAllConvertedFilesInKbResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmDeleteAllConvertedFilesInKb *mRepositoryIMockDeleteAllConvertedFilesInKb) Optional() *mRepositoryIMockDeleteAllConvertedFilesInKb { + mmDeleteAllConvertedFilesInKb.optional = true + return mmDeleteAllConvertedFilesInKb +} + // Expect sets up expected params for RepositoryI.DeleteAllConvertedFilesInKb func (mmDeleteAllConvertedFilesInKb *mRepositoryIMockDeleteAllConvertedFilesInKb) Expect(ctx context.Context, kbUID uuid.UUID) *mRepositoryIMockDeleteAllConvertedFilesInKb { if mmDeleteAllConvertedFilesInKb.mock.funcDeleteAllConvertedFilesInKb != nil { @@ -1935,6 +2042,11 @@ func (mmDeleteAllConvertedFilesInKb *mRepositoryIMockDeleteAllConvertedFilesInKb // MinimockDeleteAllConvertedFilesInKbDone returns true if the count of the DeleteAllConvertedFilesInKb invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockDeleteAllConvertedFilesInKbDone() bool { + if m.DeleteAllConvertedFilesInKbMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.DeleteAllConvertedFilesInKbMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -1973,6 +2085,7 @@ func (m *RepositoryIMock) MinimockDeleteAllConvertedFilesInKbInspect() { } type mRepositoryIMockDeleteAllKnowledgeBaseFiles struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockDeleteAllKnowledgeBaseFilesExpectation expectations []*RepositoryIMockDeleteAllKnowledgeBaseFilesExpectation @@ -2009,6 +2122,16 @@ type RepositoryIMockDeleteAllKnowledgeBaseFilesResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmDeleteAllKnowledgeBaseFiles *mRepositoryIMockDeleteAllKnowledgeBaseFiles) Optional() *mRepositoryIMockDeleteAllKnowledgeBaseFiles { + mmDeleteAllKnowledgeBaseFiles.optional = true + return mmDeleteAllKnowledgeBaseFiles +} + // Expect sets up expected params for RepositoryI.DeleteAllKnowledgeBaseFiles func (mmDeleteAllKnowledgeBaseFiles *mRepositoryIMockDeleteAllKnowledgeBaseFiles) Expect(ctx context.Context, kbUID string) *mRepositoryIMockDeleteAllKnowledgeBaseFiles { if mmDeleteAllKnowledgeBaseFiles.mock.funcDeleteAllKnowledgeBaseFiles != nil { @@ -2239,6 +2362,11 @@ func (mmDeleteAllKnowledgeBaseFiles *mRepositoryIMockDeleteAllKnowledgeBaseFiles // MinimockDeleteAllKnowledgeBaseFilesDone returns true if the count of the DeleteAllKnowledgeBaseFiles invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockDeleteAllKnowledgeBaseFilesDone() bool { + if m.DeleteAllKnowledgeBaseFilesMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.DeleteAllKnowledgeBaseFilesMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -2277,6 +2405,7 @@ func (m *RepositoryIMock) MinimockDeleteAllKnowledgeBaseFilesInspect() { } type mRepositoryIMockDeleteAndCreateChunks struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockDeleteAndCreateChunksExpectation expectations []*RepositoryIMockDeleteAndCreateChunksExpectation @@ -2320,6 +2449,16 @@ type RepositoryIMockDeleteAndCreateChunksResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) Optional() *mRepositoryIMockDeleteAndCreateChunks { + mmDeleteAndCreateChunks.optional = true + return mmDeleteAndCreateChunks +} + // Expect sets up expected params for RepositoryI.DeleteAndCreateChunks func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) Expect(ctx context.Context, sourceTable string, sourceUID uuid.UUID, chunks []*mm_repository.TextChunk, externalServiceCall func(chunkUIDs []string) (map[string]any, error)) *mRepositoryIMockDeleteAndCreateChunks { if mmDeleteAndCreateChunks.mock.funcDeleteAndCreateChunks != nil { @@ -2628,6 +2767,11 @@ func (mmDeleteAndCreateChunks *mRepositoryIMockDeleteAndCreateChunks) Calls() [] // MinimockDeleteAndCreateChunksDone returns true if the count of the DeleteAndCreateChunks invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockDeleteAndCreateChunksDone() bool { + if m.DeleteAndCreateChunksMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.DeleteAndCreateChunksMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -2666,6 +2810,7 @@ func (m *RepositoryIMock) MinimockDeleteAndCreateChunksInspect() { } type mRepositoryIMockDeleteChunksBySource struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockDeleteChunksBySourceExpectation expectations []*RepositoryIMockDeleteChunksBySourceExpectation @@ -2704,6 +2849,16 @@ type RepositoryIMockDeleteChunksBySourceResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmDeleteChunksBySource *mRepositoryIMockDeleteChunksBySource) Optional() *mRepositoryIMockDeleteChunksBySource { + mmDeleteChunksBySource.optional = true + return mmDeleteChunksBySource +} + // Expect sets up expected params for RepositoryI.DeleteChunksBySource func (mmDeleteChunksBySource *mRepositoryIMockDeleteChunksBySource) Expect(ctx context.Context, sourceTable string, sourceUID uuid.UUID) *mRepositoryIMockDeleteChunksBySource { if mmDeleteChunksBySource.mock.funcDeleteChunksBySource != nil { @@ -2960,6 +3115,11 @@ func (mmDeleteChunksBySource *mRepositoryIMockDeleteChunksBySource) Calls() []*R // MinimockDeleteChunksBySourceDone returns true if the count of the DeleteChunksBySource invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockDeleteChunksBySourceDone() bool { + if m.DeleteChunksBySourceMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.DeleteChunksBySourceMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -2998,6 +3158,7 @@ func (m *RepositoryIMock) MinimockDeleteChunksBySourceInspect() { } type mRepositoryIMockDeleteChunksByUIDs struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockDeleteChunksByUIDsExpectation expectations []*RepositoryIMockDeleteChunksByUIDsExpectation @@ -3034,6 +3195,16 @@ type RepositoryIMockDeleteChunksByUIDsResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmDeleteChunksByUIDs *mRepositoryIMockDeleteChunksByUIDs) Optional() *mRepositoryIMockDeleteChunksByUIDs { + mmDeleteChunksByUIDs.optional = true + return mmDeleteChunksByUIDs +} + // Expect sets up expected params for RepositoryI.DeleteChunksByUIDs func (mmDeleteChunksByUIDs *mRepositoryIMockDeleteChunksByUIDs) Expect(ctx context.Context, chunkUIDs []uuid.UUID) *mRepositoryIMockDeleteChunksByUIDs { if mmDeleteChunksByUIDs.mock.funcDeleteChunksByUIDs != nil { @@ -3264,6 +3435,11 @@ func (mmDeleteChunksByUIDs *mRepositoryIMockDeleteChunksByUIDs) Calls() []*Repos // MinimockDeleteChunksByUIDsDone returns true if the count of the DeleteChunksByUIDs invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockDeleteChunksByUIDsDone() bool { + if m.DeleteChunksByUIDsMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.DeleteChunksByUIDsMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -3302,6 +3478,7 @@ func (m *RepositoryIMock) MinimockDeleteChunksByUIDsInspect() { } type mRepositoryIMockDeleteConvertedFile struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockDeleteConvertedFileExpectation expectations []*RepositoryIMockDeleteConvertedFileExpectation @@ -3338,6 +3515,16 @@ type RepositoryIMockDeleteConvertedFileResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmDeleteConvertedFile *mRepositoryIMockDeleteConvertedFile) Optional() *mRepositoryIMockDeleteConvertedFile { + mmDeleteConvertedFile.optional = true + return mmDeleteConvertedFile +} + // Expect sets up expected params for RepositoryI.DeleteConvertedFile func (mmDeleteConvertedFile *mRepositoryIMockDeleteConvertedFile) Expect(ctx context.Context, uid uuid.UUID) *mRepositoryIMockDeleteConvertedFile { if mmDeleteConvertedFile.mock.funcDeleteConvertedFile != nil { @@ -3568,6 +3755,11 @@ func (mmDeleteConvertedFile *mRepositoryIMockDeleteConvertedFile) Calls() []*Rep // MinimockDeleteConvertedFileDone returns true if the count of the DeleteConvertedFile invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockDeleteConvertedFileDone() bool { + if m.DeleteConvertedFileMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.DeleteConvertedFileMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -3606,6 +3798,7 @@ func (m *RepositoryIMock) MinimockDeleteConvertedFileInspect() { } type mRepositoryIMockDeleteEmbeddingsBySource struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockDeleteEmbeddingsBySourceExpectation expectations []*RepositoryIMockDeleteEmbeddingsBySourceExpectation @@ -3644,6 +3837,16 @@ type RepositoryIMockDeleteEmbeddingsBySourceResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmDeleteEmbeddingsBySource *mRepositoryIMockDeleteEmbeddingsBySource) Optional() *mRepositoryIMockDeleteEmbeddingsBySource { + mmDeleteEmbeddingsBySource.optional = true + return mmDeleteEmbeddingsBySource +} + // Expect sets up expected params for RepositoryI.DeleteEmbeddingsBySource func (mmDeleteEmbeddingsBySource *mRepositoryIMockDeleteEmbeddingsBySource) Expect(ctx context.Context, sourceTable string, sourceUID uuid.UUID) *mRepositoryIMockDeleteEmbeddingsBySource { if mmDeleteEmbeddingsBySource.mock.funcDeleteEmbeddingsBySource != nil { @@ -3900,6 +4103,11 @@ func (mmDeleteEmbeddingsBySource *mRepositoryIMockDeleteEmbeddingsBySource) Call // MinimockDeleteEmbeddingsBySourceDone returns true if the count of the DeleteEmbeddingsBySource invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockDeleteEmbeddingsBySourceDone() bool { + if m.DeleteEmbeddingsBySourceMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.DeleteEmbeddingsBySourceMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -3938,6 +4146,7 @@ func (m *RepositoryIMock) MinimockDeleteEmbeddingsBySourceInspect() { } type mRepositoryIMockDeleteEmbeddingsByUIDs struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockDeleteEmbeddingsByUIDsExpectation expectations []*RepositoryIMockDeleteEmbeddingsByUIDsExpectation @@ -3974,6 +4183,16 @@ type RepositoryIMockDeleteEmbeddingsByUIDsResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmDeleteEmbeddingsByUIDs *mRepositoryIMockDeleteEmbeddingsByUIDs) Optional() *mRepositoryIMockDeleteEmbeddingsByUIDs { + mmDeleteEmbeddingsByUIDs.optional = true + return mmDeleteEmbeddingsByUIDs +} + // Expect sets up expected params for RepositoryI.DeleteEmbeddingsByUIDs func (mmDeleteEmbeddingsByUIDs *mRepositoryIMockDeleteEmbeddingsByUIDs) Expect(ctx context.Context, embUIDs []uuid.UUID) *mRepositoryIMockDeleteEmbeddingsByUIDs { if mmDeleteEmbeddingsByUIDs.mock.funcDeleteEmbeddingsByUIDs != nil { @@ -4204,6 +4423,11 @@ func (mmDeleteEmbeddingsByUIDs *mRepositoryIMockDeleteEmbeddingsByUIDs) Calls() // MinimockDeleteEmbeddingsByUIDsDone returns true if the count of the DeleteEmbeddingsByUIDs invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockDeleteEmbeddingsByUIDsDone() bool { + if m.DeleteEmbeddingsByUIDsMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.DeleteEmbeddingsByUIDsMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -4242,6 +4466,7 @@ func (m *RepositoryIMock) MinimockDeleteEmbeddingsByUIDsInspect() { } type mRepositoryIMockDeleteKnowledgeBase struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockDeleteKnowledgeBaseExpectation expectations []*RepositoryIMockDeleteKnowledgeBaseExpectation @@ -4281,6 +4506,16 @@ type RepositoryIMockDeleteKnowledgeBaseResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmDeleteKnowledgeBase *mRepositoryIMockDeleteKnowledgeBase) Optional() *mRepositoryIMockDeleteKnowledgeBase { + mmDeleteKnowledgeBase.optional = true + return mmDeleteKnowledgeBase +} + // Expect sets up expected params for RepositoryI.DeleteKnowledgeBase func (mmDeleteKnowledgeBase *mRepositoryIMockDeleteKnowledgeBase) Expect(ctx context.Context, ownerUID string, kbID string) *mRepositoryIMockDeleteKnowledgeBase { if mmDeleteKnowledgeBase.mock.funcDeleteKnowledgeBase != nil { @@ -4537,6 +4772,11 @@ func (mmDeleteKnowledgeBase *mRepositoryIMockDeleteKnowledgeBase) Calls() []*Rep // MinimockDeleteKnowledgeBaseDone returns true if the count of the DeleteKnowledgeBase invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockDeleteKnowledgeBaseDone() bool { + if m.DeleteKnowledgeBaseMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.DeleteKnowledgeBaseMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -4575,6 +4815,7 @@ func (m *RepositoryIMock) MinimockDeleteKnowledgeBaseInspect() { } type mRepositoryIMockDeleteKnowledgeBaseFile struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockDeleteKnowledgeBaseFileExpectation expectations []*RepositoryIMockDeleteKnowledgeBaseFileExpectation @@ -4611,6 +4852,16 @@ type RepositoryIMockDeleteKnowledgeBaseFileResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmDeleteKnowledgeBaseFile *mRepositoryIMockDeleteKnowledgeBaseFile) Optional() *mRepositoryIMockDeleteKnowledgeBaseFile { + mmDeleteKnowledgeBaseFile.optional = true + return mmDeleteKnowledgeBaseFile +} + // Expect sets up expected params for RepositoryI.DeleteKnowledgeBaseFile func (mmDeleteKnowledgeBaseFile *mRepositoryIMockDeleteKnowledgeBaseFile) Expect(ctx context.Context, fileUID string) *mRepositoryIMockDeleteKnowledgeBaseFile { if mmDeleteKnowledgeBaseFile.mock.funcDeleteKnowledgeBaseFile != nil { @@ -4841,6 +5092,11 @@ func (mmDeleteKnowledgeBaseFile *mRepositoryIMockDeleteKnowledgeBaseFile) Calls( // MinimockDeleteKnowledgeBaseFileDone returns true if the count of the DeleteKnowledgeBaseFile invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockDeleteKnowledgeBaseFileDone() bool { + if m.DeleteKnowledgeBaseFileMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.DeleteKnowledgeBaseFileMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -4879,6 +5135,7 @@ func (m *RepositoryIMock) MinimockDeleteKnowledgeBaseFileInspect() { } type mRepositoryIMockDeleteKnowledgeBaseFileAndDecreaseUsage struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockDeleteKnowledgeBaseFileAndDecreaseUsageExpectation expectations []*RepositoryIMockDeleteKnowledgeBaseFileAndDecreaseUsageExpectation @@ -4915,6 +5172,16 @@ type RepositoryIMockDeleteKnowledgeBaseFileAndDecreaseUsageResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmDeleteKnowledgeBaseFileAndDecreaseUsage *mRepositoryIMockDeleteKnowledgeBaseFileAndDecreaseUsage) Optional() *mRepositoryIMockDeleteKnowledgeBaseFileAndDecreaseUsage { + mmDeleteKnowledgeBaseFileAndDecreaseUsage.optional = true + return mmDeleteKnowledgeBaseFileAndDecreaseUsage +} + // Expect sets up expected params for RepositoryI.DeleteKnowledgeBaseFileAndDecreaseUsage func (mmDeleteKnowledgeBaseFileAndDecreaseUsage *mRepositoryIMockDeleteKnowledgeBaseFileAndDecreaseUsage) Expect(ctx context.Context, fileUID uuid.UUID) *mRepositoryIMockDeleteKnowledgeBaseFileAndDecreaseUsage { if mmDeleteKnowledgeBaseFileAndDecreaseUsage.mock.funcDeleteKnowledgeBaseFileAndDecreaseUsage != nil { @@ -5145,6 +5412,11 @@ func (mmDeleteKnowledgeBaseFileAndDecreaseUsage *mRepositoryIMockDeleteKnowledge // MinimockDeleteKnowledgeBaseFileAndDecreaseUsageDone returns true if the count of the DeleteKnowledgeBaseFileAndDecreaseUsage invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockDeleteKnowledgeBaseFileAndDecreaseUsageDone() bool { + if m.DeleteKnowledgeBaseFileAndDecreaseUsageMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.DeleteKnowledgeBaseFileAndDecreaseUsageMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -5183,6 +5455,7 @@ func (m *RepositoryIMock) MinimockDeleteKnowledgeBaseFileAndDecreaseUsageInspect } type mRepositoryIMockDeleteRepositoryTag struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockDeleteRepositoryTagExpectation expectations []*RepositoryIMockDeleteRepositoryTagExpectation @@ -5219,6 +5492,16 @@ type RepositoryIMockDeleteRepositoryTagResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmDeleteRepositoryTag *mRepositoryIMockDeleteRepositoryTag) Optional() *mRepositoryIMockDeleteRepositoryTag { + mmDeleteRepositoryTag.optional = true + return mmDeleteRepositoryTag +} + // Expect sets up expected params for RepositoryI.DeleteRepositoryTag func (mmDeleteRepositoryTag *mRepositoryIMockDeleteRepositoryTag) Expect(ctx context.Context, s1 string) *mRepositoryIMockDeleteRepositoryTag { if mmDeleteRepositoryTag.mock.funcDeleteRepositoryTag != nil { @@ -5449,6 +5732,11 @@ func (mmDeleteRepositoryTag *mRepositoryIMockDeleteRepositoryTag) Calls() []*Rep // MinimockDeleteRepositoryTagDone returns true if the count of the DeleteRepositoryTag invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockDeleteRepositoryTagDone() bool { + if m.DeleteRepositoryTagMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.DeleteRepositoryTagMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -5487,6 +5775,7 @@ func (m *RepositoryIMock) MinimockDeleteRepositoryTagInspect() { } type mRepositoryIMockGetChunksByUIDs struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockGetChunksByUIDsExpectation expectations []*RepositoryIMockGetChunksByUIDsExpectation @@ -5524,6 +5813,16 @@ type RepositoryIMockGetChunksByUIDsResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmGetChunksByUIDs *mRepositoryIMockGetChunksByUIDs) Optional() *mRepositoryIMockGetChunksByUIDs { + mmGetChunksByUIDs.optional = true + return mmGetChunksByUIDs +} + // Expect sets up expected params for RepositoryI.GetChunksByUIDs func (mmGetChunksByUIDs *mRepositoryIMockGetChunksByUIDs) Expect(ctx context.Context, chunkUIDs []uuid.UUID) *mRepositoryIMockGetChunksByUIDs { if mmGetChunksByUIDs.mock.funcGetChunksByUIDs != nil { @@ -5754,6 +6053,11 @@ func (mmGetChunksByUIDs *mRepositoryIMockGetChunksByUIDs) Calls() []*RepositoryI // MinimockGetChunksByUIDsDone returns true if the count of the GetChunksByUIDs invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockGetChunksByUIDsDone() bool { + if m.GetChunksByUIDsMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.GetChunksByUIDsMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -5792,6 +6096,7 @@ func (m *RepositoryIMock) MinimockGetChunksByUIDsInspect() { } type mRepositoryIMockGetConvertedFileByFileUID struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockGetConvertedFileByFileUIDExpectation expectations []*RepositoryIMockGetConvertedFileByFileUIDExpectation @@ -5829,6 +6134,16 @@ type RepositoryIMockGetConvertedFileByFileUIDResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmGetConvertedFileByFileUID *mRepositoryIMockGetConvertedFileByFileUID) Optional() *mRepositoryIMockGetConvertedFileByFileUID { + mmGetConvertedFileByFileUID.optional = true + return mmGetConvertedFileByFileUID +} + // Expect sets up expected params for RepositoryI.GetConvertedFileByFileUID func (mmGetConvertedFileByFileUID *mRepositoryIMockGetConvertedFileByFileUID) Expect(ctx context.Context, fileUID uuid.UUID) *mRepositoryIMockGetConvertedFileByFileUID { if mmGetConvertedFileByFileUID.mock.funcGetConvertedFileByFileUID != nil { @@ -6059,6 +6374,11 @@ func (mmGetConvertedFileByFileUID *mRepositoryIMockGetConvertedFileByFileUID) Ca // MinimockGetConvertedFileByFileUIDDone returns true if the count of the GetConvertedFileByFileUID invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockGetConvertedFileByFileUIDDone() bool { + if m.GetConvertedFileByFileUIDMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.GetConvertedFileByFileUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -6097,6 +6417,7 @@ func (m *RepositoryIMock) MinimockGetConvertedFileByFileUIDInspect() { } type mRepositoryIMockGetCountFilesByListKnowledgeBaseUID struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation expectations []*RepositoryIMockGetCountFilesByListKnowledgeBaseUIDExpectation @@ -6134,6 +6455,16 @@ type RepositoryIMockGetCountFilesByListKnowledgeBaseUIDResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID) Optional() *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID { + mmGetCountFilesByListKnowledgeBaseUID.optional = true + return mmGetCountFilesByListKnowledgeBaseUID +} + // Expect sets up expected params for RepositoryI.GetCountFilesByListKnowledgeBaseUID func (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID) Expect(ctx context.Context, kbUIDs []mm_repository.KbUID) *mRepositoryIMockGetCountFilesByListKnowledgeBaseUID { if mmGetCountFilesByListKnowledgeBaseUID.mock.funcGetCountFilesByListKnowledgeBaseUID != nil { @@ -6364,6 +6695,11 @@ func (mmGetCountFilesByListKnowledgeBaseUID *mRepositoryIMockGetCountFilesByList // MinimockGetCountFilesByListKnowledgeBaseUIDDone returns true if the count of the GetCountFilesByListKnowledgeBaseUID invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockGetCountFilesByListKnowledgeBaseUIDDone() bool { + if m.GetCountFilesByListKnowledgeBaseUIDMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.GetCountFilesByListKnowledgeBaseUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -6402,6 +6738,7 @@ func (m *RepositoryIMock) MinimockGetCountFilesByListKnowledgeBaseUIDInspect() { } type mRepositoryIMockGetEmbeddingByUIDs struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockGetEmbeddingByUIDsExpectation expectations []*RepositoryIMockGetEmbeddingByUIDsExpectation @@ -6439,6 +6776,16 @@ type RepositoryIMockGetEmbeddingByUIDsResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) Optional() *mRepositoryIMockGetEmbeddingByUIDs { + mmGetEmbeddingByUIDs.optional = true + return mmGetEmbeddingByUIDs +} + // Expect sets up expected params for RepositoryI.GetEmbeddingByUIDs func (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) Expect(ctx context.Context, embUIDs []uuid.UUID) *mRepositoryIMockGetEmbeddingByUIDs { if mmGetEmbeddingByUIDs.mock.funcGetEmbeddingByUIDs != nil { @@ -6669,6 +7016,11 @@ func (mmGetEmbeddingByUIDs *mRepositoryIMockGetEmbeddingByUIDs) Calls() []*Repos // MinimockGetEmbeddingByUIDsDone returns true if the count of the GetEmbeddingByUIDs invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockGetEmbeddingByUIDsDone() bool { + if m.GetEmbeddingByUIDsMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.GetEmbeddingByUIDsMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -6707,6 +7059,7 @@ func (m *RepositoryIMock) MinimockGetEmbeddingByUIDsInspect() { } type mRepositoryIMockGetFilesTotalTokens struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockGetFilesTotalTokensExpectation expectations []*RepositoryIMockGetFilesTotalTokensExpectation @@ -6750,6 +7103,16 @@ type RepositoryIMockGetFilesTotalTokensResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmGetFilesTotalTokens *mRepositoryIMockGetFilesTotalTokens) Optional() *mRepositoryIMockGetFilesTotalTokens { + mmGetFilesTotalTokens.optional = true + return mmGetFilesTotalTokens +} + // Expect sets up expected params for RepositoryI.GetFilesTotalTokens func (mmGetFilesTotalTokens *mRepositoryIMockGetFilesTotalTokens) Expect(ctx context.Context, sources map[mm_repository.FileUID]struct { SourceTable mm_repository.SourceTable @@ -6998,6 +7361,11 @@ func (mmGetFilesTotalTokens *mRepositoryIMockGetFilesTotalTokens) Calls() []*Rep // MinimockGetFilesTotalTokensDone returns true if the count of the GetFilesTotalTokens invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockGetFilesTotalTokensDone() bool { + if m.GetFilesTotalTokensMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.GetFilesTotalTokensMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -7036,6 +7404,7 @@ func (m *RepositoryIMock) MinimockGetFilesTotalTokensInspect() { } type mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation expectations []*RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDExpectation @@ -7075,6 +7444,16 @@ type RepositoryIMockGetKnowledgeBaseByOwnerAndKbIDResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) Optional() *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID { + mmGetKnowledgeBaseByOwnerAndKbID.optional = true + return mmGetKnowledgeBaseByOwnerAndKbID +} + // Expect sets up expected params for RepositoryI.GetKnowledgeBaseByOwnerAndKbID func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID) Expect(ctx context.Context, ownerUID uuid.UUID, kbID string) *mRepositoryIMockGetKnowledgeBaseByOwnerAndKbID { if mmGetKnowledgeBaseByOwnerAndKbID.mock.funcGetKnowledgeBaseByOwnerAndKbID != nil { @@ -7331,6 +7710,11 @@ func (mmGetKnowledgeBaseByOwnerAndKbID *mRepositoryIMockGetKnowledgeBaseByOwnerA // MinimockGetKnowledgeBaseByOwnerAndKbIDDone returns true if the count of the GetKnowledgeBaseByOwnerAndKbID invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockGetKnowledgeBaseByOwnerAndKbIDDone() bool { + if m.GetKnowledgeBaseByOwnerAndKbIDMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.GetKnowledgeBaseByOwnerAndKbIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -7369,6 +7753,7 @@ func (m *RepositoryIMock) MinimockGetKnowledgeBaseByOwnerAndKbIDInspect() { } type mRepositoryIMockGetKnowledgeBaseCountByOwner struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation expectations []*RepositoryIMockGetKnowledgeBaseCountByOwnerExpectation @@ -7406,6 +7791,16 @@ type RepositoryIMockGetKnowledgeBaseCountByOwnerResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwner) Optional() *mRepositoryIMockGetKnowledgeBaseCountByOwner { + mmGetKnowledgeBaseCountByOwner.optional = true + return mmGetKnowledgeBaseCountByOwner +} + // Expect sets up expected params for RepositoryI.GetKnowledgeBaseCountByOwner func (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwner) Expect(ctx context.Context, ownerUID string) *mRepositoryIMockGetKnowledgeBaseCountByOwner { if mmGetKnowledgeBaseCountByOwner.mock.funcGetKnowledgeBaseCountByOwner != nil { @@ -7636,6 +8031,11 @@ func (mmGetKnowledgeBaseCountByOwner *mRepositoryIMockGetKnowledgeBaseCountByOwn // MinimockGetKnowledgeBaseCountByOwnerDone returns true if the count of the GetKnowledgeBaseCountByOwner invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockGetKnowledgeBaseCountByOwnerDone() bool { + if m.GetKnowledgeBaseCountByOwnerMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.GetKnowledgeBaseCountByOwnerMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -7674,6 +8074,7 @@ func (m *RepositoryIMock) MinimockGetKnowledgeBaseCountByOwnerInspect() { } type mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation expectations []*RepositoryIMockGetKnowledgeBaseFilesByFileUIDsExpectation @@ -7713,6 +8114,16 @@ type RepositoryIMockGetKnowledgeBaseFilesByFileUIDsResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) Optional() *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs { + mmGetKnowledgeBaseFilesByFileUIDs.optional = true + return mmGetKnowledgeBaseFilesByFileUIDs +} + // Expect sets up expected params for RepositoryI.GetKnowledgeBaseFilesByFileUIDs func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs) Expect(ctx context.Context, fileUIDs []uuid.UUID, columns ...string) *mRepositoryIMockGetKnowledgeBaseFilesByFileUIDs { if mmGetKnowledgeBaseFilesByFileUIDs.mock.funcGetKnowledgeBaseFilesByFileUIDs != nil { @@ -7969,6 +8380,11 @@ func (mmGetKnowledgeBaseFilesByFileUIDs *mRepositoryIMockGetKnowledgeBaseFilesBy // MinimockGetKnowledgeBaseFilesByFileUIDsDone returns true if the count of the GetKnowledgeBaseFilesByFileUIDs invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockGetKnowledgeBaseFilesByFileUIDsDone() bool { + if m.GetKnowledgeBaseFilesByFileUIDsMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.GetKnowledgeBaseFilesByFileUIDsMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -8007,6 +8423,7 @@ func (m *RepositoryIMock) MinimockGetKnowledgeBaseFilesByFileUIDsInspect() { } type mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDExpectation expectations []*RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDExpectation @@ -8046,6 +8463,16 @@ type RepositoryIMockGetKnowledgebaseFileByKbUIDAndFileIDResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmGetKnowledgebaseFileByKbUIDAndFileID *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID) Optional() *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID { + mmGetKnowledgebaseFileByKbUIDAndFileID.optional = true + return mmGetKnowledgebaseFileByKbUIDAndFileID +} + // Expect sets up expected params for RepositoryI.GetKnowledgebaseFileByKbUIDAndFileID func (mmGetKnowledgebaseFileByKbUIDAndFileID *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID) Expect(ctx context.Context, kbUID uuid.UUID, fileID string) *mRepositoryIMockGetKnowledgebaseFileByKbUIDAndFileID { if mmGetKnowledgebaseFileByKbUIDAndFileID.mock.funcGetKnowledgebaseFileByKbUIDAndFileID != nil { @@ -8302,6 +8729,11 @@ func (mmGetKnowledgebaseFileByKbUIDAndFileID *mRepositoryIMockGetKnowledgebaseFi // MinimockGetKnowledgebaseFileByKbUIDAndFileIDDone returns true if the count of the GetKnowledgebaseFileByKbUIDAndFileID invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockGetKnowledgebaseFileByKbUIDAndFileIDDone() bool { + if m.GetKnowledgebaseFileByKbUIDAndFileIDMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.GetKnowledgebaseFileByKbUIDAndFileIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -8340,6 +8772,7 @@ func (m *RepositoryIMock) MinimockGetKnowledgebaseFileByKbUIDAndFileIDInspect() } type mRepositoryIMockGetNeedProcessFiles struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockGetNeedProcessFilesExpectation expectations []*RepositoryIMockGetNeedProcessFilesExpectation @@ -8374,6 +8807,16 @@ type RepositoryIMockGetNeedProcessFilesResults struct { ka1 []mm_repository.KnowledgeBaseFile } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmGetNeedProcessFiles *mRepositoryIMockGetNeedProcessFiles) Optional() *mRepositoryIMockGetNeedProcessFiles { + mmGetNeedProcessFiles.optional = true + return mmGetNeedProcessFiles +} + // Expect sets up expected params for RepositoryI.GetNeedProcessFiles func (mmGetNeedProcessFiles *mRepositoryIMockGetNeedProcessFiles) Expect(ctx context.Context) *mRepositoryIMockGetNeedProcessFiles { if mmGetNeedProcessFiles.mock.funcGetNeedProcessFiles != nil { @@ -8578,6 +9021,11 @@ func (mmGetNeedProcessFiles *mRepositoryIMockGetNeedProcessFiles) Calls() []*Rep // MinimockGetNeedProcessFilesDone returns true if the count of the GetNeedProcessFiles invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockGetNeedProcessFilesDone() bool { + if m.GetNeedProcessFilesMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.GetNeedProcessFilesMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -8616,6 +9064,7 @@ func (m *RepositoryIMock) MinimockGetNeedProcessFilesInspect() { } type mRepositoryIMockGetRepositoryTag struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockGetRepositoryTagExpectation expectations []*RepositoryIMockGetRepositoryTagExpectation @@ -8653,6 +9102,16 @@ type RepositoryIMockGetRepositoryTagResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) Optional() *mRepositoryIMockGetRepositoryTag { + mmGetRepositoryTag.optional = true + return mmGetRepositoryTag +} + // Expect sets up expected params for RepositoryI.GetRepositoryTag func (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) Expect(ctx context.Context, r1 utils.RepositoryTagName) *mRepositoryIMockGetRepositoryTag { if mmGetRepositoryTag.mock.funcGetRepositoryTag != nil { @@ -8883,6 +9342,11 @@ func (mmGetRepositoryTag *mRepositoryIMockGetRepositoryTag) Calls() []*Repositor // MinimockGetRepositoryTagDone returns true if the count of the GetRepositoryTag invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockGetRepositoryTagDone() bool { + if m.GetRepositoryTagMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.GetRepositoryTagMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -8921,6 +9385,7 @@ func (m *RepositoryIMock) MinimockGetRepositoryTagInspect() { } type mRepositoryIMockGetSourceTableAndUIDByFileUIDs struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation expectations []*RepositoryIMockGetSourceTableAndUIDByFileUIDsExpectation @@ -8961,6 +9426,16 @@ type RepositoryIMockGetSourceTableAndUIDByFileUIDsResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFileUIDs) Optional() *mRepositoryIMockGetSourceTableAndUIDByFileUIDs { + mmGetSourceTableAndUIDByFileUIDs.optional = true + return mmGetSourceTableAndUIDByFileUIDs +} + // Expect sets up expected params for RepositoryI.GetSourceTableAndUIDByFileUIDs func (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFileUIDs) Expect(ctx context.Context, files []mm_repository.KnowledgeBaseFile) *mRepositoryIMockGetSourceTableAndUIDByFileUIDs { if mmGetSourceTableAndUIDByFileUIDs.mock.funcGetSourceTableAndUIDByFileUIDs != nil { @@ -9203,6 +9678,11 @@ func (mmGetSourceTableAndUIDByFileUIDs *mRepositoryIMockGetSourceTableAndUIDByFi // MinimockGetSourceTableAndUIDByFileUIDsDone returns true if the count of the GetSourceTableAndUIDByFileUIDs invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockGetSourceTableAndUIDByFileUIDsDone() bool { + if m.GetSourceTableAndUIDByFileUIDsMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.GetSourceTableAndUIDByFileUIDsMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -9241,6 +9721,7 @@ func (m *RepositoryIMock) MinimockGetSourceTableAndUIDByFileUIDsInspect() { } type mRepositoryIMockGetTextChunksBySource struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockGetTextChunksBySourceExpectation expectations []*RepositoryIMockGetTextChunksBySourceExpectation @@ -9280,6 +9761,16 @@ type RepositoryIMockGetTextChunksBySourceResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) Optional() *mRepositoryIMockGetTextChunksBySource { + mmGetTextChunksBySource.optional = true + return mmGetTextChunksBySource +} + // Expect sets up expected params for RepositoryI.GetTextChunksBySource func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) Expect(ctx context.Context, sourceTable string, sourceUID uuid.UUID) *mRepositoryIMockGetTextChunksBySource { if mmGetTextChunksBySource.mock.funcGetTextChunksBySource != nil { @@ -9536,6 +10027,11 @@ func (mmGetTextChunksBySource *mRepositoryIMockGetTextChunksBySource) Calls() [] // MinimockGetTextChunksBySourceDone returns true if the count of the GetTextChunksBySource invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockGetTextChunksBySourceDone() bool { + if m.GetTextChunksBySourceMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.GetTextChunksBySourceMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -9574,6 +10070,7 @@ func (m *RepositoryIMock) MinimockGetTextChunksBySourceInspect() { } type mRepositoryIMockGetTotalChunksBySources struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockGetTotalChunksBySourcesExpectation expectations []*RepositoryIMockGetTotalChunksBySourcesExpectation @@ -9617,6 +10114,16 @@ type RepositoryIMockGetTotalChunksBySourcesResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmGetTotalChunksBySources *mRepositoryIMockGetTotalChunksBySources) Optional() *mRepositoryIMockGetTotalChunksBySources { + mmGetTotalChunksBySources.optional = true + return mmGetTotalChunksBySources +} + // Expect sets up expected params for RepositoryI.GetTotalChunksBySources func (mmGetTotalChunksBySources *mRepositoryIMockGetTotalChunksBySources) Expect(ctx context.Context, sources map[mm_repository.FileUID]struct { SourceTable mm_repository.SourceTable @@ -9865,6 +10372,11 @@ func (mmGetTotalChunksBySources *mRepositoryIMockGetTotalChunksBySources) Calls( // MinimockGetTotalChunksBySourcesDone returns true if the count of the GetTotalChunksBySources invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockGetTotalChunksBySourcesDone() bool { + if m.GetTotalChunksBySourcesMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.GetTotalChunksBySourcesMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -9903,6 +10415,7 @@ func (m *RepositoryIMock) MinimockGetTotalChunksBySourcesInspect() { } type mRepositoryIMockGetTotalTokensByListKBUIDs struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockGetTotalTokensByListKBUIDsExpectation expectations []*RepositoryIMockGetTotalTokensByListKBUIDsExpectation @@ -9940,6 +10453,16 @@ type RepositoryIMockGetTotalTokensByListKBUIDsResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmGetTotalTokensByListKBUIDs *mRepositoryIMockGetTotalTokensByListKBUIDs) Optional() *mRepositoryIMockGetTotalTokensByListKBUIDs { + mmGetTotalTokensByListKBUIDs.optional = true + return mmGetTotalTokensByListKBUIDs +} + // Expect sets up expected params for RepositoryI.GetTotalTokensByListKBUIDs func (mmGetTotalTokensByListKBUIDs *mRepositoryIMockGetTotalTokensByListKBUIDs) Expect(ctx context.Context, kbUIDs []uuid.UUID) *mRepositoryIMockGetTotalTokensByListKBUIDs { if mmGetTotalTokensByListKBUIDs.mock.funcGetTotalTokensByListKBUIDs != nil { @@ -10170,6 +10693,11 @@ func (mmGetTotalTokensByListKBUIDs *mRepositoryIMockGetTotalTokensByListKBUIDs) // MinimockGetTotalTokensByListKBUIDsDone returns true if the count of the GetTotalTokensByListKBUIDs invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockGetTotalTokensByListKBUIDsDone() bool { + if m.GetTotalTokensByListKBUIDsMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.GetTotalTokensByListKBUIDsMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -10208,6 +10736,7 @@ func (m *RepositoryIMock) MinimockGetTotalTokensByListKBUIDsInspect() { } type mRepositoryIMockGetTruthSourceByFileUID struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockGetTruthSourceByFileUIDExpectation expectations []*RepositoryIMockGetTruthSourceByFileUIDExpectation @@ -10245,6 +10774,16 @@ type RepositoryIMockGetTruthSourceByFileUIDResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) Optional() *mRepositoryIMockGetTruthSourceByFileUID { + mmGetTruthSourceByFileUID.optional = true + return mmGetTruthSourceByFileUID +} + // Expect sets up expected params for RepositoryI.GetTruthSourceByFileUID func (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) Expect(ctx context.Context, fileUID uuid.UUID) *mRepositoryIMockGetTruthSourceByFileUID { if mmGetTruthSourceByFileUID.mock.funcGetTruthSourceByFileUID != nil { @@ -10475,6 +11014,11 @@ func (mmGetTruthSourceByFileUID *mRepositoryIMockGetTruthSourceByFileUID) Calls( // MinimockGetTruthSourceByFileUIDDone returns true if the count of the GetTruthSourceByFileUID invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockGetTruthSourceByFileUIDDone() bool { + if m.GetTruthSourceByFileUIDMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.GetTruthSourceByFileUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -10513,6 +11057,7 @@ func (m *RepositoryIMock) MinimockGetTruthSourceByFileUIDInspect() { } type mRepositoryIMockHardDeleteChunksByKbFileUID struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockHardDeleteChunksByKbFileUIDExpectation expectations []*RepositoryIMockHardDeleteChunksByKbFileUIDExpectation @@ -10549,6 +11094,16 @@ type RepositoryIMockHardDeleteChunksByKbFileUIDResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmHardDeleteChunksByKbFileUID *mRepositoryIMockHardDeleteChunksByKbFileUID) Optional() *mRepositoryIMockHardDeleteChunksByKbFileUID { + mmHardDeleteChunksByKbFileUID.optional = true + return mmHardDeleteChunksByKbFileUID +} + // Expect sets up expected params for RepositoryI.HardDeleteChunksByKbFileUID func (mmHardDeleteChunksByKbFileUID *mRepositoryIMockHardDeleteChunksByKbFileUID) Expect(ctx context.Context, kbFileUID uuid.UUID) *mRepositoryIMockHardDeleteChunksByKbFileUID { if mmHardDeleteChunksByKbFileUID.mock.funcHardDeleteChunksByKbFileUID != nil { @@ -10779,6 +11334,11 @@ func (mmHardDeleteChunksByKbFileUID *mRepositoryIMockHardDeleteChunksByKbFileUID // MinimockHardDeleteChunksByKbFileUIDDone returns true if the count of the HardDeleteChunksByKbFileUID invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockHardDeleteChunksByKbFileUIDDone() bool { + if m.HardDeleteChunksByKbFileUIDMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.HardDeleteChunksByKbFileUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -10817,6 +11377,7 @@ func (m *RepositoryIMock) MinimockHardDeleteChunksByKbFileUIDInspect() { } type mRepositoryIMockHardDeleteChunksByKbUID struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockHardDeleteChunksByKbUIDExpectation expectations []*RepositoryIMockHardDeleteChunksByKbUIDExpectation @@ -10853,6 +11414,16 @@ type RepositoryIMockHardDeleteChunksByKbUIDResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmHardDeleteChunksByKbUID *mRepositoryIMockHardDeleteChunksByKbUID) Optional() *mRepositoryIMockHardDeleteChunksByKbUID { + mmHardDeleteChunksByKbUID.optional = true + return mmHardDeleteChunksByKbUID +} + // Expect sets up expected params for RepositoryI.HardDeleteChunksByKbUID func (mmHardDeleteChunksByKbUID *mRepositoryIMockHardDeleteChunksByKbUID) Expect(ctx context.Context, kbUID uuid.UUID) *mRepositoryIMockHardDeleteChunksByKbUID { if mmHardDeleteChunksByKbUID.mock.funcHardDeleteChunksByKbUID != nil { @@ -11083,6 +11654,11 @@ func (mmHardDeleteChunksByKbUID *mRepositoryIMockHardDeleteChunksByKbUID) Calls( // MinimockHardDeleteChunksByKbUIDDone returns true if the count of the HardDeleteChunksByKbUID invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockHardDeleteChunksByKbUIDDone() bool { + if m.HardDeleteChunksByKbUIDMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.HardDeleteChunksByKbUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -11121,6 +11697,7 @@ func (m *RepositoryIMock) MinimockHardDeleteChunksByKbUIDInspect() { } type mRepositoryIMockHardDeleteConvertedFileByFileUID struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation expectations []*RepositoryIMockHardDeleteConvertedFileByFileUIDExpectation @@ -11157,6 +11734,16 @@ type RepositoryIMockHardDeleteConvertedFileByFileUIDResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmHardDeleteConvertedFileByFileUID *mRepositoryIMockHardDeleteConvertedFileByFileUID) Optional() *mRepositoryIMockHardDeleteConvertedFileByFileUID { + mmHardDeleteConvertedFileByFileUID.optional = true + return mmHardDeleteConvertedFileByFileUID +} + // Expect sets up expected params for RepositoryI.HardDeleteConvertedFileByFileUID func (mmHardDeleteConvertedFileByFileUID *mRepositoryIMockHardDeleteConvertedFileByFileUID) Expect(ctx context.Context, fileUID uuid.UUID) *mRepositoryIMockHardDeleteConvertedFileByFileUID { if mmHardDeleteConvertedFileByFileUID.mock.funcHardDeleteConvertedFileByFileUID != nil { @@ -11387,6 +11974,11 @@ func (mmHardDeleteConvertedFileByFileUID *mRepositoryIMockHardDeleteConvertedFil // MinimockHardDeleteConvertedFileByFileUIDDone returns true if the count of the HardDeleteConvertedFileByFileUID invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockHardDeleteConvertedFileByFileUIDDone() bool { + if m.HardDeleteConvertedFileByFileUIDMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.HardDeleteConvertedFileByFileUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -11425,6 +12017,7 @@ func (m *RepositoryIMock) MinimockHardDeleteConvertedFileByFileUIDInspect() { } type mRepositoryIMockHardDeleteEmbeddingsByKbFileUID struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation expectations []*RepositoryIMockHardDeleteEmbeddingsByKbFileUIDExpectation @@ -11461,6 +12054,16 @@ type RepositoryIMockHardDeleteEmbeddingsByKbFileUIDResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmHardDeleteEmbeddingsByKbFileUID *mRepositoryIMockHardDeleteEmbeddingsByKbFileUID) Optional() *mRepositoryIMockHardDeleteEmbeddingsByKbFileUID { + mmHardDeleteEmbeddingsByKbFileUID.optional = true + return mmHardDeleteEmbeddingsByKbFileUID +} + // Expect sets up expected params for RepositoryI.HardDeleteEmbeddingsByKbFileUID func (mmHardDeleteEmbeddingsByKbFileUID *mRepositoryIMockHardDeleteEmbeddingsByKbFileUID) Expect(ctx context.Context, kbFileUID uuid.UUID) *mRepositoryIMockHardDeleteEmbeddingsByKbFileUID { if mmHardDeleteEmbeddingsByKbFileUID.mock.funcHardDeleteEmbeddingsByKbFileUID != nil { @@ -11691,6 +12294,11 @@ func (mmHardDeleteEmbeddingsByKbFileUID *mRepositoryIMockHardDeleteEmbeddingsByK // MinimockHardDeleteEmbeddingsByKbFileUIDDone returns true if the count of the HardDeleteEmbeddingsByKbFileUID invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockHardDeleteEmbeddingsByKbFileUIDDone() bool { + if m.HardDeleteEmbeddingsByKbFileUIDMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.HardDeleteEmbeddingsByKbFileUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -11729,6 +12337,7 @@ func (m *RepositoryIMock) MinimockHardDeleteEmbeddingsByKbFileUIDInspect() { } type mRepositoryIMockHardDeleteEmbeddingsByKbUID struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation expectations []*RepositoryIMockHardDeleteEmbeddingsByKbUIDExpectation @@ -11765,6 +12374,16 @@ type RepositoryIMockHardDeleteEmbeddingsByKbUIDResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmHardDeleteEmbeddingsByKbUID *mRepositoryIMockHardDeleteEmbeddingsByKbUID) Optional() *mRepositoryIMockHardDeleteEmbeddingsByKbUID { + mmHardDeleteEmbeddingsByKbUID.optional = true + return mmHardDeleteEmbeddingsByKbUID +} + // Expect sets up expected params for RepositoryI.HardDeleteEmbeddingsByKbUID func (mmHardDeleteEmbeddingsByKbUID *mRepositoryIMockHardDeleteEmbeddingsByKbUID) Expect(ctx context.Context, kbUID uuid.UUID) *mRepositoryIMockHardDeleteEmbeddingsByKbUID { if mmHardDeleteEmbeddingsByKbUID.mock.funcHardDeleteEmbeddingsByKbUID != nil { @@ -11995,6 +12614,11 @@ func (mmHardDeleteEmbeddingsByKbUID *mRepositoryIMockHardDeleteEmbeddingsByKbUID // MinimockHardDeleteEmbeddingsByKbUIDDone returns true if the count of the HardDeleteEmbeddingsByKbUID invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockHardDeleteEmbeddingsByKbUIDDone() bool { + if m.HardDeleteEmbeddingsByKbUIDMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.HardDeleteEmbeddingsByKbUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -12033,6 +12657,7 @@ func (m *RepositoryIMock) MinimockHardDeleteEmbeddingsByKbUIDInspect() { } type mRepositoryIMockIncreaseKnowledgeBaseUsage struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockIncreaseKnowledgeBaseUsageExpectation expectations []*RepositoryIMockIncreaseKnowledgeBaseUsageExpectation @@ -12073,6 +12698,16 @@ type RepositoryIMockIncreaseKnowledgeBaseUsageResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) Optional() *mRepositoryIMockIncreaseKnowledgeBaseUsage { + mmIncreaseKnowledgeBaseUsage.optional = true + return mmIncreaseKnowledgeBaseUsage +} + // Expect sets up expected params for RepositoryI.IncreaseKnowledgeBaseUsage func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) Expect(ctx context.Context, tx *gorm.DB, kbUID string, amount int) *mRepositoryIMockIncreaseKnowledgeBaseUsage { if mmIncreaseKnowledgeBaseUsage.mock.funcIncreaseKnowledgeBaseUsage != nil { @@ -12355,6 +12990,11 @@ func (mmIncreaseKnowledgeBaseUsage *mRepositoryIMockIncreaseKnowledgeBaseUsage) // MinimockIncreaseKnowledgeBaseUsageDone returns true if the count of the IncreaseKnowledgeBaseUsage invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockIncreaseKnowledgeBaseUsageDone() bool { + if m.IncreaseKnowledgeBaseUsageMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.IncreaseKnowledgeBaseUsageMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -12393,6 +13033,7 @@ func (m *RepositoryIMock) MinimockIncreaseKnowledgeBaseUsageInspect() { } type mRepositoryIMockKnowledgeBaseFileTableName struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockKnowledgeBaseFileTableNameExpectation expectations []*RepositoryIMockKnowledgeBaseFileTableNameExpectation @@ -12413,6 +13054,16 @@ type RepositoryIMockKnowledgeBaseFileTableNameResults struct { s1 string } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmKnowledgeBaseFileTableName *mRepositoryIMockKnowledgeBaseFileTableName) Optional() *mRepositoryIMockKnowledgeBaseFileTableName { + mmKnowledgeBaseFileTableName.optional = true + return mmKnowledgeBaseFileTableName +} + // Expect sets up expected params for RepositoryI.KnowledgeBaseFileTableName func (mmKnowledgeBaseFileTableName *mRepositoryIMockKnowledgeBaseFileTableName) Expect() *mRepositoryIMockKnowledgeBaseFileTableName { if mmKnowledgeBaseFileTableName.mock.funcKnowledgeBaseFileTableName != nil { @@ -12522,6 +13173,11 @@ func (mmKnowledgeBaseFileTableName *RepositoryIMock) KnowledgeBaseFileTableNameB // MinimockKnowledgeBaseFileTableNameDone returns true if the count of the KnowledgeBaseFileTableName invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockKnowledgeBaseFileTableNameDone() bool { + if m.KnowledgeBaseFileTableNameMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.KnowledgeBaseFileTableNameMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -12555,23 +13211,514 @@ func (m *RepositoryIMock) MinimockKnowledgeBaseFileTableNameInspect() { } } -type mRepositoryIMockListChunksByKbFileUID struct { +type mRepositoryIMockListCatalogRuns struct { + optional bool mock *RepositoryIMock - defaultExpectation *RepositoryIMockListChunksByKbFileUIDExpectation - expectations []*RepositoryIMockListChunksByKbFileUIDExpectation + defaultExpectation *RepositoryIMockListCatalogRunsExpectation + expectations []*RepositoryIMockListCatalogRunsExpectation - callArgs []*RepositoryIMockListChunksByKbFileUIDParams + callArgs []*RepositoryIMockListCatalogRunsParams mutex sync.RWMutex expectedInvocations uint64 } -// RepositoryIMockListChunksByKbFileUIDExpectation specifies expectation struct of the RepositoryI.ListChunksByKbFileUID -type RepositoryIMockListChunksByKbFileUIDExpectation struct { +// RepositoryIMockListCatalogRunsExpectation specifies expectation struct of the RepositoryI.ListCatalogRuns +type RepositoryIMockListCatalogRunsExpectation struct { mock *RepositoryIMock - params *RepositoryIMockListChunksByKbFileUIDParams - paramPtrs *RepositoryIMockListChunksByKbFileUIDParamPtrs - results *RepositoryIMockListChunksByKbFileUIDResults + params *RepositoryIMockListCatalogRunsParams + paramPtrs *RepositoryIMockListCatalogRunsParamPtrs + results *RepositoryIMockListCatalogRunsResults + Counter uint64 +} + +// RepositoryIMockListCatalogRunsParams contains parameters of the RepositoryI.ListCatalogRuns +type RepositoryIMockListCatalogRunsParams struct { + ctx context.Context + pageSize int64 + page int64 + filter filtering.Filter + order ordering.OrderBy + catalogUID string + requesterUID string + isOwner bool +} + +// RepositoryIMockListCatalogRunsParamPtrs contains pointers to parameters of the RepositoryI.ListCatalogRuns +type RepositoryIMockListCatalogRunsParamPtrs struct { + ctx *context.Context + pageSize *int64 + page *int64 + filter *filtering.Filter + order *ordering.OrderBy + catalogUID *string + requesterUID *string + isOwner *bool +} + +// RepositoryIMockListCatalogRunsResults contains results of the RepositoryI.ListCatalogRuns +type RepositoryIMockListCatalogRunsResults struct { + modelTriggers []*mm_repository.CatalogRun + totalSize int64 + err error +} + +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmListCatalogRuns *mRepositoryIMockListCatalogRuns) Optional() *mRepositoryIMockListCatalogRuns { + mmListCatalogRuns.optional = true + return mmListCatalogRuns +} + +// Expect sets up expected params for RepositoryI.ListCatalogRuns +func (mmListCatalogRuns *mRepositoryIMockListCatalogRuns) Expect(ctx context.Context, pageSize int64, page int64, filter filtering.Filter, order ordering.OrderBy, catalogUID string, requesterUID string, isOwner bool) *mRepositoryIMockListCatalogRuns { + if mmListCatalogRuns.mock.funcListCatalogRuns != nil { + mmListCatalogRuns.mock.t.Fatalf("RepositoryIMock.ListCatalogRuns mock is already set by Set") + } + + if mmListCatalogRuns.defaultExpectation == nil { + mmListCatalogRuns.defaultExpectation = &RepositoryIMockListCatalogRunsExpectation{} + } + + if mmListCatalogRuns.defaultExpectation.paramPtrs != nil { + mmListCatalogRuns.mock.t.Fatalf("RepositoryIMock.ListCatalogRuns mock is already set by ExpectParams functions") + } + + mmListCatalogRuns.defaultExpectation.params = &RepositoryIMockListCatalogRunsParams{ctx, pageSize, page, filter, order, catalogUID, requesterUID, isOwner} + for _, e := range mmListCatalogRuns.expectations { + if minimock.Equal(e.params, mmListCatalogRuns.defaultExpectation.params) { + mmListCatalogRuns.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmListCatalogRuns.defaultExpectation.params) + } + } + + return mmListCatalogRuns +} + +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.ListCatalogRuns +func (mmListCatalogRuns *mRepositoryIMockListCatalogRuns) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockListCatalogRuns { + if mmListCatalogRuns.mock.funcListCatalogRuns != nil { + mmListCatalogRuns.mock.t.Fatalf("RepositoryIMock.ListCatalogRuns mock is already set by Set") + } + + if mmListCatalogRuns.defaultExpectation == nil { + mmListCatalogRuns.defaultExpectation = &RepositoryIMockListCatalogRunsExpectation{} + } + + if mmListCatalogRuns.defaultExpectation.params != nil { + mmListCatalogRuns.mock.t.Fatalf("RepositoryIMock.ListCatalogRuns mock is already set by Expect") + } + + if mmListCatalogRuns.defaultExpectation.paramPtrs == nil { + mmListCatalogRuns.defaultExpectation.paramPtrs = &RepositoryIMockListCatalogRunsParamPtrs{} + } + mmListCatalogRuns.defaultExpectation.paramPtrs.ctx = &ctx + + return mmListCatalogRuns +} + +// ExpectPageSizeParam2 sets up expected param pageSize for RepositoryI.ListCatalogRuns +func (mmListCatalogRuns *mRepositoryIMockListCatalogRuns) ExpectPageSizeParam2(pageSize int64) *mRepositoryIMockListCatalogRuns { + if mmListCatalogRuns.mock.funcListCatalogRuns != nil { + mmListCatalogRuns.mock.t.Fatalf("RepositoryIMock.ListCatalogRuns mock is already set by Set") + } + + if mmListCatalogRuns.defaultExpectation == nil { + mmListCatalogRuns.defaultExpectation = &RepositoryIMockListCatalogRunsExpectation{} + } + + if mmListCatalogRuns.defaultExpectation.params != nil { + mmListCatalogRuns.mock.t.Fatalf("RepositoryIMock.ListCatalogRuns mock is already set by Expect") + } + + if mmListCatalogRuns.defaultExpectation.paramPtrs == nil { + mmListCatalogRuns.defaultExpectation.paramPtrs = &RepositoryIMockListCatalogRunsParamPtrs{} + } + mmListCatalogRuns.defaultExpectation.paramPtrs.pageSize = &pageSize + + return mmListCatalogRuns +} + +// ExpectPageParam3 sets up expected param page for RepositoryI.ListCatalogRuns +func (mmListCatalogRuns *mRepositoryIMockListCatalogRuns) ExpectPageParam3(page int64) *mRepositoryIMockListCatalogRuns { + if mmListCatalogRuns.mock.funcListCatalogRuns != nil { + mmListCatalogRuns.mock.t.Fatalf("RepositoryIMock.ListCatalogRuns mock is already set by Set") + } + + if mmListCatalogRuns.defaultExpectation == nil { + mmListCatalogRuns.defaultExpectation = &RepositoryIMockListCatalogRunsExpectation{} + } + + if mmListCatalogRuns.defaultExpectation.params != nil { + mmListCatalogRuns.mock.t.Fatalf("RepositoryIMock.ListCatalogRuns mock is already set by Expect") + } + + if mmListCatalogRuns.defaultExpectation.paramPtrs == nil { + mmListCatalogRuns.defaultExpectation.paramPtrs = &RepositoryIMockListCatalogRunsParamPtrs{} + } + mmListCatalogRuns.defaultExpectation.paramPtrs.page = &page + + return mmListCatalogRuns +} + +// ExpectFilterParam4 sets up expected param filter for RepositoryI.ListCatalogRuns +func (mmListCatalogRuns *mRepositoryIMockListCatalogRuns) ExpectFilterParam4(filter filtering.Filter) *mRepositoryIMockListCatalogRuns { + if mmListCatalogRuns.mock.funcListCatalogRuns != nil { + mmListCatalogRuns.mock.t.Fatalf("RepositoryIMock.ListCatalogRuns mock is already set by Set") + } + + if mmListCatalogRuns.defaultExpectation == nil { + mmListCatalogRuns.defaultExpectation = &RepositoryIMockListCatalogRunsExpectation{} + } + + if mmListCatalogRuns.defaultExpectation.params != nil { + mmListCatalogRuns.mock.t.Fatalf("RepositoryIMock.ListCatalogRuns mock is already set by Expect") + } + + if mmListCatalogRuns.defaultExpectation.paramPtrs == nil { + mmListCatalogRuns.defaultExpectation.paramPtrs = &RepositoryIMockListCatalogRunsParamPtrs{} + } + mmListCatalogRuns.defaultExpectation.paramPtrs.filter = &filter + + return mmListCatalogRuns +} + +// ExpectOrderParam5 sets up expected param order for RepositoryI.ListCatalogRuns +func (mmListCatalogRuns *mRepositoryIMockListCatalogRuns) ExpectOrderParam5(order ordering.OrderBy) *mRepositoryIMockListCatalogRuns { + if mmListCatalogRuns.mock.funcListCatalogRuns != nil { + mmListCatalogRuns.mock.t.Fatalf("RepositoryIMock.ListCatalogRuns mock is already set by Set") + } + + if mmListCatalogRuns.defaultExpectation == nil { + mmListCatalogRuns.defaultExpectation = &RepositoryIMockListCatalogRunsExpectation{} + } + + if mmListCatalogRuns.defaultExpectation.params != nil { + mmListCatalogRuns.mock.t.Fatalf("RepositoryIMock.ListCatalogRuns mock is already set by Expect") + } + + if mmListCatalogRuns.defaultExpectation.paramPtrs == nil { + mmListCatalogRuns.defaultExpectation.paramPtrs = &RepositoryIMockListCatalogRunsParamPtrs{} + } + mmListCatalogRuns.defaultExpectation.paramPtrs.order = &order + + return mmListCatalogRuns +} + +// ExpectCatalogUIDParam6 sets up expected param catalogUID for RepositoryI.ListCatalogRuns +func (mmListCatalogRuns *mRepositoryIMockListCatalogRuns) ExpectCatalogUIDParam6(catalogUID string) *mRepositoryIMockListCatalogRuns { + if mmListCatalogRuns.mock.funcListCatalogRuns != nil { + mmListCatalogRuns.mock.t.Fatalf("RepositoryIMock.ListCatalogRuns mock is already set by Set") + } + + if mmListCatalogRuns.defaultExpectation == nil { + mmListCatalogRuns.defaultExpectation = &RepositoryIMockListCatalogRunsExpectation{} + } + + if mmListCatalogRuns.defaultExpectation.params != nil { + mmListCatalogRuns.mock.t.Fatalf("RepositoryIMock.ListCatalogRuns mock is already set by Expect") + } + + if mmListCatalogRuns.defaultExpectation.paramPtrs == nil { + mmListCatalogRuns.defaultExpectation.paramPtrs = &RepositoryIMockListCatalogRunsParamPtrs{} + } + mmListCatalogRuns.defaultExpectation.paramPtrs.catalogUID = &catalogUID + + return mmListCatalogRuns +} + +// ExpectRequesterUIDParam7 sets up expected param requesterUID for RepositoryI.ListCatalogRuns +func (mmListCatalogRuns *mRepositoryIMockListCatalogRuns) ExpectRequesterUIDParam7(requesterUID string) *mRepositoryIMockListCatalogRuns { + if mmListCatalogRuns.mock.funcListCatalogRuns != nil { + mmListCatalogRuns.mock.t.Fatalf("RepositoryIMock.ListCatalogRuns mock is already set by Set") + } + + if mmListCatalogRuns.defaultExpectation == nil { + mmListCatalogRuns.defaultExpectation = &RepositoryIMockListCatalogRunsExpectation{} + } + + if mmListCatalogRuns.defaultExpectation.params != nil { + mmListCatalogRuns.mock.t.Fatalf("RepositoryIMock.ListCatalogRuns mock is already set by Expect") + } + + if mmListCatalogRuns.defaultExpectation.paramPtrs == nil { + mmListCatalogRuns.defaultExpectation.paramPtrs = &RepositoryIMockListCatalogRunsParamPtrs{} + } + mmListCatalogRuns.defaultExpectation.paramPtrs.requesterUID = &requesterUID + + return mmListCatalogRuns +} + +// ExpectIsOwnerParam8 sets up expected param isOwner for RepositoryI.ListCatalogRuns +func (mmListCatalogRuns *mRepositoryIMockListCatalogRuns) ExpectIsOwnerParam8(isOwner bool) *mRepositoryIMockListCatalogRuns { + if mmListCatalogRuns.mock.funcListCatalogRuns != nil { + mmListCatalogRuns.mock.t.Fatalf("RepositoryIMock.ListCatalogRuns mock is already set by Set") + } + + if mmListCatalogRuns.defaultExpectation == nil { + mmListCatalogRuns.defaultExpectation = &RepositoryIMockListCatalogRunsExpectation{} + } + + if mmListCatalogRuns.defaultExpectation.params != nil { + mmListCatalogRuns.mock.t.Fatalf("RepositoryIMock.ListCatalogRuns mock is already set by Expect") + } + + if mmListCatalogRuns.defaultExpectation.paramPtrs == nil { + mmListCatalogRuns.defaultExpectation.paramPtrs = &RepositoryIMockListCatalogRunsParamPtrs{} + } + mmListCatalogRuns.defaultExpectation.paramPtrs.isOwner = &isOwner + + return mmListCatalogRuns +} + +// Inspect accepts an inspector function that has same arguments as the RepositoryI.ListCatalogRuns +func (mmListCatalogRuns *mRepositoryIMockListCatalogRuns) Inspect(f func(ctx context.Context, pageSize int64, page int64, filter filtering.Filter, order ordering.OrderBy, catalogUID string, requesterUID string, isOwner bool)) *mRepositoryIMockListCatalogRuns { + if mmListCatalogRuns.mock.inspectFuncListCatalogRuns != nil { + mmListCatalogRuns.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.ListCatalogRuns") + } + + mmListCatalogRuns.mock.inspectFuncListCatalogRuns = f + + return mmListCatalogRuns +} + +// Return sets up results that will be returned by RepositoryI.ListCatalogRuns +func (mmListCatalogRuns *mRepositoryIMockListCatalogRuns) Return(modelTriggers []*mm_repository.CatalogRun, totalSize int64, err error) *RepositoryIMock { + if mmListCatalogRuns.mock.funcListCatalogRuns != nil { + mmListCatalogRuns.mock.t.Fatalf("RepositoryIMock.ListCatalogRuns mock is already set by Set") + } + + if mmListCatalogRuns.defaultExpectation == nil { + mmListCatalogRuns.defaultExpectation = &RepositoryIMockListCatalogRunsExpectation{mock: mmListCatalogRuns.mock} + } + mmListCatalogRuns.defaultExpectation.results = &RepositoryIMockListCatalogRunsResults{modelTriggers, totalSize, err} + return mmListCatalogRuns.mock +} + +// Set uses given function f to mock the RepositoryI.ListCatalogRuns method +func (mmListCatalogRuns *mRepositoryIMockListCatalogRuns) Set(f func(ctx context.Context, pageSize int64, page int64, filter filtering.Filter, order ordering.OrderBy, catalogUID string, requesterUID string, isOwner bool) (modelTriggers []*mm_repository.CatalogRun, totalSize int64, err error)) *RepositoryIMock { + if mmListCatalogRuns.defaultExpectation != nil { + mmListCatalogRuns.mock.t.Fatalf("Default expectation is already set for the RepositoryI.ListCatalogRuns method") + } + + if len(mmListCatalogRuns.expectations) > 0 { + mmListCatalogRuns.mock.t.Fatalf("Some expectations are already set for the RepositoryI.ListCatalogRuns method") + } + + mmListCatalogRuns.mock.funcListCatalogRuns = f + return mmListCatalogRuns.mock +} + +// When sets expectation for the RepositoryI.ListCatalogRuns which will trigger the result defined by the following +// Then helper +func (mmListCatalogRuns *mRepositoryIMockListCatalogRuns) When(ctx context.Context, pageSize int64, page int64, filter filtering.Filter, order ordering.OrderBy, catalogUID string, requesterUID string, isOwner bool) *RepositoryIMockListCatalogRunsExpectation { + if mmListCatalogRuns.mock.funcListCatalogRuns != nil { + mmListCatalogRuns.mock.t.Fatalf("RepositoryIMock.ListCatalogRuns mock is already set by Set") + } + + expectation := &RepositoryIMockListCatalogRunsExpectation{ + mock: mmListCatalogRuns.mock, + params: &RepositoryIMockListCatalogRunsParams{ctx, pageSize, page, filter, order, catalogUID, requesterUID, isOwner}, + } + mmListCatalogRuns.expectations = append(mmListCatalogRuns.expectations, expectation) + return expectation +} + +// Then sets up RepositoryI.ListCatalogRuns return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockListCatalogRunsExpectation) Then(modelTriggers []*mm_repository.CatalogRun, totalSize int64, err error) *RepositoryIMock { + e.results = &RepositoryIMockListCatalogRunsResults{modelTriggers, totalSize, err} + return e.mock +} + +// Times sets number of times RepositoryI.ListCatalogRuns should be invoked +func (mmListCatalogRuns *mRepositoryIMockListCatalogRuns) Times(n uint64) *mRepositoryIMockListCatalogRuns { + if n == 0 { + mmListCatalogRuns.mock.t.Fatalf("Times of RepositoryIMock.ListCatalogRuns mock can not be zero") + } + mm_atomic.StoreUint64(&mmListCatalogRuns.expectedInvocations, n) + return mmListCatalogRuns +} + +func (mmListCatalogRuns *mRepositoryIMockListCatalogRuns) invocationsDone() bool { + if len(mmListCatalogRuns.expectations) == 0 && mmListCatalogRuns.defaultExpectation == nil && mmListCatalogRuns.mock.funcListCatalogRuns == nil { + return true + } + + totalInvocations := mm_atomic.LoadUint64(&mmListCatalogRuns.mock.afterListCatalogRunsCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmListCatalogRuns.expectedInvocations) + + return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) +} + +// ListCatalogRuns implements repository.RepositoryI +func (mmListCatalogRuns *RepositoryIMock) ListCatalogRuns(ctx context.Context, pageSize int64, page int64, filter filtering.Filter, order ordering.OrderBy, catalogUID string, requesterUID string, isOwner bool) (modelTriggers []*mm_repository.CatalogRun, totalSize int64, err error) { + mm_atomic.AddUint64(&mmListCatalogRuns.beforeListCatalogRunsCounter, 1) + defer mm_atomic.AddUint64(&mmListCatalogRuns.afterListCatalogRunsCounter, 1) + + if mmListCatalogRuns.inspectFuncListCatalogRuns != nil { + mmListCatalogRuns.inspectFuncListCatalogRuns(ctx, pageSize, page, filter, order, catalogUID, requesterUID, isOwner) + } + + mm_params := RepositoryIMockListCatalogRunsParams{ctx, pageSize, page, filter, order, catalogUID, requesterUID, isOwner} + + // Record call args + mmListCatalogRuns.ListCatalogRunsMock.mutex.Lock() + mmListCatalogRuns.ListCatalogRunsMock.callArgs = append(mmListCatalogRuns.ListCatalogRunsMock.callArgs, &mm_params) + mmListCatalogRuns.ListCatalogRunsMock.mutex.Unlock() + + for _, e := range mmListCatalogRuns.ListCatalogRunsMock.expectations { + if minimock.Equal(*e.params, mm_params) { + mm_atomic.AddUint64(&e.Counter, 1) + return e.results.modelTriggers, e.results.totalSize, e.results.err + } + } + + if mmListCatalogRuns.ListCatalogRunsMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmListCatalogRuns.ListCatalogRunsMock.defaultExpectation.Counter, 1) + mm_want := mmListCatalogRuns.ListCatalogRunsMock.defaultExpectation.params + mm_want_ptrs := mmListCatalogRuns.ListCatalogRunsMock.defaultExpectation.paramPtrs + + mm_got := RepositoryIMockListCatalogRunsParams{ctx, pageSize, page, filter, order, catalogUID, requesterUID, isOwner} + + if mm_want_ptrs != nil { + + if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { + mmListCatalogRuns.t.Errorf("RepositoryIMock.ListCatalogRuns got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + } + + if mm_want_ptrs.pageSize != nil && !minimock.Equal(*mm_want_ptrs.pageSize, mm_got.pageSize) { + mmListCatalogRuns.t.Errorf("RepositoryIMock.ListCatalogRuns got unexpected parameter pageSize, want: %#v, got: %#v%s\n", *mm_want_ptrs.pageSize, mm_got.pageSize, minimock.Diff(*mm_want_ptrs.pageSize, mm_got.pageSize)) + } + + if mm_want_ptrs.page != nil && !minimock.Equal(*mm_want_ptrs.page, mm_got.page) { + mmListCatalogRuns.t.Errorf("RepositoryIMock.ListCatalogRuns got unexpected parameter page, want: %#v, got: %#v%s\n", *mm_want_ptrs.page, mm_got.page, minimock.Diff(*mm_want_ptrs.page, mm_got.page)) + } + + if mm_want_ptrs.filter != nil && !minimock.Equal(*mm_want_ptrs.filter, mm_got.filter) { + mmListCatalogRuns.t.Errorf("RepositoryIMock.ListCatalogRuns got unexpected parameter filter, want: %#v, got: %#v%s\n", *mm_want_ptrs.filter, mm_got.filter, minimock.Diff(*mm_want_ptrs.filter, mm_got.filter)) + } + + if mm_want_ptrs.order != nil && !minimock.Equal(*mm_want_ptrs.order, mm_got.order) { + mmListCatalogRuns.t.Errorf("RepositoryIMock.ListCatalogRuns got unexpected parameter order, want: %#v, got: %#v%s\n", *mm_want_ptrs.order, mm_got.order, minimock.Diff(*mm_want_ptrs.order, mm_got.order)) + } + + if mm_want_ptrs.catalogUID != nil && !minimock.Equal(*mm_want_ptrs.catalogUID, mm_got.catalogUID) { + mmListCatalogRuns.t.Errorf("RepositoryIMock.ListCatalogRuns got unexpected parameter catalogUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.catalogUID, mm_got.catalogUID, minimock.Diff(*mm_want_ptrs.catalogUID, mm_got.catalogUID)) + } + + if mm_want_ptrs.requesterUID != nil && !minimock.Equal(*mm_want_ptrs.requesterUID, mm_got.requesterUID) { + mmListCatalogRuns.t.Errorf("RepositoryIMock.ListCatalogRuns got unexpected parameter requesterUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.requesterUID, mm_got.requesterUID, minimock.Diff(*mm_want_ptrs.requesterUID, mm_got.requesterUID)) + } + + if mm_want_ptrs.isOwner != nil && !minimock.Equal(*mm_want_ptrs.isOwner, mm_got.isOwner) { + mmListCatalogRuns.t.Errorf("RepositoryIMock.ListCatalogRuns got unexpected parameter isOwner, want: %#v, got: %#v%s\n", *mm_want_ptrs.isOwner, mm_got.isOwner, minimock.Diff(*mm_want_ptrs.isOwner, mm_got.isOwner)) + } + + } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { + mmListCatalogRuns.t.Errorf("RepositoryIMock.ListCatalogRuns got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + } + + mm_results := mmListCatalogRuns.ListCatalogRunsMock.defaultExpectation.results + if mm_results == nil { + mmListCatalogRuns.t.Fatal("No results are set for the RepositoryIMock.ListCatalogRuns") + } + return (*mm_results).modelTriggers, (*mm_results).totalSize, (*mm_results).err + } + if mmListCatalogRuns.funcListCatalogRuns != nil { + return mmListCatalogRuns.funcListCatalogRuns(ctx, pageSize, page, filter, order, catalogUID, requesterUID, isOwner) + } + mmListCatalogRuns.t.Fatalf("Unexpected call to RepositoryIMock.ListCatalogRuns. %v %v %v %v %v %v %v %v", ctx, pageSize, page, filter, order, catalogUID, requesterUID, isOwner) + return +} + +// ListCatalogRunsAfterCounter returns a count of finished RepositoryIMock.ListCatalogRuns invocations +func (mmListCatalogRuns *RepositoryIMock) ListCatalogRunsAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmListCatalogRuns.afterListCatalogRunsCounter) +} + +// ListCatalogRunsBeforeCounter returns a count of RepositoryIMock.ListCatalogRuns invocations +func (mmListCatalogRuns *RepositoryIMock) ListCatalogRunsBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmListCatalogRuns.beforeListCatalogRunsCounter) +} + +// Calls returns a list of arguments used in each call to RepositoryIMock.ListCatalogRuns. +// The list is in the same order as the calls were made (i.e. recent calls have a higher index) +func (mmListCatalogRuns *mRepositoryIMockListCatalogRuns) Calls() []*RepositoryIMockListCatalogRunsParams { + mmListCatalogRuns.mutex.RLock() + + argCopy := make([]*RepositoryIMockListCatalogRunsParams, len(mmListCatalogRuns.callArgs)) + copy(argCopy, mmListCatalogRuns.callArgs) + + mmListCatalogRuns.mutex.RUnlock() + + return argCopy +} + +// MinimockListCatalogRunsDone returns true if the count of the ListCatalogRuns invocations corresponds +// the number of defined expectations +func (m *RepositoryIMock) MinimockListCatalogRunsDone() bool { + if m.ListCatalogRunsMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + + for _, e := range m.ListCatalogRunsMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + return false + } + } + + return m.ListCatalogRunsMock.invocationsDone() +} + +// MinimockListCatalogRunsInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockListCatalogRunsInspect() { + for _, e := range m.ListCatalogRunsMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + m.t.Errorf("Expected call to RepositoryIMock.ListCatalogRuns with params: %#v", *e.params) + } + } + + afterListCatalogRunsCounter := mm_atomic.LoadUint64(&m.afterListCatalogRunsCounter) + // if default expectation was set then invocations count should be greater than zero + if m.ListCatalogRunsMock.defaultExpectation != nil && afterListCatalogRunsCounter < 1 { + if m.ListCatalogRunsMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.ListCatalogRuns") + } else { + m.t.Errorf("Expected call to RepositoryIMock.ListCatalogRuns with params: %#v", *m.ListCatalogRunsMock.defaultExpectation.params) + } + } + // if func was set then invocations count should be greater than zero + if m.funcListCatalogRuns != nil && afterListCatalogRunsCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.ListCatalogRuns") + } + + if !m.ListCatalogRunsMock.invocationsDone() && afterListCatalogRunsCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.ListCatalogRuns but found %d calls", + mm_atomic.LoadUint64(&m.ListCatalogRunsMock.expectedInvocations), afterListCatalogRunsCounter) + } +} + +type mRepositoryIMockListChunksByKbFileUID struct { + optional bool + mock *RepositoryIMock + defaultExpectation *RepositoryIMockListChunksByKbFileUIDExpectation + expectations []*RepositoryIMockListChunksByKbFileUIDExpectation + + callArgs []*RepositoryIMockListChunksByKbFileUIDParams + mutex sync.RWMutex + + expectedInvocations uint64 +} + +// RepositoryIMockListChunksByKbFileUIDExpectation specifies expectation struct of the RepositoryI.ListChunksByKbFileUID +type RepositoryIMockListChunksByKbFileUIDExpectation struct { + mock *RepositoryIMock + params *RepositoryIMockListChunksByKbFileUIDParams + paramPtrs *RepositoryIMockListChunksByKbFileUIDParamPtrs + results *RepositoryIMockListChunksByKbFileUIDResults Counter uint64 } @@ -12593,6 +13740,16 @@ type RepositoryIMockListChunksByKbFileUIDResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmListChunksByKbFileUID *mRepositoryIMockListChunksByKbFileUID) Optional() *mRepositoryIMockListChunksByKbFileUID { + mmListChunksByKbFileUID.optional = true + return mmListChunksByKbFileUID +} + // Expect sets up expected params for RepositoryI.ListChunksByKbFileUID func (mmListChunksByKbFileUID *mRepositoryIMockListChunksByKbFileUID) Expect(ctx context.Context, kbFileUID uuid.UUID) *mRepositoryIMockListChunksByKbFileUID { if mmListChunksByKbFileUID.mock.funcListChunksByKbFileUID != nil { @@ -12823,6 +13980,11 @@ func (mmListChunksByKbFileUID *mRepositoryIMockListChunksByKbFileUID) Calls() [] // MinimockListChunksByKbFileUIDDone returns true if the count of the ListChunksByKbFileUID invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockListChunksByKbFileUIDDone() bool { + if m.ListChunksByKbFileUIDMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.ListChunksByKbFileUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -12861,6 +14023,7 @@ func (m *RepositoryIMock) MinimockListChunksByKbFileUIDInspect() { } type mRepositoryIMockListEmbeddingsByKbFileUID struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockListEmbeddingsByKbFileUIDExpectation expectations []*RepositoryIMockListEmbeddingsByKbFileUIDExpectation @@ -12898,6 +14061,16 @@ type RepositoryIMockListEmbeddingsByKbFileUIDResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmListEmbeddingsByKbFileUID *mRepositoryIMockListEmbeddingsByKbFileUID) Optional() *mRepositoryIMockListEmbeddingsByKbFileUID { + mmListEmbeddingsByKbFileUID.optional = true + return mmListEmbeddingsByKbFileUID +} + // Expect sets up expected params for RepositoryI.ListEmbeddingsByKbFileUID func (mmListEmbeddingsByKbFileUID *mRepositoryIMockListEmbeddingsByKbFileUID) Expect(ctx context.Context, kbFileUID uuid.UUID) *mRepositoryIMockListEmbeddingsByKbFileUID { if mmListEmbeddingsByKbFileUID.mock.funcListEmbeddingsByKbFileUID != nil { @@ -13128,6 +14301,11 @@ func (mmListEmbeddingsByKbFileUID *mRepositoryIMockListEmbeddingsByKbFileUID) Ca // MinimockListEmbeddingsByKbFileUIDDone returns true if the count of the ListEmbeddingsByKbFileUID invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockListEmbeddingsByKbFileUIDDone() bool { + if m.ListEmbeddingsByKbFileUIDMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.ListEmbeddingsByKbFileUIDMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -13166,6 +14344,7 @@ func (m *RepositoryIMock) MinimockListEmbeddingsByKbFileUIDInspect() { } type mRepositoryIMockListKnowledgeBaseFiles struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockListKnowledgeBaseFilesExpectation expectations []*RepositoryIMockListKnowledgeBaseFilesExpectation @@ -13215,6 +14394,16 @@ type RepositoryIMockListKnowledgeBaseFilesResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) Optional() *mRepositoryIMockListKnowledgeBaseFiles { + mmListKnowledgeBaseFiles.optional = true + return mmListKnowledgeBaseFiles +} + // Expect sets up expected params for RepositoryI.ListKnowledgeBaseFiles func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) Expect(ctx context.Context, uid string, ownerUID string, kbUID string, pageSize int32, nextPageToken string, filesUID []string) *mRepositoryIMockListKnowledgeBaseFiles { if mmListKnowledgeBaseFiles.mock.funcListKnowledgeBaseFiles != nil { @@ -13575,6 +14764,11 @@ func (mmListKnowledgeBaseFiles *mRepositoryIMockListKnowledgeBaseFiles) Calls() // MinimockListKnowledgeBaseFilesDone returns true if the count of the ListKnowledgeBaseFiles invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockListKnowledgeBaseFilesDone() bool { + if m.ListKnowledgeBaseFilesMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.ListKnowledgeBaseFilesMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -13613,6 +14807,7 @@ func (m *RepositoryIMock) MinimockListKnowledgeBaseFilesInspect() { } type mRepositoryIMockListKnowledgeBases struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockListKnowledgeBasesExpectation expectations []*RepositoryIMockListKnowledgeBasesExpectation @@ -13650,6 +14845,16 @@ type RepositoryIMockListKnowledgeBasesResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmListKnowledgeBases *mRepositoryIMockListKnowledgeBases) Optional() *mRepositoryIMockListKnowledgeBases { + mmListKnowledgeBases.optional = true + return mmListKnowledgeBases +} + // Expect sets up expected params for RepositoryI.ListKnowledgeBases func (mmListKnowledgeBases *mRepositoryIMockListKnowledgeBases) Expect(ctx context.Context, ownerUID string) *mRepositoryIMockListKnowledgeBases { if mmListKnowledgeBases.mock.funcListKnowledgeBases != nil { @@ -13880,6 +15085,11 @@ func (mmListKnowledgeBases *mRepositoryIMockListKnowledgeBases) Calls() []*Repos // MinimockListKnowledgeBasesDone returns true if the count of the ListKnowledgeBases invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockListKnowledgeBasesDone() bool { + if m.ListKnowledgeBasesMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.ListKnowledgeBasesMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -13918,6 +15128,7 @@ func (m *RepositoryIMock) MinimockListKnowledgeBasesInspect() { } type mRepositoryIMockProcessKnowledgeBaseFiles struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockProcessKnowledgeBaseFilesExpectation expectations []*RepositoryIMockProcessKnowledgeBaseFilesExpectation @@ -13957,6 +15168,16 @@ type RepositoryIMockProcessKnowledgeBaseFilesResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmProcessKnowledgeBaseFiles *mRepositoryIMockProcessKnowledgeBaseFiles) Optional() *mRepositoryIMockProcessKnowledgeBaseFiles { + mmProcessKnowledgeBaseFiles.optional = true + return mmProcessKnowledgeBaseFiles +} + // Expect sets up expected params for RepositoryI.ProcessKnowledgeBaseFiles func (mmProcessKnowledgeBaseFiles *mRepositoryIMockProcessKnowledgeBaseFiles) Expect(ctx context.Context, fileUIDs []string, requester uuid.UUID) *mRepositoryIMockProcessKnowledgeBaseFiles { if mmProcessKnowledgeBaseFiles.mock.funcProcessKnowledgeBaseFiles != nil { @@ -14213,6 +15434,11 @@ func (mmProcessKnowledgeBaseFiles *mRepositoryIMockProcessKnowledgeBaseFiles) Ca // MinimockProcessKnowledgeBaseFilesDone returns true if the count of the ProcessKnowledgeBaseFiles invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockProcessKnowledgeBaseFilesDone() bool { + if m.ProcessKnowledgeBaseFilesMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.ProcessKnowledgeBaseFilesMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -14251,6 +15477,7 @@ func (m *RepositoryIMock) MinimockProcessKnowledgeBaseFilesInspect() { } type mRepositoryIMockTextChunkTableName struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockTextChunkTableNameExpectation expectations []*RepositoryIMockTextChunkTableNameExpectation @@ -14271,6 +15498,16 @@ type RepositoryIMockTextChunkTableNameResults struct { s1 string } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmTextChunkTableName *mRepositoryIMockTextChunkTableName) Optional() *mRepositoryIMockTextChunkTableName { + mmTextChunkTableName.optional = true + return mmTextChunkTableName +} + // Expect sets up expected params for RepositoryI.TextChunkTableName func (mmTextChunkTableName *mRepositoryIMockTextChunkTableName) Expect() *mRepositoryIMockTextChunkTableName { if mmTextChunkTableName.mock.funcTextChunkTableName != nil { @@ -14339,81 +15576,435 @@ func (mmTextChunkTableName *mRepositoryIMockTextChunkTableName) invocationsDone( totalInvocations := mm_atomic.LoadUint64(&mmTextChunkTableName.mock.afterTextChunkTableNameCounter) expectedInvocations := mm_atomic.LoadUint64(&mmTextChunkTableName.expectedInvocations) - return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) -} + return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) +} + +// TextChunkTableName implements repository.RepositoryI +func (mmTextChunkTableName *RepositoryIMock) TextChunkTableName() (s1 string) { + mm_atomic.AddUint64(&mmTextChunkTableName.beforeTextChunkTableNameCounter, 1) + defer mm_atomic.AddUint64(&mmTextChunkTableName.afterTextChunkTableNameCounter, 1) + + if mmTextChunkTableName.inspectFuncTextChunkTableName != nil { + mmTextChunkTableName.inspectFuncTextChunkTableName() + } + + if mmTextChunkTableName.TextChunkTableNameMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmTextChunkTableName.TextChunkTableNameMock.defaultExpectation.Counter, 1) + + mm_results := mmTextChunkTableName.TextChunkTableNameMock.defaultExpectation.results + if mm_results == nil { + mmTextChunkTableName.t.Fatal("No results are set for the RepositoryIMock.TextChunkTableName") + } + return (*mm_results).s1 + } + if mmTextChunkTableName.funcTextChunkTableName != nil { + return mmTextChunkTableName.funcTextChunkTableName() + } + mmTextChunkTableName.t.Fatalf("Unexpected call to RepositoryIMock.TextChunkTableName.") + return +} + +// TextChunkTableNameAfterCounter returns a count of finished RepositoryIMock.TextChunkTableName invocations +func (mmTextChunkTableName *RepositoryIMock) TextChunkTableNameAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmTextChunkTableName.afterTextChunkTableNameCounter) +} + +// TextChunkTableNameBeforeCounter returns a count of RepositoryIMock.TextChunkTableName invocations +func (mmTextChunkTableName *RepositoryIMock) TextChunkTableNameBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmTextChunkTableName.beforeTextChunkTableNameCounter) +} + +// MinimockTextChunkTableNameDone returns true if the count of the TextChunkTableName invocations corresponds +// the number of defined expectations +func (m *RepositoryIMock) MinimockTextChunkTableNameDone() bool { + if m.TextChunkTableNameMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + + for _, e := range m.TextChunkTableNameMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + return false + } + } + + return m.TextChunkTableNameMock.invocationsDone() +} + +// MinimockTextChunkTableNameInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockTextChunkTableNameInspect() { + for _, e := range m.TextChunkTableNameMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + m.t.Error("Expected call to RepositoryIMock.TextChunkTableName") + } + } + + afterTextChunkTableNameCounter := mm_atomic.LoadUint64(&m.afterTextChunkTableNameCounter) + // if default expectation was set then invocations count should be greater than zero + if m.TextChunkTableNameMock.defaultExpectation != nil && afterTextChunkTableNameCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.TextChunkTableName") + } + // if func was set then invocations count should be greater than zero + if m.funcTextChunkTableName != nil && afterTextChunkTableNameCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.TextChunkTableName") + } + + if !m.TextChunkTableNameMock.invocationsDone() && afterTextChunkTableNameCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.TextChunkTableName but found %d calls", + mm_atomic.LoadUint64(&m.TextChunkTableNameMock.expectedInvocations), afterTextChunkTableNameCounter) + } +} + +type mRepositoryIMockUpdateCatalogRun struct { + optional bool + mock *RepositoryIMock + defaultExpectation *RepositoryIMockUpdateCatalogRunExpectation + expectations []*RepositoryIMockUpdateCatalogRunExpectation + + callArgs []*RepositoryIMockUpdateCatalogRunParams + mutex sync.RWMutex + + expectedInvocations uint64 +} + +// RepositoryIMockUpdateCatalogRunExpectation specifies expectation struct of the RepositoryI.UpdateCatalogRun +type RepositoryIMockUpdateCatalogRunExpectation struct { + mock *RepositoryIMock + params *RepositoryIMockUpdateCatalogRunParams + paramPtrs *RepositoryIMockUpdateCatalogRunParamPtrs + results *RepositoryIMockUpdateCatalogRunResults + Counter uint64 +} + +// RepositoryIMockUpdateCatalogRunParams contains parameters of the RepositoryI.UpdateCatalogRun +type RepositoryIMockUpdateCatalogRunParams struct { + ctx context.Context + runUID uuid.UUID + run *mm_repository.CatalogRun +} + +// RepositoryIMockUpdateCatalogRunParamPtrs contains pointers to parameters of the RepositoryI.UpdateCatalogRun +type RepositoryIMockUpdateCatalogRunParamPtrs struct { + ctx *context.Context + runUID *uuid.UUID + run **mm_repository.CatalogRun +} + +// RepositoryIMockUpdateCatalogRunResults contains results of the RepositoryI.UpdateCatalogRun +type RepositoryIMockUpdateCatalogRunResults struct { + err error +} + +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmUpdateCatalogRun *mRepositoryIMockUpdateCatalogRun) Optional() *mRepositoryIMockUpdateCatalogRun { + mmUpdateCatalogRun.optional = true + return mmUpdateCatalogRun +} + +// Expect sets up expected params for RepositoryI.UpdateCatalogRun +func (mmUpdateCatalogRun *mRepositoryIMockUpdateCatalogRun) Expect(ctx context.Context, runUID uuid.UUID, run *mm_repository.CatalogRun) *mRepositoryIMockUpdateCatalogRun { + if mmUpdateCatalogRun.mock.funcUpdateCatalogRun != nil { + mmUpdateCatalogRun.mock.t.Fatalf("RepositoryIMock.UpdateCatalogRun mock is already set by Set") + } + + if mmUpdateCatalogRun.defaultExpectation == nil { + mmUpdateCatalogRun.defaultExpectation = &RepositoryIMockUpdateCatalogRunExpectation{} + } + + if mmUpdateCatalogRun.defaultExpectation.paramPtrs != nil { + mmUpdateCatalogRun.mock.t.Fatalf("RepositoryIMock.UpdateCatalogRun mock is already set by ExpectParams functions") + } + + mmUpdateCatalogRun.defaultExpectation.params = &RepositoryIMockUpdateCatalogRunParams{ctx, runUID, run} + for _, e := range mmUpdateCatalogRun.expectations { + if minimock.Equal(e.params, mmUpdateCatalogRun.defaultExpectation.params) { + mmUpdateCatalogRun.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmUpdateCatalogRun.defaultExpectation.params) + } + } + + return mmUpdateCatalogRun +} + +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.UpdateCatalogRun +func (mmUpdateCatalogRun *mRepositoryIMockUpdateCatalogRun) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockUpdateCatalogRun { + if mmUpdateCatalogRun.mock.funcUpdateCatalogRun != nil { + mmUpdateCatalogRun.mock.t.Fatalf("RepositoryIMock.UpdateCatalogRun mock is already set by Set") + } + + if mmUpdateCatalogRun.defaultExpectation == nil { + mmUpdateCatalogRun.defaultExpectation = &RepositoryIMockUpdateCatalogRunExpectation{} + } + + if mmUpdateCatalogRun.defaultExpectation.params != nil { + mmUpdateCatalogRun.mock.t.Fatalf("RepositoryIMock.UpdateCatalogRun mock is already set by Expect") + } + + if mmUpdateCatalogRun.defaultExpectation.paramPtrs == nil { + mmUpdateCatalogRun.defaultExpectation.paramPtrs = &RepositoryIMockUpdateCatalogRunParamPtrs{} + } + mmUpdateCatalogRun.defaultExpectation.paramPtrs.ctx = &ctx + + return mmUpdateCatalogRun +} + +// ExpectRunUIDParam2 sets up expected param runUID for RepositoryI.UpdateCatalogRun +func (mmUpdateCatalogRun *mRepositoryIMockUpdateCatalogRun) ExpectRunUIDParam2(runUID uuid.UUID) *mRepositoryIMockUpdateCatalogRun { + if mmUpdateCatalogRun.mock.funcUpdateCatalogRun != nil { + mmUpdateCatalogRun.mock.t.Fatalf("RepositoryIMock.UpdateCatalogRun mock is already set by Set") + } + + if mmUpdateCatalogRun.defaultExpectation == nil { + mmUpdateCatalogRun.defaultExpectation = &RepositoryIMockUpdateCatalogRunExpectation{} + } + + if mmUpdateCatalogRun.defaultExpectation.params != nil { + mmUpdateCatalogRun.mock.t.Fatalf("RepositoryIMock.UpdateCatalogRun mock is already set by Expect") + } + + if mmUpdateCatalogRun.defaultExpectation.paramPtrs == nil { + mmUpdateCatalogRun.defaultExpectation.paramPtrs = &RepositoryIMockUpdateCatalogRunParamPtrs{} + } + mmUpdateCatalogRun.defaultExpectation.paramPtrs.runUID = &runUID + + return mmUpdateCatalogRun +} + +// ExpectRunParam3 sets up expected param run for RepositoryI.UpdateCatalogRun +func (mmUpdateCatalogRun *mRepositoryIMockUpdateCatalogRun) ExpectRunParam3(run *mm_repository.CatalogRun) *mRepositoryIMockUpdateCatalogRun { + if mmUpdateCatalogRun.mock.funcUpdateCatalogRun != nil { + mmUpdateCatalogRun.mock.t.Fatalf("RepositoryIMock.UpdateCatalogRun mock is already set by Set") + } + + if mmUpdateCatalogRun.defaultExpectation == nil { + mmUpdateCatalogRun.defaultExpectation = &RepositoryIMockUpdateCatalogRunExpectation{} + } + + if mmUpdateCatalogRun.defaultExpectation.params != nil { + mmUpdateCatalogRun.mock.t.Fatalf("RepositoryIMock.UpdateCatalogRun mock is already set by Expect") + } + + if mmUpdateCatalogRun.defaultExpectation.paramPtrs == nil { + mmUpdateCatalogRun.defaultExpectation.paramPtrs = &RepositoryIMockUpdateCatalogRunParamPtrs{} + } + mmUpdateCatalogRun.defaultExpectation.paramPtrs.run = &run + + return mmUpdateCatalogRun +} + +// Inspect accepts an inspector function that has same arguments as the RepositoryI.UpdateCatalogRun +func (mmUpdateCatalogRun *mRepositoryIMockUpdateCatalogRun) Inspect(f func(ctx context.Context, runUID uuid.UUID, run *mm_repository.CatalogRun)) *mRepositoryIMockUpdateCatalogRun { + if mmUpdateCatalogRun.mock.inspectFuncUpdateCatalogRun != nil { + mmUpdateCatalogRun.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.UpdateCatalogRun") + } + + mmUpdateCatalogRun.mock.inspectFuncUpdateCatalogRun = f + + return mmUpdateCatalogRun +} + +// Return sets up results that will be returned by RepositoryI.UpdateCatalogRun +func (mmUpdateCatalogRun *mRepositoryIMockUpdateCatalogRun) Return(err error) *RepositoryIMock { + if mmUpdateCatalogRun.mock.funcUpdateCatalogRun != nil { + mmUpdateCatalogRun.mock.t.Fatalf("RepositoryIMock.UpdateCatalogRun mock is already set by Set") + } + + if mmUpdateCatalogRun.defaultExpectation == nil { + mmUpdateCatalogRun.defaultExpectation = &RepositoryIMockUpdateCatalogRunExpectation{mock: mmUpdateCatalogRun.mock} + } + mmUpdateCatalogRun.defaultExpectation.results = &RepositoryIMockUpdateCatalogRunResults{err} + return mmUpdateCatalogRun.mock +} + +// Set uses given function f to mock the RepositoryI.UpdateCatalogRun method +func (mmUpdateCatalogRun *mRepositoryIMockUpdateCatalogRun) Set(f func(ctx context.Context, runUID uuid.UUID, run *mm_repository.CatalogRun) (err error)) *RepositoryIMock { + if mmUpdateCatalogRun.defaultExpectation != nil { + mmUpdateCatalogRun.mock.t.Fatalf("Default expectation is already set for the RepositoryI.UpdateCatalogRun method") + } + + if len(mmUpdateCatalogRun.expectations) > 0 { + mmUpdateCatalogRun.mock.t.Fatalf("Some expectations are already set for the RepositoryI.UpdateCatalogRun method") + } + + mmUpdateCatalogRun.mock.funcUpdateCatalogRun = f + return mmUpdateCatalogRun.mock +} + +// When sets expectation for the RepositoryI.UpdateCatalogRun which will trigger the result defined by the following +// Then helper +func (mmUpdateCatalogRun *mRepositoryIMockUpdateCatalogRun) When(ctx context.Context, runUID uuid.UUID, run *mm_repository.CatalogRun) *RepositoryIMockUpdateCatalogRunExpectation { + if mmUpdateCatalogRun.mock.funcUpdateCatalogRun != nil { + mmUpdateCatalogRun.mock.t.Fatalf("RepositoryIMock.UpdateCatalogRun mock is already set by Set") + } + + expectation := &RepositoryIMockUpdateCatalogRunExpectation{ + mock: mmUpdateCatalogRun.mock, + params: &RepositoryIMockUpdateCatalogRunParams{ctx, runUID, run}, + } + mmUpdateCatalogRun.expectations = append(mmUpdateCatalogRun.expectations, expectation) + return expectation +} + +// Then sets up RepositoryI.UpdateCatalogRun return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockUpdateCatalogRunExpectation) Then(err error) *RepositoryIMock { + e.results = &RepositoryIMockUpdateCatalogRunResults{err} + return e.mock +} + +// Times sets number of times RepositoryI.UpdateCatalogRun should be invoked +func (mmUpdateCatalogRun *mRepositoryIMockUpdateCatalogRun) Times(n uint64) *mRepositoryIMockUpdateCatalogRun { + if n == 0 { + mmUpdateCatalogRun.mock.t.Fatalf("Times of RepositoryIMock.UpdateCatalogRun mock can not be zero") + } + mm_atomic.StoreUint64(&mmUpdateCatalogRun.expectedInvocations, n) + return mmUpdateCatalogRun +} + +func (mmUpdateCatalogRun *mRepositoryIMockUpdateCatalogRun) invocationsDone() bool { + if len(mmUpdateCatalogRun.expectations) == 0 && mmUpdateCatalogRun.defaultExpectation == nil && mmUpdateCatalogRun.mock.funcUpdateCatalogRun == nil { + return true + } + + totalInvocations := mm_atomic.LoadUint64(&mmUpdateCatalogRun.mock.afterUpdateCatalogRunCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmUpdateCatalogRun.expectedInvocations) + + return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) +} + +// UpdateCatalogRun implements repository.RepositoryI +func (mmUpdateCatalogRun *RepositoryIMock) UpdateCatalogRun(ctx context.Context, runUID uuid.UUID, run *mm_repository.CatalogRun) (err error) { + mm_atomic.AddUint64(&mmUpdateCatalogRun.beforeUpdateCatalogRunCounter, 1) + defer mm_atomic.AddUint64(&mmUpdateCatalogRun.afterUpdateCatalogRunCounter, 1) + + if mmUpdateCatalogRun.inspectFuncUpdateCatalogRun != nil { + mmUpdateCatalogRun.inspectFuncUpdateCatalogRun(ctx, runUID, run) + } + + mm_params := RepositoryIMockUpdateCatalogRunParams{ctx, runUID, run} + + // Record call args + mmUpdateCatalogRun.UpdateCatalogRunMock.mutex.Lock() + mmUpdateCatalogRun.UpdateCatalogRunMock.callArgs = append(mmUpdateCatalogRun.UpdateCatalogRunMock.callArgs, &mm_params) + mmUpdateCatalogRun.UpdateCatalogRunMock.mutex.Unlock() + + for _, e := range mmUpdateCatalogRun.UpdateCatalogRunMock.expectations { + if minimock.Equal(*e.params, mm_params) { + mm_atomic.AddUint64(&e.Counter, 1) + return e.results.err + } + } + + if mmUpdateCatalogRun.UpdateCatalogRunMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmUpdateCatalogRun.UpdateCatalogRunMock.defaultExpectation.Counter, 1) + mm_want := mmUpdateCatalogRun.UpdateCatalogRunMock.defaultExpectation.params + mm_want_ptrs := mmUpdateCatalogRun.UpdateCatalogRunMock.defaultExpectation.paramPtrs + + mm_got := RepositoryIMockUpdateCatalogRunParams{ctx, runUID, run} + + if mm_want_ptrs != nil { + + if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { + mmUpdateCatalogRun.t.Errorf("RepositoryIMock.UpdateCatalogRun got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + } -// TextChunkTableName implements repository.RepositoryI -func (mmTextChunkTableName *RepositoryIMock) TextChunkTableName() (s1 string) { - mm_atomic.AddUint64(&mmTextChunkTableName.beforeTextChunkTableNameCounter, 1) - defer mm_atomic.AddUint64(&mmTextChunkTableName.afterTextChunkTableNameCounter, 1) + if mm_want_ptrs.runUID != nil && !minimock.Equal(*mm_want_ptrs.runUID, mm_got.runUID) { + mmUpdateCatalogRun.t.Errorf("RepositoryIMock.UpdateCatalogRun got unexpected parameter runUID, want: %#v, got: %#v%s\n", *mm_want_ptrs.runUID, mm_got.runUID, minimock.Diff(*mm_want_ptrs.runUID, mm_got.runUID)) + } - if mmTextChunkTableName.inspectFuncTextChunkTableName != nil { - mmTextChunkTableName.inspectFuncTextChunkTableName() - } + if mm_want_ptrs.run != nil && !minimock.Equal(*mm_want_ptrs.run, mm_got.run) { + mmUpdateCatalogRun.t.Errorf("RepositoryIMock.UpdateCatalogRun got unexpected parameter run, want: %#v, got: %#v%s\n", *mm_want_ptrs.run, mm_got.run, minimock.Diff(*mm_want_ptrs.run, mm_got.run)) + } - if mmTextChunkTableName.TextChunkTableNameMock.defaultExpectation != nil { - mm_atomic.AddUint64(&mmTextChunkTableName.TextChunkTableNameMock.defaultExpectation.Counter, 1) + } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { + mmUpdateCatalogRun.t.Errorf("RepositoryIMock.UpdateCatalogRun got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + } - mm_results := mmTextChunkTableName.TextChunkTableNameMock.defaultExpectation.results + mm_results := mmUpdateCatalogRun.UpdateCatalogRunMock.defaultExpectation.results if mm_results == nil { - mmTextChunkTableName.t.Fatal("No results are set for the RepositoryIMock.TextChunkTableName") + mmUpdateCatalogRun.t.Fatal("No results are set for the RepositoryIMock.UpdateCatalogRun") } - return (*mm_results).s1 + return (*mm_results).err } - if mmTextChunkTableName.funcTextChunkTableName != nil { - return mmTextChunkTableName.funcTextChunkTableName() + if mmUpdateCatalogRun.funcUpdateCatalogRun != nil { + return mmUpdateCatalogRun.funcUpdateCatalogRun(ctx, runUID, run) } - mmTextChunkTableName.t.Fatalf("Unexpected call to RepositoryIMock.TextChunkTableName.") + mmUpdateCatalogRun.t.Fatalf("Unexpected call to RepositoryIMock.UpdateCatalogRun. %v %v %v", ctx, runUID, run) return } -// TextChunkTableNameAfterCounter returns a count of finished RepositoryIMock.TextChunkTableName invocations -func (mmTextChunkTableName *RepositoryIMock) TextChunkTableNameAfterCounter() uint64 { - return mm_atomic.LoadUint64(&mmTextChunkTableName.afterTextChunkTableNameCounter) +// UpdateCatalogRunAfterCounter returns a count of finished RepositoryIMock.UpdateCatalogRun invocations +func (mmUpdateCatalogRun *RepositoryIMock) UpdateCatalogRunAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmUpdateCatalogRun.afterUpdateCatalogRunCounter) } -// TextChunkTableNameBeforeCounter returns a count of RepositoryIMock.TextChunkTableName invocations -func (mmTextChunkTableName *RepositoryIMock) TextChunkTableNameBeforeCounter() uint64 { - return mm_atomic.LoadUint64(&mmTextChunkTableName.beforeTextChunkTableNameCounter) +// UpdateCatalogRunBeforeCounter returns a count of RepositoryIMock.UpdateCatalogRun invocations +func (mmUpdateCatalogRun *RepositoryIMock) UpdateCatalogRunBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmUpdateCatalogRun.beforeUpdateCatalogRunCounter) } -// MinimockTextChunkTableNameDone returns true if the count of the TextChunkTableName invocations corresponds +// Calls returns a list of arguments used in each call to RepositoryIMock.UpdateCatalogRun. +// The list is in the same order as the calls were made (i.e. recent calls have a higher index) +func (mmUpdateCatalogRun *mRepositoryIMockUpdateCatalogRun) Calls() []*RepositoryIMockUpdateCatalogRunParams { + mmUpdateCatalogRun.mutex.RLock() + + argCopy := make([]*RepositoryIMockUpdateCatalogRunParams, len(mmUpdateCatalogRun.callArgs)) + copy(argCopy, mmUpdateCatalogRun.callArgs) + + mmUpdateCatalogRun.mutex.RUnlock() + + return argCopy +} + +// MinimockUpdateCatalogRunDone returns true if the count of the UpdateCatalogRun invocations corresponds // the number of defined expectations -func (m *RepositoryIMock) MinimockTextChunkTableNameDone() bool { - for _, e := range m.TextChunkTableNameMock.expectations { +func (m *RepositoryIMock) MinimockUpdateCatalogRunDone() bool { + if m.UpdateCatalogRunMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + + for _, e := range m.UpdateCatalogRunMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false } } - return m.TextChunkTableNameMock.invocationsDone() + return m.UpdateCatalogRunMock.invocationsDone() } -// MinimockTextChunkTableNameInspect logs each unmet expectation -func (m *RepositoryIMock) MinimockTextChunkTableNameInspect() { - for _, e := range m.TextChunkTableNameMock.expectations { +// MinimockUpdateCatalogRunInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockUpdateCatalogRunInspect() { + for _, e := range m.UpdateCatalogRunMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { - m.t.Error("Expected call to RepositoryIMock.TextChunkTableName") + m.t.Errorf("Expected call to RepositoryIMock.UpdateCatalogRun with params: %#v", *e.params) } } - afterTextChunkTableNameCounter := mm_atomic.LoadUint64(&m.afterTextChunkTableNameCounter) + afterUpdateCatalogRunCounter := mm_atomic.LoadUint64(&m.afterUpdateCatalogRunCounter) // if default expectation was set then invocations count should be greater than zero - if m.TextChunkTableNameMock.defaultExpectation != nil && afterTextChunkTableNameCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.TextChunkTableName") + if m.UpdateCatalogRunMock.defaultExpectation != nil && afterUpdateCatalogRunCounter < 1 { + if m.UpdateCatalogRunMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.UpdateCatalogRun") + } else { + m.t.Errorf("Expected call to RepositoryIMock.UpdateCatalogRun with params: %#v", *m.UpdateCatalogRunMock.defaultExpectation.params) + } } // if func was set then invocations count should be greater than zero - if m.funcTextChunkTableName != nil && afterTextChunkTableNameCounter < 1 { - m.t.Error("Expected call to RepositoryIMock.TextChunkTableName") + if m.funcUpdateCatalogRun != nil && afterUpdateCatalogRunCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.UpdateCatalogRun") } - if !m.TextChunkTableNameMock.invocationsDone() && afterTextChunkTableNameCounter > 0 { - m.t.Errorf("Expected %d calls to RepositoryIMock.TextChunkTableName but found %d calls", - mm_atomic.LoadUint64(&m.TextChunkTableNameMock.expectedInvocations), afterTextChunkTableNameCounter) + if !m.UpdateCatalogRunMock.invocationsDone() && afterUpdateCatalogRunCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.UpdateCatalogRun but found %d calls", + mm_atomic.LoadUint64(&m.UpdateCatalogRunMock.expectedInvocations), afterUpdateCatalogRunCounter) } } type mRepositoryIMockUpdateChunk struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockUpdateChunkExpectation expectations []*RepositoryIMockUpdateChunkExpectation @@ -14453,6 +16044,16 @@ type RepositoryIMockUpdateChunkResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmUpdateChunk *mRepositoryIMockUpdateChunk) Optional() *mRepositoryIMockUpdateChunk { + mmUpdateChunk.optional = true + return mmUpdateChunk +} + // Expect sets up expected params for RepositoryI.UpdateChunk func (mmUpdateChunk *mRepositoryIMockUpdateChunk) Expect(ctx context.Context, chunkUID string, updates map[string]interface{}) *mRepositoryIMockUpdateChunk { if mmUpdateChunk.mock.funcUpdateChunk != nil { @@ -14709,6 +16310,11 @@ func (mmUpdateChunk *mRepositoryIMockUpdateChunk) Calls() []*RepositoryIMockUpda // MinimockUpdateChunkDone returns true if the count of the UpdateChunk invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockUpdateChunkDone() bool { + if m.UpdateChunkMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.UpdateChunkMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -14747,6 +16353,7 @@ func (m *RepositoryIMock) MinimockUpdateChunkInspect() { } type mRepositoryIMockUpdateKbFileExtraMetaData struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockUpdateKbFileExtraMetaDataExpectation expectations []*RepositoryIMockUpdateKbFileExtraMetaDataExpectation @@ -14799,6 +16406,16 @@ type RepositoryIMockUpdateKbFileExtraMetaDataResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmUpdateKbFileExtraMetaData *mRepositoryIMockUpdateKbFileExtraMetaData) Optional() *mRepositoryIMockUpdateKbFileExtraMetaData { + mmUpdateKbFileExtraMetaData.optional = true + return mmUpdateKbFileExtraMetaData +} + // Expect sets up expected params for RepositoryI.UpdateKbFileExtraMetaData func (mmUpdateKbFileExtraMetaData *mRepositoryIMockUpdateKbFileExtraMetaData) Expect(ctx context.Context, fileUID uuid.UUID, failureReason string, convertingPipe string, chunkingPipe string, embeddingPipe string, processingTime *int64, convertingTime *int64, chunkingTime *int64, embeddingTime *int64) *mRepositoryIMockUpdateKbFileExtraMetaData { if mmUpdateKbFileExtraMetaData.mock.funcUpdateKbFileExtraMetaData != nil { @@ -15237,6 +16854,11 @@ func (mmUpdateKbFileExtraMetaData *mRepositoryIMockUpdateKbFileExtraMetaData) Ca // MinimockUpdateKbFileExtraMetaDataDone returns true if the count of the UpdateKbFileExtraMetaData invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockUpdateKbFileExtraMetaDataDone() bool { + if m.UpdateKbFileExtraMetaDataMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.UpdateKbFileExtraMetaDataMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -15275,6 +16897,7 @@ func (m *RepositoryIMock) MinimockUpdateKbFileExtraMetaDataInspect() { } type mRepositoryIMockUpdateKnowledgeBase struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockUpdateKnowledgeBaseExpectation expectations []*RepositoryIMockUpdateKnowledgeBaseExpectation @@ -15314,6 +16937,16 @@ type RepositoryIMockUpdateKnowledgeBaseResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmUpdateKnowledgeBase *mRepositoryIMockUpdateKnowledgeBase) Optional() *mRepositoryIMockUpdateKnowledgeBase { + mmUpdateKnowledgeBase.optional = true + return mmUpdateKnowledgeBase +} + // Expect sets up expected params for RepositoryI.UpdateKnowledgeBase func (mmUpdateKnowledgeBase *mRepositoryIMockUpdateKnowledgeBase) Expect(ctx context.Context, ownerUID string, kb mm_repository.KnowledgeBase) *mRepositoryIMockUpdateKnowledgeBase { if mmUpdateKnowledgeBase.mock.funcUpdateKnowledgeBase != nil { @@ -15570,6 +17203,11 @@ func (mmUpdateKnowledgeBase *mRepositoryIMockUpdateKnowledgeBase) Calls() []*Rep // MinimockUpdateKnowledgeBaseDone returns true if the count of the UpdateKnowledgeBase invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockUpdateKnowledgeBaseDone() bool { + if m.UpdateKnowledgeBaseMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.UpdateKnowledgeBaseMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -15608,6 +17246,7 @@ func (m *RepositoryIMock) MinimockUpdateKnowledgeBaseInspect() { } type mRepositoryIMockUpdateKnowledgeBaseFile struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockUpdateKnowledgeBaseFileExpectation expectations []*RepositoryIMockUpdateKnowledgeBaseFileExpectation @@ -15647,6 +17286,16 @@ type RepositoryIMockUpdateKnowledgeBaseFileResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmUpdateKnowledgeBaseFile *mRepositoryIMockUpdateKnowledgeBaseFile) Optional() *mRepositoryIMockUpdateKnowledgeBaseFile { + mmUpdateKnowledgeBaseFile.optional = true + return mmUpdateKnowledgeBaseFile +} + // Expect sets up expected params for RepositoryI.UpdateKnowledgeBaseFile func (mmUpdateKnowledgeBaseFile *mRepositoryIMockUpdateKnowledgeBaseFile) Expect(ctx context.Context, fileUID string, updateMap map[string]interface{}) *mRepositoryIMockUpdateKnowledgeBaseFile { if mmUpdateKnowledgeBaseFile.mock.funcUpdateKnowledgeBaseFile != nil { @@ -15903,6 +17552,11 @@ func (mmUpdateKnowledgeBaseFile *mRepositoryIMockUpdateKnowledgeBaseFile) Calls( // MinimockUpdateKnowledgeBaseFileDone returns true if the count of the UpdateKnowledgeBaseFile invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockUpdateKnowledgeBaseFileDone() bool { + if m.UpdateKnowledgeBaseFileMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.UpdateKnowledgeBaseFileMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -15940,7 +17594,329 @@ func (m *RepositoryIMock) MinimockUpdateKnowledgeBaseFileInspect() { } } +type mRepositoryIMockUpsertCatalogRun struct { + optional bool + mock *RepositoryIMock + defaultExpectation *RepositoryIMockUpsertCatalogRunExpectation + expectations []*RepositoryIMockUpsertCatalogRunExpectation + + callArgs []*RepositoryIMockUpsertCatalogRunParams + mutex sync.RWMutex + + expectedInvocations uint64 +} + +// RepositoryIMockUpsertCatalogRunExpectation specifies expectation struct of the RepositoryI.CreateCatalogRun +type RepositoryIMockUpsertCatalogRunExpectation struct { + mock *RepositoryIMock + params *RepositoryIMockUpsertCatalogRunParams + paramPtrs *RepositoryIMockUpsertCatalogRunParamPtrs + results *RepositoryIMockUpsertCatalogRunResults + Counter uint64 +} + +// RepositoryIMockUpsertCatalogRunParams contains parameters of the RepositoryI.CreateCatalogRun +type RepositoryIMockUpsertCatalogRunParams struct { + ctx context.Context + run *mm_repository.CatalogRun +} + +// RepositoryIMockUpsertCatalogRunParamPtrs contains pointers to parameters of the RepositoryI.CreateCatalogRun +type RepositoryIMockUpsertCatalogRunParamPtrs struct { + ctx *context.Context + run **mm_repository.CatalogRun +} + +// RepositoryIMockUpsertCatalogRunResults contains results of the RepositoryI.CreateCatalogRun +type RepositoryIMockUpsertCatalogRunResults struct { + cp1 *mm_repository.CatalogRun + err error +} + +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmUpsertCatalogRun *mRepositoryIMockUpsertCatalogRun) Optional() *mRepositoryIMockUpsertCatalogRun { + mmUpsertCatalogRun.optional = true + return mmUpsertCatalogRun +} + +// Expect sets up expected params for RepositoryI.CreateCatalogRun +func (mmUpsertCatalogRun *mRepositoryIMockUpsertCatalogRun) Expect(ctx context.Context, run *mm_repository.CatalogRun) *mRepositoryIMockUpsertCatalogRun { + if mmUpsertCatalogRun.mock.funcUpsertCatalogRun != nil { + mmUpsertCatalogRun.mock.t.Fatalf("RepositoryIMock.CreateCatalogRun mock is already set by Set") + } + + if mmUpsertCatalogRun.defaultExpectation == nil { + mmUpsertCatalogRun.defaultExpectation = &RepositoryIMockUpsertCatalogRunExpectation{} + } + + if mmUpsertCatalogRun.defaultExpectation.paramPtrs != nil { + mmUpsertCatalogRun.mock.t.Fatalf("RepositoryIMock.CreateCatalogRun mock is already set by ExpectParams functions") + } + + mmUpsertCatalogRun.defaultExpectation.params = &RepositoryIMockUpsertCatalogRunParams{ctx, run} + for _, e := range mmUpsertCatalogRun.expectations { + if minimock.Equal(e.params, mmUpsertCatalogRun.defaultExpectation.params) { + mmUpsertCatalogRun.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmUpsertCatalogRun.defaultExpectation.params) + } + } + + return mmUpsertCatalogRun +} + +// ExpectCtxParam1 sets up expected param ctx for RepositoryI.CreateCatalogRun +func (mmUpsertCatalogRun *mRepositoryIMockUpsertCatalogRun) ExpectCtxParam1(ctx context.Context) *mRepositoryIMockUpsertCatalogRun { + if mmUpsertCatalogRun.mock.funcUpsertCatalogRun != nil { + mmUpsertCatalogRun.mock.t.Fatalf("RepositoryIMock.CreateCatalogRun mock is already set by Set") + } + + if mmUpsertCatalogRun.defaultExpectation == nil { + mmUpsertCatalogRun.defaultExpectation = &RepositoryIMockUpsertCatalogRunExpectation{} + } + + if mmUpsertCatalogRun.defaultExpectation.params != nil { + mmUpsertCatalogRun.mock.t.Fatalf("RepositoryIMock.CreateCatalogRun mock is already set by Expect") + } + + if mmUpsertCatalogRun.defaultExpectation.paramPtrs == nil { + mmUpsertCatalogRun.defaultExpectation.paramPtrs = &RepositoryIMockUpsertCatalogRunParamPtrs{} + } + mmUpsertCatalogRun.defaultExpectation.paramPtrs.ctx = &ctx + + return mmUpsertCatalogRun +} + +// ExpectRunParam2 sets up expected param run for RepositoryI.CreateCatalogRun +func (mmUpsertCatalogRun *mRepositoryIMockUpsertCatalogRun) ExpectRunParam2(run *mm_repository.CatalogRun) *mRepositoryIMockUpsertCatalogRun { + if mmUpsertCatalogRun.mock.funcUpsertCatalogRun != nil { + mmUpsertCatalogRun.mock.t.Fatalf("RepositoryIMock.CreateCatalogRun mock is already set by Set") + } + + if mmUpsertCatalogRun.defaultExpectation == nil { + mmUpsertCatalogRun.defaultExpectation = &RepositoryIMockUpsertCatalogRunExpectation{} + } + + if mmUpsertCatalogRun.defaultExpectation.params != nil { + mmUpsertCatalogRun.mock.t.Fatalf("RepositoryIMock.CreateCatalogRun mock is already set by Expect") + } + + if mmUpsertCatalogRun.defaultExpectation.paramPtrs == nil { + mmUpsertCatalogRun.defaultExpectation.paramPtrs = &RepositoryIMockUpsertCatalogRunParamPtrs{} + } + mmUpsertCatalogRun.defaultExpectation.paramPtrs.run = &run + + return mmUpsertCatalogRun +} + +// Inspect accepts an inspector function that has same arguments as the RepositoryI.CreateCatalogRun +func (mmUpsertCatalogRun *mRepositoryIMockUpsertCatalogRun) Inspect(f func(ctx context.Context, run *mm_repository.CatalogRun)) *mRepositoryIMockUpsertCatalogRun { + if mmUpsertCatalogRun.mock.inspectFuncUpsertCatalogRun != nil { + mmUpsertCatalogRun.mock.t.Fatalf("Inspect function is already set for RepositoryIMock.CreateCatalogRun") + } + + mmUpsertCatalogRun.mock.inspectFuncUpsertCatalogRun = f + + return mmUpsertCatalogRun +} + +// Return sets up results that will be returned by RepositoryI.CreateCatalogRun +func (mmUpsertCatalogRun *mRepositoryIMockUpsertCatalogRun) Return(cp1 *mm_repository.CatalogRun, err error) *RepositoryIMock { + if mmUpsertCatalogRun.mock.funcUpsertCatalogRun != nil { + mmUpsertCatalogRun.mock.t.Fatalf("RepositoryIMock.CreateCatalogRun mock is already set by Set") + } + + if mmUpsertCatalogRun.defaultExpectation == nil { + mmUpsertCatalogRun.defaultExpectation = &RepositoryIMockUpsertCatalogRunExpectation{mock: mmUpsertCatalogRun.mock} + } + mmUpsertCatalogRun.defaultExpectation.results = &RepositoryIMockUpsertCatalogRunResults{cp1, err} + return mmUpsertCatalogRun.mock +} + +// Set uses given function f to mock the RepositoryI.CreateCatalogRun method +func (mmUpsertCatalogRun *mRepositoryIMockUpsertCatalogRun) Set(f func(ctx context.Context, run *mm_repository.CatalogRun) (cp1 *mm_repository.CatalogRun, err error)) *RepositoryIMock { + if mmUpsertCatalogRun.defaultExpectation != nil { + mmUpsertCatalogRun.mock.t.Fatalf("Default expectation is already set for the RepositoryI.CreateCatalogRun method") + } + + if len(mmUpsertCatalogRun.expectations) > 0 { + mmUpsertCatalogRun.mock.t.Fatalf("Some expectations are already set for the RepositoryI.CreateCatalogRun method") + } + + mmUpsertCatalogRun.mock.funcUpsertCatalogRun = f + return mmUpsertCatalogRun.mock +} + +// When sets expectation for the RepositoryI.CreateCatalogRun which will trigger the result defined by the following +// Then helper +func (mmUpsertCatalogRun *mRepositoryIMockUpsertCatalogRun) When(ctx context.Context, run *mm_repository.CatalogRun) *RepositoryIMockUpsertCatalogRunExpectation { + if mmUpsertCatalogRun.mock.funcUpsertCatalogRun != nil { + mmUpsertCatalogRun.mock.t.Fatalf("RepositoryIMock.CreateCatalogRun mock is already set by Set") + } + + expectation := &RepositoryIMockUpsertCatalogRunExpectation{ + mock: mmUpsertCatalogRun.mock, + params: &RepositoryIMockUpsertCatalogRunParams{ctx, run}, + } + mmUpsertCatalogRun.expectations = append(mmUpsertCatalogRun.expectations, expectation) + return expectation +} + +// Then sets up RepositoryI.CreateCatalogRun return parameters for the expectation previously defined by the When method +func (e *RepositoryIMockUpsertCatalogRunExpectation) Then(cp1 *mm_repository.CatalogRun, err error) *RepositoryIMock { + e.results = &RepositoryIMockUpsertCatalogRunResults{cp1, err} + return e.mock +} + +// Times sets number of times RepositoryI.CreateCatalogRun should be invoked +func (mmUpsertCatalogRun *mRepositoryIMockUpsertCatalogRun) Times(n uint64) *mRepositoryIMockUpsertCatalogRun { + if n == 0 { + mmUpsertCatalogRun.mock.t.Fatalf("Times of RepositoryIMock.CreateCatalogRun mock can not be zero") + } + mm_atomic.StoreUint64(&mmUpsertCatalogRun.expectedInvocations, n) + return mmUpsertCatalogRun +} + +func (mmUpsertCatalogRun *mRepositoryIMockUpsertCatalogRun) invocationsDone() bool { + if len(mmUpsertCatalogRun.expectations) == 0 && mmUpsertCatalogRun.defaultExpectation == nil && mmUpsertCatalogRun.mock.funcUpsertCatalogRun == nil { + return true + } + + totalInvocations := mm_atomic.LoadUint64(&mmUpsertCatalogRun.mock.afterUpsertCatalogRunCounter) + expectedInvocations := mm_atomic.LoadUint64(&mmUpsertCatalogRun.expectedInvocations) + + return totalInvocations > 0 && (expectedInvocations == 0 || expectedInvocations == totalInvocations) +} + +// UpsertCatalogRun implements repository.RepositoryI +func (mmUpsertCatalogRun *RepositoryIMock) CreateCatalogRun(ctx context.Context, run *mm_repository.CatalogRun) (cp1 *mm_repository.CatalogRun, err error) { + mm_atomic.AddUint64(&mmUpsertCatalogRun.beforeUpsertCatalogRunCounter, 1) + defer mm_atomic.AddUint64(&mmUpsertCatalogRun.afterUpsertCatalogRunCounter, 1) + + if mmUpsertCatalogRun.inspectFuncUpsertCatalogRun != nil { + mmUpsertCatalogRun.inspectFuncUpsertCatalogRun(ctx, run) + } + + mm_params := RepositoryIMockUpsertCatalogRunParams{ctx, run} + + // Record call args + mmUpsertCatalogRun.UpsertCatalogRunMock.mutex.Lock() + mmUpsertCatalogRun.UpsertCatalogRunMock.callArgs = append(mmUpsertCatalogRun.UpsertCatalogRunMock.callArgs, &mm_params) + mmUpsertCatalogRun.UpsertCatalogRunMock.mutex.Unlock() + + for _, e := range mmUpsertCatalogRun.UpsertCatalogRunMock.expectations { + if minimock.Equal(*e.params, mm_params) { + mm_atomic.AddUint64(&e.Counter, 1) + return e.results.cp1, e.results.err + } + } + + if mmUpsertCatalogRun.UpsertCatalogRunMock.defaultExpectation != nil { + mm_atomic.AddUint64(&mmUpsertCatalogRun.UpsertCatalogRunMock.defaultExpectation.Counter, 1) + mm_want := mmUpsertCatalogRun.UpsertCatalogRunMock.defaultExpectation.params + mm_want_ptrs := mmUpsertCatalogRun.UpsertCatalogRunMock.defaultExpectation.paramPtrs + + mm_got := RepositoryIMockUpsertCatalogRunParams{ctx, run} + + if mm_want_ptrs != nil { + + if mm_want_ptrs.ctx != nil && !minimock.Equal(*mm_want_ptrs.ctx, mm_got.ctx) { + mmUpsertCatalogRun.t.Errorf("RepositoryIMock.CreateCatalogRun got unexpected parameter ctx, want: %#v, got: %#v%s\n", *mm_want_ptrs.ctx, mm_got.ctx, minimock.Diff(*mm_want_ptrs.ctx, mm_got.ctx)) + } + + if mm_want_ptrs.run != nil && !minimock.Equal(*mm_want_ptrs.run, mm_got.run) { + mmUpsertCatalogRun.t.Errorf("RepositoryIMock.CreateCatalogRun got unexpected parameter run, want: %#v, got: %#v%s\n", *mm_want_ptrs.run, mm_got.run, minimock.Diff(*mm_want_ptrs.run, mm_got.run)) + } + + } else if mm_want != nil && !minimock.Equal(*mm_want, mm_got) { + mmUpsertCatalogRun.t.Errorf("RepositoryIMock.CreateCatalogRun got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got)) + } + + mm_results := mmUpsertCatalogRun.UpsertCatalogRunMock.defaultExpectation.results + if mm_results == nil { + mmUpsertCatalogRun.t.Fatal("No results are set for the RepositoryIMock.CreateCatalogRun") + } + return (*mm_results).cp1, (*mm_results).err + } + if mmUpsertCatalogRun.funcUpsertCatalogRun != nil { + return mmUpsertCatalogRun.funcUpsertCatalogRun(ctx, run) + } + mmUpsertCatalogRun.t.Fatalf("Unexpected call to RepositoryIMock.CreateCatalogRun. %v %v", ctx, run) + return +} + +// UpsertCatalogRunAfterCounter returns a count of finished RepositoryIMock.UpsertCatalogRun invocations +func (mmUpsertCatalogRun *RepositoryIMock) UpsertCatalogRunAfterCounter() uint64 { + return mm_atomic.LoadUint64(&mmUpsertCatalogRun.afterUpsertCatalogRunCounter) +} + +// UpsertCatalogRunBeforeCounter returns a count of RepositoryIMock.UpsertCatalogRun invocations +func (mmUpsertCatalogRun *RepositoryIMock) UpsertCatalogRunBeforeCounter() uint64 { + return mm_atomic.LoadUint64(&mmUpsertCatalogRun.beforeUpsertCatalogRunCounter) +} + +// Calls returns a list of arguments used in each call to RepositoryIMock.UpsertCatalogRun. +// The list is in the same order as the calls were made (i.e. recent calls have a higher index) +func (mmUpsertCatalogRun *mRepositoryIMockUpsertCatalogRun) Calls() []*RepositoryIMockUpsertCatalogRunParams { + mmUpsertCatalogRun.mutex.RLock() + + argCopy := make([]*RepositoryIMockUpsertCatalogRunParams, len(mmUpsertCatalogRun.callArgs)) + copy(argCopy, mmUpsertCatalogRun.callArgs) + + mmUpsertCatalogRun.mutex.RUnlock() + + return argCopy +} + +// MinimockUpsertCatalogRunDone returns true if the count of the UpsertCatalogRun invocations corresponds +// the number of defined expectations +func (m *RepositoryIMock) MinimockUpsertCatalogRunDone() bool { + if m.UpsertCatalogRunMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + + for _, e := range m.UpsertCatalogRunMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + return false + } + } + + return m.UpsertCatalogRunMock.invocationsDone() +} + +// MinimockUpsertCatalogRunInspect logs each unmet expectation +func (m *RepositoryIMock) MinimockUpsertCatalogRunInspect() { + for _, e := range m.UpsertCatalogRunMock.expectations { + if mm_atomic.LoadUint64(&e.Counter) < 1 { + m.t.Errorf("Expected call to RepositoryIMock.CreateCatalogRun with params: %#v", *e.params) + } + } + + afterUpsertCatalogRunCounter := mm_atomic.LoadUint64(&m.afterUpsertCatalogRunCounter) + // if default expectation was set then invocations count should be greater than zero + if m.UpsertCatalogRunMock.defaultExpectation != nil && afterUpsertCatalogRunCounter < 1 { + if m.UpsertCatalogRunMock.defaultExpectation.params == nil { + m.t.Error("Expected call to RepositoryIMock.CreateCatalogRun") + } else { + m.t.Errorf("Expected call to RepositoryIMock.CreateCatalogRun with params: %#v", *m.UpsertCatalogRunMock.defaultExpectation.params) + } + } + // if func was set then invocations count should be greater than zero + if m.funcUpsertCatalogRun != nil && afterUpsertCatalogRunCounter < 1 { + m.t.Error("Expected call to RepositoryIMock.CreateCatalogRun") + } + + if !m.UpsertCatalogRunMock.invocationsDone() && afterUpsertCatalogRunCounter > 0 { + m.t.Errorf("Expected %d calls to RepositoryIMock.CreateCatalogRun but found %d calls", + mm_atomic.LoadUint64(&m.UpsertCatalogRunMock.expectedInvocations), afterUpsertCatalogRunCounter) + } +} + type mRepositoryIMockUpsertEmbeddings struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockUpsertEmbeddingsExpectation expectations []*RepositoryIMockUpsertEmbeddingsExpectation @@ -15980,6 +17956,16 @@ type RepositoryIMockUpsertEmbeddingsResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmUpsertEmbeddings *mRepositoryIMockUpsertEmbeddings) Optional() *mRepositoryIMockUpsertEmbeddings { + mmUpsertEmbeddings.optional = true + return mmUpsertEmbeddings +} + // Expect sets up expected params for RepositoryI.UpsertEmbeddings func (mmUpsertEmbeddings *mRepositoryIMockUpsertEmbeddings) Expect(ctx context.Context, embeddings []mm_repository.Embedding, externalServiceCall func(embUIDs []string) error) *mRepositoryIMockUpsertEmbeddings { if mmUpsertEmbeddings.mock.funcUpsertEmbeddings != nil { @@ -16236,6 +18222,11 @@ func (mmUpsertEmbeddings *mRepositoryIMockUpsertEmbeddings) Calls() []*Repositor // MinimockUpsertEmbeddingsDone returns true if the count of the UpsertEmbeddings invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockUpsertEmbeddingsDone() bool { + if m.UpsertEmbeddingsMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.UpsertEmbeddingsMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -16274,6 +18265,7 @@ func (m *RepositoryIMock) MinimockUpsertEmbeddingsInspect() { } type mRepositoryIMockUpsertRepositoryTag struct { + optional bool mock *RepositoryIMock defaultExpectation *RepositoryIMockUpsertRepositoryTagExpectation expectations []*RepositoryIMockUpsertRepositoryTagExpectation @@ -16311,6 +18303,16 @@ type RepositoryIMockUpsertRepositoryTagResults struct { err error } +// Marks this method to be optional. The default behavior of any method with Return() is '1 or more', meaning +// the test will fail minimock's automatic final call check if the mocked method was not called at least once. +// Optional() makes method check to work in '0 or more' mode. +// It is NOT RECOMMENDED to use this option unless you really need it, as default behaviour helps to +// catch the problems when the expected method call is totally skipped during test run. +func (mmUpsertRepositoryTag *mRepositoryIMockUpsertRepositoryTag) Optional() *mRepositoryIMockUpsertRepositoryTag { + mmUpsertRepositoryTag.optional = true + return mmUpsertRepositoryTag +} + // Expect sets up expected params for RepositoryI.UpsertRepositoryTag func (mmUpsertRepositoryTag *mRepositoryIMockUpsertRepositoryTag) Expect(ctx context.Context, rp1 *pb.RepositoryTag) *mRepositoryIMockUpsertRepositoryTag { if mmUpsertRepositoryTag.mock.funcUpsertRepositoryTag != nil { @@ -16541,6 +18543,11 @@ func (mmUpsertRepositoryTag *mRepositoryIMockUpsertRepositoryTag) Calls() []*Rep // MinimockUpsertRepositoryTagDone returns true if the count of the UpsertRepositoryTag invocations corresponds // the number of defined expectations func (m *RepositoryIMock) MinimockUpsertRepositoryTagDone() bool { + if m.UpsertRepositoryTagMock.optional { + // Optional methods provide '0 or more' call count restriction. + return true + } + for _, e := range m.UpsertRepositoryTagMock.expectations { if mm_atomic.LoadUint64(&e.Counter) < 1 { return false @@ -16660,6 +18667,8 @@ func (m *RepositoryIMock) MinimockFinish() { m.MinimockKnowledgeBaseFileTableNameInspect() + m.MinimockListCatalogRunsInspect() + m.MinimockListChunksByKbFileUIDInspect() m.MinimockListEmbeddingsByKbFileUIDInspect() @@ -16672,6 +18681,8 @@ func (m *RepositoryIMock) MinimockFinish() { m.MinimockTextChunkTableNameInspect() + m.MinimockUpdateCatalogRunInspect() + m.MinimockUpdateChunkInspect() m.MinimockUpdateKbFileExtraMetaDataInspect() @@ -16680,10 +18691,11 @@ func (m *RepositoryIMock) MinimockFinish() { m.MinimockUpdateKnowledgeBaseFileInspect() + m.MinimockUpsertCatalogRunInspect() + m.MinimockUpsertEmbeddingsInspect() m.MinimockUpsertRepositoryTagInspect() - m.t.FailNow() } }) } @@ -16746,16 +18758,19 @@ func (m *RepositoryIMock) minimockDone() bool { m.MinimockHardDeleteEmbeddingsByKbUIDDone() && m.MinimockIncreaseKnowledgeBaseUsageDone() && m.MinimockKnowledgeBaseFileTableNameDone() && + m.MinimockListCatalogRunsDone() && m.MinimockListChunksByKbFileUIDDone() && m.MinimockListEmbeddingsByKbFileUIDDone() && m.MinimockListKnowledgeBaseFilesDone() && m.MinimockListKnowledgeBasesDone() && m.MinimockProcessKnowledgeBaseFilesDone() && m.MinimockTextChunkTableNameDone() && + m.MinimockUpdateCatalogRunDone() && m.MinimockUpdateChunkDone() && m.MinimockUpdateKbFileExtraMetaDataDone() && m.MinimockUpdateKnowledgeBaseDone() && m.MinimockUpdateKnowledgeBaseFileDone() && + m.MinimockUpsertCatalogRunDone() && m.MinimockUpsertEmbeddingsDone() && m.MinimockUpsertRepositoryTagDone() } diff --git a/pkg/repository/catalogrun.go b/pkg/repository/catalogrun.go new file mode 100644 index 0000000..03d2859 --- /dev/null +++ b/pkg/repository/catalogrun.go @@ -0,0 +1,32 @@ +package repository + +import ( + "context" + + "github.com/gofrs/uuid" + "go.einride.tech/aip/filtering" + "go.einride.tech/aip/ordering" +) + +type CatalogRunI interface { + CreateCatalogRun(ctx context.Context, run *CatalogRun) (*CatalogRun, error) + UpdateCatalogRun(ctx context.Context, runUID uuid.UUID, run *CatalogRun) error + ListCatalogRuns(ctx context.Context, pageSize, page int64, filter filtering.Filter, order ordering.OrderBy, catalogUID, requesterUID string, isOwner bool) (modelTriggers []*CatalogRun, totalSize int64, err error) +} + +func (r *Repository) CreateCatalogRun(ctx context.Context, run *CatalogRun) (*CatalogRun, error) { + err := r.db.Create(run).Error + if err != nil { + return nil, err + } + return run, nil +} + +func (r *Repository) UpdateCatalogRun(ctx context.Context, runUID uuid.UUID, run *CatalogRun) error { + return r.db.Model(&CatalogRun{}).Where(&CatalogRun{UID: runUID}).Updates(&run).Error +} + +func (r *Repository) ListCatalogRuns(ctx context.Context, pageSize, page int64, filter filtering.Filter, order ordering.OrderBy, catalogUID, requesterUID string, isOwner bool) (modelTriggers []*CatalogRun, totalSize int64, err error) { + // TODO implement me + panic("implement me") +} diff --git a/pkg/repository/catalogrun_test.go b/pkg/repository/catalogrun_test.go new file mode 100644 index 0000000..c6bd9a1 --- /dev/null +++ b/pkg/repository/catalogrun_test.go @@ -0,0 +1,140 @@ +//go:build dbtest +// +build dbtest + +package repository_test + +import ( + "context" + "fmt" + "os" + "testing" + "time" + + "github.com/gofrs/uuid" + "github.com/stretchr/testify/require" + "gopkg.in/guregu/null.v4" + "gorm.io/driver/postgres" + "gorm.io/gorm" + "gorm.io/gorm/logger" + "gorm.io/gorm/schema" + + qt "github.com/frankban/quicktest" + + "github.com/instill-ai/artifact-backend/config" + "github.com/instill-ai/artifact-backend/pkg/repository" + + database "github.com/instill-ai/artifact-backend/pkg/db" + + pb "github.com/instill-ai/protogen-go/artifact/artifact/v1alpha" + runpb "github.com/instill-ai/protogen-go/common/run/v1alpha" +) + +var db *gorm.DB + +func TestMain(m *testing.M) { + databaseConfig := config.DatabaseConfig{ + Username: "postgres", + Host: "localhost", + Port: 5432, + Name: "artifact", + TimeZone: "Etc/UTC", + } + + dsn := fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%d sslmode=disable TimeZone=%s", + databaseConfig.Host, + databaseConfig.Username, + databaseConfig.Password, + databaseConfig.Name, + databaseConfig.Port, + databaseConfig.TimeZone, + ) + + var err error + db, err = gorm.Open(postgres.New(postgres.Config{ + DSN: dsn, + PreferSimpleProtocol: true, // disables implicit prepared statement usage + }), &gorm.Config{ + QueryFields: true, // QueryFields mode will select by all fields’ name for current model + NamingStrategy: schema.NamingStrategy{ + SingularTable: true, + }, + }) + db.Logger = logger.Default.LogMode(logger.Info) + + if err != nil { + panic(err.Error()) + } + + defer database.Close(db) + + os.Exit(m.Run()) +} + +func TestRepository_CreateCatalogRun(t *testing.T) { + c := qt.New(t) + tx := db.Begin() + c.Cleanup(func() { tx.Rollback() }) + + repo := repository.NewRepository(tx) + run := &repository.CatalogRun{ + CatalogUID: uuid.Must(uuid.NewV4()), + Status: repository.RunStatus(runpb.RunStatus_RUN_STATUS_PROCESSING), + Source: repository.RunSource(runpb.RunSource_RUN_SOURCE_API), + Action: repository.RunAction(pb.CatalogRunAction_CATALOG_RUN_ACTION_CREATE), + RunnerUID: uuid.Must(uuid.NewV4()), + RequesterUID: uuid.Must(uuid.NewV4()), + StartedTime: time.Now().Add(-10 * time.Minute), + CompletedTime: null.TimeFrom(time.Now()), + FileUIDs: []string{uuid.Must(uuid.NewV4()).String()}, + } + run.TotalDuration = null.IntFrom(run.CompletedTime.Time.Sub(run.CreateTime).Milliseconds()) + + ctx := context.Background() + created, err := repo.CreateCatalogRun(ctx, run) + require.NoError(t, err) + + require.False(t, created.UID.IsNil()) + require.Equal(t, created.CatalogUID, run.CatalogUID) + require.Equal(t, created.Status, run.Status) + require.Equal(t, created.Source, run.Source) + require.Equal(t, created.FileUIDs, run.FileUIDs) + require.LessOrEqual(t, time.Since(created.CreateTime).Milliseconds(), int64(1000)) + require.LessOrEqual(t, time.Since(created.UpdateTime).Milliseconds(), int64(1000)) +} + +func TestRepository_UpdateCatalogRun(t *testing.T) { + c := qt.New(t) + tx := db.Begin() + c.Cleanup(func() { tx.Rollback() }) + + repo := repository.NewRepository(tx) + run := &repository.CatalogRun{ + CatalogUID: uuid.Must(uuid.NewV4()), + Status: repository.RunStatus(runpb.RunStatus_RUN_STATUS_PROCESSING), + Source: repository.RunSource(runpb.RunSource_RUN_SOURCE_API), + Action: repository.RunAction(pb.CatalogRunAction_CATALOG_RUN_ACTION_CREATE), + RunnerUID: uuid.Must(uuid.NewV4()), + RequesterUID: uuid.Must(uuid.NewV4()), + StartedTime: time.Now().Add(-10 * time.Minute), + FileUIDs: []string{uuid.Must(uuid.NewV4()).String()}, + } + + ctx := context.Background() + created, err := repo.CreateCatalogRun(ctx, run) + require.NoError(t, err) + require.False(t, created.UID.IsNil()) + require.False(t, created.CompletedTime.Valid) + + created.CompletedTime = null.TimeFrom(time.Now()) + created.TotalDuration = null.IntFrom(run.CompletedTime.Time.Sub(run.CreateTime).Milliseconds()) + err = repo.UpdateCatalogRun(ctx, created.UID, created) + require.NoError(t, err) + + check := &repository.CatalogRun{UID: created.UID} + err = tx.First(check).Error + require.NoError(t, err) + require.Equal(t, check.UID, created.UID) + require.True(t, created.CompletedTime.Valid) + require.True(t, created.TotalDuration.Valid) + require.NotEqual(t, check.CreateTime, check.UpdateTime) +} diff --git a/pkg/repository/datamodel.go b/pkg/repository/datamodel.go index 804fa05..38e6f11 100644 --- a/pkg/repository/datamodel.go +++ b/pkg/repository/datamodel.go @@ -1,8 +1,16 @@ package repository import ( + "database/sql/driver" "fmt" "time" + + "github.com/gofrs/uuid" + "gopkg.in/guregu/null.v4" + "gorm.io/datatypes" + + pb "github.com/instill-ai/protogen-go/artifact/artifact/v1alpha" + runpb "github.com/instill-ai/protogen-go/common/run/v1alpha" ) type repositoryTag struct { @@ -20,3 +28,56 @@ func repositoryTagName(repo, id string) string { // :tag to improve the efficiency of the queries. return fmt.Sprintf("%s:%s", repo, id) } + +// for saving the protobuf types as string values +type ( + RunStatus runpb.RunStatus + RunSource runpb.RunSource + RunAction pb.CatalogRunAction +) + +func (v *RunStatus) Scan(value any) error { + *v = RunStatus(runpb.RunStatus_value[value.(string)]) + return nil +} + +func (v RunStatus) Value() (driver.Value, error) { + return runpb.RunStatus(v).String(), nil +} + +func (v *RunSource) Scan(value any) error { + *v = RunSource(runpb.RunSource_value[value.(string)]) + return nil +} + +func (v RunSource) Value() (driver.Value, error) { + return runpb.RunSource(v).String(), nil +} + +func (v *RunAction) Scan(value any) error { + *v = RunAction(pb.CatalogRunAction_value[value.(string)]) + return nil +} + +func (v RunAction) Value() (driver.Value, error) { + return pb.CatalogRunAction(v).String(), nil +} + +type CatalogRun struct { + UID uuid.UUID `gorm:"type:uuid;default:gen_random_uuid();primaryKey"` + CatalogUID uuid.UUID + Status RunStatus + Source RunSource + Action RunAction + RunnerUID uuid.UUID + RequesterUID uuid.UUID + FileUIDs TagsArray `gorm:"type:VARCHAR(255)[]"` + ReferenceUIDs TagsArray `gorm:"type:VARCHAR(255)[]"` + Payload datatypes.JSON `gorm:"type:jsonb"` + StartedTime time.Time + CompletedTime null.Time + TotalDuration null.Int + Error null.String + CreateTime time.Time `gorm:"autoCreateTime:nano"` + UpdateTime time.Time `gorm:"autoUpdateTime:nano"` +} diff --git a/pkg/repository/repository.go b/pkg/repository/repository.go index 3dbb30c..45ba290 100644 --- a/pkg/repository/repository.go +++ b/pkg/repository/repository.go @@ -11,6 +11,7 @@ type RepositoryI interface { ConvertedFileI TextChunkI EmbeddingI + CatalogRunI } // Repository implements Artifact storage functions in PostgreSQL.