aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/aws/smithy-go/middleware/shared_test.go
diff options
context:
space:
mode:
authorvitalyisaev <vitalyisaev@ydb.tech>2023-12-12 21:55:07 +0300
committervitalyisaev <vitalyisaev@ydb.tech>2023-12-12 22:25:10 +0300
commit4967f99474a4040ba150eb04995de06342252718 (patch)
treec9c118836513a8fab6e9fcfb25be5d404338bca7 /vendor/github.com/aws/smithy-go/middleware/shared_test.go
parent2ce9cccb9b0bdd4cd7a3491dc5cbf8687cda51de (diff)
downloadydb-4967f99474a4040ba150eb04995de06342252718.tar.gz
YQ Connector: prepare code base for S3 integration
1. Кодовая база Коннектора переписана с помощью Go дженериков так, чтобы добавление нового источника данных (в частности S3 + csv) максимально переиспользовало имеющийся код (чтобы сохранялась логика нарезания на блоки данных, учёт трафика и пр.) 2. API Connector расширено для работы с S3, но ещё пока не протестировано.
Diffstat (limited to 'vendor/github.com/aws/smithy-go/middleware/shared_test.go')
-rw-r--r--vendor/github.com/aws/smithy-go/middleware/shared_test.go74
1 files changed, 74 insertions, 0 deletions
diff --git a/vendor/github.com/aws/smithy-go/middleware/shared_test.go b/vendor/github.com/aws/smithy-go/middleware/shared_test.go
new file mode 100644
index 0000000000..8f04960735
--- /dev/null
+++ b/vendor/github.com/aws/smithy-go/middleware/shared_test.go
@@ -0,0 +1,74 @@
+package middleware
+
+import (
+ "context"
+ "testing"
+)
+
+type mockIder struct {
+ Identifier string
+}
+
+func (m *mockIder) ID() string { return m.Identifier }
+
+func noError(t *testing.T, err error) {
+ t.Helper()
+ if err != nil {
+ t.Errorf("expect no error, got %v", err)
+ }
+}
+
+func mockInitializeMiddleware(id string) InitializeMiddleware {
+ return InitializeMiddlewareFunc(id,
+ func(
+ ctx context.Context, in InitializeInput, next InitializeHandler,
+ ) (
+ out InitializeOutput, metadata Metadata, err error,
+ ) {
+ return next.HandleInitialize(ctx, in)
+ })
+}
+
+func mockSerializeMiddleware(id string) SerializeMiddleware {
+ return SerializeMiddlewareFunc(id,
+ func(
+ ctx context.Context, in SerializeInput, next SerializeHandler,
+ ) (
+ out SerializeOutput, metadata Metadata, err error,
+ ) {
+ return next.HandleSerialize(ctx, in)
+ })
+}
+
+func mockBuildMiddleware(id string) BuildMiddleware {
+ return BuildMiddlewareFunc(id,
+ func(
+ ctx context.Context, in BuildInput, next BuildHandler,
+ ) (
+ out BuildOutput, metadata Metadata, err error,
+ ) {
+ return next.HandleBuild(ctx, in)
+ })
+}
+
+func mockFinalizeMiddleware(id string) FinalizeMiddleware {
+ return FinalizeMiddlewareFunc(id,
+ func(
+ ctx context.Context, in FinalizeInput, next FinalizeHandler,
+ ) (
+ out FinalizeOutput, metadata Metadata, err error,
+ ) {
+ return next.HandleFinalize(ctx, in)
+ })
+}
+
+func mockDeserializeMiddleware(id string) DeserializeMiddleware {
+ return DeserializeMiddlewareFunc(id,
+ func(
+ ctx context.Context, in DeserializeInput, next DeserializeHandler,
+ ) (
+ out DeserializeOutput, metadata Metadata, err error,
+ ) {
+ return next.HandleDeserialize(ctx, in)
+ })
+}