Compare commits

...

210 Commits

Author SHA1 Message Date
RW
0c8e92ace9 Update README.md 2025-07-07 11:30:26 +02:00
Muhammed Efe Cetin
896938ef21 update release policy 2025-07-06 16:07:06 +03:00
Muhammed Efe Cetin
1389ad7ce6 Merge branch 'add-withcontext' of https://github.com/gofiber/storage into add-withcontext 2025-07-04 14:42:57 +03:00
Muhammed Efe Cetin
0feb2ba53d apply some ai reviews 2025-07-04 14:42:34 +03:00
René
4c92ab4ee3 update nodejs version from 18 to 20
ERROR: Wrangler requires at least Node.js v20.0.0. You are using v18.20.8. Please update your version of Node.js.
2025-07-04 13:23:48 +02:00
M. Efe Çetin
b65f330ec7 Merge branch 'main' into add-withcontext 2025-07-04 13:08:07 +03:00
Muhammed Efe Cetin
8139126338 add dummy ctx to leveldb 2025-07-04 02:33:26 +03:00
Muhammed Efe Cetin
92bf2760f4 update docs 2025-07-04 02:23:49 +03:00
Muhammed Efe Cetin
b6563da412 Merge branch 'add-withcontext' of https://github.com/gofiber/storage into add-withcontext 2025-07-04 02:06:46 +03:00
Muhammed Efe Cetin
c32a7ae1a8 fix mssql benchmarks 2025-07-04 02:05:13 +03:00
RW
ec9ced0881 Merge pull request #1808 from gofiber/dependabot/go_modules/dynamodb/github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue-1.19.4
Some checks failed
Benchmark / changes (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Tests DynamoDB / Tests (1.23.x) (push) Has been cancelled
Tests DynamoDB / Tests (1.24.x) (push) Has been cancelled
Tests S3 / Tests (1.23.x) (push) Has been cancelled
Tests S3 / Tests (1.24.x) (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
chore(deps): bump github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue from 1.19.3 to 1.19.4 in /dynamodb
2025-07-03 09:23:48 +02:00
dependabot[bot]
ab255b2d0e chore(deps): bump github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue
Bumps [github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue](https://github.com/aws/aws-sdk-go-v2) from 1.19.3 to 1.19.4.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/pi/v1.19.3...service/mq/v1.19.4)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue
  dependency-version: 1.19.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-03 07:22:31 +00:00
RW
3fde0cd380 Merge pull request #1810 from gofiber/dependabot/go_modules/s3/github.com/aws/aws-sdk-go-v2/feature/s3/manager-1.17.83
chore(deps): bump github.com/aws/aws-sdk-go-v2/feature/s3/manager from 1.17.82 to 1.17.83 in /s3
2025-07-03 09:20:56 +02:00
dependabot[bot]
b45ae6825d chore(deps): bump github.com/aws/aws-sdk-go-v2/feature/s3/manager in /s3
Bumps [github.com/aws/aws-sdk-go-v2/feature/s3/manager](https://github.com/aws/aws-sdk-go-v2) from 1.17.82 to 1.17.83.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/feature/s3/manager/v1.17.82...feature/s3/manager/v1.17.83)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/feature/s3/manager
  dependency-version: 1.17.83
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-03 07:19:33 +00:00
RW
085b336b91 Merge pull request #1809 from gofiber/codex/2025-07-02-11-22-48
Add benchmark tests for mockstorage
2025-07-02 13:27:33 +02:00
RW
73af914681 Merge branch 'add-withcontext' into codex/2025-07-02-11-22-48 2025-07-02 13:26:14 +02:00
RW
46bf456daa Update mockstorage module dependencies 2025-07-02 13:22:53 +02:00
RW
5e964eef23 Merge pull request #1807 from gofiber/dependabot/go_modules/dynamodb/github.com/aws/aws-sdk-go-v2/service/dynamodb-1.44.0
Some checks failed
Benchmark / changes (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Tests DynamoDB / Tests (1.23.x) (push) Has been cancelled
Tests DynamoDB / Tests (1.24.x) (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
chore(deps): bump github.com/aws/aws-sdk-go-v2/service/dynamodb from 1.43.4 to 1.44.0 in /dynamodb
2025-07-01 12:19:52 +02:00
dependabot[bot]
303d23c784 chore(deps): bump github.com/aws/aws-sdk-go-v2/service/dynamodb
Bumps [github.com/aws/aws-sdk-go-v2/service/dynamodb](https://github.com/aws/aws-sdk-go-v2) from 1.43.4 to 1.44.0.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/ivs/v1.43.4...service/s3/v1.44.0)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/dynamodb
  dependency-version: 1.44.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-01 10:18:23 +00:00
RW
8fe1a661ec Merge pull request #1803 from gofiber/dependabot/go_modules/valkey/github.com/valkey-io/valkey-go-1.0.62
Some checks failed
Benchmark / changes (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Tests Redis / Tests (1.23.x, 6) (push) Has been cancelled
Tests Redis / Tests (1.23.x, 7) (push) Has been cancelled
Tests Redis / Tests (1.24.x, 6) (push) Has been cancelled
Tests Redis / Tests (1.24.x, 7) (push) Has been cancelled
Tests Rueidis / Tests (1.23.x, 6) (push) Has been cancelled
Tests Rueidis / Tests (1.23.x, 7) (push) Has been cancelled
Tests Rueidis / Tests (1.24.x, 6) (push) Has been cancelled
Tests Rueidis / Tests (1.24.x, 7) (push) Has been cancelled
Tests S3 / Tests (1.23.x) (push) Has been cancelled
Tests S3 / Tests (1.24.x) (push) Has been cancelled
Tests TestHelper Redis / Tests (1.23.x, 6) (push) Has been cancelled
Tests TestHelper Redis / Tests (1.23.x, 7) (push) Has been cancelled
Tests TestHelper Redis / Tests (1.24.x, 6) (push) Has been cancelled
Tests TestHelper Redis / Tests (1.24.x, 7) (push) Has been cancelled
Tests Valkey / Tests (1.23.x, 7) (push) Has been cancelled
Tests Valkey / Tests (1.23.x, 8) (push) Has been cancelled
Tests Valkey / Tests (1.24.x, 7) (push) Has been cancelled
Tests Valkey / Tests (1.24.x, 8) (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
chore(deps): bump github.com/valkey-io/valkey-go from 1.0.61 to 1.0.62 in /valkey
2025-06-27 09:22:17 +02:00
RW
d806d258ef Merge pull request #1802 from gofiber/dependabot/go_modules/rueidis/github.com/redis/rueidis-1.0.62
chore(deps): bump github.com/redis/rueidis from 1.0.61 to 1.0.62 in /rueidis
2025-06-27 09:21:57 +02:00
dependabot[bot]
88b3cb24be chore(deps): bump github.com/valkey-io/valkey-go in /valkey
Bumps [github.com/valkey-io/valkey-go](https://github.com/valkey-io/valkey-go) from 1.0.61 to 1.0.62.
- [Release notes](https://github.com/valkey-io/valkey-go/releases)
- [Commits](https://github.com/valkey-io/valkey-go/compare/v1.0.61...v1.0.62)

---
updated-dependencies:
- dependency-name: github.com/valkey-io/valkey-go
  dependency-version: 1.0.62
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-27 07:20:15 +00:00
dependabot[bot]
ad20f62903 chore(deps): bump github.com/redis/rueidis in /rueidis
Bumps [github.com/redis/rueidis](https://github.com/redis/rueidis) from 1.0.61 to 1.0.62.
- [Release notes](https://github.com/redis/rueidis/releases)
- [Commits](https://github.com/redis/rueidis/compare/v1.0.61...v1.0.62)

---
updated-dependencies:
- dependency-name: github.com/redis/rueidis
  dependency-version: 1.0.62
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-27 07:20:10 +00:00
RW
99fc0e2590 Merge pull request #1800 from gofiber/dependabot/go_modules/s3/github.com/aws/aws-sdk-go-v2/feature/s3/manager-1.17.82
chore(deps): bump github.com/aws/aws-sdk-go-v2/feature/s3/manager from 1.17.81 to 1.17.82 in /s3
2025-06-26 09:18:04 +02:00
dependabot[bot]
2e20a4d558 chore(deps): bump github.com/aws/aws-sdk-go-v2/feature/s3/manager in /s3
Bumps [github.com/aws/aws-sdk-go-v2/feature/s3/manager](https://github.com/aws/aws-sdk-go-v2) from 1.17.81 to 1.17.82.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/feature/s3/manager/v1.17.81...feature/s3/manager/v1.17.82)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/feature/s3/manager
  dependency-version: 1.17.82
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-26 07:16:33 +00:00
RW
bd9313079b Delete go.work 2025-06-26 09:02:04 +02:00
Muhammed Efe Cetin
64111772da Add WithContext methods to storage.go
Add WithContext methods to storage.go
2025-06-25 16:03:19 +03:00
Muhammed Efe Cetin
5b0ff185f2 fix tests 2025-06-25 15:38:08 +03:00
Muhammed Efe Cetin
cf369907b8 update tests 2025-06-25 15:18:30 +03:00
Muhammed Efe Cetin
d95247b156 update go version matrix for some storage workflows 2025-06-25 14:46:06 +03:00
Muhammed Efe Cetin
2841c64d32 add context support to more storages 2025-06-25 14:36:56 +03:00
Muhammed Efe Cetin
75b43b2ac4 add context support to more storages 2025-06-25 14:13:21 +03:00
M. Efe Çetin
85ffd9d133 Merge branch 'main' into add-withcontext 2025-06-25 13:56:00 +03:00
RW
a1921fcac8 Merge pull request #1798 from gofiber/dependabot/go_modules/redis/github.com/redis/go-redis/v9-9.11.0
chore(deps): bump github.com/redis/go-redis/v9 from 9.10.0 to 9.11.0 in /redis
2025-06-25 09:52:42 +02:00
RW
c45802b369 Merge pull request #1799 from gofiber/dependabot/go_modules/testhelpers/redis/github.com/redis/go-redis/v9-9.11.0
chore(deps): bump github.com/redis/go-redis/v9 from 9.10.0 to 9.11.0 in /testhelpers/redis
2025-06-25 09:51:53 +02:00
dependabot[bot]
38c493be10 chore(deps): bump github.com/redis/go-redis/v9 in /testhelpers/redis
Bumps [github.com/redis/go-redis/v9](https://github.com/redis/go-redis) from 9.10.0 to 9.11.0.
- [Release notes](https://github.com/redis/go-redis/releases)
- [Changelog](https://github.com/redis/go-redis/blob/master/CHANGELOG.md)
- [Commits](https://github.com/redis/go-redis/compare/v9.10.0...v9.11.0)

---
updated-dependencies:
- dependency-name: github.com/redis/go-redis/v9
  dependency-version: 9.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-25 07:50:52 +00:00
dependabot[bot]
ffeaf190a6 chore(deps): bump github.com/redis/go-redis/v9 in /redis
Bumps [github.com/redis/go-redis/v9](https://github.com/redis/go-redis) from 9.10.0 to 9.11.0.
- [Release notes](https://github.com/redis/go-redis/releases)
- [Changelog](https://github.com/redis/go-redis/blob/master/CHANGELOG.md)
- [Commits](https://github.com/redis/go-redis/compare/v9.10.0...v9.11.0)

---
updated-dependencies:
- dependency-name: github.com/redis/go-redis/v9
  dependency-version: 9.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-25 07:50:44 +00:00
RW
2cab07ac23 Merge pull request #1796 from gofiber/dependabot/go_modules/clickhouse/github.com/ClickHouse/clickhouse-go/v2-2.37.2
Some checks failed
Benchmark / changes (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Tests Clickhouse / Tests (1.23.x) (push) Has been cancelled
Tests Clickhouse / Tests (1.24.x) (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
chore(deps): bump github.com/ClickHouse/clickhouse-go/v2 from 2.37.1 to 2.37.2 in /clickhouse
2025-06-24 10:17:14 +02:00
dependabot[bot]
9e9f692339 chore(deps): bump github.com/ClickHouse/clickhouse-go/v2 in /clickhouse
Bumps [github.com/ClickHouse/clickhouse-go/v2](https://github.com/ClickHouse/clickhouse-go) from 2.37.1 to 2.37.2.
- [Release notes](https://github.com/ClickHouse/clickhouse-go/releases)
- [Changelog](https://github.com/ClickHouse/clickhouse-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ClickHouse/clickhouse-go/compare/v2.37.1...v2.37.2)

---
updated-dependencies:
- dependency-name: github.com/ClickHouse/clickhouse-go/v2
  dependency-version: 2.37.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-24 08:15:13 +00:00
RW
bda063edd9 Update dependabot.yml
Some checks failed
Benchmark / changes (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
Tests Coherence / Tests (1.23.x) (push) Has been cancelled
Tests Coherence / Tests (1.24.x) (push) Has been cancelled
2025-06-23 11:07:04 +02:00
RW
e8eac60d32 Merge pull request #1794 from gofiber/dependabot/go_modules/coherence/github.com/oracle/coherence-go-client/v2-2.3.1
chore(deps): bump github.com/oracle/coherence-go-client/v2 from 2.3.0 to 2.3.1 in /coherence
2025-06-23 11:00:31 +02:00
dependabot[bot]
fcd6ee741d chore(deps): bump github.com/oracle/coherence-go-client/v2 in /coherence
Bumps [github.com/oracle/coherence-go-client/v2](https://github.com/oracle/coherence-go-client) from 2.3.0 to 2.3.1.
- [Release notes](https://github.com/oracle/coherence-go-client/releases)
- [Commits](https://github.com/oracle/coherence-go-client/compare/v2.3.0...v2.3.1)

---
updated-dependencies:
- dependency-name: github.com/oracle/coherence-go-client/v2
  dependency-version: 2.3.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-23 08:57:55 +00:00
RW
129a9b4a03 Merge pull request #1785 from gofiber/dependabot/go_modules/dynamodb/github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue-1.19.3
Some checks failed
Benchmark / changes (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Tests DynamoDB / Tests (1.23.x) (push) Has been cancelled
Tests DynamoDB / Tests (1.24.x) (push) Has been cancelled
Tests S3 / Tests (1.23.x) (push) Has been cancelled
Tests S3 / Tests (1.24.x) (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
chore(deps): bump github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue from 1.19.2 to 1.19.3 in /dynamodb
2025-06-19 10:00:33 +02:00
dependabot[bot]
9470818c26 chore(deps): bump github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue
Bumps [github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue](https://github.com/aws/aws-sdk-go-v2) from 1.19.2 to 1.19.3.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/mq/v1.19.2...service/pi/v1.19.3)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue
  dependency-version: 1.19.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-19 07:59:14 +00:00
RW
fe8eba6afe Merge pull request #1792 from gofiber/dependabot/go_modules/s3/github.com/aws/aws-sdk-go-v2/feature/s3/manager-1.17.81
chore(deps): bump github.com/aws/aws-sdk-go-v2/feature/s3/manager from 1.17.79 to 1.17.81 in /s3
2025-06-19 09:57:44 +02:00
dependabot[bot]
9e0adc6f17 chore(deps): bump github.com/aws/aws-sdk-go-v2/feature/s3/manager in /s3
Bumps [github.com/aws/aws-sdk-go-v2/feature/s3/manager](https://github.com/aws/aws-sdk-go-v2) from 1.17.79 to 1.17.81.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/feature/s3/manager/v1.17.79...feature/s3/manager/v1.17.81)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/feature/s3/manager
  dependency-version: 1.17.81
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-19 07:56:09 +00:00
RW
676b7c385b Merge pull request #1787 from gofiber/dependabot/go_modules/s3/github.com/aws/aws-sdk-go-v2/service/s3-1.80.3
Some checks failed
Benchmark / changes (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
Tests DynamoDB / Tests (1.23.x) (push) Has been cancelled
Tests DynamoDB / Tests (1.24.x) (push) Has been cancelled
Tests S3 / Tests (1.23.x) (push) Has been cancelled
Tests S3 / Tests (1.24.x) (push) Has been cancelled
chore(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.80.2 to 1.80.3 in /s3
2025-06-18 09:37:01 +02:00
dependabot[bot]
c5d36121f9 chore(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 in /s3
Bumps [github.com/aws/aws-sdk-go-v2/service/s3](https://github.com/aws/aws-sdk-go-v2) from 1.80.2 to 1.80.3.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.80.2...service/s3/v1.80.3)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/s3
  dependency-version: 1.80.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-18 07:35:20 +00:00
RW
287fb557dd Merge pull request #1783 from gofiber/dependabot/go_modules/dynamodb/github.com/aws/aws-sdk-go-v2/config-1.29.17
chore(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.29.16 to 1.29.17 in /dynamodb
2025-06-18 09:33:09 +02:00
dependabot[bot]
0fa7c1c3c0 chore(deps): bump github.com/aws/aws-sdk-go-v2/config in /dynamodb
Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.29.16 to 1.29.17.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.29.16...config/v1.29.17)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-version: 1.29.17
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-18 07:33:02 +00:00
RW
6150b60e10 Merge pull request #1782 from gofiber/dependabot/go_modules/dynamodb/github.com/aws/aws-sdk-go-v2/service/dynamodb-1.43.4
chore(deps): bump github.com/aws/aws-sdk-go-v2/service/dynamodb from 1.43.3 to 1.43.4 in /dynamodb
2025-06-18 09:31:39 +02:00
dependabot[bot]
1144ec5054 chore(deps): bump github.com/aws/aws-sdk-go-v2/service/dynamodb
Bumps [github.com/aws/aws-sdk-go-v2/service/dynamodb](https://github.com/aws/aws-sdk-go-v2) from 1.43.3 to 1.43.4.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/ssm/v1.43.3...service/ivs/v1.43.4)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/dynamodb
  dependency-version: 1.43.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-18 07:30:14 +00:00
RW
f6ebad3ae3 Merge pull request #1779 from gofiber/dependabot/go_modules/clickhouse/github.com/ClickHouse/clickhouse-go/v2-2.37.1
Some checks failed
Benchmark / changes (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
Tests S3 / Tests (1.23.x) (push) Has been cancelled
Tests S3 / Tests (1.24.x) (push) Has been cancelled
Tests Clickhouse / Tests (1.23.x) (push) Has been cancelled
Tests Clickhouse / Tests (1.24.x) (push) Has been cancelled
Tests Minio / Tests (1.23.x) (push) Has been cancelled
Tests Minio / Tests (1.24.x) (push) Has been cancelled
chore(deps): bump github.com/ClickHouse/clickhouse-go/v2 from 2.36.0 to 2.37.1 in /clickhouse
2025-06-17 09:41:52 +02:00
RW
a872a0b45f Merge pull request #1781 from gofiber/dependabot/go_modules/s3/github.com/aws/smithy-go-1.22.4
chore(deps): bump github.com/aws/smithy-go from 1.22.3 to 1.22.4 in /s3
2025-06-17 09:41:20 +02:00
RW
91191d439b Merge pull request #1780 from gofiber/dependabot/go_modules/minio/github.com/minio/minio-go/v7-7.0.94
chore(deps): bump github.com/minio/minio-go/v7 from 7.0.93 to 7.0.94 in /minio
2025-06-17 09:41:18 +02:00
dependabot[bot]
fea1743ad1 chore(deps): bump github.com/aws/smithy-go from 1.22.3 to 1.22.4 in /s3
Bumps [github.com/aws/smithy-go](https://github.com/aws/smithy-go) from 1.22.3 to 1.22.4.
- [Release notes](https://github.com/aws/smithy-go/releases)
- [Changelog](https://github.com/aws/smithy-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/smithy-go/compare/v1.22.3...v1.22.4)

---
updated-dependencies:
- dependency-name: github.com/aws/smithy-go
  dependency-version: 1.22.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-17 07:40:16 +00:00
dependabot[bot]
9acde27b81 chore(deps): bump github.com/minio/minio-go/v7 in /minio
Bumps [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) from 7.0.93 to 7.0.94.
- [Release notes](https://github.com/minio/minio-go/releases)
- [Commits](https://github.com/minio/minio-go/compare/v7.0.93...v7.0.94)

---
updated-dependencies:
- dependency-name: github.com/minio/minio-go/v7
  dependency-version: 7.0.94
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-17 07:40:08 +00:00
dependabot[bot]
bf35e275d9 chore(deps): bump github.com/ClickHouse/clickhouse-go/v2 in /clickhouse
Bumps [github.com/ClickHouse/clickhouse-go/v2](https://github.com/ClickHouse/clickhouse-go) from 2.36.0 to 2.37.1.
- [Release notes](https://github.com/ClickHouse/clickhouse-go/releases)
- [Changelog](https://github.com/ClickHouse/clickhouse-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ClickHouse/clickhouse-go/compare/v2.36.0...v2.37.1)

---
updated-dependencies:
- dependency-name: github.com/ClickHouse/clickhouse-go/v2
  dependency-version: 2.37.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-17 07:39:59 +00:00
RW
06387240dd Merge pull request #1778 from gofiber/dependabot/go_modules/coherence/github.com/oracle/coherence-go-client/v2-2.3.0
Some checks failed
Benchmark / changes (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
Tests Coherence / Tests (1.23.x) (push) Has been cancelled
Tests Coherence / Tests (1.24.x) (push) Has been cancelled
chore(deps): bump github.com/oracle/coherence-go-client/v2 from 2.2.0 to 2.3.0 in /coherence
2025-06-16 10:09:15 +02:00
dependabot[bot]
048f64d774 chore(deps): bump github.com/oracle/coherence-go-client/v2 in /coherence
Bumps [github.com/oracle/coherence-go-client/v2](https://github.com/oracle/coherence-go-client) from 2.2.0 to 2.3.0.
- [Release notes](https://github.com/oracle/coherence-go-client/releases)
- [Commits](https://github.com/oracle/coherence-go-client/compare/v2.2.0...v2.3.0)

---
updated-dependencies:
- dependency-name: github.com/oracle/coherence-go-client/v2
  dependency-version: 2.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-16 08:06:38 +00:00
RW
4ab3b3c0bd Merge pull request #1777 from gofiber/dependabot/go_modules/mysql/github.com/go-sql-driver/mysql-1.9.3
Some checks failed
Benchmark / changes (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Tests MySQL / Tests (1.23.x) (push) Has been cancelled
Tests MySQL / Tests (1.24.x) (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
chore(deps): bump github.com/go-sql-driver/mysql from 1.9.2 to 1.9.3 in /mysql
2025-06-13 09:29:11 +02:00
dependabot[bot]
a0e741ea81 chore(deps): bump github.com/go-sql-driver/mysql in /mysql
Bumps [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) from 1.9.2 to 1.9.3.
- [Release notes](https://github.com/go-sql-driver/mysql/releases)
- [Changelog](https://github.com/go-sql-driver/mysql/blob/v1.9.3/CHANGELOG.md)
- [Commits](https://github.com/go-sql-driver/mysql/compare/v1.9.2...v1.9.3)

---
updated-dependencies:
- dependency-name: github.com/go-sql-driver/mysql
  dependency-version: 1.9.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-13 07:26:18 +00:00
RW
0c03dbe199 Merge pull request #1776 from gofiber/dependabot/go_modules/minio/github.com/minio/minio-go/v7-7.0.93
Some checks failed
Benchmark / changes (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
Tests Minio / Tests (1.23.x) (push) Has been cancelled
Tests Minio / Tests (1.24.x) (push) Has been cancelled
chore(deps): bump github.com/minio/minio-go/v7 from 7.0.92 to 7.0.93 in /minio
2025-06-12 09:25:46 +02:00
dependabot[bot]
8ee03469cb chore(deps): bump github.com/minio/minio-go/v7 in /minio
Bumps [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) from 7.0.92 to 7.0.93.
- [Release notes](https://github.com/minio/minio-go/releases)
- [Commits](https://github.com/minio/minio-go/compare/v7.0.92...v7.0.93)

---
updated-dependencies:
- dependency-name: github.com/minio/minio-go/v7
  dependency-version: 7.0.93
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-12 07:24:37 +00:00
RW
eb223558f8 Merge pull request #1772 from gofiber/dependabot/go_modules/s3/github.com/aws/aws-sdk-go-v2/feature/s3/manager-1.17.79
Some checks failed
Benchmark / changes (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
Tests DynamoDB / Tests (1.23.x) (push) Has been cancelled
Tests DynamoDB / Tests (1.24.x) (push) Has been cancelled
Tests S3 / Tests (1.23.x) (push) Has been cancelled
Tests S3 / Tests (1.24.x) (push) Has been cancelled
chore(deps): bump github.com/aws/aws-sdk-go-v2/feature/s3/manager from 1.17.77 to 1.17.79 in /s3
2025-06-11 09:56:40 +02:00
dependabot[bot]
b31aabce01 chore(deps): bump github.com/aws/aws-sdk-go-v2/feature/s3/manager in /s3
Bumps [github.com/aws/aws-sdk-go-v2/feature/s3/manager](https://github.com/aws/aws-sdk-go-v2) from 1.17.77 to 1.17.79.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/feature/s3/manager/v1.17.77...feature/s3/manager/v1.17.79)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/feature/s3/manager
  dependency-version: 1.17.79
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-11 07:55:48 +00:00
RW
1984506cfd Merge pull request #1773 from gofiber/dependabot/go_modules/s3/github.com/aws/aws-sdk-go-v2/config-1.29.16
chore(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.29.15 to 1.29.16 in /s3
2025-06-11 09:54:35 +02:00
RW
9a7df92ade Merge pull request #1775 from gofiber/dependabot/go_modules/s3/github.com/aws/aws-sdk-go-v2-1.36.4
chore(deps): bump github.com/aws/aws-sdk-go-v2 from 1.36.3 to 1.36.4 in /s3
2025-06-11 09:54:32 +02:00
RW
c603327efd Merge pull request #1771 from gofiber/dependabot/go_modules/s3/github.com/aws/aws-sdk-go-v2/service/s3-1.80.2
chore(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.80.1 to 1.80.2 in /s3
2025-06-11 09:54:27 +02:00
dependabot[bot]
aee853e12e chore(deps): bump github.com/aws/aws-sdk-go-v2/config in /s3
Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.29.15 to 1.29.16.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.29.15...config/v1.29.16)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-version: 1.29.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-11 07:54:25 +00:00
RW
bd5ce882fb Merge pull request #1774 from gofiber/dependabot/go_modules/s3/github.com/aws/aws-sdk-go-v2/credentials-1.17.69
chore(deps): bump github.com/aws/aws-sdk-go-v2/credentials from 1.17.68 to 1.17.69 in /s3
2025-06-11 09:53:37 +02:00
dependabot[bot]
53b9539472 chore(deps): bump github.com/aws/aws-sdk-go-v2 in /s3
Bumps [github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2) from 1.36.3 to 1.36.4.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.36.3...v1.36.4)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2
  dependency-version: 1.36.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-11 07:53:34 +00:00
dependabot[bot]
363be39151 chore(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 in /s3
Bumps [github.com/aws/aws-sdk-go-v2/service/s3](https://github.com/aws/aws-sdk-go-v2) from 1.80.1 to 1.80.2.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.80.1...service/s3/v1.80.2)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/s3
  dependency-version: 1.80.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-11 07:53:25 +00:00
dependabot[bot]
0404c9479c chore(deps): bump github.com/aws/aws-sdk-go-v2/credentials in /s3
Bumps [github.com/aws/aws-sdk-go-v2/credentials](https://github.com/aws/aws-sdk-go-v2) from 1.17.68 to 1.17.69.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/credentials/v1.17.68...credentials/v1.17.69)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/credentials
  dependency-version: 1.17.69
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-11 07:52:35 +00:00
RW
6de3835af3 Merge pull request #1769 from gofiber/dependabot/go_modules/dynamodb/github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue-1.19.2
chore(deps): bump github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue from 1.19.1 to 1.19.2 in /dynamodb
2025-06-11 09:51:59 +02:00
dependabot[bot]
f8cae390d6 chore(deps): bump github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue
Bumps [github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue](https://github.com/aws/aws-sdk-go-v2) from 1.19.1 to 1.19.2.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.19.1...service/mq/v1.19.2)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue
  dependency-version: 1.19.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-11 07:50:41 +00:00
RW
ff407691a9 Merge pull request #1763 from gofiber/dependabot/go_modules/s3/github.com/aws/aws-sdk-go-v2/credentials-1.17.68
chore(deps): bump github.com/aws/aws-sdk-go-v2/credentials from 1.17.67 to 1.17.68 in /s3
2025-06-11 09:49:15 +02:00
dependabot[bot]
535b29cba8 chore(deps): bump github.com/aws/aws-sdk-go-v2/credentials in /s3
Bumps [github.com/aws/aws-sdk-go-v2/credentials](https://github.com/aws/aws-sdk-go-v2) from 1.17.67 to 1.17.68.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/credentials/v1.17.67...credentials/v1.17.68)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/credentials
  dependency-version: 1.17.68
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-11 07:48:14 +00:00
RW
23106b5a0b Merge pull request #1767 from gofiber/dependabot/go_modules/dynamodb/github.com/aws/aws-sdk-go-v2/config-1.29.16
chore(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.29.15 to 1.29.16 in /dynamodb
2025-06-11 09:47:24 +02:00
dependabot[bot]
51cadf014a chore(deps): bump github.com/aws/aws-sdk-go-v2/config in /dynamodb
Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.29.15 to 1.29.16.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.29.15...config/v1.29.16)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-version: 1.29.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-11 07:47:16 +00:00
RW
708a8075e1 Merge pull request #1766 from gofiber/dependabot/go_modules/dynamodb/github.com/aws/aws-sdk-go-v2/service/dynamodb-1.43.3
chore(deps): bump github.com/aws/aws-sdk-go-v2/service/dynamodb from 1.43.2 to 1.43.3 in /dynamodb
2025-06-11 09:45:50 +02:00
dependabot[bot]
544043e9ca chore(deps): bump github.com/aws/aws-sdk-go-v2/service/dynamodb
Bumps [github.com/aws/aws-sdk-go-v2/service/dynamodb](https://github.com/aws/aws-sdk-go-v2) from 1.43.2 to 1.43.3.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/ssm/v1.43.2...service/ssm/v1.43.3)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/dynamodb
  dependency-version: 1.43.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-11 07:44:29 +00:00
RW
f70f371c8e Merge pull request #1762 from gofiber/dependabot/go_modules/valkey/github.com/valkey-io/valkey-go-1.0.61
Some checks failed
Benchmark / changes (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Tests DynamoDB / Tests (1.23.x) (push) Has been cancelled
Tests DynamoDB / Tests (1.24.x) (push) Has been cancelled
Tests Redis / Tests (1.23.x, 6) (push) Has been cancelled
Tests Redis / Tests (1.23.x, 7) (push) Has been cancelled
Tests Redis / Tests (1.24.x, 6) (push) Has been cancelled
Tests Redis / Tests (1.24.x, 7) (push) Has been cancelled
Tests Rueidis / Tests (1.23.x, 6) (push) Has been cancelled
Tests Rueidis / Tests (1.23.x, 7) (push) Has been cancelled
Tests Rueidis / Tests (1.24.x, 6) (push) Has been cancelled
Tests Rueidis / Tests (1.24.x, 7) (push) Has been cancelled
Tests S3 / Tests (1.23.x) (push) Has been cancelled
Tests S3 / Tests (1.24.x) (push) Has been cancelled
Tests TestHelper Redis / Tests (1.23.x, 6) (push) Has been cancelled
Tests TestHelper Redis / Tests (1.23.x, 7) (push) Has been cancelled
Tests TestHelper Redis / Tests (1.24.x, 6) (push) Has been cancelled
Tests TestHelper Redis / Tests (1.24.x, 7) (push) Has been cancelled
Tests Valkey / Tests (1.23.x, 7) (push) Has been cancelled
Tests Valkey / Tests (1.23.x, 8) (push) Has been cancelled
Tests Valkey / Tests (1.24.x, 7) (push) Has been cancelled
Tests Valkey / Tests (1.24.x, 8) (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
chore(deps): bump github.com/valkey-io/valkey-go from 1.0.60 to 1.0.61 in /valkey
2025-06-09 10:58:57 +02:00
dependabot[bot]
074537ef41 chore(deps): bump github.com/valkey-io/valkey-go in /valkey
Bumps [github.com/valkey-io/valkey-go](https://github.com/valkey-io/valkey-go) from 1.0.60 to 1.0.61.
- [Release notes](https://github.com/valkey-io/valkey-go/releases)
- [Commits](https://github.com/valkey-io/valkey-go/compare/v1.0.60...v1.0.61)

---
updated-dependencies:
- dependency-name: github.com/valkey-io/valkey-go
  dependency-version: 1.0.61
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-09 08:57:07 +00:00
RW
1a6c4754d6 Merge pull request #1761 from gofiber/dependabot/go_modules/s3/github.com/aws/aws-sdk-go-v2/config-1.29.15
chore(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.29.14 to 1.29.15 in /s3
2025-06-09 10:43:12 +02:00
RW
a27e2d7e38 Merge pull request #1753 from gofiber/dependabot/go_modules/dynamodb/github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue-1.19.1
chore(deps): bump github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue from 1.19.0 to 1.19.1 in /dynamodb
2025-06-09 10:42:57 +02:00
RW
ff897f62f5 Merge pull request #1760 from gofiber/dependabot/go_modules/testhelpers/redis/github.com/redis/go-redis/v9-9.10.0
chore(deps): bump github.com/redis/go-redis/v9 from 9.9.0 to 9.10.0 in /testhelpers/redis
2025-06-09 10:42:48 +02:00
RW
1993e96068 Merge pull request #1759 from gofiber/dependabot/go_modules/s3/github.com/aws/aws-sdk-go-v2/service/s3-1.80.1
chore(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.80.0 to 1.80.1 in /s3
2025-06-09 10:42:23 +02:00
dependabot[bot]
00ccfbd917 chore(deps): bump github.com/aws/aws-sdk-go-v2/config in /s3
Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.29.14 to 1.29.15.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.29.14...config/v1.29.15)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-version: 1.29.15
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-09 08:41:59 +00:00
dependabot[bot]
c55ad9852a chore(deps): bump github.com/redis/go-redis/v9 in /testhelpers/redis
Bumps [github.com/redis/go-redis/v9](https://github.com/redis/go-redis) from 9.9.0 to 9.10.0.
- [Release notes](https://github.com/redis/go-redis/releases)
- [Changelog](https://github.com/redis/go-redis/blob/master/CHANGELOG.md)
- [Commits](https://github.com/redis/go-redis/compare/v9.9.0...v9.10.0)

---
updated-dependencies:
- dependency-name: github.com/redis/go-redis/v9
  dependency-version: 9.10.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-09 08:41:19 +00:00
dependabot[bot]
87171e462b chore(deps): bump github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue
Bumps [github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue](https://github.com/aws/aws-sdk-go-v2) from 1.19.0 to 1.19.1.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/v1.19.1/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.19.0...v1.19.1)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue
  dependency-version: 1.19.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-09 08:41:04 +00:00
dependabot[bot]
43f19bf837 chore(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 in /s3
Bumps [github.com/aws/aws-sdk-go-v2/service/s3](https://github.com/aws/aws-sdk-go-v2) from 1.80.0 to 1.80.1.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.80.0...service/s3/v1.80.1)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/s3
  dependency-version: 1.80.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-09 08:41:03 +00:00
RW
794f267560 Merge pull request #1757 from gofiber/dependabot/go_modules/redis/github.com/redis/go-redis/v9-9.10.0
chore(deps): bump github.com/redis/go-redis/v9 from 9.9.0 to 9.10.0 in /redis
2025-06-09 10:40:48 +02:00
RW
359f17bdb6 Merge pull request #1756 from gofiber/dependabot/go_modules/dynamodb/github.com/aws/aws-sdk-go-v2/service/dynamodb-1.43.2
chore(deps): bump github.com/aws/aws-sdk-go-v2/service/dynamodb from 1.43.1 to 1.43.2 in /dynamodb
2025-06-09 10:39:08 +02:00
dependabot[bot]
22c8749ebd chore(deps): bump github.com/redis/go-redis/v9 in /redis
Bumps [github.com/redis/go-redis/v9](https://github.com/redis/go-redis) from 9.9.0 to 9.10.0.
- [Release notes](https://github.com/redis/go-redis/releases)
- [Changelog](https://github.com/redis/go-redis/blob/master/CHANGELOG.md)
- [Commits](https://github.com/redis/go-redis/compare/v9.9.0...v9.10.0)

---
updated-dependencies:
- dependency-name: github.com/redis/go-redis/v9
  dependency-version: 9.10.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-09 08:38:48 +00:00
RW
c40fab2f49 Merge pull request #1755 from gofiber/dependabot/go_modules/rueidis/github.com/redis/rueidis-1.0.61
chore(deps): bump github.com/redis/rueidis from 1.0.60 to 1.0.61 in /rueidis
2025-06-09 10:38:30 +02:00
dependabot[bot]
295b6144e5 chore(deps): bump github.com/aws/aws-sdk-go-v2/service/dynamodb
Bumps [github.com/aws/aws-sdk-go-v2/service/dynamodb](https://github.com/aws/aws-sdk-go-v2) from 1.43.1 to 1.43.2.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.43.1...service/ssm/v1.43.2)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/dynamodb
  dependency-version: 1.43.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-09 08:37:44 +00:00
dependabot[bot]
e730d3061e chore(deps): bump github.com/redis/rueidis in /rueidis
Bumps [github.com/redis/rueidis](https://github.com/redis/rueidis) from 1.0.60 to 1.0.61.
- [Release notes](https://github.com/redis/rueidis/releases)
- [Commits](https://github.com/redis/rueidis/compare/v1.0.60...v1.0.61)

---
updated-dependencies:
- dependency-name: github.com/redis/rueidis
  dependency-version: 1.0.61
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-09 08:36:43 +00:00
RW
31d99f8c13 Merge pull request #1752 from gofiber/dependabot/go_modules/dynamodb/github.com/aws/aws-sdk-go-v2/config-1.29.15
chore(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.29.14 to 1.29.15 in /dynamodb
2025-06-09 10:33:02 +02:00
dependabot[bot]
052af41b84 chore(deps): bump github.com/aws/aws-sdk-go-v2/config in /dynamodb
Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.29.14 to 1.29.15.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.29.14...config/v1.29.15)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-version: 1.29.15
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-09 08:31:33 +00:00
RW
087d3e71d7 Merge pull request #1751 from gofiber/dependabot/go_modules/mongodb/go.mongodb.org/mongo-driver-1.17.4
Some checks failed
Benchmark / changes (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Tests Mongodb / Tests (1.23.x) (push) Has been cancelled
Tests Mongodb / Tests (1.24.x) (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
chore(deps): bump go.mongodb.org/mongo-driver from 1.17.3 to 1.17.4 in /mongodb
2025-06-06 09:51:08 +02:00
dependabot[bot]
40fd1286eb chore(deps): bump go.mongodb.org/mongo-driver in /mongodb
Bumps [go.mongodb.org/mongo-driver](https://github.com/mongodb/mongo-go-driver) from 1.17.3 to 1.17.4.
- [Release notes](https://github.com/mongodb/mongo-go-driver/releases)
- [Commits](https://github.com/mongodb/mongo-go-driver/compare/v1.17.3...v1.17.4)

---
updated-dependencies:
- dependency-name: go.mongodb.org/mongo-driver
  dependency-version: 1.17.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-06 07:49:05 +00:00
RW
f7a52236a0 Merge pull request #1749 from gofiber/dependabot/go_modules/clickhouse/github.com/ClickHouse/clickhouse-go/v2-2.36.0
Some checks failed
Benchmark / changes (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Tests Clickhouse / Tests (1.23.x) (push) Has been cancelled
Tests Clickhouse / Tests (1.24.x) (push) Has been cancelled
Tests Nats Driver / Tests (1.23.x) (push) Has been cancelled
Tests Nats Driver / Tests (1.24.x) (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
chore(deps): bump github.com/ClickHouse/clickhouse-go/v2 from 2.35.0 to 2.36.0 in /clickhouse
2025-06-04 09:42:34 +02:00
RW
86e2c40dc0 Merge pull request #1750 from gofiber/dependabot/go_modules/nats/github.com/nats-io/nats.go-1.43.0
chore(deps): bump github.com/nats-io/nats.go from 1.42.0 to 1.43.0 in /nats
2025-06-04 09:42:18 +02:00
dependabot[bot]
ce2ee440e9 chore(deps): bump github.com/nats-io/nats.go in /nats
Bumps [github.com/nats-io/nats.go](https://github.com/nats-io/nats.go) from 1.42.0 to 1.43.0.
- [Release notes](https://github.com/nats-io/nats.go/releases)
- [Commits](https://github.com/nats-io/nats.go/compare/v1.42.0...v1.43.0)

---
updated-dependencies:
- dependency-name: github.com/nats-io/nats.go
  dependency-version: 1.43.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-04 07:40:53 +00:00
dependabot[bot]
e5566caab1 chore(deps): bump github.com/ClickHouse/clickhouse-go/v2 in /clickhouse
Bumps [github.com/ClickHouse/clickhouse-go/v2](https://github.com/ClickHouse/clickhouse-go) from 2.35.0 to 2.36.0.
- [Release notes](https://github.com/ClickHouse/clickhouse-go/releases)
- [Changelog](https://github.com/ClickHouse/clickhouse-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ClickHouse/clickhouse-go/compare/v2.35.0...v2.36.0)

---
updated-dependencies:
- dependency-name: github.com/ClickHouse/clickhouse-go/v2
  dependency-version: 2.36.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-04 07:40:42 +00:00
RW
82b0c39bcd Merge pull request #1747 from gofiber/dependabot/go_modules/s3/github.com/aws/aws-sdk-go-v2/feature/s3/manager-1.17.77
Some checks failed
Benchmark / changes (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Tests S3 / Tests (1.23.x) (push) Has been cancelled
Tests S3 / Tests (1.24.x) (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
chore(deps): bump github.com/aws/aws-sdk-go-v2/feature/s3/manager from 1.17.76 to 1.17.77 in /s3
2025-05-30 09:49:06 +02:00
dependabot[bot]
30b5c7a76b chore(deps): bump github.com/aws/aws-sdk-go-v2/feature/s3/manager in /s3
Bumps [github.com/aws/aws-sdk-go-v2/feature/s3/manager](https://github.com/aws/aws-sdk-go-v2) from 1.17.76 to 1.17.77.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/feature/s3/manager/v1.17.76...feature/s3/manager/v1.17.77)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/feature/s3/manager
  dependency-version: 1.17.77
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-30 07:48:04 +00:00
RW
bddb91a82d Merge pull request #1739 from gofiber/dependabot/go_modules/rueidis/github.com/redis/rueidis-1.0.60
Some checks failed
Benchmark / changes (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Tests Redis / Tests (1.23.x, 6) (push) Has been cancelled
Tests Redis / Tests (1.23.x, 7) (push) Has been cancelled
Tests Redis / Tests (1.24.x, 6) (push) Has been cancelled
Tests Redis / Tests (1.24.x, 7) (push) Has been cancelled
Tests Rueidis / Tests (1.23.x, 6) (push) Has been cancelled
Tests Rueidis / Tests (1.23.x, 7) (push) Has been cancelled
Tests Rueidis / Tests (1.24.x, 6) (push) Has been cancelled
Tests Rueidis / Tests (1.24.x, 7) (push) Has been cancelled
Tests TestHelper Redis / Tests (1.23.x, 6) (push) Has been cancelled
Tests TestHelper Redis / Tests (1.23.x, 7) (push) Has been cancelled
Tests TestHelper Redis / Tests (1.24.x, 6) (push) Has been cancelled
Tests TestHelper Redis / Tests (1.24.x, 7) (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
chore(deps): bump github.com/redis/rueidis from 1.0.44 to 1.0.60 in /rueidis
2025-05-28 09:26:11 +02:00
dependabot[bot]
2e2f3c48c0 chore(deps): bump github.com/redis/rueidis in /rueidis
Bumps [github.com/redis/rueidis](https://github.com/redis/rueidis) from 1.0.44 to 1.0.60.
- [Release notes](https://github.com/redis/rueidis/releases)
- [Commits](https://github.com/redis/rueidis/compare/v1.0.44...v1.0.60)

---
updated-dependencies:
- dependency-name: github.com/redis/rueidis
  dependency-version: 1.0.60
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-28 07:24:33 +00:00
RW
e03d911acb Merge pull request #1744 from gofiber/dependabot/go_modules/redis/github.com/redis/go-redis/v9-9.9.0
chore(deps): bump github.com/redis/go-redis/v9 from 9.8.0 to 9.9.0 in /redis
2025-05-28 09:23:42 +02:00
RW
da211647b7 Merge pull request #1745 from gofiber/dependabot/go_modules/testhelpers/redis/github.com/redis/go-redis/v9-9.9.0
chore(deps): bump github.com/redis/go-redis/v9 from 9.8.0 to 9.9.0 in /testhelpers/redis
2025-05-28 09:23:05 +02:00
dependabot[bot]
8c999edaf5 chore(deps): bump github.com/redis/go-redis/v9 in /testhelpers/redis
Bumps [github.com/redis/go-redis/v9](https://github.com/redis/go-redis) from 9.8.0 to 9.9.0.
- [Release notes](https://github.com/redis/go-redis/releases)
- [Changelog](https://github.com/redis/go-redis/blob/master/CHANGELOG.md)
- [Commits](https://github.com/redis/go-redis/compare/v9.8.0...v9.9.0)

---
updated-dependencies:
- dependency-name: github.com/redis/go-redis/v9
  dependency-version: 9.9.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-28 07:21:33 +00:00
dependabot[bot]
51ac27beaf chore(deps): bump github.com/redis/go-redis/v9 in /redis
Bumps [github.com/redis/go-redis/v9](https://github.com/redis/go-redis) from 9.8.0 to 9.9.0.
- [Release notes](https://github.com/redis/go-redis/releases)
- [Changelog](https://github.com/redis/go-redis/blob/master/CHANGELOG.md)
- [Commits](https://github.com/redis/go-redis/compare/v9.8.0...v9.9.0)

---
updated-dependencies:
- dependency-name: github.com/redis/go-redis/v9
  dependency-version: 9.9.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-28 07:21:24 +00:00
René
aeb0d91ae1 add go.work file
Some checks failed
Benchmark / changes (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
2025-05-25 17:17:19 +02:00
René
b2211037ca Merge remote-tracking branch 'origin/main' 2025-05-25 17:16:24 +02:00
René
1e89154864 add go.work file 2025-05-25 17:16:12 +02:00
Manuel de la Peña
74b3bd3f2f chore(minio): defer closing the store in test 2025-05-23 13:18:53 +02:00
Manuel de la Peña
0f13ff4a80 Merge branch 'main' into add-withcontext
* main: (168 commits)
  chore: read redis image for ruedis
  chore: align ruedis expiration test with redis
  chore: skip cluster tests
  chore: align valkey expiration test with redis
  chore: refine message
  fix: reuse valkey container in benchmarks
  chore: pass the redis-like image explicitly in tests
  fix: missing eval of redis image from env var
  chore: proper parallel layout
  chore: add integration tests to the redis helper module
  chore: verify mtls properly in tests
  chore(deps): bump github.com/aws/aws-sdk-go-v2/feature/s3/manager in /s3
  chore(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 in /s3
  chore(deps): bump github.com/ClickHouse/clickhouse-go/v2 in /clickhouse
  chore(deps): bump github.com/minio/minio-go/v7 in /minio
  chore(deps): bump github.com/valkey-io/valkey-go in /valkey
  chore(deps): bump github.com/jackc/pgx/v5 in /postgres
  chore: add tests for the helper module
  chore: make sure the client gets the variable locally
  fix(coherence): set coherence log level to ERROR in benchmarks
  ...
2025-05-23 12:53:15 +02:00
RW
f19bcd6674 Merge pull request #1723 from mdelapenya/fix-ruedis-benchmarks
Some checks failed
Benchmark / changes (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Tests Redis / Tests (1.23.x, 6) (push) Has been cancelled
Tests Redis / Tests (1.23.x, 7) (push) Has been cancelled
Tests Redis / Tests (1.24.x, 6) (push) Has been cancelled
Tests Redis / Tests (1.24.x, 7) (push) Has been cancelled
Tests Rueidis / Tests (1.23.x, 6) (push) Has been cancelled
Tests Rueidis / Tests (1.23.x, 7) (push) Has been cancelled
Tests Rueidis / Tests (1.24.x, 6) (push) Has been cancelled
Tests Rueidis / Tests (1.24.x, 7) (push) Has been cancelled
Tests TestHelper Redis / Tests (1.23.x, 6) (push) Has been cancelled
Tests TestHelper Redis / Tests (1.23.x, 7) (push) Has been cancelled
Tests TestHelper Redis / Tests (1.24.x, 6) (push) Has been cancelled
Tests TestHelper Redis / Tests (1.24.x, 7) (push) Has been cancelled
Tests Valkey / Tests (1.23.x, 7) (push) Has been cancelled
Tests Valkey / Tests (1.23.x, 8) (push) Has been cancelled
Tests Valkey / Tests (1.24.x, 7) (push) Has been cancelled
Tests Valkey / Tests (1.24.x, 8) (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
feat(redis): use testcontainers in rueidis and valkey
2025-05-23 12:36:13 +02:00
Manuel de la Peña
bf7c309100 chore: read redis image for ruedis 2025-05-23 12:31:03 +02:00
Manuel de la Peña
288cedb4a4 chore: align ruedis expiration test with redis 2025-05-23 12:30:48 +02:00
Manuel de la Peña
4c19cbad89 chore: skip cluster tests 2025-05-23 12:30:26 +02:00
Manuel de la Peña
ba248c9967 chore: align valkey expiration test with redis 2025-05-23 12:25:20 +02:00
Manuel de la Peña
168125aba4 chore: refine message 2025-05-23 12:23:18 +02:00
Manuel de la Peña
331a84b6c5 fix: reuse valkey container in benchmarks 2025-05-23 11:56:55 +02:00
Manuel de la Peña
4d516c348a chore: pass the redis-like image explicitly in tests 2025-05-23 10:38:30 +02:00
Manuel de la Peña
1e6e787ec5 fix: missing eval of redis image from env var 2025-05-23 10:20:28 +02:00
Manuel de la Peña
5794b5068f chore: proper parallel layout 2025-05-23 10:00:56 +02:00
Manuel de la Peña
941ef46eaa chore: add integration tests to the redis helper module 2025-05-23 09:57:19 +02:00
Manuel de la Peña
30b20739d0 chore: verify mtls properly in tests 2025-05-23 09:49:43 +02:00
RW
40b2566dc1 Merge pull request #1743 from gofiber/dependabot/go_modules/s3/github.com/aws/aws-sdk-go-v2/feature/s3/manager-1.17.76
Some checks failed
Benchmark / changes (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
Tests S3 / Tests (1.23.x) (push) Has been cancelled
Tests S3 / Tests (1.24.x) (push) Has been cancelled
chore(deps): bump github.com/aws/aws-sdk-go-v2/feature/s3/manager from 1.17.75 to 1.17.76 in /s3
2025-05-23 09:29:25 +02:00
dependabot[bot]
189b125e02 chore(deps): bump github.com/aws/aws-sdk-go-v2/feature/s3/manager in /s3
Bumps [github.com/aws/aws-sdk-go-v2/feature/s3/manager](https://github.com/aws/aws-sdk-go-v2) from 1.17.75 to 1.17.76.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/feature/s3/manager/v1.17.75...feature/s3/manager/v1.17.76)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/feature/s3/manager
  dependency-version: 1.17.76
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-23 07:29:17 +00:00
RW
c89793a5b6 Merge pull request #1742 from gofiber/dependabot/go_modules/s3/github.com/aws/aws-sdk-go-v2/service/s3-1.79.4
chore(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 from 1.79.3 to 1.79.4 in /s3
2025-05-23 09:27:27 +02:00
dependabot[bot]
07846ad515 chore(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 in /s3
Bumps [github.com/aws/aws-sdk-go-v2/service/s3](https://github.com/aws/aws-sdk-go-v2) from 1.79.3 to 1.79.4.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.79.3...service/s3/v1.79.4)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/s3
  dependency-version: 1.79.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-23 07:26:08 +00:00
Manuel de la Peña
b85c02262b Merge branch 'main' into fix-ruedis-benchmarks
* main:
  chore(deps): bump github.com/ClickHouse/clickhouse-go/v2 in /clickhouse
  chore(deps): bump github.com/minio/minio-go/v7 in /minio
  chore(deps): bump github.com/valkey-io/valkey-go in /valkey
  chore(deps): bump github.com/jackc/pgx/v5 in /postgres
2025-05-22 18:08:55 +02:00
RW
7089f9d809 Merge pull request #1741 from gofiber/dependabot/go_modules/clickhouse/github.com/ClickHouse/clickhouse-go/v2-2.35.0
Some checks failed
Benchmark / changes (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
Tests Clickhouse / Tests (1.23.x) (push) Has been cancelled
Tests Clickhouse / Tests (1.24.x) (push) Has been cancelled
chore(deps): bump github.com/ClickHouse/clickhouse-go/v2 from 2.34.0 to 2.35.0 in /clickhouse
2025-05-22 09:31:21 +02:00
dependabot[bot]
fc3a3a91dc chore(deps): bump github.com/ClickHouse/clickhouse-go/v2 in /clickhouse
Bumps [github.com/ClickHouse/clickhouse-go/v2](https://github.com/ClickHouse/clickhouse-go) from 2.34.0 to 2.35.0.
- [Release notes](https://github.com/ClickHouse/clickhouse-go/releases)
- [Changelog](https://github.com/ClickHouse/clickhouse-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ClickHouse/clickhouse-go/compare/v2.34.0...v2.35.0)

---
updated-dependencies:
- dependency-name: github.com/ClickHouse/clickhouse-go/v2
  dependency-version: 2.35.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-22 07:29:07 +00:00
RW
51143819c8 Merge pull request #1740 from gofiber/dependabot/go_modules/minio/github.com/minio/minio-go/v7-7.0.92
Some checks failed
Benchmark / changes (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Tests Minio / Tests (1.23.x) (push) Has been cancelled
Tests Minio / Tests (1.24.x) (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
chore(deps): bump github.com/minio/minio-go/v7 from 7.0.91 to 7.0.92 in /minio
2025-05-20 09:43:38 +02:00
dependabot[bot]
093d2519c7 chore(deps): bump github.com/minio/minio-go/v7 in /minio
Bumps [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) from 7.0.91 to 7.0.92.
- [Release notes](https://github.com/minio/minio-go/releases)
- [Commits](https://github.com/minio/minio-go/compare/v7.0.91...v7.0.92)

---
updated-dependencies:
- dependency-name: github.com/minio/minio-go/v7
  dependency-version: 7.0.92
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-20 07:42:14 +00:00
RW
ef7980445d Merge pull request #1738 from gofiber/dependabot/go_modules/valkey/github.com/valkey-io/valkey-go-1.0.60
Some checks failed
Benchmark / changes (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
Tests Postgres / Tests (1.23.x) (push) Has been cancelled
Tests Postgres / Tests (1.24.x) (push) Has been cancelled
Tests Valkey / Tests (1.23.x, 7.x) (push) Has been cancelled
Tests Valkey / Tests (1.23.x, 8.x) (push) Has been cancelled
chore(deps): bump github.com/valkey-io/valkey-go from 1.0.59 to 1.0.60 in /valkey
2025-05-19 10:03:02 +02:00
RW
743bcd8ec3 Merge pull request #1737 from gofiber/dependabot/go_modules/postgres/github.com/jackc/pgx/v5-5.7.5
chore(deps): bump github.com/jackc/pgx/v5 from 5.7.4 to 5.7.5 in /postgres
2025-05-19 10:02:42 +02:00
dependabot[bot]
24f8717aa0 chore(deps): bump github.com/valkey-io/valkey-go in /valkey
Bumps [github.com/valkey-io/valkey-go](https://github.com/valkey-io/valkey-go) from 1.0.59 to 1.0.60.
- [Release notes](https://github.com/valkey-io/valkey-go/releases)
- [Commits](https://github.com/valkey-io/valkey-go/compare/v1.0.59...v1.0.60)

---
updated-dependencies:
- dependency-name: github.com/valkey-io/valkey-go
  dependency-version: 1.0.60
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-19 08:01:22 +00:00
dependabot[bot]
3db82583cc chore(deps): bump github.com/jackc/pgx/v5 in /postgres
Bumps [github.com/jackc/pgx/v5](https://github.com/jackc/pgx) from 5.7.4 to 5.7.5.
- [Changelog](https://github.com/jackc/pgx/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jackc/pgx/compare/v5.7.4...v5.7.5)

---
updated-dependencies:
- dependency-name: github.com/jackc/pgx/v5
  dependency-version: 5.7.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-19 08:01:14 +00:00
Manuel de la Peña
46267c6361 Merge branch 'main' into fix-ruedis-benchmarks
* main:
  chore: make sure the client gets the variable locally
  fix(coherence): set coherence log level to ERROR in benchmarks
  Update coherence storage to v2.2.0
  chore(deps): bump dependabot/fetch-metadata from 2.3.0 to 2.4.0
  chore(deps): bump github.com/microsoft/go-mssqldb in /mssql
2025-05-15 19:16:56 +02:00
Manuel de la Peña
a77e60ff9f chore: add tests for the helper module 2025-05-15 19:16:08 +02:00
RW
fe41cfbd81 Merge pull request #1735 from mdelapenya/fix-coherence-benchmarks
Some checks failed
Benchmark / changes (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Tests Coherence / Tests (1.23.x) (push) Has been cancelled
Tests Coherence / Tests (1.24.x) (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
chore(coherence): make sure the client gets the variable locally
2025-05-13 13:21:33 +02:00
Manuel de la Peña
7faca3f2d0 chore: make sure the client gets the variable locally 2025-05-13 12:10:52 +02:00
RW
911bf1b50e Merge pull request #1734 from mdelapenya/fix-coherence-benchmarks
fix(coherence): set coherence log level to ERROR in benchmarks
2025-05-13 11:55:36 +02:00
Manuel de la Peña
b366427f96 fix(coherence): set coherence log level to ERROR in benchmarks 2025-05-13 11:52:35 +02:00
RW
7cb29ad8ff Merge pull request #1733 from tmiddlet2666/coherence-v220
🧹 chore: Update coherence storage to v2.2.0
2025-05-13 08:36:28 +02:00
Juan Calderon-Perez
53a943a2d5 Merge branch 'main' into coherence-v220 2025-05-12 20:31:23 -04:00
Juan Calderon-Perez
0ab6d9b3f1 Merge pull request #1732 from gofiber/dependabot/github_actions/dependabot/fetch-metadata-2.4.0
Some checks failed
Benchmark / changes (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
chore(deps): bump dependabot/fetch-metadata from 2.3.0 to 2.4.0
2025-05-12 20:25:39 -04:00
Tim Middleton
b703f5f64c Update coherence storage to v2.2.0 2025-05-13 08:20:28 +08:00
dependabot[bot]
f5f112f987 chore(deps): bump dependabot/fetch-metadata from 2.3.0 to 2.4.0
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.3.0 to 2.4.0.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.3.0...v2.4.0)

---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
  dependency-version: 2.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-12 07:42:09 +00:00
RW
7663d74cdf Merge pull request #1731 from gofiber/dependabot/go_modules/mssql/github.com/microsoft/go-mssqldb-1.8.1
Some checks failed
Benchmark / changes (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
Tests MSSQL / Tests (1.19.x) (push) Has been cancelled
Tests MSSQL / Tests (1.20.x) (push) Has been cancelled
Tests MSSQL / Tests (1.21.x) (push) Has been cancelled
chore(deps): bump github.com/microsoft/go-mssqldb from 1.8.0 to 1.8.1 in /mssql
2025-05-12 09:29:24 +02:00
dependabot[bot]
8f0819b1c5 chore(deps): bump github.com/microsoft/go-mssqldb in /mssql
Bumps [github.com/microsoft/go-mssqldb](https://github.com/microsoft/go-mssqldb) from 1.8.0 to 1.8.1.
- [Release notes](https://github.com/microsoft/go-mssqldb/releases)
- [Changelog](https://github.com/microsoft/go-mssqldb/blob/main/CHANGELOG.md)
- [Commits](https://github.com/microsoft/go-mssqldb/compare/v1.8.0...v1.8.1)

---
updated-dependencies:
- dependency-name: github.com/microsoft/go-mssqldb
  dependency-version: 1.8.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-12 07:19:49 +00:00
Manuel de la Peña
abdb9c790a Merge branch 'main' into fix-ruedis-benchmarks 2025-05-08 12:22:30 +02:00
RW
545378511c Merge pull request #1724 from mdelapenya/more-tc-modules
Some checks failed
Benchmark / changes (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
Tests Coherence / Tests (1.23.x) (push) Has been cancelled
Tests Coherence / Tests (1.24.x) (push) Has been cancelled
Tests Memcache / Tests (1.23.x) (push) Has been cancelled
Tests Memcache / Tests (1.24.x) (push) Has been cancelled
feat(coherence|memcached): use testcontainers-go in tests
2025-05-07 15:02:55 +02:00
Manuel de la Peña
af5649d1a7 fix: suppress session debug logs 2025-05-07 06:23:44 +02:00
Manuel de la Peña
adc1376cc6 fix: lint 2025-05-07 06:17:23 +02:00
Manuel de la Peña
7b2d4bb285 chore: add healthcheck to coherence 2025-05-07 05:57:21 +02:00
Juan Calderon-Perez
9dc93a5d83 Merge branch 'main' into more-tc-modules 2025-05-06 22:51:09 -04:00
RW
dc8199d089 Merge pull request #1730 from gofiber/dependabot/go_modules/s3/github.com/aws/aws-sdk-go-v2/feature/s3/manager-1.17.75
Some checks failed
Benchmark / changes (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Tests Aerospike / Tests (1.23.x) (push) Has been cancelled
Tests Aerospike / Tests (1.24.x) (push) Has been cancelled
Tests S3 / Tests (1.23.x) (push) Has been cancelled
Tests S3 / Tests (1.24.x) (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
chore(deps): bump github.com/aws/aws-sdk-go-v2/feature/s3/manager from 1.17.74 to 1.17.75 in /s3
2025-05-06 09:33:30 +02:00
RW
d73e1f3a9a Merge pull request #1729 from gofiber/dependabot/go_modules/aerospike/github.com/aerospike/aerospike-client-go/v8-8.2.2
chore(deps): bump github.com/aerospike/aerospike-client-go/v8 from 8.2.1 to 8.2.2 in /aerospike
2025-05-06 09:33:14 +02:00
dependabot[bot]
ca3a52c65b chore(deps): bump github.com/aws/aws-sdk-go-v2/feature/s3/manager in /s3
Bumps [github.com/aws/aws-sdk-go-v2/feature/s3/manager](https://github.com/aws/aws-sdk-go-v2) from 1.17.74 to 1.17.75.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/feature/s3/manager/v1.17.74...feature/s3/manager/v1.17.75)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/feature/s3/manager
  dependency-version: 1.17.75
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-06 07:32:20 +00:00
dependabot[bot]
d0e25aa231 chore(deps): bump github.com/aerospike/aerospike-client-go/v8
Bumps [github.com/aerospike/aerospike-client-go/v8](https://github.com/aerospike/aerospike-client-go) from 8.2.1 to 8.2.2.
- [Release notes](https://github.com/aerospike/aerospike-client-go/releases)
- [Changelog](https://github.com/aerospike/aerospike-client-go/blob/v8/CHANGELOG.md)
- [Commits](https://github.com/aerospike/aerospike-client-go/compare/v8.2.1...v8.2.2)

---
updated-dependencies:
- dependency-name: github.com/aerospike/aerospike-client-go/v8
  dependency-version: 8.2.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-06 07:31:23 +00:00
RW
7ef0190a4a Merge pull request #1728 from gofiber/dependabot/go_modules/nats/github.com/nats-io/nats.go-1.42.0
Some checks failed
Benchmark / changes (push) Has been cancelled
Benchmark / compare (push) Has been cancelled
Golangci-Lint Check / changes (push) Has been cancelled
Golangci-Lint Check / lint (push) Has been cancelled
Release Drafter (All) / changes (push) Has been cancelled
Release Drafter (All) / release-drafter (push) Has been cancelled
Tests Nats Driver / Tests (1.23.x) (push) Has been cancelled
Tests Nats Driver / Tests (1.24.x) (push) Has been cancelled
chore(deps): bump github.com/nats-io/nats.go from 1.41.2 to 1.42.0 in /nats
2025-05-05 10:19:04 +02:00
dependabot[bot]
fba083b9de chore(deps): bump github.com/nats-io/nats.go in /nats
Bumps [github.com/nats-io/nats.go](https://github.com/nats-io/nats.go) from 1.41.2 to 1.42.0.
- [Release notes](https://github.com/nats-io/nats.go/releases)
- [Commits](https://github.com/nats-io/nats.go/compare/v1.41.2...v1.42.0)

---
updated-dependencies:
- dependency-name: github.com/nats-io/nats.go
  dependency-version: 1.42.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-05 08:17:49 +00:00
Manuel de la Peña
bf7fc60523 chore: remove coherence from GH actions 2025-05-01 02:27:22 +02:00
Manuel de la Peña
7ed83dd161 feat(coherence): use testcontainers-go in tests 2025-05-01 02:25:07 +02:00
Manuel de la Peña
79d6043639 feat(memcached): use testcontainers-go in tests 2025-05-01 01:55:47 +02:00
Manuel de la Peña
b7893d7d4a fix: do not run benchmarks for the helpers 2025-04-30 13:44:50 +02:00
Manuel de la Peña
ba60ab9a1f fix: indentation 2025-04-30 13:41:37 +02:00
Manuel de la Peña
dd7391a11a chore(ci): exclude testhelpers root dir from the filters 2025-04-30 13:38:12 +02:00
Manuel de la Peña
7866e27c75 chore: remove shell script for cert generation 2025-04-30 13:22:50 +02:00
Manuel de la Peña
892e6fec63 chore: consume the testredis module in valkey 2025-04-30 13:21:51 +02:00
Manuel de la Peña
5b7af066bb chore: consume the testredis module in rueidis 2025-04-30 13:21:51 +02:00
Manuel de la Peña
05b5be3f18 chore: consume the testredis module in redis 2025-04-30 13:21:51 +02:00
Manuel de la Peña
76a7b0a657 chore: support for overriding the redis image 2025-04-30 13:21:43 +02:00
Manuel de la Peña
b90664baad feat: add a test module for testing redis and friends 2025-04-30 13:03:14 +02:00
Manuel de la Peña
1f42b00573 fix(benchmarks): re-add redis install for ruedis and valkey 2025-04-30 10:49:35 +02:00
Muhammed Efe Cetin
ba32290665 fix tests 2025-04-23 00:26:43 +03:00
Muhammed Efe Cetin
8dcdba4a72 coherence: add support for context management 2025-04-22 23:54:00 +03:00
Muhammed Efe Cetin
0a9e0ef282 neo4j: add support for context management 2025-04-22 23:54:00 +03:00
Manuel de la Peña
53b2205e67 chore: use testcontainers properly in mongodb 2025-04-22 23:54:00 +03:00
Manuel de la Peña
371611ba54 chore: use testcontainers properly in postgres 2025-04-22 23:54:00 +03:00
Manuel de la Peña
d1893c2e4a chore: use testcontainers properly in mysql 2025-04-22 23:54:00 +03:00
Manuel de la Peña
f3bdd2599c chore: use testcontainers properly in dynamodb 2025-04-22 23:54:00 +03:00
Manuel de la Peña
d7bbc22084 chore: use testcontainers properly in nats 2025-04-22 23:54:00 +03:00
Muhammed Efe Cetin
58388d34e8 couchbase: add support for context management 2025-04-22 23:53:24 +03:00
Muhammed Efe Cetin
634695c6fb cloudflarekv: make context functional for test_module 2025-04-22 23:53:23 +03:00
Muhammed Efe Cetin
f03ca4e3a8 cloudflarekv: add support for context management 2025-04-22 23:53:23 +03:00
Muhammed Efe Cetin
2192ac6cfe azureblob: add support for context management 2025-04-22 23:53:23 +03:00
Muhammed Efe Cetin
1b443d036e valkey: add support for context management 2025-04-22 23:52:45 +03:00
Muhammed Efe Cetin
75f5216baf sqlite3: add support for context management 2025-04-22 23:52:45 +03:00
Muhammed Efe Cetin
ce31f766b9 scylladb: add support for context management 2025-04-22 23:52:44 +03:00
Muhammed Efe Cetin
486941cc00 s3: add support for context management 2025-04-22 23:51:48 +03:00
Muhammed Efe Cetin
d6fb9319dd rueidis: add support for context management 2025-04-22 23:51:48 +03:00
Muhammed Efe Cetin
245dce0f1d redis: add support for context management 2025-04-22 23:51:47 +03:00
Muhammed Efe Cetin
a5ea1ad30f postgres: add support for context management 2025-04-22 23:51:47 +03:00
Muhammed Efe Cetin
a422c89d98 nats: add support for context management 2025-04-22 23:51:47 +03:00
Muhammed Efe Cetin
3242f93c9f mysql: add support for context management 2025-04-22 23:46:52 +03:00
Muhammed Efe Cetin
17ab512fe3 mssql: add support for context management 2025-04-22 23:46:52 +03:00
Muhammed Efe Cetin
c1e526d31d mongodb: add support for context management 2025-04-22 23:46:52 +03:00
Muhammed Efe Cetin
134e774e80 minio: add support for context management 2025-04-22 23:46:52 +03:00
Muhammed Efe Cetin
a01135d48b etcd: add support for context management 2025-04-22 23:44:32 +03:00
Muhammed Efe Cetin
9d7368cc48 dynamodb: add support for context management 2025-04-22 23:44:32 +03:00
Muhammed Efe Cetin
58bbe4632f clickhouse: add support for context management 2025-04-22 23:44:32 +03:00
Muhammed Efe Cetin
e5059da502 arangodb: add support for context management 2025-04-22 23:44:32 +03:00
168 changed files with 5587 additions and 1261 deletions

View File

@@ -23,3 +23,6 @@ updates:
patterns:
- "github.com/testcontainers/testcontainers-go"
- "github.com/testcontainers/testcontainers-go/modules/**"
utils-modules:
patterns:
- "github.com/gofiber/utils/v2"

View File

@@ -1,63 +0,0 @@
#!/bin/bash
# Generate some test certificates which are used by the regression test suite:
#
# ./tls/ca.{crt,key} Self signed CA certificate.
# ./tls/redis.{crt,key} A certificate with no key usage/policy restrictions.
# ./tls/client.{crt,key} A certificate restricted for SSL client usage.
# ./tls/server.{crt,key} A certificate restricted for SSL server usage.
set -e
generate_cert() {
local name=$1
local cn="$2"
local opts="$3"
local keyfile=./tls/${name}.key
local certfile=./tls/${name}.crt
[ -f $keyfile ] || openssl genrsa -out $keyfile 2048
openssl req \
-new -sha256 \
-subj "/O=Redis Test/CN=$cn" \
-key $keyfile | \
openssl x509 \
-req -sha256 \
-CA ./tls/ca.crt \
-CAkey ./tls/ca.key \
-CAserial ./tls/ca.txt \
-CAcreateserial \
-days 365 \
$opts \
-out $certfile
}
mkdir -p ./tls
[ -f ./tls/ca.key ] || openssl genrsa -out ./tls/ca.key 4096
openssl req \
-x509 -new -nodes -sha256 \
-key ./tls/ca.key \
-days 3650 \
-subj '/O=Redis Test/CN=Certificate Authority' \
-out ./tls/ca.crt
cat > ./tls/openssl.cnf <<_END_
[ server_cert ]
keyUsage = digitalSignature, keyEncipherment
nsCertType = server
subjectAltName = DNS:localhost"
[ client_cert ]
keyUsage = digitalSignature, keyEncipherment
nsCertType = client
_END_
generate_cert server "Server-only" "-extfile ./tls/openssl.cnf -extensions server_cert"
generate_cert client "Client-only" "-extfile ./tls/openssl.cnf -extensions client_cert"
generate_cert redis "localhost" "-extfile ./tls/openssl.cnf -extensions server_cert"
generate_cert valkey "localhost" "-extfile ./tls/openssl.cnf -extensions server_cert"
# List generated certs
ls -la ./tls
echo "$PWD"

View File

@@ -28,7 +28,7 @@ jobs:
- name: Generate filters
id: filter-setup
run: |
filters=$(find . -maxdepth 1 -type d ! -path ./.git ! -path . -exec basename {} \; | grep -v '^\.' | awk '{printf "%s: \"%s/**\"\n", $1, $1}')
filters=$(find . -maxdepth 1 -type d ! -path ./.git ! -path . ! -path ./testhelpers -exec basename {} \; | grep -v '^\.' | awk '{printf "%s: \"%s/**\"\n", $1, $1}')
echo "filters<<EOF" >> $GITHUB_OUTPUT
echo "$filters" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
@@ -64,12 +64,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install Memcached
if: ${{ matrix.package == 'memcache' }}
run: |
docker run -d -p 11211:11211 memcached:latest
node-version: '20'
- name: Install Cloudflare Worker
if: ${{ matrix.package == 'cloudflarekv' }}
@@ -78,12 +73,6 @@ jobs:
cd cloudflarekv && npx wrangler dev &
npx wait-on tcp:8787
- name: Install Coherence
if: ${{ matrix.package == 'coherence' }}
run: |
docker run -d -p 1408:1408 -p 30000:30000 ghcr.io/oracle/coherence-ce:22.06.5
sleep 30
- name: Install etcd
if: ${{ matrix.package == 'etcd' }}
run: |
@@ -94,6 +83,23 @@ jobs:
--env ETCD_ADVERTISE_CLIENT_URLS=http://etcd-server:2379 \
bitnami/etcd:latest
- name: Install MSSQL
if: ${{ matrix.package == 'mssql' }}
run: |
docker run -d --name mssql-server \
--publish 1433:1433 \
--env ACCEPT_EULA=Y \
--env SA_PASSWORD=MsSql!1234 \
--env MSSQL_DB=master \
--env MSSQL_USER=sa \
--env MSSQL_PASSWORD=MsSql!1234 \
--health-cmd "/opt/mssql-tools/bin/sqlcmd -U sa -P MsSql!1234 -Q 'select 1' -b -o /dev/null" \
--health-interval 1s \
--health-timeout 30s \
--health-start-period 10s \
--health-retries 20 \
mcmoe/mssqldocker:latest
- name: Run Benchmarks
working-directory: ${{ matrix.package }}
run: |
@@ -109,9 +115,11 @@ jobs:
TEST_ARANGODB_IMAGE: arangodb:latest
TEST_AZURITE_IMAGE: mcr.microsoft.com/azure-storage/azurite:latest
TEST_CASSANDRA_IMAGE: "cassandra:latest"
TEST_COHERENCE_IMAGE: "ghcr.io/oracle/coherence-ce:25.03.1-graal"
TEST_CLICKHOUSE_IMAGE: "clickhouse/clickhouse-server:23-alpine"
TEST_COUCHBASE_IMAGE: "couchbase:enterprise-7.6.5"
TEST_DYNAMODB_IMAGE: amazon/dynamodb-local:latest
TEST_MEMCACHED_IMAGE: "memcached:latest"
TEST_MINIO_IMAGE: "docker.io/minio/minio:latest"
TEST_MONGODB_IMAGE: "docker.io/mongo:7"
TEST_MYSQL_IMAGE: "docker.io/mysql:9"
@@ -120,6 +128,8 @@ jobs:
TEST_REDIS_IMAGE: "docker.io/redis:7"
TEST_SCYLLADB_IMAGE: "scylladb/scylla:6.2"
TEST_SURREALDB_IMAGE: "surrealdb/surrealdb:latest"
TEST_VALKEY_IMAGE: "valkey/valkey:8"
COHERENCE_LOG_LEVEL: "ERROR"
- name: Get Previous Benchmark Results
uses: actions/cache@v4

View File

@@ -28,7 +28,7 @@ jobs:
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2.3.0
uses: dependabot/fetch-metadata@v2.4.0
with:
github-token: "${{ secrets.PR_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs

View File

@@ -31,9 +31,12 @@ jobs:
- name: Generate filters
id: filter-setup
run: |
filters=$(find . -maxdepth 1 -type d ! -path ./.git ! -path . -exec basename {} \; | grep -v '^\.' | awk '{printf "%s: \"%s/**\"\n", $1, $1}')
filters=$(find . -maxdepth 1 -type d ! -path ./.git ! -path . ! -path ./testhelpers -exec basename {} \; | grep -v '^\.' | awk '{printf "%s: \"%s/**\"\n", $1, $1}')
# Add all testhelpers subdirectories to filters
testhelpers_filters=$(find ./testhelpers -mindepth 1 -maxdepth 1 -type d -exec basename {} \; | awk '{printf "testhelpers/%s: \"testhelpers/%s/**\"\n", $1, $1}')
echo "filters<<EOF" >> $GITHUB_OUTPUT
echo "$filters" >> $GITHUB_OUTPUT
echo "$testhelpers_filters" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
shell: bash

View File

@@ -18,7 +18,7 @@ jobs:
- name: Generate filters
id: filter-setup
run: |
filters=$(find . -maxdepth 1 -type d ! -path ./.git ! -path . -exec basename {} \; | grep -v '^\.' | awk '{printf "%s: \"%s/**\"\n", $1, $1}')
filters=$(find . -maxdepth 1 -type d ! -path ./.git ! -path . ! -path ./testhelpers -exec basename {} \; | grep -v '^\.' | awk '{printf "%s: \"%s/**\"\n", $1, $1}')
echo "filters<<EOF" >> $GITHUB_OUTPUT
echo "$filters" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

View File

@@ -25,7 +25,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20'
- name: Install JQ
run: sudo apt-get install jq

View File

@@ -14,9 +14,8 @@ jobs:
strategy:
matrix:
go-version:
- 1.19.x
- 1.20.x
- 1.21.x
- 1.23.x
- 1.24.x
runs-on: ubuntu-latest
steps:
- name: Fetch Repository

View File

@@ -15,9 +15,8 @@ jobs:
strategy:
matrix:
go-version:
- 1.19.x
- 1.20.x
- 1.21.x
- 1.23.x
- 1.24.x
steps:
- name: Fetch Repository
uses: actions/checkout@v4

View File

@@ -17,8 +17,8 @@ jobs:
strategy:
matrix:
go-version:
- 1.21.x
- 1.22.x
- 1.23.x
- 1.24.x
steps:
- name: Checkout Repository
uses: actions/checkout@v4
@@ -31,7 +31,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20'
- name: Start Wrangler Dev
run: |

View File

@@ -20,13 +20,11 @@ jobs:
steps:
- name: Fetch Repository
uses: actions/checkout@v4
- name: Startup Coherence
run: |
docker run -d -p 1408:1408 -p 30000:30000 ghcr.io/oracle/coherence-ce:25.03
sleep 30
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '${{ matrix.go-version }}'
- name: Run Test
env:
TEST_COHERENCE_IMAGE: "ghcr.io/oracle/coherence-ce:25.03.1-graal"
run: cd ./coherence && COHERENCE_SESSION_DEBUG=true go clean -testcache && go test ./... -v -race

View File

@@ -15,9 +15,8 @@ jobs:
strategy:
matrix:
go-version:
- 1.19.x
- 1.20.x
- 1.21.x
- 1.23.x
- 1.24.x
steps:
- name: Fetch Repository
uses: actions/checkout@v4

View File

@@ -12,17 +12,11 @@ name: "Tests Memcache"
jobs:
Tests:
runs-on: ubuntu-latest
services:
mongo:
image: 'memcached:latest'
ports:
- '11211:11211'
strategy:
matrix:
go-version:
- 1.19.x
- 1.20.x
- 1.21.x
- 1.23.x
- 1.24.x
steps:
- name: Fetch Repository
uses: actions/checkout@v4
@@ -31,4 +25,6 @@ jobs:
with:
go-version: '${{ matrix.go-version }}'
- name: Run Test
env:
TEST_MEMCACHED_IMAGE: "memcached:latest"
run: cd ./memcache && go test ./... -v -race

View File

@@ -14,9 +14,8 @@ jobs:
strategy:
matrix:
go-version:
- 1.19.x
- 1.20.x
- 1.21.x
- 1.23.x
- 1.24.x
runs-on: ubuntu-latest
steps:
- name: Fetch Repository

View File

@@ -14,8 +14,8 @@ jobs:
strategy:
matrix:
go-version:
- 1.21.x
- 1.22.x
- 1.23.x
- 1.24.x
runs-on: ubuntu-latest
steps:
- name: Fetch Repository

View File

@@ -32,9 +32,8 @@ jobs:
strategy:
matrix:
go-version:
- 1.19.x
- 1.20.x
- 1.21.x
- 1.23.x
- 1.24.x
steps:
- name: Fetch Repository
uses: actions/checkout@v4

View File

@@ -16,6 +16,7 @@ jobs:
matrix:
go-version:
- 1.23.x
- 1.24.x
steps:
- name: Fetch Repository
uses: actions/checkout@v4

View File

@@ -14,9 +14,8 @@ jobs:
strategy:
matrix:
go-version:
- 1.19.x
- 1.20.x
- 1.21.x
- 1.23.x
- 1.24.x
runs-on: ubuntu-latest
steps:
- name: Fetch Repository

View File

@@ -15,9 +15,8 @@ jobs:
strategy:
matrix:
go-version:
- 1.19.x
- 1.20.x
- 1.21.x
- 1.23.x
- 1.24.x
steps:
- name: Fetch Repository
uses: actions/checkout@v4

View File

@@ -15,33 +15,15 @@ jobs:
strategy:
matrix:
go-version:
- 1.20.x
- 1.21.x
- 1.23.x
- 1.24.x
redis:
- '6.x'
- '7.x'
- '6'
- '7'
steps:
- name: Fetch Repository
uses: actions/checkout@v4
- name: Generate TLS certs
run: ./.github/scripts/gen-test-certs.sh
- name: Setup Redis
uses: shogo82148/actions-setup-redis@v1
with:
redis-version: ${{ matrix.redis }}
auto-start: 'false'
redis-port: '6379'
redis-tls-port: '6380'
- name: Run Redis
run: |
redis-server --tls-port 6380 --port 6379 \
--tls-cert-file /home/runner/work/storage/storage/tls/redis.crt \
--tls-key-file /home/runner/work/storage/storage/tls/redis.key \
--tls-ca-cert-file /home/runner/work/storage/storage/tls/ca.crt &
- name: Setup Redis Cluster
uses: vishnudxb/redis-cluster@1.0.9
with:
@@ -59,4 +41,6 @@ jobs:
go-version: '${{ matrix.go-version }}'
- name: Run Test
env:
TEST_REDIS_IMAGE: "docker.io/redis:${{ matrix.redis }}"
run: cd ./rueidis && go test ./... -v -race

View File

@@ -14,9 +14,8 @@ jobs:
strategy:
matrix:
go-version:
- 1.19.x
- 1.20.x
- 1.21.x
- 1.23.x
- 1.24.x
runs-on: ubuntu-latest
steps:
- name: Fetch Repository

View File

@@ -0,0 +1,36 @@
on:
push:
branches:
- master
- main
paths:
- 'testhelpers/redis/**'
pull_request:
paths:
- 'testhelpers/redis/**'
name: "Tests TestHelper Redis"
jobs:
Tests:
runs-on: ubuntu-latest
strategy:
matrix:
go-version:
- 1.23.x
- 1.24.x
redis:
- '6'
- '7'
steps:
- name: Fetch Repository
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '${{ matrix.go-version }}'
- name: Run Test
env:
TEST_REDIS_IMAGE: "docker.io/redis:${{ matrix.redis }}"
working-directory: testhelpers/redis
run: go test ./... -v -race

View File

@@ -17,32 +17,14 @@ jobs:
matrix:
go-version:
- 1.23.x
- 1.24.x
valkey:
- '7.x'
- '8.x'
- '7'
- '8'
steps:
- name: Fetch Repository
uses: actions/checkout@v4
- name: Generate TLS certs
run: ./.github/scripts/gen-test-certs.sh
- name: Setup Valkey
uses: shogo82148/actions-setup-redis@v1
with:
distribution: 'valkey'
redis-version: ${{ matrix.valkey }}
auto-start: 'false'
redis-port: '6379'
redis-tls-port: '6380'
- name: Run Valkey
run: |
valkey-server --tls-port 6380 --port 6379 \
--tls-cert-file /home/runner/work/storage/storage/tls/valkey.crt \
--tls-key-file /home/runner/work/storage/storage/tls/valkey.key \
--tls-ca-cert-file /home/runner/work/storage/storage/tls/ca.crt &
- name: Setup Valkey Cluster
uses: vishnudxb/redis-cluster@1.0.9
with:
@@ -60,4 +42,6 @@ jobs:
go-version: '${{ matrix.go-version }}'
- name: Run Test
env:
TEST_VALKEY_IMAGE: "valkey/valkey:${{ matrix.valkey }}"
run: cd ./valkey && go test ./... -v -race

4
.gitignore vendored
View File

@@ -31,5 +31,5 @@ vendor
/Godeps/
node_modules/
# Go specific
go.work*
# Go workspace file
go.work.sum

View File

@@ -1,22 +0,0 @@
This document contains instructions for migrating to various storage versions.
### 0.1 -> 0.2
v0.2 fixes [a bug](https://github.com/gofiber/fiber/issues/1258) in MYSQL, Postgres and Arangodb in which
inserting non-UTF8 characters would trigger a panic due to the values being saved in a TEXT column instead of a
BYTEA/BLOB column. Migration instructions (note you may need to adjust the table names if you have supplied a custom
config to the storage):
**Postgres**
```sql
ALTER TABLE fiber_storage
ALTER COLUMN v TYPE BYTEA USING v::bytea;
```
**MYSQL**
```sql
ALTER TABLE fiber_storage MODIFY COLUMN v BLOB;
```
**Arangodb**
No migration other then updating the library is necessary.

View File

@@ -22,23 +22,40 @@ sidebar_position: 1
Premade storage drivers that implement the [`Storage`](https://github.com/gofiber/storage/blob/main/storage.go) interface, designed to be used with various [Fiber middlewares](https://github.com/gofiber/fiber/tree/master/middleware).
**Note:** All storages are tested with the latest two [Go version](https://go.dev/doc/devel/release#policy). Older Go versions may also work, but are not guaranteed to be supported.
```go
// Storage interface for communicating with different database/key-value
// providers. Visit https://github.com/gofiber/storage for more info.
type Storage interface {
// GetWithContext gets the value for the given key with a context.
// `nil, nil` is returned when the key does not exist
GetWithContext(ctx context.Context, key string) ([]byte, error)
// Get gets the value for the given key.
// `nil, nil` is returned when the key does not exist
Get(key string) ([]byte, error)
// SetWithContext stores the given value for the given key
// with an expiration value, 0 means no expiration.
SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error
// Set stores the given value for the given key along
// with an expiration value, 0 means no expiration.
// Empty key or value will be ignored without an error.
Set(key string, val []byte, exp time.Duration) error
// DeleteWithContext deletes the value for the given key with a context.
// It returns no error if the storage does not contain the key,
DeleteWithContext(ctx context.Context, key string) error
// Delete deletes the value for the given key.
// It returns no error if the storage does not contain the key,
Delete(key string) error
// ResetWithContext resets the storage and deletes all keys with a context.
ResetWithContext(ctx context.Context) error
// Reset resets the storage and delete all keys.
Reset() error
@@ -46,6 +63,7 @@ type Storage interface {
// collectors and open connections.
Close() error
}
```
## 📑 Storage Implementations

View File

@@ -9,8 +9,6 @@ title: Aerospike
An Aerospike client driver using `aerospike/aerospike-client-go` and [aerospike/aerospike-client-go](https://github.com/aerospike/aerospike-client-go).
**Note: Requires Go 1.23 and above**
### Table of Contents
- [Signatures](#signatures)
@@ -24,14 +22,20 @@ An Aerospike client driver using `aerospike/aerospike-client-go` and [aerospike/
```go
func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error
func (s *Storage) Reset() error
func (s *Storage) ResetWithContext(ctx context.Context) error
func (s *Storage) Close() error
func (s *Storage) Conn() driver.Client
func (s *Storage) GetSchemaInfo() *SchemaInfo
```
**Note:** The context methods are dummy methods and don't have any functionality, as Aerospike does not support context cancellation in its client library. They are provided for compliance with the Fiber storage interface.
### Installation
Aerospike is tested on the 2 last [Go versions](https://golang.org/dl/) with support for modules. So make sure to initialize one first if you didn't do that yet:

View File

@@ -1,6 +1,7 @@
package aerospike
import (
"context"
"log"
"time"
@@ -216,6 +217,11 @@ func (s *Storage) Get(key string) ([]byte, error) {
return data, nil
}
// GetWithContext gets value by key (dummy context support)
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error) {
return s.Get(key)
}
// Set key with value
func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
k, err := aerospike.NewKey(s.namespace, s.setName, key)
@@ -242,6 +248,11 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
return s.client.Put(writePolicy, k, bins)
}
// SetWithContext sets value by key (dummy context support)
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error {
return s.Set(key, val, exp)
}
// Delete key
func (s *Storage) Delete(key string) error {
k, err := aerospike.NewKey(s.namespace, s.setName, key)
@@ -253,6 +264,11 @@ func (s *Storage) Delete(key string) error {
return err
}
// DeleteWithContext deletes key (dummy context support)
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error {
return s.Delete(key)
}
// Reset all keys
func (s *Storage) Reset() error {
// Use ScanAll which returns a Recordset
@@ -293,6 +309,11 @@ func (s *Storage) Reset() error {
return nil
}
// ResetWithContext resets all keys (dummy context support)
func (s *Storage) ResetWithContext(ctx context.Context) error {
return s.Reset()
}
// Close the storage
func (s *Storage) Close() error {
s.client.Close()

View File

@@ -3,7 +3,7 @@ module github.com/gofiber/storage/aerospike
go 1.23.0
require (
github.com/aerospike/aerospike-client-go/v8 v8.2.1
github.com/aerospike/aerospike-client-go/v8 v8.2.2
github.com/stretchr/testify v1.10.0
github.com/testcontainers/testcontainers-go v0.37.0
github.com/testcontainers/testcontainers-go/modules/aerospike v0.37.0

View File

@@ -6,8 +6,8 @@ github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEK
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
github.com/aerospike/aerospike-client-go/v8 v8.2.1 h1:Vxp+E1Sj+r5o67x+BP8FE07DVwo7x1AHWzfnQU1wzIU=
github.com/aerospike/aerospike-client-go/v8 v8.2.1/go.mod h1:H6CzKDoHxBj1yY/oQPci1bUIbEx2ATQtJ2GtZ+N64Wg=
github.com/aerospike/aerospike-client-go/v8 v8.2.2 h1:NV1GxB+ATUb1cQtwaIS731A/6EkwuAX4/heh8CpvQOI=
github.com/aerospike/aerospike-client-go/v8 v8.2.2/go.mod h1:H6CzKDoHxBj1yY/oQPci1bUIbEx2ATQtJ2GtZ+N64Wg=
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=

View File

@@ -9,8 +9,6 @@ title: ArangoDB
A ArangoDB storage driver using `arangodb/go-driver` and [arangodb/go-driver](https://github.com/arangodb/go-driver).
**Note: Requires Go 1.19 and above**
### Table of Contents
- [Signatures](#signatures)
- [Installation](#installation)
@@ -21,9 +19,13 @@ A ArangoDB storage driver using `arangodb/go-driver` and [arangodb/go-driver](ht
### Signatures
```go
func New(config ...Config) Storage
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error)
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error
func (s *Storage) Delete(key string) error
func (s *Storage) ResetWithContext(ctx context.Context) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() driver.Client

View File

@@ -116,14 +116,12 @@ func New(config ...Config) *Storage {
return store
}
// Get value by key
func (s *Storage) Get(key string) ([]byte, error) {
// GetWithContext value by key with given context
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error) {
if len(key) <= 0 {
return nil, nil
}
ctx := context.Background()
// Check if the document exists
// to avoid errors later
exists, err := s.collection.DocumentExists(ctx, key)
@@ -151,8 +149,13 @@ func (s *Storage) Get(key string) ([]byte, error) {
return utils.UnsafeBytes(model.Val), nil
}
// Set key with value
func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
// Get value by key
func (s *Storage) Get(key string) ([]byte, error) {
return s.GetWithContext(context.Background(), key)
}
// SetWithContext key with value with given context
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error {
// Ain't Nobody Got Time For That
if len(key) <= 0 || len(val) <= 0 {
return nil
@@ -169,7 +172,6 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
Val: valStr,
Exp: expireAt,
}
ctx := context.Background()
// Arango does not support documents with the same key
// So we need to check if the document exists
@@ -188,20 +190,35 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
return err
}
// Delete value by key
func (s *Storage) Delete(key string) error {
// Set key with value
func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
return s.SetWithContext(context.Background(), key, val, exp)
}
// DeleteWithContext value by key with given context
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error {
// Ain't Nobody Got Time For That
if len(key) <= 0 {
return nil
}
_, err := s.collection.RemoveDocument(context.Background(), key)
_, err := s.collection.RemoveDocument(ctx, key)
return err
}
// Delete value by key
func (s *Storage) Delete(key string) error {
return s.DeleteWithContext(context.Background(), key)
}
// ResetWithContext all keys with given context
func (s *Storage) ResetWithContext(ctx context.Context) error {
return s.collection.Truncate(ctx)
}
// Reset all keys
// truncate the collection
func (s *Storage) Reset() error {
return s.collection.Truncate(context.Background())
return s.ResetWithContext(context.Background())
}
// Close the database

View File

@@ -67,6 +67,22 @@ func Test_ArangoDB_Set(t *testing.T) {
require.NoError(t, err)
}
func Test_ArangoDB_SetWithContext(t *testing.T) {
var (
key = "john"
val = []byte("doe")
)
testStore := newTestStore(t)
defer testStore.Close()
ctx, cancel := context.WithCancel(context.Background())
cancel()
err := testStore.SetWithContext(ctx, key, val, 0)
require.ErrorIs(t, err, context.Canceled)
}
func Test_ArangoDB_Upsert(t *testing.T) {
var (
key = "john"
@@ -100,6 +116,26 @@ func Test_ArangoDB_Get(t *testing.T) {
require.Equal(t, val, result)
}
func Test_ArangoDB_GetWithContext(t *testing.T) {
var (
key = "john"
val = []byte("doe")
)
testStore := newTestStore(t)
defer testStore.Close()
err := testStore.Set(key, val, 0)
require.NoError(t, err)
ctx, cancel := context.WithCancel(context.Background())
cancel()
result, err := testStore.GetWithContext(ctx, key)
require.ErrorIs(t, err, context.Canceled)
require.Zero(t, len(result))
}
func Test_ArangoDB_Set_Expiration(t *testing.T) {
var (
key = "john"
@@ -156,6 +192,29 @@ func Test_ArangoDB_Delete(t *testing.T) {
require.Zero(t, len(result))
}
func Test_ArangoDB_DeleteWithContext(t *testing.T) {
var (
key = "john"
val = []byte("doe")
)
testStore := newTestStore(t)
defer testStore.Close()
err := testStore.Set(key, val, 0)
require.NoError(t, err)
ctx, cancel := context.WithCancel(context.Background())
cancel()
err = testStore.DeleteWithContext(ctx, key)
require.ErrorIs(t, err, context.Canceled)
result, err := testStore.Get(key)
require.NoError(t, err)
require.Equal(t, val, result)
}
func Test_ArangoDB_Reset(t *testing.T) {
val := []byte("doe")
@@ -180,6 +239,33 @@ func Test_ArangoDB_Reset(t *testing.T) {
require.Zero(t, len(result))
}
func Test_ArangoDB_ResetWithContext(t *testing.T) {
val := []byte("doe")
testStore := newTestStore(t)
defer testStore.Close()
err := testStore.Set("john1", val, 0)
require.NoError(t, err)
err = testStore.Set("john2", val, 0)
require.Equal(t, err, nil)
ctx, cancel := context.WithCancel(context.Background())
cancel()
err = testStore.ResetWithContext(ctx)
require.ErrorIs(t, err, context.Canceled)
result, err := testStore.Get("john1")
require.NoError(t, err)
require.Equal(t, val, result)
result, err = testStore.Get("john2")
require.NoError(t, err)
require.Equal(t, val, result)
}
func Test_ArangoDB_Non_UTF8(t *testing.T) {
val := []byte("0xF5")

View File

@@ -9,8 +9,6 @@ title: Azure Blob
[Azure Blob storage](https://azure.microsoft.com/en-us/products/storage/blobs/#overview) is Microsoft's object storage solution for the cloud.
**Note: Requires Go 1.19 and above**
### Table of Contents
- [Signatures](#signatures)
@@ -24,9 +22,13 @@ title: Azure Blob
```go
func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error
func (s *Storage) Reset() error
func (s *Storage) ResetWithContext(ctx context.Context) error
func (s *Storage) Close() error
func (s *Storage) Conn() *azblob.Client
```

View File

@@ -48,13 +48,12 @@ func New(config ...Config) *Storage {
return storage
}
// Get value by key
func (s *Storage) Get(key string) ([]byte, error) {
// GetWithContext gets value by key
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error) {
if len(key) <= 0 {
return nil, nil
}
ctx, cancel := s.requestContext()
defer cancel()
resp, err := s.client.DownloadStream(ctx, s.container, key, nil)
if err != nil {
return []byte{}, err
@@ -63,55 +62,81 @@ func (s *Storage) Get(key string) ([]byte, error) {
return data, err
}
// Set key with value
func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
// Get gets value by key
func (s *Storage) Get(key string) ([]byte, error) {
ctx, cancel := s.requestContext()
defer cancel()
return s.GetWithContext(ctx, key)
}
// SetWithContext sets key with value
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error {
if len(key) <= 0 {
return nil
}
ctx, cancel := s.requestContext()
defer cancel()
_, err := s.client.UploadBuffer(ctx, s.container, key, val, nil)
return err
}
// Delete entry by key
func (s *Storage) Delete(key string) error {
// Set sets key with value
func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
ctx, cancel := s.requestContext()
defer cancel()
return s.SetWithContext(ctx, key, val, exp)
}
// DeleteWithContext deletes entry by key
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error {
if len(key) <= 0 {
return nil
}
ctx, cancel := s.requestContext()
defer cancel()
_, err := s.client.DeleteBlob(ctx, s.container, key, nil)
return err
}
// Reset all entries
func (s *Storage) Reset() error {
// Delete deletes entry by key
func (s *Storage) Delete(key string) error {
ctx, cancel := s.requestContext()
defer cancel()
return s.DeleteWithContext(ctx, key)
}
// ResetWithContext resets all entries
func (s *Storage) ResetWithContext(ctx context.Context) error {
//_, err := s.client.DeleteContainer(ctx, s.container, nil)
//return err
pager := s.client.NewListBlobsFlatPager(s.container, nil)
errCounter := 0
for pager.More() {
resp, err := pager.NextPage(ctx)
if err != nil {
errCounter = errCounter + 1
return err
}
for _, v := range resp.Segment.BlobItems {
_, err = s.client.DeleteBlob(ctx, s.container, *v.Name, nil)
if err != nil {
errCounter = errCounter + 1
return err
}
}
}
if errCounter > 0 {
return fmt.Errorf("%d errors occured while resetting", errCounter)
}
return nil
}
// Reset resets all entries
func (s *Storage) Reset() error {
ctx, cancel := s.requestContext()
defer cancel()
return s.ResetWithContext(ctx)
}
// Conn returns storage client
func (s *Storage) Conn() *azblob.Client {
return s.client

View File

@@ -63,6 +63,26 @@ func Test_AzureBlob_Get(t *testing.T) {
require.Equal(t, val, result)
}
func Test_AzureBlob_GetWithContext(t *testing.T) {
var (
key = "john"
val = []byte("doe")
)
testStore := newTestStore(t)
defer testStore.Close()
err := testStore.Set(key, val, 0)
require.NoError(t, err)
ctx, cancel := context.WithCancel(context.Background())
cancel()
result, err := testStore.GetWithContext(ctx, key)
require.ErrorIs(t, err, context.Canceled)
require.Zero(t, len(result))
}
func Test_AzureBlob_Set(t *testing.T) {
var (
key = "john"
@@ -76,6 +96,22 @@ func Test_AzureBlob_Set(t *testing.T) {
require.NoError(t, err)
}
func Test_AzureBlob_SetWithContext(t *testing.T) {
var (
key = "john"
val = []byte("doe")
)
testStore := newTestStore(t)
defer testStore.Close()
ctx, cancel := context.WithCancel(context.Background())
cancel()
err := testStore.SetWithContext(ctx, key, val, 0)
require.ErrorIs(t, err, context.Canceled)
}
func Test_AzureBlob_Delete(t *testing.T) {
var (
key = "john"
@@ -101,6 +137,29 @@ func Test_AzureBlob_Delete(t *testing.T) {
require.Zero(t, len(result))
}
func Test_AzureBlob_DeleteWithContext(t *testing.T) {
var (
key = "john"
val = []byte("doe")
)
testStore := newTestStore(t)
defer testStore.Close()
err := testStore.Set(key, val, 0)
require.NoError(t, err)
ctx, cancel := context.WithCancel(context.Background())
cancel()
err = testStore.DeleteWithContext(ctx, key)
require.ErrorIs(t, err, context.Canceled)
result, err := testStore.Get(key)
require.NoError(t, err)
require.Equal(t, val, result)
}
func Test_AzureBlob_Override(t *testing.T) {
var (
key = "john"
@@ -172,6 +231,33 @@ func Test_AzureBlob_Conn(t *testing.T) {
require.True(t, testStore.Conn() != nil)
}
func Test_AzureBlob_ResetWithContext(t *testing.T) {
val := []byte("doe")
testStore := newTestStore(t)
defer testStore.Close()
err := testStore.Set("john1", val, 0)
require.NoError(t, err)
err = testStore.Set("john2", val, 0)
require.NoError(t, err)
ctx, cancel := context.WithCancel(context.Background())
cancel()
err = testStore.ResetWithContext(ctx)
require.ErrorIs(t, err, context.Canceled)
result, err := testStore.Get("john1")
require.NoError(t, err)
require.Equal(t, val, result)
result, err = testStore.Get("john2")
require.NoError(t, err)
require.Equal(t, val, result)
}
func Test_AzureBlob_Close(t *testing.T) {
testStore := newTestStore(t)
require.NoError(t, testStore.Close())

View File

@@ -9,8 +9,6 @@ title: Badger
A fast key-value DB using [dgraph-io/badger](https://github.com/dgraph-io/badger)
**Note: Requires Go 1.19 and above**
### Table of Contents
- [Signatures](#signatures)
@@ -24,13 +22,19 @@ A fast key-value DB using [dgraph-io/badger](https://github.com/dgraph-io/badger
```go
func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error
func (s *Storage) Reset() error
func (s *Storage) ResetWithContext(ctx context.Context) error
func (s *Storage) Close() error
func (s *Storage) Conn() *badger.DB
```
**Note:** The context methods are dummy methods and don't have any functionality, as Badger does not support context cancellation in its client library. They are provided for compliance with the Fiber storage interface.
### Installation
Badger is tested on the 2 last [Go versions](https://golang.org/dl/) with support for modules. So make sure to initialize one first if you didn't do that yet:

View File

@@ -1,6 +1,7 @@
package badger
import (
"context"
"time"
"github.com/dgraph-io/badger/v3"
@@ -72,6 +73,12 @@ func (s *Storage) Get(key string) ([]byte, error) {
return data, err
}
// GetWithContext gets value by key.
// Note: This method is not used in the current implementation, but is included to satisfy the Storage interface.
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error) {
return s.Get(key)
}
// Set key with value
func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
// Ain't Nobody Got Time For That
@@ -88,6 +95,12 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
})
}
// SetWithContext sets key with value.
// Note: This method is not used in the current implementation, but is included to satisfy the Storage interface.
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error {
return s.Set(key, val, exp)
}
// Delete key by key
func (s *Storage) Delete(key string) error {
// Ain't Nobody Got Time For That
@@ -99,11 +112,23 @@ func (s *Storage) Delete(key string) error {
})
}
// DeleteWithContext deletes key by key.
// Note: This method is not used in the current implementation, but is included to satisfy the Storage interface.
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error {
return s.Delete(key)
}
// Reset all keys
func (s *Storage) Reset() error {
return s.db.DropAll()
}
// ResetWithContext resets all keys.
// Note: This method is not used in the current implementation, but is included to satisfy the Storage interface.
func (s *Storage) ResetWithContext(ctx context.Context) error {
return s.db.DropAll()
}
// Close the memory storage
func (s *Storage) Close() error {
s.done <- struct{}{}

View File

@@ -1,6 +1,6 @@
module github.com/gofiber/storage/badger/v2
go 1.19
go 1.23.0
require (
github.com/dgraph-io/badger/v3 v3.2103.5

View File

@@ -9,8 +9,6 @@ title: Bbolt
A Bbolt storage driver using [etcd-io/bbolt](https://github.com/etcd-io/bbolt). Bolt is a pure Go key/value store inspired by [Howard Chu's](https://twitter.com/hyc_symas) [LMDB project](https://www.symas.com/symas-embedded-database-lmdb). The goal of the project is to provide a simple, fast, and reliable database for projects that don't require a full database server such as Postgres or MySQL.
**Note: Requires Go 1.19 and above**
### Table of Contents
- [Signatures](#signatures)
- [Installation](#installation)
@@ -22,12 +20,19 @@ A Bbolt storage driver using [etcd-io/bbolt](https://github.com/etcd-io/bbolt).
```go
func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error
func (s *Storage) Reset() error
func (s *Storage) ResetWithContext(ctx context.Context) error
func (s *Storage) Close() error
func (s *Storage) Conn() *bbolt.DB
```
**Note:** The context methods are dummy methods and don't have any functionality, as Bbolt does not support context cancellation in its client library. They are provided for compliance with the Fiber storage interface.
### Installation
Bbolt is tested on the 2 last [Go versions](https://golang.org/dl/) with support for modules. So make sure to initialize one first if you didn't do that yet:
```bash

View File

@@ -1,6 +1,7 @@
package bbolt
import (
"context"
"time"
"github.com/gofiber/utils/v2"
@@ -62,6 +63,11 @@ func (s *Storage) Get(key string) ([]byte, error) {
return value, err
}
// GetWithContext gets value by key (dummy context support)
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error) {
return s.Get(key)
}
// Set key with value
func (s *Storage) Set(key string, value []byte, exp time.Duration) error {
if len(key) <= 0 || len(value) <= 0 {
@@ -70,11 +76,15 @@ func (s *Storage) Set(key string, value []byte, exp time.Duration) error {
return s.conn.Update(func(tx *bbolt.Tx) error {
b := tx.Bucket(utils.UnsafeBytes(s.bucket))
return b.Put(utils.UnsafeBytes(key), value)
})
}
// SetWithContext sets key with value (dummy context support)
func (s *Storage) SetWithContext(ctx context.Context, key string, value []byte, exp time.Duration) error {
return s.Set(key, value, exp)
}
// Delete entry by key
func (s *Storage) Delete(key string) error {
if len(key) <= 0 {
@@ -83,28 +93,36 @@ func (s *Storage) Delete(key string) error {
return s.conn.Update(func(tx *bbolt.Tx) error {
b := tx.Bucket(utils.UnsafeBytes(s.bucket))
return b.Delete(utils.UnsafeBytes(key))
})
}
// DeleteWithContext deletes key by key (dummy context support)
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error {
return s.Delete(key)
}
// Reset all entries
func (s *Storage) Reset() error {
return s.conn.Update(func(tx *bbolt.Tx) error {
b := tx.Bucket(utils.UnsafeBytes(s.bucket))
return b.ForEach(func(k, _ []byte) error {
return b.Delete(k)
})
})
}
// ResetWithContext resets all entries (dummy context support)
func (s *Storage) ResetWithContext(ctx context.Context) error {
return s.Reset()
}
// Close the database
func (s *Storage) Close() error {
return s.conn.Close()
}
// Return database client
// Conn returns the database client
func (s *Storage) Conn() *bbolt.DB {
return s.conn
}

View File

@@ -1,6 +1,6 @@
module github.com/gofiber/storage/bbolt/v2
go 1.19
go 1.23.0
require (
github.com/gofiber/utils/v2 v2.0.0-beta.3

View File

@@ -11,6 +11,7 @@ github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf
go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI=
go.etcd.io/bbolt v1.3.9/go.mod h1:zaO32+Ti0PK1ivdPtgMESzuzL2VPoIG1PCQNvOdo/dE=
golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=
golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=

View File

@@ -19,9 +19,13 @@ A Cassandra storage driver using [gocql/gocql](https://github.com/gocql/gocql)
```go
func New(config ...Config) (*Storage, error)
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error
func (s *Storage) Reset() error
func (s *Storage) ResetWithContext(ctx context.Context) error
func (s *Storage) Close() error
func (s *Storage) Conn() *gocql.Session
```

View File

@@ -1,6 +1,7 @@
package cassandra
import (
"context"
"fmt"
"strings"
"time"
@@ -218,8 +219,8 @@ type queryResult struct {
ExpiresAt time.Time `db:"expires_at"`
}
// Set stores a key-value pair with optional expiration
func (s *Storage) Set(key string, value []byte, exp time.Duration) error {
// SetWithContext stores a key-value pair with optional expiration with context support
func (s *Storage) SetWithContext(ctx context.Context, key string, value []byte, exp time.Duration) error {
// Validate key
if _, err := validateIdentifier(key, "key"); err != nil {
return err
@@ -256,11 +257,16 @@ func (s *Storage) Set(key string, value []byte, exp time.Duration) error {
"key": key,
"value": value,
"expires_at": expiresAt,
}).ExecRelease()
}).WithContext(ctx).ExecRelease()
}
// Get retrieves a value by key
func (s *Storage) Get(key string) ([]byte, error) {
// Set stores a key-value pair with optional expiration
func (s *Storage) Set(key string, value []byte, exp time.Duration) error {
return s.SetWithContext(context.Background(), key, value, exp)
}
// GetWithContext retrieves a value by key with context support.
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error) {
// Use query builder for select
stmt, names := qb.Select(fmt.Sprintf("%s.%s", s.keyspace, s.table)).
Columns("value", "expires_at").
@@ -271,7 +277,7 @@ func (s *Storage) Get(key string) ([]byte, error) {
// Use gocqlx session
if err := s.sx.Query(stmt, names).BindMap(map[string]interface{}{
"key": key,
}).GetRelease(&result); err != nil {
}).WithContext(ctx).GetRelease(&result); err != nil {
if err == gocql.ErrNotFound {
return nil, ErrNotFound
}
@@ -290,8 +296,13 @@ func (s *Storage) Get(key string) ([]byte, error) {
return result.Value, nil
}
// Delete removes a key from storage
func (s *Storage) Delete(key string) error {
// Get retrieves a value by key.
func (s *Storage) Get(key string) ([]byte, error) {
return s.GetWithContext(context.Background(), key)
}
// DeleteWithContext removes a key from storage with context support.
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error {
// Use query builder for delete
stmt, names := qb.Delete(fmt.Sprintf("%s.%s", s.keyspace, s.table)).
Where(qb.Eq("key")).
@@ -300,14 +311,26 @@ func (s *Storage) Delete(key string) error {
// Use gocqlx session
return s.sx.Query(stmt, names).BindMap(map[string]interface{}{
"key": key,
}).ExecRelease()
}).WithContext(ctx).ExecRelease()
}
// Reset clears all keys from storage
func (s *Storage) Reset() error {
// Delete removes a key from storage.
func (s *Storage) Delete(key string) error {
// Use the context-free version
return s.DeleteWithContext(context.Background(), key)
}
// ResetWithContext clears all keys from storage with context support.
func (s *Storage) ResetWithContext(ctx context.Context) error {
// Use direct TRUNCATE query with proper escaping
query := fmt.Sprintf("TRUNCATE TABLE %s.%s", s.keyspace, s.table)
return s.sx.Query(query, []string{}).ExecRelease()
return s.sx.Query(query, []string{}).WithContext(ctx).ExecRelease()
}
// Reset clears all keys from storage.
func (s *Storage) Reset() error {
// Use the context-free version
return s.ResetWithContext(context.Background())
}
// Conn returns the underlying gocql session.

View File

@@ -66,6 +66,22 @@ func Test_Set(t *testing.T) {
require.Equal(t, []byte("value"), val)
}
func Test_SetWithContext(t *testing.T) {
store := newTestStore(t)
defer store.Close()
// Test SetWithContext
ctx, cancel := context.WithCancel(context.Background())
cancel()
err := store.SetWithContext(ctx, "test", []byte("value"), 0)
require.ErrorIs(t, err, context.Canceled)
// Verify the value was not set
val, err := store.Get("test")
require.Error(t, err)
require.Empty(t, val)
}
// Test_Get tests the Get operation
func Test_Get(t *testing.T) {
store := newTestStore(t)
@@ -86,6 +102,28 @@ func Test_Get(t *testing.T) {
require.Nil(t, val)
}
// Test_GetWithContext tests the Get operation with context
func Test_GetWithContext(t *testing.T) {
store := newTestStore(t)
defer store.Close()
// Set a value first
err := store.Set("test", []byte("value"), 0)
require.NoError(t, err)
// Test GetWithContext
ctx, cancel := context.WithCancel(context.Background())
cancel()
val, err := store.GetWithContext(ctx, "test")
require.ErrorIs(t, err, context.Canceled)
require.Nil(t, val)
// Verify the value still exists
val, err = store.Get("test")
require.NoError(t, err)
require.Equal(t, []byte("value"), val)
}
// Test_Delete tests the Delete operation
func Test_Delete(t *testing.T) {
store := newTestStore(t)
@@ -110,6 +148,32 @@ func Test_Delete(t *testing.T) {
require.Nil(t, val)
}
// Test_DeleteWithContext tests the Delete operation with context
func Test_DeleteWithContext(t *testing.T) {
store := newTestStore(t)
defer store.Close()
// Set a value first
err := store.Set("test", []byte("value"), 0)
require.NoError(t, err)
// Verify the value exists
val, err := store.Get("test")
require.NoError(t, err)
require.Equal(t, []byte("value"), val)
// Test DeleteWithContext
ctx, cancel := context.WithCancel(context.Background())
cancel()
err = store.DeleteWithContext(ctx, "test")
require.ErrorIs(t, err, context.Canceled)
// Verify the value still exists
val, err = store.Get("test")
require.NoError(t, err)
require.Equal(t, []byte("value"), val)
}
// Test_Expirable_Keys tests the expirable keys functionality
func Test_Expirable_Keys(t *testing.T) {
store := newTestStore(t)
@@ -180,6 +244,33 @@ func Test_Reset(t *testing.T) {
require.Nil(t, val)
}
// Test_ResetWithContext tests the Reset method with context
func Test_ResetWithContext(t *testing.T) {
store := newTestStore(t)
defer store.Close()
// Add some data
err := store.Set("test1", []byte("value1"), 0)
require.NoError(t, err)
err = store.Set("test2", []byte("value2"), 0)
require.NoError(t, err)
// Reset storage with context
ctx, cancel := context.WithCancel(context.Background())
cancel()
err = store.ResetWithContext(ctx)
require.ErrorIs(t, err, context.Canceled)
// Verify data is still there
val, err := store.Get("test1")
require.NoError(t, err)
require.Equal(t, []byte("value1"), val)
val, err = store.Get("test2")
require.NoError(t, err)
require.Equal(t, []byte("value2"), val)
}
// Test_Valid_Identifiers tests valid identifier cases
func Test_Valid_Identifiers(t *testing.T) {
store := newTestStore(t)

View File

@@ -19,9 +19,13 @@ A Clickhouse storage driver using [https://github.com/ClickHouse/clickhouse-go](
```go
func New(config ...Config) (*Storage, error)
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error
func (s *Storage) Reset() error
func (s *Storage) ResetWithContext(ctx context.Context) error
func (s *Storage) Close() error
func (s *Storage) Conn() *Session
```

View File

@@ -12,7 +12,6 @@ import (
type Storage struct {
session driver.Conn
context context.Context
table string
}
@@ -47,12 +46,11 @@ func New(configuration Config) (*Storage, error) {
return &Storage{
session: conn,
context: ctx,
table: configuration.Table,
}, nil
}
func (s *Storage) Set(key string, value []byte, expiration time.Duration) error {
func (s *Storage) SetWithContext(ctx context.Context, key string, value []byte, expiration time.Duration) error {
if len(key) <= 0 || len(value) <= 0 {
return nil
}
@@ -65,7 +63,7 @@ func (s *Storage) Set(key string, value []byte, expiration time.Duration) error
return s.
session.
Exec(
s.context,
ctx,
insertDataString,
driver.Named("table", s.table),
driver.Named("key", key),
@@ -74,7 +72,11 @@ func (s *Storage) Set(key string, value []byte, expiration time.Duration) error
)
}
func (s *Storage) Get(key string) ([]byte, error) {
func (s *Storage) Set(key string, value []byte, expiration time.Duration) error {
return s.SetWithContext(context.Background(), key, value, expiration)
}
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error) {
if len(key) == 0 {
return []byte{}, nil
}
@@ -82,7 +84,7 @@ func (s *Storage) Get(key string) ([]byte, error) {
var result schema
row := s.session.QueryRow(
s.context,
ctx,
selectDataString,
driver.Named("table", s.table),
driver.Named("key", key),
@@ -109,16 +111,28 @@ func (s *Storage) Get(key string) ([]byte, error) {
return []byte(result.Value), nil
}
func (s *Storage) Delete(key string) error {
func (s *Storage) Get(key string) ([]byte, error) {
return s.GetWithContext(context.Background(), key)
}
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error {
if len(key) == 0 {
return nil
}
return s.session.Exec(s.context, deleteDataString, driver.Named("table", s.table), driver.Named("key", key))
return s.session.Exec(ctx, deleteDataString, driver.Named("table", s.table), driver.Named("key", key))
}
func (s *Storage) Delete(key string) error {
return s.DeleteWithContext(context.Background(), key)
}
func (s *Storage) ResetWithContext(ctx context.Context) error {
return s.session.Exec(ctx, resetDataString, driver.Named("table", s.table))
}
func (s *Storage) Reset() error {
return s.session.Exec(s.context, resetDataString, driver.Named("table", s.table))
return s.ResetWithContext(context.Background())
}
func (s *Storage) Close() error {

View File

@@ -83,6 +83,21 @@ func Test_Connection(t *testing.T) {
defer client.Close()
}
func Test_SetWithContext(t *testing.T) {
client := newTestStore(t, Config{
Engine: Memory,
Table: "test_table",
Clean: true,
})
defer client.Close()
ctx, cancel := context.WithCancel(context.Background())
cancel()
err := client.SetWithContext(ctx, "somekey", []byte("somevalue"), 0)
require.ErrorIs(t, err, context.Canceled)
}
func Test_Set(t *testing.T) {
client := newTestStore(t, Config{
Engine: Memory,
@@ -107,6 +122,25 @@ func Test_Set_With_Exp(t *testing.T) {
require.NoError(t, err)
}
func Test_GetWithContext(t *testing.T) {
client := newTestStore(t, Config{
Engine: Memory,
Table: "test_table",
Clean: true,
})
defer client.Close()
err := client.Set("somekey", []byte("somevalue"), 0)
require.NoError(t, err)
ctx, cancel := context.WithCancel(context.Background())
cancel()
value, err := client.GetWithContext(ctx, "somekey")
require.ErrorIs(t, err, context.Canceled)
assert.Equal(t, []byte{}, value)
}
func Test_Get(t *testing.T) {
client := newTestStore(t, Config{
Engine: Memory,
@@ -150,6 +184,29 @@ func Test_Get_With_Exp(t *testing.T) {
assert.Equal(t, []byte{}, value)
}
func Test_DeleteWithContext(t *testing.T) {
client := newTestStore(t, Config{
Engine: Memory,
Table: "test_table",
Clean: true,
})
defer client.Close()
err := client.Set("somekeytodelete", []byte("somevalue"), time.Second*5)
require.NoError(t, err)
ctx, cancel := context.WithCancel(context.Background())
cancel()
err = client.DeleteWithContext(ctx, "somekeytodelete")
require.ErrorIs(t, err, context.Canceled)
value, err := client.Get("somekeytodelete")
require.NoError(t, err)
require.Equal(t, []byte("somevalue"), value)
}
func Test_Delete(t *testing.T) {
client := newTestStore(t, Config{
Engine: Memory,
@@ -171,6 +228,29 @@ func Test_Delete(t *testing.T) {
assert.Equal(t, []byte{}, value)
}
func Test_ResetWithContext(t *testing.T) {
client := newTestStore(t, Config{
Engine: Memory,
Table: "test_table",
Clean: true,
})
defer client.Close()
err := client.Set("testkey", []byte("somevalue"), 0)
require.NoError(t, err)
ctx, cancel := context.WithCancel(context.Background())
cancel()
err = client.ResetWithContext(ctx)
require.ErrorIs(t, err, context.Canceled)
value, err := client.Get("testkey")
require.NoError(t, err)
require.Equal(t, []byte("somevalue"), value)
}
func Test_Reset(t *testing.T) {
client := newTestStore(t, Config{
Engine: Memory,

View File

@@ -3,7 +3,7 @@ module github.com/gofiber/storage/clickhouse
go 1.23.0
require (
github.com/ClickHouse/clickhouse-go/v2 v2.34.0
github.com/ClickHouse/clickhouse-go/v2 v2.37.2
github.com/stretchr/testify v1.10.0
github.com/testcontainers/testcontainers-go v0.37.0
github.com/testcontainers/testcontainers-go/modules/clickhouse v0.37.0
@@ -12,16 +12,18 @@ require (
require (
dario.cat/mergo v1.0.1 // indirect
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
github.com/ClickHouse/ch-go v0.65.1 // indirect
github.com/ClickHouse/ch-go v0.66.1 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/andybalholm/brotli v1.1.1 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/containerd/errdefs v1.0.0 // indirect
github.com/containerd/errdefs/pkg v0.3.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/platforms v0.2.1 // indirect
github.com/cpuguy83/dockercfg v0.3.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/docker v28.0.4+incompatible // indirect
github.com/docker/docker v28.2.2+incompatible // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/ebitengine/purego v0.8.2 // indirect
@@ -38,6 +40,7 @@ require (
github.com/lufia/plan9stats v0.0.0-20250317134145-8bc96cf8fc35 // indirect
github.com/magiconair/properties v1.8.10 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/go-archive v0.1.0 // indirect
github.com/moby/patternmatcher v0.6.0 // indirect
github.com/moby/sys/sequential v0.6.0 // indirect
github.com/moby/sys/user v0.4.0 // indirect
@@ -60,10 +63,10 @@ require (
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 // indirect
go.opentelemetry.io/otel v1.35.0 // indirect
go.opentelemetry.io/otel/metric v1.35.0 // indirect
go.opentelemetry.io/otel/trace v1.35.0 // indirect
golang.org/x/crypto v0.37.0 // indirect
golang.org/x/sys v0.32.0 // indirect
go.opentelemetry.io/otel v1.36.0 // indirect
go.opentelemetry.io/otel/metric v1.36.0 // indirect
go.opentelemetry.io/otel/trace v1.36.0 // indirect
golang.org/x/crypto v0.39.0 // indirect
golang.org/x/sys v0.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

View File

@@ -1,19 +1,23 @@
dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s=
dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU=
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8=
github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 h1:He8afgbRMd7mFxO99hRNu+6tazq8nFF9lIwo9JFroBk=
github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8=
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg=
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/ClickHouse/ch-go v0.65.1 h1:SLuxmLl5Mjj44/XbINsK2HFvzqup0s6rwKLFH347ZhU=
github.com/ClickHouse/ch-go v0.65.1/go.mod h1:bsodgURwmrkvkBe5jw1qnGDgyITsYErfONKAHn05nv4=
github.com/ClickHouse/clickhouse-go/v2 v2.34.0 h1:Y4rqkdrRHgExvC4o/NTbLdY5LFQ3LHS77/RNFxFX3Co=
github.com/ClickHouse/clickhouse-go/v2 v2.34.0/go.mod h1:yioSINoRLVZkLyDzdMXPLRIqhDvel8iLBlwh6Iefso8=
github.com/ClickHouse/ch-go v0.66.1 h1:LQHFslfVYZsISOY0dnOYOXGkOUvpv376CCm8g7W74A4=
github.com/ClickHouse/ch-go v0.66.1/go.mod h1:NEYcg3aOFv2EmTJfo4m2WF7sHB/YFbLUuIWv9iq76xY=
github.com/ClickHouse/clickhouse-go/v2 v2.37.2 h1:wRLNKoynvHQEN4znnVHNLaYnrqVc9sGJmGYg+GGCfto=
github.com/ClickHouse/clickhouse-go/v2 v2.37.2/go.mod h1:pH2zrBGp5Y438DMwAxXMm1neSXPPjSI7tD4MURVULw8=
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA=
github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA=
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI=
github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M=
github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE=
github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk=
github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=
github.com/containerd/platforms v0.2.1 h1:zvwtM3rz2YHPQsF2CHYM8+KtB5dvhISiXh5ZpSBQv6A=
@@ -27,8 +31,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
github.com/docker/docker v28.0.4+incompatible h1:JNNkBctYKurkw6FrHfKqY0nKIDf5nrbxjVBtS+cdcok=
github.com/docker/docker v28.0.4+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v28.2.2+incompatible h1:CjwRSksz8Yo4+RmQ339Dp/D2tGO5JxwYeqtMOEe0LDw=
github.com/docker/docker v28.2.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c=
github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
@@ -79,8 +83,12 @@ github.com/magiconair/properties v1.8.10 h1:s31yESBquKXCV9a/ScB3ESkOjUYYv+X0rg8S
github.com/magiconair/properties v1.8.10/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
github.com/moby/go-archive v0.1.0 h1:Kk/5rdW/g+H8NHdJW2gsXyZ7UnzvJNOy6VKJqueWdcQ=
github.com/moby/go-archive v0.1.0/go.mod h1:G9B+YoujNohJmrIYFBpSd54GTUB4lt9S+xVQvsJyFuo=
github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk=
github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc=
github.com/moby/sys/atomicwriter v0.1.0 h1:kw5D/EqkBwsBFi0ss9v1VG3wIkVhzGvLklJ+w3A14Sw=
github.com/moby/sys/atomicwriter v0.1.0/go.mod h1:Ul8oqv2ZMNHOceF643P6FKPXeCmYtlQMvpizfsSoaWs=
github.com/moby/sys/sequential v0.6.0 h1:qrx7XFUd/5DxtqcoH1h438hF5TmOvzC/lspjy7zgvCU=
github.com/moby/sys/sequential v0.6.0/go.mod h1:uyv8EUTrca5PnDsdMGXhZe6CCe8U/UiTWd+lL+7b/Ko=
github.com/moby/sys/user v0.4.0 h1:jhcMKit7SA80hivmFJcbB1vqmw//wU61Zdui2eQXuMs=
@@ -148,28 +156,28 @@ go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJyS
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 h1:sbiXRNDSWJOTobXh5HyQKjq6wUC5tNybqjIqDpAY4CU=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0/go.mod h1:69uWxva0WgAA/4bu2Yy70SLDBwZXuQ6PbBpbsa5iZrQ=
go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ=
go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y=
go.opentelemetry.io/otel v1.36.0 h1:UumtzIklRBY6cI/lllNZlALOF5nNIzJVb16APdvgTXg=
go.opentelemetry.io/otel v1.36.0/go.mod h1:/TcFMXYjyRNh8khOAO9ybYkqaDBb/70aVwkNML4pP8E=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 h1:Mne5On7VWdx7omSrSSZvM4Kw7cS7NQkOOmLcgscI51U=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0/go.mod h1:IPtUMKL4O3tH5y+iXVyAXqpAwMuzC1IrxVS81rummfE=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMeyr1aBvBiPVYihXIaeIZba6b8E1bYp7lbdxK8CQg=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0/go.mod h1:oVdCUtjq9MK9BlS7TtucsQwUcXcymNiEDjgDD2jMtZU=
go.opentelemetry.io/otel/metric v1.35.0 h1:0znxYu2SNyuMSQT4Y9WDWej0VpcsxkuklLa4/siN90M=
go.opentelemetry.io/otel/metric v1.35.0/go.mod h1:nKVFgxBZ2fReX6IlyW28MgZojkoAkJGaE8CpgeAU3oE=
go.opentelemetry.io/otel/sdk v1.35.0 h1:iPctf8iprVySXSKJffSS79eOjl9pvxV9ZqOWT0QejKY=
go.opentelemetry.io/otel/sdk v1.35.0/go.mod h1:+ga1bZliga3DxJ3CQGg3updiaAJoNECOgJREo9KHGQg=
go.opentelemetry.io/otel/metric v1.36.0 h1:MoWPKVhQvJ+eeXWHFBOPoBOi20jh6Iq2CcCREuTYufE=
go.opentelemetry.io/otel/metric v1.36.0/go.mod h1:zC7Ks+yeyJt4xig9DEw9kuUFe5C3zLbVjV2PzT6qzbs=
go.opentelemetry.io/otel/sdk v1.36.0 h1:b6SYIuLRs88ztox4EyrvRti80uXIFy+Sqzoh9kFULbs=
go.opentelemetry.io/otel/sdk v1.36.0/go.mod h1:+lC+mTgD+MUWfjJubi2vvXWcVxyr9rmlshZni72pXeY=
go.opentelemetry.io/otel/sdk/metric v1.35.0 h1:1RriWBmCKgkeHEhM7a2uMjMUfP7MsOF5JpUCaEqEI9o=
go.opentelemetry.io/otel/sdk/metric v1.35.0/go.mod h1:is6XYCUMpcKi+ZsOvfluY5YstFnhW0BidkR+gL+qN+w=
go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt/xgMs=
go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc=
go.opentelemetry.io/otel/trace v1.36.0 h1:ahxWNuqZjpdiFAyrIoQ4GIiAIhxAunQR6MUoKrsNd4w=
go.opentelemetry.io/otel/trace v1.36.0/go.mod h1:gQ+OnDZzrybY4k4seLzPAWNwVBBVlF2szhehOBB/tGA=
go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I=
go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE=
golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc=
golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM=
golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
@@ -177,8 +185,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw=
golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -194,17 +202,17 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o=
golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw=
golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg=
golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/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.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0=
golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU=
golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M=
golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA=
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44=
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -218,14 +226,14 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T
google.golang.org/genproto v0.0.0-20230526203410-71b5a4ffd15e h1:Ao9GzfUMPH3zjVfzXG5rlWlk+Q8MXWKwWpwVQE1MXfw=
google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 h1:RFiFrvy37/mpSpdySBDrUdipW/dHwsRwh3J3+A9VgT4=
google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237/go.mod h1:Z5Iiy3jtmioajWHDGFk7CeugTyHtPvMHA4UTmUkyalE=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY=
google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA=
google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw=
google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/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/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
@@ -233,5 +241,5 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EV
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/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=
gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU=
gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=
gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=
gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=

View File

@@ -9,8 +9,6 @@ title: Cloudflare KV
A Cloudflare KV storage driver using [cloudflare/cloudflare-go](https://github.com/cloudflare/cloudflare-go).
**Note: Requires Go 1.21 and above**
### Table of Contents
- [Signatures](#signatures)
@@ -24,9 +22,13 @@ A Cloudflare KV storage driver using [cloudflare/cloudflare-go](https://github.c
```go
func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error
func (s *Storage) Reset() error
func (s *Storage) ResetWithContext(ctx context.Context) error
func (s *Storage) Close() error
func (s *Storage) Conn() *cloudflare.API
```

View File

@@ -55,8 +55,8 @@ func New(config ...Config) *Storage {
return storage
}
func (s *Storage) Get(key string) ([]byte, error) {
resp, err := s.api.GetWorkersKV(context.Background(), cloudflare.AccountIdentifier(s.accountID), cloudflare.GetWorkersKVParams{NamespaceID: s.namespaceID, Key: key})
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error) {
resp, err := s.api.GetWorkersKV(ctx, cloudflare.AccountIdentifier(s.accountID), cloudflare.GetWorkersKVParams{NamespaceID: s.namespaceID, Key: key})
if err != nil {
log.Printf("Error occur in GetWorkersKV: %v", err)
@@ -66,8 +66,12 @@ func (s *Storage) Get(key string) ([]byte, error) {
return resp, nil
}
func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
_, err := s.api.WriteWorkersKVEntry(context.Background(), cloudflare.AccountIdentifier(s.accountID), cloudflare.WriteWorkersKVEntryParams{
func (s *Storage) Get(key string) ([]byte, error) {
return s.GetWithContext(context.Background(), key)
}
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error {
_, err := s.api.WriteWorkersKVEntry(ctx, cloudflare.AccountIdentifier(s.accountID), cloudflare.WriteWorkersKVEntryParams{
NamespaceID: s.namespaceID,
Key: key,
Value: val,
@@ -81,8 +85,12 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
return nil
}
func (s *Storage) Delete(key string) error {
_, err := s.api.DeleteWorkersKVEntry(context.Background(), cloudflare.AccountIdentifier(s.accountID), cloudflare.DeleteWorkersKVEntryParams{
func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
return s.SetWithContext(context.Background(), key, val, exp)
}
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error {
_, err := s.api.DeleteWorkersKVEntry(ctx, cloudflare.AccountIdentifier(s.accountID), cloudflare.DeleteWorkersKVEntryParams{
NamespaceID: s.namespaceID,
Key: key,
})
@@ -95,14 +103,18 @@ func (s *Storage) Delete(key string) error {
return nil
}
func (s *Storage) Reset() error {
func (s *Storage) Delete(key string) error {
return s.DeleteWithContext(context.Background(), key)
}
func (s *Storage) ResetWithContext(ctx context.Context) error {
var (
cursor string
keys []string
)
for {
resp, err := s.api.ListWorkersKVKeys(context.Background(), cloudflare.AccountIdentifier(s.accountID), cloudflare.ListWorkersKVsParams{
resp, err := s.api.ListWorkersKVKeys(ctx, cloudflare.AccountIdentifier(s.accountID), cloudflare.ListWorkersKVsParams{
NamespaceID: s.namespaceID,
Cursor: cursor,
})
@@ -119,7 +131,7 @@ func (s *Storage) Reset() error {
keys = append(keys, name)
}
_, err = s.api.DeleteWorkersKVEntries(context.Background(), cloudflare.AccountIdentifier(s.accountID), cloudflare.DeleteWorkersKVEntriesParams{
_, err = s.api.DeleteWorkersKVEntries(ctx, cloudflare.AccountIdentifier(s.accountID), cloudflare.DeleteWorkersKVEntriesParams{
NamespaceID: s.namespaceID,
Keys: keys,
})
@@ -140,6 +152,10 @@ func (s *Storage) Reset() error {
return nil
}
func (s *Storage) Reset() error {
return s.ResetWithContext(context.Background())
}
func (s *Storage) Close() error {
return nil
}

View File

@@ -2,18 +2,20 @@ package cloudflarekv
import (
"bytes"
"context"
"os"
"testing"
"github.com/stretchr/testify/require"
)
func TestMain(m *testing.M) {
var testStore *Storage
func TestMain(m *testing.M) {
testStore = New(Config{
Key: "test",
Reset: true,
})
code := m.Run()
@@ -25,12 +27,6 @@ func TestMain(m *testing.M) {
func Test_CloudflareKV_Get(t *testing.T) {
t.Parallel()
var testStore *Storage
testStore = New(Config{
Key: "test",
})
var (
key = "john"
val = []byte("doe")
@@ -55,14 +51,29 @@ func Test_CloudflareKV_Get(t *testing.T) {
_ = testStore.Close()
}
func Test_CloudflareKV_Set(t *testing.T) {
func Test_CloudflareKV_GetWithContext(t *testing.T) {
t.Parallel()
var testStore *Storage
var (
key = "john"
val = []byte("doe")
)
testStore = New(Config{
Key: "test",
})
err := testStore.Set(key, val, 0)
require.NoError(t, err)
ctx, cancel := context.WithCancel(context.Background())
cancel()
val, err = testStore.GetWithContext(ctx, key)
require.ErrorContains(t, err, context.Canceled.Error())
require.Nil(t, val)
_ = testStore.Close()
}
func Test_CloudflareKV_Set(t *testing.T) {
t.Parallel()
var (
key = "john"
@@ -76,15 +87,22 @@ func Test_CloudflareKV_Set(t *testing.T) {
_ = testStore.Close()
}
func Test_CloudflareKV_SetWithContext(t *testing.T) {
var (
key = "john"
val = []byte("doe")
)
ctx, cancel := context.WithCancel(context.Background())
cancel()
err := testStore.SetWithContext(ctx, key, val, 0)
require.ErrorIs(t, err, context.Canceled)
}
func Test_CloudflareKV_Delete(t *testing.T) {
t.Parallel()
var testStore *Storage
testStore = New(Config{
Key: "test",
})
var (
key = "john"
val = []byte("doe")
@@ -99,30 +117,63 @@ func Test_CloudflareKV_Delete(t *testing.T) {
_ = testStore.Close()
}
func Test_CloudflareKV_DeleteWithContext(t *testing.T) {
var (
key = "john"
val = []byte("doe")
)
err := testStore.Set(key, val, 0)
require.NoError(t, err)
ctx, cancel := context.WithCancel(context.Background())
cancel()
err = testStore.DeleteWithContext(ctx, key)
require.ErrorIs(t, err, context.Canceled)
result, err := testStore.Get(key)
require.NoError(t, err)
require.Equal(t, val, result)
}
func Test_CloudflareKV_Reset(t *testing.T) {
t.Parallel()
var testStore *Storage
testStore = New(Config{
Key: "test",
})
err := testStore.Reset()
require.NoError(t, err)
_ = testStore.Close()
}
func Test_CloudflareKV_ResetWithContext(t *testing.T) {
val := []byte("doe")
err := testStore.Set("john1", val, 0)
require.NoError(t, err)
err = testStore.Set("john2", val, 0)
require.NoError(t, err)
ctx, cancel := context.WithCancel(context.Background())
cancel()
err = testStore.ResetWithContext(ctx)
require.ErrorIs(t, err, context.Canceled)
result, err := testStore.Get("john1")
require.NoError(t, err)
require.Equal(t, val, result)
result, err = testStore.Get("john2")
require.NoError(t, err)
require.Equal(t, val, result)
}
func Test_CloudflareKV_Close(t *testing.T) {
t.Parallel()
var testStore *Storage
testStore = New(Config{
Key: "test",
})
require.Nil(t, testStore.Close())
_ = testStore.Close()
@@ -131,25 +182,12 @@ func Test_CloudflareKV_Close(t *testing.T) {
func Test_CloudflareKV_Conn(t *testing.T) {
t.Parallel()
var testStore *Storage
testStore = New(Config{
Key: "test",
})
require.NotNil(t, testStore.Conn())
_ = testStore.Close()
}
func Benchmark_CloudflareKV_Set(b *testing.B) {
var testStore *Storage
testStore = New(Config{
Key: "test",
})
b.ReportAllocs()
b.ResetTimer()
@@ -164,13 +202,6 @@ func Benchmark_CloudflareKV_Set(b *testing.B) {
}
func Benchmark_CloudflareKV_Get(b *testing.B) {
var testStore *Storage
testStore = New(Config{
Key: "test",
})
err := testStore.Set("john", []byte("doe"), 0)
require.NoError(b, err)
@@ -187,13 +218,6 @@ func Benchmark_CloudflareKV_Get(b *testing.B) {
}
func Benchmark_CloudflareKV_SetAndDelete(b *testing.B) {
var testStore *Storage
testStore = New(Config{
Key: "test",
})
b.ReportAllocs()
b.ResetTimer()

View File

@@ -1,6 +1,6 @@
module github.com/gofiber/storage/cloudflarekv
go 1.21
go 1.23.0
require (
github.com/cloudflare/cloudflare-go v0.115.0

View File

@@ -54,7 +54,7 @@ func (t *TestModule) GetWorkersKV(ctx context.Context, rc *cloudflare.ResourceCo
return nil, err
}
req, err := http.NewRequest(http.MethodPost, t.baseUrl+"/getworkerskvvaluebykey", bytes.NewReader(marshalledBody))
req, err := http.NewRequestWithContext(ctx, http.MethodPost, t.baseUrl+"/getworkerskvvaluebykey", bytes.NewReader(marshalledBody))
if err != nil {
log.Println("Error occur in /getworkerskvvaluebykey > making http call")
@@ -68,7 +68,12 @@ func (t *TestModule) GetWorkersKV(ctx context.Context, rc *cloudflare.ResourceCo
return nil, err
}
defer resp.Body.Close()
defer func() {
err := resp.Body.Close()
if err != nil {
log.Println("Error closing response body:", err)
}
}()
respBody, err := io.ReadAll(resp.Body)
if err != nil {
@@ -95,7 +100,7 @@ func (t *TestModule) WriteWorkersKVEntry(ctx context.Context, rc *cloudflare.Res
return cloudflare.Response{}, err
}
req, err := http.NewRequest(http.MethodPost, t.baseUrl+"/writeworkerskvkeyvaluepair", bytes.NewReader(marshalledBody))
req, err := http.NewRequestWithContext(ctx, http.MethodPost, t.baseUrl+"/writeworkerskvkeyvaluepair", bytes.NewReader(marshalledBody))
if err != nil {
log.Println("Error occur in /writeworkerskvkeyvaluepair > making http call")
@@ -111,7 +116,12 @@ func (t *TestModule) WriteWorkersKVEntry(ctx context.Context, rc *cloudflare.Res
return cloudflare.Response{}, err
}
defer resp.Body.Close()
defer func() {
err := resp.Body.Close()
if err != nil {
log.Println("Error closing response body:", err)
}
}()
return cloudflare.Response{
Success: true,
@@ -134,7 +144,7 @@ func (t *TestModule) DeleteWorkersKVEntry(ctx context.Context, rc *cloudflare.Re
return cloudflare.Response{}, err
}
req, err := http.NewRequest(http.MethodDelete, t.baseUrl+"/deleteworkerskvpairbykey", bytes.NewReader(marshalledBody))
req, err := http.NewRequestWithContext(ctx, http.MethodDelete, t.baseUrl+"/deleteworkerskvpairbykey", bytes.NewReader(marshalledBody))
if err != nil {
log.Println("Error occur in /deleteworkerskvpairbykey > making http call")
@@ -148,7 +158,12 @@ func (t *TestModule) DeleteWorkersKVEntry(ctx context.Context, rc *cloudflare.Re
return cloudflare.Response{}, err
}
defer resp.Body.Close()
defer func() {
err := resp.Body.Close()
if err != nil {
log.Println("Error closing response body:", err)
}
}()
return cloudflare.Response{
Success: true,
@@ -173,7 +188,7 @@ func (t *TestModule) ListWorkersKVKeys(ctx context.Context, rc *cloudflare.Resou
return cloudflare.ListStorageKeysResponse{}, err
}
req, err := http.NewRequest(http.MethodPost, t.baseUrl+"/listworkerskvkeys", bytes.NewReader(marshalledBody))
req, err := http.NewRequestWithContext(ctx, http.MethodPost, t.baseUrl+"/listworkerskvkeys", bytes.NewReader(marshalledBody))
if err != nil {
log.Println("Error occur in /listworkerskvkeys > making http call")
@@ -189,7 +204,12 @@ func (t *TestModule) ListWorkersKVKeys(ctx context.Context, rc *cloudflare.Resou
return cloudflare.ListStorageKeysResponse{}, err
}
defer resp.Body.Close()
defer func() {
err := resp.Body.Close()
if err != nil {
log.Println("Error closing response body:", err)
}
}()
result := []cloudflare.StorageKey{}
@@ -225,7 +245,7 @@ func (t *TestModule) DeleteWorkersKVEntries(ctx context.Context, rc *cloudflare.
return cloudflare.Response{}, err
}
req, err := http.NewRequest(http.MethodDelete, t.baseUrl+"/deleteworkerskventries", bytes.NewReader(marshalledBody))
req, err := http.NewRequestWithContext(ctx, http.MethodDelete, t.baseUrl+"/deleteworkerskventries", bytes.NewReader(marshalledBody))
if err != nil {
log.Println("Error occur in /deleteworkerskventries > making new request")

View File

@@ -17,9 +17,13 @@ A Coherence storage driver using [https://github.com/oracle/coherence-go-client]
```go
func New(config ...Config) (*Storage, error)
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error
func (s *Storage) Reset() error
func (s *Storage) ResetWithContext(ctx context.Context) error
func (s *Storage) Close() error
func (s *Storage) Conn() *Session
```

View File

@@ -7,8 +7,9 @@ import (
"context"
"crypto/tls"
"fmt"
coh "github.com/oracle/coherence-go-client/v2/coherence"
"time"
coh "github.com/oracle/coherence-go-client/v2/coherence"
)
const (
@@ -21,7 +22,6 @@ const (
type Storage struct {
session *coh.Session
namedCache coh.NamedCache[string, []byte]
ctx context.Context
}
// Config defines configuration options for Coherence connection.
@@ -140,12 +140,11 @@ func newCoherenceStorage(session *coh.Session, cacheName string, nearCacheTimeou
return &Storage{
session: session,
namedCache: nc,
ctx: context.Background(),
}, nil
}
func (s *Storage) Get(key string) ([]byte, error) {
v, err := s.namedCache.Get(s.ctx, key)
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error) {
v, err := s.namedCache.Get(ctx, key)
if err != nil {
return nil, err
}
@@ -155,18 +154,34 @@ func (s *Storage) Get(key string) ([]byte, error) {
return *v, nil
}
func (s *Storage) Get(key string) ([]byte, error) {
return s.GetWithContext(context.Background(), key)
}
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error {
_, err := s.namedCache.PutWithExpiry(ctx, key, val, exp)
return err
}
func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
_, err := s.namedCache.PutWithExpiry(s.ctx, key, val, exp)
return s.SetWithContext(context.Background(), key, val, exp)
}
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error {
_, err := s.namedCache.Remove(ctx, key)
return err
}
func (s *Storage) Delete(key string) error {
_, err := s.namedCache.Remove(s.ctx, key)
return err
return s.DeleteWithContext(context.Background(), key)
}
func (s *Storage) ResetWithContext(ctx context.Context) error {
return s.namedCache.Truncate(ctx)
}
func (s *Storage) Reset() error {
return s.namedCache.Truncate(s.ctx)
return s.ResetWithContext(context.Background())
}
func (s *Storage) Close() error {

View File

@@ -4,10 +4,14 @@ package coherence
* Copyright © 2023, 2024 Oracle and/or its affiliates.
*/
import (
"github.com/stretchr/testify/require"
"context"
"os"
"testing"
"time"
"github.com/stretchr/testify/require"
"github.com/testcontainers/testcontainers-go"
"github.com/testcontainers/testcontainers-go/wait"
)
var (
@@ -18,35 +22,90 @@ var (
value2 = []byte("value2")
)
var testStore *Storage
const (
// coherenceImage is the default image used for running coherence in tests.
coherenceImage = "ghcr.io/oracle/coherence-ce:25.03.1-graal"
coherenceImageEnvVar string = "TEST_COHERENCE_IMAGE"
coherencePort = "1408/tcp"
coherencePort2 = "30000/tcp"
func TestMain(m *testing.M) {
testStore, _ = New(Config{
Reset: true,
NearCacheTimeout: time.Duration(4) * time.Second,
})
// configuration for the health check
coherenceHealthEnvVar = "COHERENCE_HEALTH_HTTP_PORT"
coherenceHealthPort = "6676"
)
code := m.Run()
_ = testStore.Close()
os.Exit(code)
}
// newTestStore returns a new Coherence Store and ensures it is reset.
func newTestStore(t testing.TB, config ...Config) (*Storage, error) {
func newTestConfig(t testing.TB) Config {
t.Helper()
testStore, err := New(config...)
// The coherence client adds debug messages to stdout, which corrupt
// the output of the benchmarks. See "[Coherence Client Debug]" for
// more information.
//
// [Coherence Client Debug]: https://github.com/oracle/coherence-go-client/blob/6383df14821ecf7c1ecd5f33a2c2fd402102d797/coherence/session.go#L195
t.Setenv("COHERENCE_SESSION_DEBUG", "false")
img := coherenceImage
if imgFromEnv := os.Getenv(coherenceImageEnvVar); imgFromEnv != "" {
img = imgFromEnv
}
ctx := context.Background()
c, err := testcontainers.Run(ctx,
img,
testcontainers.WithExposedPorts(coherencePort, coherencePort2, coherenceHealthPort),
testcontainers.WithEnv(map[string]string{
coherenceHealthEnvVar: coherenceHealthPort,
}),
testcontainers.WithWaitStrategy(
wait.ForListeningPort(coherencePort),
wait.ForListeningPort(coherencePort2),
wait.ForListeningPort(coherenceHealthPort+"/tcp"),
wait.ForHTTP("/ready").WithPort(coherenceHealthPort+"/tcp").WithStartupTimeout(time.Second*30),
),
)
testcontainers.CleanupContainer(t, c)
require.NoError(t, err)
err = testStore.Reset()
host, err := c.Host(ctx)
require.NoError(t, err)
return testStore, err
port, err := c.MappedPort(ctx, coherencePort)
require.NoError(t, err)
return Config{
Reset: true,
Address: host + ":" + port.Port(),
NearCacheTimeout: time.Duration(4) * time.Second,
}
}
func newTestStore(t testing.TB) *Storage {
return newTestStoreWithConfig(t, nil)
}
func newTestStoreWithConfig(t testing.TB, config *Config) *Storage {
t.Helper()
var cfg Config
if config == nil {
cfg = newTestConfig(t)
} else {
cfg = *config
}
storage, err := New(cfg)
require.NoError(t, err)
return storage
}
func Test_Coherence_Set_And_Get(t *testing.T) {
var val []byte
testStore := newTestStore(t)
defer testStore.Close()
err := testStore.Set(key1, value1, 0)
require.NoError(t, err)
@@ -57,9 +116,52 @@ func Test_Coherence_Set_And_Get(t *testing.T) {
require.NotNil(t, testStore.Conn())
}
func Test_Coherence_Set_And_GetWithContext(t *testing.T) {
var val []byte
testStore := newTestStore(t)
defer testStore.Close()
err := testStore.Set(key1, value1, 0)
require.NoError(t, err)
// Coherence will create new context instance as the provided one is deadline exceeded.
ctx, cancel := context.WithCancel(context.Background())
cancel()
val, err = testStore.GetWithContext(ctx, key1)
require.Error(t, err)
require.Empty(t, val)
require.NotNil(t, testStore.Conn())
}
func Test_Coherence_SetContext_And_Get(t *testing.T) {
var val []byte
testStore := newTestStore(t)
defer testStore.Close()
ctx, cancel := context.WithTimeout(context.Background(), time.Microsecond)
cancel()
// Coherencce will create new context instance as the provided one is deadline exceeded.
err := testStore.SetWithContext(ctx, key1, value1, 1*time.Nanosecond)
require.ErrorIs(t, err, context.DeadlineExceeded)
val, err = testStore.Get(key1)
require.NoError(t, err)
require.False(t, len(val) == 0)
require.NotNil(t, testStore.Conn())
}
func Test_Coherence_Set_Override(t *testing.T) {
var val []byte
testStore := newTestStore(t)
defer testStore.Close()
err := testStore.Set(key1, value1, 0)
require.NoError(t, err)
@@ -74,6 +176,11 @@ func Test_Coherence_Set_Override(t *testing.T) {
func Test_Coherence_Set_With_Reset(t *testing.T) {
var val []byte
cfg := newTestConfig(t)
testStore := newTestStoreWithConfig(t, &cfg)
defer testStore.Close()
err := testStore.Set(key1, value1, 0)
require.NoError(t, err)
@@ -82,7 +189,10 @@ func Test_Coherence_Set_With_Reset(t *testing.T) {
require.Equal(t, value1, val)
// get a new store but reset it, so the subsequent Get will return nil
testStore2, err := newTestStore(t, Config{Reset: true})
testStore2 := newTestStoreWithConfig(t, &cfg)
defer testStore2.Close()
err = testStore2.Reset()
require.NoError(t, err)
val, err = testStore2.Get(key1)
@@ -95,6 +205,9 @@ func Test_Coherence_Set_With_Reset(t *testing.T) {
func Test_Coherence_Set_With_Expiry(t *testing.T) {
var val []byte
testStore := newTestStore(t)
defer testStore.Close()
// set with an expiry of 5 seconds
err := testStore.Set(key1, value1, time.Duration(5)*time.Second)
require.NoError(t, err)
@@ -108,6 +221,9 @@ func Test_Coherence_Set_With_Expiry(t *testing.T) {
func Test_Coherence_Get_Missing(t *testing.T) {
var val []byte
testStore := newTestStore(t)
defer testStore.Close()
val, err := testStore.Get(missingKey)
require.NoError(t, err)
require.True(t, len(val) == 0)
@@ -116,6 +232,9 @@ func Test_Coherence_Get_Missing(t *testing.T) {
func Test_Coherence_Reset(t *testing.T) {
var val []byte
testStore := newTestStore(t)
defer testStore.Close()
err := testStore.Set(key1, value1, 0)
require.NoError(t, err)
@@ -133,6 +252,45 @@ func Test_Coherence_Reset(t *testing.T) {
// reset the store, this should remove both entries
err = testStore.Reset()
require.NoError(t, err)
// check the keys have expired
val, err = testStore.Get(key1)
require.NoError(t, err)
require.True(t, len(val) == 0)
val, err = testStore.Get(key2)
require.NoError(t, err)
require.True(t, len(val) == 0)
}
func Test_Coherence_ResetWithContext(t *testing.T) {
var val []byte
testStore := newTestStore(t)
defer testStore.Close()
err := testStore.Set(key1, value1, 0)
require.NoError(t, err)
err = testStore.Set(key2, value2, 0)
require.NoError(t, err)
// check the keys exist
val, err = testStore.Get(key1)
require.NoError(t, err)
require.Equal(t, value1, val)
val, err = testStore.Get(key2)
require.NoError(t, err)
require.Equal(t, value2, val)
// reset the store, this should remove both entries
// Coherence will create new context instance as the provided one is deadline exceeded.
ctx, cancel := context.WithCancel(context.Background())
cancel()
err = testStore.ResetWithContext(ctx)
require.NoError(t, err)
// check the keys have expired
val, err = testStore.Get(key1)
@@ -147,6 +305,9 @@ func Test_Coherence_Reset(t *testing.T) {
func Test_Coherence_Set_And_Delete(t *testing.T) {
var val []byte
testStore := newTestStore(t)
defer testStore.Close()
err := testStore.Set(key1, value1, 0)
require.NoError(t, err)
@@ -159,19 +320,48 @@ func Test_Coherence_Set_And_Delete(t *testing.T) {
require.True(t, len(val) == 0)
}
func Test_Coherence_Set_And_DeleteWithContext(t *testing.T) {
var val []byte
testStore := newTestStore(t)
defer testStore.Close()
err := testStore.Set(key1, value1, 0)
require.NoError(t, err)
ctx, cancel := context.WithCancel(context.Background())
cancel()
// Coherence will create new context instance as the provided one is deadline exceeded.
err = testStore.DeleteWithContext(ctx, key1)
require.Error(t, err)
// ensure the key has gone
val, err = testStore.Get(key1)
require.NoError(t, err)
require.True(t, len(val) == 0)
}
// TestCoherenceWithScope ensures we can create multiple session stores with multiple scopes.
func Test_Coherence_With_Scope(t *testing.T) {
var val []byte
// create two session stores with different scopes
testStore1, err := newTestStore(t, Config{ScopeName: "scope1"})
require.NoError(t, err)
cfg := newTestConfig(t)
testStore2, err := newTestStore(t, Config{ScopeName: "scope2"})
require.NoError(t, err)
cfg1 := cfg
cfg1.ScopeName = "scope1"
testStore1 := newTestStoreWithConfig(t, &cfg1)
defer testStore1.Close()
// create two session stores with different scopes
cfg2 := cfg
cfg2.ScopeName = "scope2"
testStore2 := newTestStoreWithConfig(t, &cfg2)
defer testStore2.Close()
// ensure we can put the same key with different values in each scope
err = testStore1.Set(key1, value1, 0)
err := testStore1.Set(key1, value1, 0)
require.NoError(t, err)
err = testStore2.Set(key1, value2, 0)
@@ -185,12 +375,14 @@ func Test_Coherence_With_Scope(t *testing.T) {
val, err = testStore2.Get(key1)
require.NoError(t, err)
require.Equal(t, value2, val)
require.NoError(t, testStore1.Close())
require.NoError(t, testStore2.Close())
}
func Benchmark_Coherence_Set(b *testing.B) {
b.Setenv("COHERENCE_LOG_LEVEL", "ERROR")
testStore := newTestStore(b)
defer testStore.Close()
b.ReportAllocs()
b.ResetTimer()
@@ -203,6 +395,11 @@ func Benchmark_Coherence_Set(b *testing.B) {
}
func Benchmark_Coherence_Get(b *testing.B) {
b.Setenv("COHERENCE_LOG_LEVEL", "ERROR")
testStore := newTestStore(b)
defer testStore.Close()
err := testStore.Set("john", []byte("doe"), 0)
require.NoError(b, err)
@@ -217,6 +414,11 @@ func Benchmark_Coherence_Get(b *testing.B) {
}
func Benchmark_Coherence_SetAndDelete(b *testing.B) {
b.Setenv("COHERENCE_LOG_LEVEL", "ERROR")
testStore := newTestStore(b)
defer testStore.Close()
b.ReportAllocs()
b.ResetTimer()

View File

@@ -3,25 +3,67 @@ module github.com/gofiber/storage/coherence
go 1.23.0
require (
github.com/oracle/coherence-go-client/v2 v2.1.0
github.com/oracle/coherence-go-client/v2 v2.3.1
github.com/stretchr/testify v1.10.0
github.com/testcontainers/testcontainers-go v0.37.0
)
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250425173222-7b384671a197 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
require (
dario.cat/mergo v1.0.1 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/platforms v0.2.1 // indirect
github.com/cpuguy83/dockercfg v0.3.2 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/docker v28.0.1+incompatible // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/ebitengine/purego v0.8.2 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/kr/pretty v0.1.0 // indirect
golang.org/x/net v0.39.0 // indirect
golang.org/x/sys v0.32.0 // indirect
golang.org/x/text v0.24.0 // indirect
google.golang.org/grpc v1.72.0 // indirect
github.com/klauspost/compress v1.17.4 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/magiconair/properties v1.8.10 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/patternmatcher v0.6.0 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/sys/user v0.1.0 // indirect
github.com/moby/sys/userns v0.1.0 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/shirou/gopsutil/v4 v4.25.1 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel v1.35.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0 // indirect
go.opentelemetry.io/otel/metric v1.35.0 // indirect
go.opentelemetry.io/otel/trace v1.35.0 // indirect
go.opentelemetry.io/proto/otlp v1.6.0 // indirect
golang.org/x/crypto v0.39.0 // indirect
golang.org/x/net v0.41.0 // indirect
golang.org/x/sys v0.33.0 // indirect
golang.org/x/text v0.26.0 // indirect
google.golang.org/grpc v1.73.0 // indirect
google.golang.org/protobuf v1.36.6 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
)

View File

@@ -1,56 +1,190 @@
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s=
dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU=
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8=
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8=
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=
github.com/containerd/platforms v0.2.1 h1:zvwtM3rz2YHPQsF2CHYM8+KtB5dvhISiXh5ZpSBQv6A=
github.com/containerd/platforms v0.2.1/go.mod h1:XHCb+2/hzowdiut9rkudds9bE5yJ7npe7dG/wG+uFPw=
github.com/cpuguy83/dockercfg v0.3.2 h1:DlJTyZGBDlXqUZ2Dk2Q3xHs/FtnooJJVaad2S9GKorA=
github.com/cpuguy83/dockercfg v0.3.2/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc=
github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
github.com/docker/docker v28.0.1+incompatible h1:FCHjSRdXhNRFjlHMTv4jUNlIBbTeRjrWfeFuJp7jpo0=
github.com/docker/docker v28.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c=
github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/ebitengine/purego v0.8.2 h1:jPPGWs2sZ1UgOSgD2bClL0MJIqu58nOmIcBuXr62z1I=
github.com/ebitengine/purego v0.8.2/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
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/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 h1:5ZPtiqj0JL5oKWmcsq4VMaAW5ukBEgSGXEN89zeH1Jo=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3/go.mod h1:ndYquD05frm2vACXE1nsccT4oJzjhw2arTS2cpUD1PI=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4=
github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8=
github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY=
github.com/oracle/coherence-go-client/v2 v2.1.0 h1:EQ9kmwJP9ERA/TtdsIG/mEDyUMm596FxM2pKR+9l1zw=
github.com/oracle/coherence-go-client/v2 v2.1.0/go.mod h1:Myuz1GfRntOmNTV2tdFLSFJafmL1Iq1PJiwXZjGCmhI=
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4=
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I=
github.com/magiconair/properties v1.8.10 h1:s31yESBquKXCV9a/ScB3ESkOjUYYv+X0rg8SYxI99mE=
github.com/magiconair/properties v1.8.10/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk=
github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc=
github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc=
github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo=
github.com/moby/sys/user v0.1.0 h1:WmZ93f5Ux6het5iituh9x2zAG7NFY9Aqi49jjE1PaQg=
github.com/moby/sys/user v0.1.0/go.mod h1:fKJhFOnsCN6xZ5gSfbM6zaHGgDJMrqt9/reuj4T7MmU=
github.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g=
github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28=
github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=
github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y=
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040=
github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M=
github.com/oracle/coherence-go-client/v2 v2.3.1 h1:DhyWDw7vNeWcbI990E22FLc093Y2ZOhcmv646sFEl9o=
github.com/oracle/coherence-go-client/v2 v2.3.1/go.mod h1:1qVtUmN87JU5D1JduoD0KRzOmhqZ2gJaxsPvmJ+5mEA=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw=
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
github.com/shirou/gopsutil/v4 v4.25.1 h1:QSWkTc+fu9LTAWfkZwZ6j8MSUk4A2LV7rbH0ZqmLjXs=
github.com/shirou/gopsutil/v4 v4.25.1/go.mod h1:RoUCUpndaJFtT+2zsZzzmhvbfGoDCJ7nFXKJf8GqJbI=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.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.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/testcontainers/testcontainers-go v0.37.0 h1:L2Qc0vkTw2EHWQ08djon0D2uw7Z/PtHS/QzZZ5Ra/hg=
github.com/testcontainers/testcontainers-go v0.37.0/go.mod h1:QPzbxZhQ6Bclip9igjLFj6z0hs01bU8lrl2dHQmgFGM=
github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU=
github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI=
github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk=
github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY=
go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI=
go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ=
go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE=
go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A=
go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU=
go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk=
go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w=
go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k=
go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE=
golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY=
golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E=
golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0=
golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250425173222-7b384671a197 h1:29cjnHVylHwTzH66WfFZqgSQgnxzvWE+jvBwpZCLRxY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250425173222-7b384671a197/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A=
google.golang.org/grpc v1.72.0 h1:S7UkcVa60b5AAQTaO6ZKamFp1zMZSU0fGDK2WZLbBnM=
google.golang.org/grpc v1.72.0/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw=
go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ=
go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0 h1:1fTNlAIJZGWLP5FVu0fikVry1IsiUnXjf7QFvoNN3Xw=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0/go.mod h1:zjPK58DtkqQFn+YUMbx0M2XV3QgKU0gS9LeGohREyK4=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMeyr1aBvBiPVYihXIaeIZba6b8E1bYp7lbdxK8CQg=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0/go.mod h1:oVdCUtjq9MK9BlS7TtucsQwUcXcymNiEDjgDD2jMtZU=
go.opentelemetry.io/otel/metric v1.35.0 h1:0znxYu2SNyuMSQT4Y9WDWej0VpcsxkuklLa4/siN90M=
go.opentelemetry.io/otel/metric v1.35.0/go.mod h1:nKVFgxBZ2fReX6IlyW28MgZojkoAkJGaE8CpgeAU3oE=
go.opentelemetry.io/otel/sdk v1.35.0 h1:iPctf8iprVySXSKJffSS79eOjl9pvxV9ZqOWT0QejKY=
go.opentelemetry.io/otel/sdk v1.35.0/go.mod h1:+ga1bZliga3DxJ3CQGg3updiaAJoNECOgJREo9KHGQg=
go.opentelemetry.io/otel/sdk/metric v1.35.0 h1:1RriWBmCKgkeHEhM7a2uMjMUfP7MsOF5JpUCaEqEI9o=
go.opentelemetry.io/otel/sdk/metric v1.35.0/go.mod h1:is6XYCUMpcKi+ZsOvfluY5YstFnhW0BidkR+gL+qN+w=
go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt/xgMs=
go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc=
go.opentelemetry.io/proto/otlp v1.6.0 h1:jQjP+AQyTf+Fe7OKj/MfkDrmK4MNVtw2NpXsf9fefDI=
go.opentelemetry.io/proto/otlp v1.6.0/go.mod h1:cicgGehlFuNdgZkcALOCh3VE6K/u2tAjzlRhDwmVpZc=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM=
golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw=
golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg=
golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M=
golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA=
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44=
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/genproto/googleapis/api v0.0.0-20250428153025-10db94c68c34 h1:0PeQib/pH3nB/5pEmFeVQJotzGohV0dq4Vcp09H5yhE=
google.golang.org/genproto/googleapis/api v0.0.0-20250428153025-10db94c68c34/go.mod h1:0awUlEkap+Pb1UMeJwJQQAdJQrt3moU7J2moTy69irI=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a h1:v2PbRU4K3llS09c7zodFpNePeamkAwG3mPrAery9VeE=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A=
google.golang.org/grpc v1.73.0 h1:VIWSmpI2MegBtTuFt5/JWy2oXxtjJ/e89Z70ImfD2ok=
google.golang.org/grpc v1.73.0/go.mod h1:50sbHOUqWoCQGI8V2HQLJM0B+LMlIUjNSZmow7EVBQc=
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/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=
gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU=
gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=

View File

@@ -9,8 +9,6 @@ title: Couchbase
A Couchbase storage driver using [couchbase/gocb](https://github.com/couchbase/gocb).
**Note: Requires Go 1.19 and above**
### Table of Contents
- [Signatures](#signatures)
- [Installation](#installation)
@@ -22,9 +20,13 @@ A Couchbase storage driver using [couchbase/gocb](https://github.com/couchbase/g
```go
func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error
func (s *Storage) Reset() error
func (s *Storage) ResetWithContext(ctx context.Context) error
func (s *Storage) Close() error
func (s *Storage) Conn() *gocb.Cluster
```

View File

@@ -1,6 +1,7 @@
package couchbase
import (
"context"
"time"
"github.com/couchbase/gocb/v2"
@@ -43,8 +44,10 @@ func New(config ...Config) *Storage {
return &Storage{cb: cb, bucket: b}
}
func (s *Storage) Get(key string) ([]byte, error) {
out, err := s.bucket.DefaultCollection().Get(key, nil)
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error) {
out, err := s.bucket.DefaultCollection().Get(key, &gocb.GetOptions{
Context: ctx,
})
if err != nil {
switch e := err.(type) {
case *gocb.KeyValueError:
@@ -66,8 +69,13 @@ func (s *Storage) Get(key string) ([]byte, error) {
return value, nil
}
func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
func (s *Storage) Get(key string) ([]byte, error) {
return s.GetWithContext(context.Background(), key)
}
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error {
if _, err := s.bucket.DefaultCollection().Upsert(key, val, &gocb.UpsertOptions{
Context: ctx,
Expiry: exp,
}); err != nil {
return err
@@ -76,15 +84,31 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
return nil
}
func (s *Storage) Delete(key string) error {
if _, err := s.bucket.DefaultCollection().Remove(key, nil); err != nil {
func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
return s.SetWithContext(context.Background(), key, val, exp)
}
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error {
if _, err := s.bucket.DefaultCollection().Remove(key, &gocb.RemoveOptions{
Context: ctx,
}); err != nil {
return err
}
return nil
}
func (s *Storage) Delete(key string) error {
return s.DeleteWithContext(context.Background(), key)
}
func (s *Storage) ResetWithContext(ctx context.Context) error {
return s.cb.Buckets().FlushBucket(s.bucket.Name(), &gocb.FlushBucketOptions{
Context: ctx,
})
}
func (s *Storage) Reset() error {
return s.cb.Buckets().FlushBucket(s.bucket.Name(), nil)
return s.ResetWithContext(context.Background())
}
func (s *Storage) Close() error {

View File

@@ -61,6 +61,17 @@ func TestSetCouchbase_ShouldReturnNoError(t *testing.T) {
require.NoError(t, err)
}
func TestSetWithContextCouchbase_ContextCancelled_ShouldReturnError(t *testing.T) {
testStore := newTestStore(t)
ctx, cancel := context.WithTimeout(context.Background(), time.Microsecond)
defer cancel()
err := testStore.SetWithContext(ctx, "test", []byte("test"), 0)
require.Error(t, err)
}
func TestGetCouchbase_ShouldReturnNil_WhenDocumentNotFound(t *testing.T) {
testStore := newTestStore(t)
defer testStore.Close()

View File

@@ -11,8 +11,6 @@ A DynamoDB storage driver using [aws/aws-sdk-go-v2](https://github.com/aws/aws-s
**Note:** If config fields of credentials not given, credentials are using from the environment variables, ~/.aws/credentials, or EC2 instance role. If config fields of credentials given, credentials are using from config. Look at: [specifying credentials](https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk/#specifying-credentials)
**Note: Requires Go 1.19 and above**
### Table of Contents
- [Signatures](#signatures)
- [Installation](#installation)
@@ -27,9 +25,13 @@ func New(config Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error
func (s *Storage) Reset() error
func (s *Storage) ResetWithContext(ctx context.Context) error
func (s *Storage) Close() error
func (s *Storage) Conn() *awsdynamodb.Client
```

View File

@@ -19,7 +19,6 @@ import (
type Storage struct {
db *awsdynamodb.Client
table string
requestTimeout time.Duration
}
// "k" is used as table column name for the key.
@@ -77,11 +76,8 @@ func New(config Config) *Storage {
return store
}
// Get value by key
func (s *Storage) Get(key string) ([]byte, error) {
ctx, cancel := s.requestContext()
defer cancel()
// GetWithContext retrieves the value associated with the given key using the provided context.
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error) {
k := make(map[string]types.AttributeValue)
k[keyAttrName] = &types.AttributeValueMemberS{
Value: key,
@@ -108,11 +104,12 @@ func (s *Storage) Get(key string) ([]byte, error) {
return item.V, err
}
// Set key with value
func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
ctx, cancel := s.requestContext()
defer cancel()
func (s *Storage) Get(key string) ([]byte, error) {
return s.GetWithContext(context.Background(), key)
}
// Set key with value
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error {
// Ain't Nobody Got Time For That
if len(key) <= 0 || len(val) <= 0 {
return nil
@@ -134,11 +131,12 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
return err
}
// Delete entry by key
func (s *Storage) Delete(key string) error {
ctx, cancel := s.requestContext()
defer cancel()
func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
return s.SetWithContext(context.Background(), key, val, exp)
}
// Delete entry by key
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error {
// Ain't Nobody Got Time For That
if len(key) <= 0 {
return nil
@@ -157,11 +155,12 @@ func (s *Storage) Delete(key string) error {
return err
}
// Reset all entries, including unexpired
func (s *Storage) Reset() error {
ctx, cancel := s.requestContext()
defer cancel()
func (s *Storage) Delete(key string) error {
return s.DeleteWithContext(context.Background(), key)
}
// Reset all entries, including unexpired
func (s *Storage) ResetWithContext(ctx context.Context) error {
deleteTableInput := awsdynamodb.DeleteTableInput{
TableName: &s.table,
}
@@ -169,14 +168,17 @@ func (s *Storage) Reset() error {
return err
}
func (s *Storage) Reset() error {
return s.ResetWithContext(context.Background())
}
// Close the database
func (s *Storage) Close() error {
return nil
}
func (s *Storage) createTable(cfg Config, describeTableInput awsdynamodb.DescribeTableInput) error {
ctx, cancel := s.requestContext()
defer cancel()
ctx := context.Background()
keyAttrType := "S" // For "string"
keyType := "HASH" // As opposed to "RANGE"
@@ -225,14 +227,6 @@ func (s *Storage) createTable(cfg Config, describeTableInput awsdynamodb.Describ
return nil
}
// Context for making requests will timeout if a non-zero timeout is configured
func (s *Storage) requestContext() (context.Context, context.CancelFunc) {
if s.requestTimeout > 0 {
return context.WithTimeout(context.Background(), s.requestTimeout)
}
return context.Background(), func() {}
}
func returnAWSConfig(cfg Config) (aws.Config, error) {
if cfg.Credentials != (Credentials{}) {
credentials := credentials.NewStaticCredentialsProvider(cfg.Credentials.AccessKey, cfg.Credentials.SecretAccessKey, "")

View File

@@ -60,6 +60,22 @@ func Test_DynamoDB_Set(t *testing.T) {
require.NoError(t, err)
}
func Test_DynamoDB_SetWithContext(t *testing.T) {
var (
key = "john"
val = []byte("doe")
)
ctx, cancel := context.WithCancel(context.Background())
cancel()
testStore := newTestStore(t)
defer testStore.Close()
err := testStore.SetWithContext(ctx, key, val, 0)
require.ErrorIs(t, err, context.Canceled)
}
func Test_DynamoDB_Set_Override(t *testing.T) {
var (
key = "john"
@@ -93,6 +109,22 @@ func Test_DynamoDB_Get(t *testing.T) {
require.Equal(t, val, result)
}
func Test_DynamoDB_GetWithContext(t *testing.T) {
var (
key = "john"
)
ctx, cancel := context.WithCancel(context.Background())
cancel()
testStore := newTestStore(t)
defer testStore.Close()
result, err := testStore.GetWithContext(ctx, key)
require.ErrorIs(t, err, context.Canceled)
require.Zero(t, len(result))
}
func Test_DynamoDB_Get_NotExist(t *testing.T) {
testStore := newTestStore(t)
defer testStore.Close()
@@ -122,6 +154,29 @@ func Test_DynamoDB_Delete(t *testing.T) {
require.Zero(t, len(result))
}
func Test_DynamoDB_DeleteWithContext(t *testing.T) {
var (
key = "john"
val = []byte("doe")
)
testStore := newTestStore(t)
defer testStore.Close()
err := testStore.Set(key, val, 0)
require.NoError(t, err)
ctx, cancel := context.WithCancel(context.Background())
cancel()
err = testStore.DeleteWithContext(ctx, key)
require.ErrorIs(t, err, context.Canceled)
result, err := testStore.Get(key)
require.NoError(t, err)
require.Equal(t, val, result)
}
func Test_DynamoDB_Reset(t *testing.T) {
val := []byte("doe")
@@ -146,6 +201,33 @@ func Test_DynamoDB_Reset(t *testing.T) {
require.Zero(t, len(result))
}
func Test_DynamoDB_ResetWithContext(t *testing.T) {
val := []byte("doe")
testStore := newTestStore(t)
defer testStore.Close()
err := testStore.Set("john1", val, 0)
require.NoError(t, err)
err = testStore.Set("john2", val, 0)
require.NoError(t, err)
ctx, cancel := context.WithCancel(context.Background())
cancel()
err = testStore.ResetWithContext(ctx)
require.ErrorIs(t, err, context.Canceled)
result, err := testStore.Get("john1")
require.NoError(t, err)
require.Equal(t, val, result)
result, err = testStore.Get("john2")
require.NoError(t, err)
require.Equal(t, val, result)
}
func Test_DynamoDB_Close(t *testing.T) {
testStore := newTestStore(t)
require.Nil(t, testStore.Close())

View File

@@ -3,11 +3,11 @@ module github.com/gofiber/storage/dynamodb/v2
go 1.23.0
require (
github.com/aws/aws-sdk-go-v2 v1.36.3
github.com/aws/aws-sdk-go-v2/config v1.29.14
github.com/aws/aws-sdk-go-v2/credentials v1.17.67
github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.19.0
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.43.1
github.com/aws/aws-sdk-go-v2 v1.36.5
github.com/aws/aws-sdk-go-v2/config v1.29.17
github.com/aws/aws-sdk-go-v2/credentials v1.17.70
github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.19.4
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.44.0
github.com/stretchr/testify v1.10.0
github.com/testcontainers/testcontainers-go v0.37.0
github.com/testcontainers/testcontainers-go/modules/dynamodb v0.37.0
@@ -17,18 +17,18 @@ require (
dario.cat/mergo v1.0.1 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.30 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.34 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.34 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.32 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.36 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.36 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect
github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.25.3 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.3 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.10.15 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.15 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.25.3 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.33.19 // indirect
github.com/aws/smithy-go v1.22.3 // indirect
github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.25.6 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.4 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.10.17 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.17 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.25.5 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.3 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.34.0 // indirect
github.com/aws/smithy-go v1.22.4 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/platforms v0.2.1 // indirect

View File

@@ -6,40 +6,40 @@ github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOEl
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
github.com/aws/aws-sdk-go-v2 v1.36.3 h1:mJoei2CxPutQVxaATCzDUjcZEjVRdpsiiXi2o38yqWM=
github.com/aws/aws-sdk-go-v2 v1.36.3/go.mod h1:LLXuLpgzEbD766Z5ECcRmi8AzSwfZItDtmABVkRLGzg=
github.com/aws/aws-sdk-go-v2/config v1.29.14 h1:f+eEi/2cKCg9pqKBoAIwRGzVb70MRKqWX4dg1BDcSJM=
github.com/aws/aws-sdk-go-v2/config v1.29.14/go.mod h1:wVPHWcIFv3WO89w0rE10gzf17ZYy+UVS1Geq8Iei34g=
github.com/aws/aws-sdk-go-v2/credentials v1.17.67 h1:9KxtdcIA/5xPNQyZRgUSpYOE6j9Bc4+D7nZua0KGYOM=
github.com/aws/aws-sdk-go-v2/credentials v1.17.67/go.mod h1:p3C44m+cfnbv763s52gCqrjaqyPikj9Sg47kUVaNZQQ=
github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.19.0 h1:F3W0YqWZrpCcelbvXMP9LWSTOI620aAq1+8fZ/71TBg=
github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.19.0/go.mod h1:34X+UzFJwsQfyk5U1hYiCO/gv9ZVL+Hh8w+bJQ6+HbU=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.30 h1:x793wxmUWVDhshP8WW2mlnXuFrO4cOd3HLBroh1paFw=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.30/go.mod h1:Jpne2tDnYiFascUEs2AWHJL9Yp7A5ZVy3TNyxaAjD6M=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.34 h1:ZK5jHhnrioRkUNOc+hOgQKlUL5JeC3S6JgLxtQ+Rm0Q=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.34/go.mod h1:p4VfIceZokChbA9FzMbRGz5OV+lekcVtHlPKEO0gSZY=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.34 h1:SZwFm17ZUNNg5Np0ioo/gq8Mn6u9w19Mri8DnJ15Jf0=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.34/go.mod h1:dFZsC0BLo346mvKQLWmoJxT+Sjp+qcVR1tRVHQGOH9Q=
github.com/aws/aws-sdk-go-v2 v1.36.5 h1:0OF9RiEMEdDdZEMqF9MRjevyxAQcf6gY+E7vwBILFj0=
github.com/aws/aws-sdk-go-v2 v1.36.5/go.mod h1:EYrzvCCN9CMUTa5+6lf6MM4tq3Zjp8UhSGR/cBsjai0=
github.com/aws/aws-sdk-go-v2/config v1.29.17 h1:jSuiQ5jEe4SAMH6lLRMY9OVC+TqJLP5655pBGjmnjr0=
github.com/aws/aws-sdk-go-v2/config v1.29.17/go.mod h1:9P4wwACpbeXs9Pm9w1QTh6BwWwJjwYvJ1iCt5QbCXh8=
github.com/aws/aws-sdk-go-v2/credentials v1.17.70 h1:ONnH5CM16RTXRkS8Z1qg7/s2eDOhHhaXVd72mmyv4/0=
github.com/aws/aws-sdk-go-v2/credentials v1.17.70/go.mod h1:M+lWhhmomVGgtuPOhO85u4pEa3SmssPTdcYpP/5J/xc=
github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.19.4 h1:jKR2jpZqpmBSAVX7xxdOi1E3Z0E9WizMIlxlGI3Hh9o=
github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.19.4/go.mod h1:ATyfcCpSMZuB/rnpFcVbiqrTiFzdwcTXeVbgEk6iXbY=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.32 h1:KAXP9JSHO1vKGCr5f4O6WmlVKLFFXgWYAGoJosorxzU=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.32/go.mod h1:h4Sg6FQdexC1yYG9RDnOvLbW1a/P986++/Y/a+GyEM8=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.36 h1:SsytQyTMHMDPspp+spo7XwXTP44aJZZAC7fBV2C5+5s=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.36/go.mod h1:Q1lnJArKRXkenyog6+Y+zr7WDpk4e6XlR6gs20bbeNo=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.36 h1:i2vNHQiXUvKhs3quBR6aqlgJaiaexz/aNvdCktW/kAM=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.36/go.mod h1:UdyGa7Q91id/sdyHPwth+043HhmP6yP9MBHgbZM0xo8=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 h1:bIqFDwgGXXN1Kpp99pDOdKMTTb5d2KyU5X/BZxjOkRo=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3/go.mod h1:H5O/EsxDWyU+LP/V8i5sm8cxoZgc2fdNR9bxlOFrQTo=
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.43.1 h1:YYjNTAyPL0425ECmq6Xm48NSXdT6hDVQmLOJZxyhNTM=
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.43.1/go.mod h1:yYaWRnVSPyAmexW5t7G3TcuYoalYfT+xQwzWsvtUQ7M=
github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.25.3 h1:GHC1WTF3ZBZy+gvz2qtYB6ttALVx35hlwc4IzOIUY7g=
github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.25.3/go.mod h1:lUqWdw5/esjPTkITXhN4C66o1ltwDq2qQ12j3SOzhVg=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.3 h1:eAh2A4b5IzM/lum78bZ590jy36+d/aFLgKF/4Vd1xPE=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.3/go.mod h1:0yKJC/kb8sAnmlYa6Zs3QVYqaC8ug2AbnNChv5Ox3uA=
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.10.15 h1:M1R1rud7HzDrfCdlBQ7NjnRsDNEhXO/vGhuD189Ggmk=
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.10.15/go.mod h1:uvFKBSq9yMPV4LGAi7N4awn4tLY+hKE35f8THes2mzQ=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.15 h1:dM9/92u2F1JbDaGooxTq18wmmFzbJRfXfVfy96/1CXM=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.15/go.mod h1:SwFBy2vjtA0vZbjjaFtfN045boopadnoVPhu4Fv66vY=
github.com/aws/aws-sdk-go-v2/service/sso v1.25.3 h1:1Gw+9ajCV1jogloEv1RRnvfRFia2cL6c9cuKV2Ps+G8=
github.com/aws/aws-sdk-go-v2/service/sso v1.25.3/go.mod h1:qs4a9T5EMLl/Cajiw2TcbNt2UNo/Hqlyp+GiuG4CFDI=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.1 h1:hXmVKytPfTy5axZ+fYbR5d0cFmC3JvwLm5kM83luako=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.1/go.mod h1:MlYRNmYu/fGPoxBQVvBYr9nyr948aY/WLUvwBMBJubs=
github.com/aws/aws-sdk-go-v2/service/sts v1.33.19 h1:1XuUZ8mYJw9B6lzAkXhqHlJd/XvaX32evhproijJEZY=
github.com/aws/aws-sdk-go-v2/service/sts v1.33.19/go.mod h1:cQnB8CUnxbMU82JvlqjKR2HBOm3fe9pWorWBza6MBJ4=
github.com/aws/smithy-go v1.22.3 h1:Z//5NuZCSW6R4PhQ93hShNbyBbn8BWCmCVCt+Q8Io5k=
github.com/aws/smithy-go v1.22.3/go.mod h1:t1ufH5HMublsJYulve2RKmHDC15xu1f26kHCp/HgceI=
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.44.0 h1:A99gjqZDbdhjtjJVZrmVzVKO2+p3MSg35bDWtbMQVxw=
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.44.0/go.mod h1:mWB0GE1bqcVSvpW7OtFA0sKuHk52+IqtnsYU2jUfYAs=
github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.25.6 h1:QHaS/SHXfyNycuu4GiWb+AfW5T3bput6X5E3Ai/Q31M=
github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.25.6/go.mod h1:He/RikglWUczbkV+fkdpcV/3GdL/rTRNVy7VaUiezMo=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.4 h1:CXV68E2dNqhuynZJPB80bhPQwAKqBWVer887figW6Jc=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.4/go.mod h1:/xFi9KtvBXP97ppCz1TAEvU1Uf66qvid89rbem3wCzQ=
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.10.17 h1:x187MqiHwBGjMGAed8Y8K1VGuCtFvQvXb24r+bwmSdo=
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.10.17/go.mod h1:mC9qMbA6e1pwEq6X3zDGtZRXMG2YaElJkbJlMVHLs5I=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.17 h1:t0E6FzREdtCsiLIoLCWsYliNsRBgyGD/MCK571qk4MI=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.17/go.mod h1:ygpklyoaypuyDvOM5ujWGrYWpAK3h7ugnmKCU/76Ys4=
github.com/aws/aws-sdk-go-v2/service/sso v1.25.5 h1:AIRJ3lfb2w/1/8wOOSqYb9fUKGwQbtysJ2H1MofRUPg=
github.com/aws/aws-sdk-go-v2/service/sso v1.25.5/go.mod h1:b7SiVprpU+iGazDUqvRSLf5XmCdn+JtT1on7uNL6Ipc=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.3 h1:BpOxT3yhLwSJ77qIY3DoHAQjZsc4HEGfMCE4NGy3uFg=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.3/go.mod h1:vq/GQR1gOFLquZMSrxUK/cpvKCNVYibNyJ1m7JrU88E=
github.com/aws/aws-sdk-go-v2/service/sts v1.34.0 h1:NFOJ/NXEGV4Rq//71Hs1jC/NvPs1ezajK+yQmkwnPV0=
github.com/aws/aws-sdk-go-v2/service/sts v1.34.0/go.mod h1:7ph2tGpfQvwzgistp2+zga9f+bCjlQJPkPUmMgDSD7w=
github.com/aws/smithy-go v1.22.4 h1:uqXzVZNuNexwc/xrh6Tb56u89WDlJY6HS+KC0S4QSjw=
github.com/aws/smithy-go v1.22.4/go.mod h1:t1ufH5HMublsJYulve2RKmHDC15xu1f26kHCp/HgceI=
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=

View File

@@ -9,8 +9,6 @@ title: Etcd
A Etcd storage driver using [`etcd-io/etcd`](https://github.com/etcd-io/etcd).
**Note: Requires Go 1.19 and above**
### Table of Contents
- [Signatures](#signatures)
- [Installation](#installation)
@@ -22,9 +20,13 @@ A Etcd storage driver using [`etcd-io/etcd`](https://github.com/etcd-io/etcd).
```go
func New(config ...Config) *Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error
func (s *Storage) Reset() error
func (s *Storage) ResetWithContext(ctx context.Context) error
func (s *Storage) Close() error
func (s *Storage) Conn() *clientv3.Client
```

View File

@@ -4,7 +4,7 @@ import (
"context"
"time"
"go.etcd.io/etcd/client/v3"
clientv3 "go.etcd.io/etcd/client/v3"
)
type Storage struct {
@@ -32,11 +32,11 @@ func New(config ...Config) *Storage {
return store
}
func (s *Storage) Get(key string) ([]byte, error) {
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error) {
if len(key) <= 0 {
return nil, nil
}
item, err := s.db.Get(context.Background(), key)
item, err := s.db.Get(ctx, key)
if err != nil {
return nil, err
}
@@ -48,18 +48,39 @@ func (s *Storage) Get(key string) ([]byte, error) {
return item.Kvs[0].Value, nil
}
func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
func (s *Storage) Get(key string) ([]byte, error) {
return s.GetWithContext(context.Background(), key)
}
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error {
// Ain't Nobody Got Time For That
if len(key) <= 0 || len(val) <= 0 {
return nil
}
lease, err := s.db.Grant(context.Background(), int64(exp.Seconds()))
lease, err := s.db.Grant(ctx, int64(exp.Seconds()))
if err != nil {
return err
}
_, err = s.db.Put(context.Background(), key, string(val), clientv3.WithLease(lease.ID))
_, err = s.db.Put(ctx, key, string(val), clientv3.WithLease(lease.ID))
if err != nil {
return err
}
return nil
}
func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
return s.SetWithContext(context.Background(), key, val, exp)
}
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error {
if len(key) <= 0 {
return nil
}
_, err := s.db.Delete(ctx, key)
if err != nil {
return err
}
@@ -68,11 +89,11 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
}
func (s *Storage) Delete(key string) error {
if len(key) <= 0 {
return nil
return s.DeleteWithContext(context.Background(), key)
}
_, err := s.db.Delete(context.Background(), key)
func (s *Storage) ResetWithContext(ctx context.Context) error {
_, err := s.db.Delete(ctx, "", clientv3.WithPrefix())
if err != nil {
return err
}
@@ -81,12 +102,7 @@ func (s *Storage) Delete(key string) error {
}
func (s *Storage) Reset() error {
_, err := s.db.Delete(context.Background(), "", clientv3.WithPrefix())
if err != nil {
return err
}
return nil
return s.ResetWithContext(context.Background())
}
func (s *Storage) Close() error {

View File

@@ -1,6 +1,7 @@
package etcd
import (
"context"
"os"
"testing"
"time"
@@ -49,6 +50,36 @@ func TestSetAndGet_GetShouldReturn_SettedValueWithoutError(t *testing.T) {
require.Equal(t, val, []byte("fiber_test_value"))
}
func TestSetWithContext(t *testing.T) {
var (
key = "john"
val = []byte("doe")
)
ctx, cancel := context.WithCancel(context.Background())
cancel()
err := testStore.SetWithContext(ctx, key, val, 0)
require.ErrorIs(t, err, context.Canceled)
}
func TestSetAndGetWithContext(t *testing.T) {
var (
key = "john"
val = []byte("doe")
)
ctx, cancel := context.WithCancel(context.Background())
cancel()
err := testStore.Set(key, val, 0)
require.NoError(t, err)
result, err := testStore.GetWithContext(ctx, key)
require.ErrorIs(t, err, context.Canceled)
require.Nil(t, result)
}
func TestSetAndGet_GetShouldReturnNil_WhenTTLExpired(t *testing.T) {
err := testStore.Set("test", []byte("fiber_test_value"), 3*time.Second)
require.NoError(t, err)
@@ -72,6 +103,21 @@ func TestSetAndDelete_DeleteShouldReturn_NoError(t *testing.T) {
require.NoError(t, err)
}
func TestDeleteWithContext(t *testing.T) {
err := testStore.Set("test", []byte("fiber_test_value"), 0)
require.NoError(t, err)
ctx, cancel := context.WithCancel(context.Background())
cancel()
err = testStore.DeleteWithContext(ctx, "test")
require.ErrorIs(t, err, context.Canceled)
val, err := testStore.Get("test")
require.NoError(t, err)
require.Equal(t, val, []byte("fiber_test_value"))
}
func TestSetAndReset_ResetShouldReturn_NoError(t *testing.T) {
err := testStore.Set("test", []byte("fiber_test_value"), 0)
require.NoError(t, err)
@@ -83,6 +129,21 @@ func TestSetAndReset_ResetShouldReturn_NoError(t *testing.T) {
require.NoError(t, err)
}
func TestResetWithContext(t *testing.T) {
err := testStore.Set("test", []byte("fiber_test_value"), 0)
require.NoError(t, err)
ctx, cancel := context.WithCancel(context.Background())
cancel()
err = testStore.ResetWithContext(ctx)
require.ErrorIs(t, err, context.Canceled)
val, err := testStore.Get("test")
require.NoError(t, err)
require.Equal(t, val, []byte("fiber_test_value"))
}
func TestClose_CloseShouldReturn_NoError(t *testing.T) {
err := testStore.Close()
require.NoError(t, err)

View File

@@ -1,6 +1,6 @@
module github.com/gofiber/storage/etcd/v2
go 1.19
go 1.23.0
require (
github.com/stretchr/testify v1.10.0

View File

@@ -1,4 +1,5 @@
github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A=
github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4=
github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec=
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
@@ -13,6 +14,7 @@ github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@@ -28,6 +30,7 @@ go.etcd.io/etcd/client/pkg/v3 v3.5.12/go.mod h1:seTzl2d9APP8R5Y2hFL3NVlD6qC/dOT+
go.etcd.io/etcd/client/v3 v3.5.12 h1:v5lCPXn1pf1Uu3M4laUE2hp/geOTc5uPcYYsNe1lDxg=
go.etcd.io/etcd/client/v3 v3.5.12/go.mod h1:tSbBCakoWmmddL+BKVAJHa9km+O/E+bumDe9mSbPiqw=
go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk=
go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c=

2
go.mod
View File

@@ -1,3 +1,3 @@
module github.com/gofiber/storage
go 1.19
go 1.23.0

View File

@@ -22,13 +22,19 @@ A fast key-value DB using [syndtr/goleveldb](https://github.com/syndtr/goleveldb
```go
func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error
func (s *Storage) Reset() error
func (s *Storage) ResetWithContext(ctx context.Context) error
func (s *Storage) Close() error
func (s *Storage) Conn() *leveldb.DB
```
**Note:** The context methods are dummy methods and don't have any functionality, as LevelDB does not support context cancellation in its client library. They are provided for compliance with the Fiber storage interface.
### Installation
LevelDB is tested on the 2 last [Go versions](https://golang.org/dl/) with support for modules. So make sure to initialize one first if you didn't do that yet:

View File

@@ -1,6 +1,6 @@
module github.com/gofiber/storage/leveldb
go 1.23
go 1.23.0
require (
github.com/stretchr/testify v1.10.0

View File

@@ -1,6 +1,7 @@
package leveldb
import (
"context"
"encoding/json"
"time"
@@ -41,12 +42,12 @@ func New(config ...Config) *Storage {
}
// Get value by key
func (s *Storage) Get(key []byte) ([]byte, error) {
func (s *Storage) Get(key string) ([]byte, error) {
if len(key) <= 0 {
return nil, nil
}
data, err := s.db.Get(key, nil)
data, err := s.db.Get([]byte(key), nil)
if err != nil {
return nil, nil
}
@@ -66,13 +67,18 @@ func (s *Storage) Get(key []byte) ([]byte, error) {
return stored.Value, nil
}
// GetWithContext gets value by key (dummy context support)
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error) {
return s.Get(key)
}
// Set key with value
func (s *Storage) Set(key, value []byte, exp time.Duration) error {
func (s *Storage) Set(key string, value []byte, exp time.Duration) error {
if len(key) <= 0 || len(value) <= 0 {
return nil
}
if exp == 0 {
return s.db.Put(key, value, nil)
return s.db.Put([]byte(key), value, nil)
}
data := item{
@@ -84,7 +90,12 @@ func (s *Storage) Set(key, value []byte, exp time.Duration) error {
if err != nil {
return err
}
return s.db.Put(key, encoded, nil)
return s.db.Put([]byte(key), encoded, nil)
}
// SetWithContext sets key with value (dummy context support)
func (s *Storage) SetWithContext(ctx context.Context, key string, value []byte, exp time.Duration) error {
return s.Set(key, value, exp)
}
// Delete key by key
@@ -111,6 +122,11 @@ func (s *Storage) Reset() error {
return iter.Error()
}
// ResetWithContext resets all keys (dummy context support)
func (s *Storage) ResetWithContext(ctx context.Context) error {
return s.Reset()
}
// Close the memory storage
func (s *Storage) Close() error {
s.done <- struct{}{} // GC stop

View File

@@ -38,10 +38,10 @@ func Test_New_WithConfig(t *testing.T) {
func Test_Set_Overwrite(t *testing.T) {
db := New()
db.Set([]byte("key"), []byte("value"), time.Second*1)
db.Set([]byte("key"), []byte("value2"), time.Second*1)
db.Set("key", []byte("value"), time.Second*1)
db.Set("key", []byte("value2"), time.Second*1)
value, err := db.Get([]byte("key"))
value, err := db.Get("key")
require.Nil(t, err)
require.Equal(t, []byte("value2"), value)
@@ -52,9 +52,9 @@ func Test_Set_Overwrite(t *testing.T) {
func Test_Get_For0Second(t *testing.T) {
db := New()
db.Set([]byte("key"), []byte("value"), 0)
db.Set("key", []byte("value"), 0)
_, err := db.Get([]byte("key"))
_, err := db.Get("key")
require.Nil(t, err)
err = removeAllFiles("./fiber.leveldb")
@@ -64,19 +64,19 @@ func Test_Get_For0Second(t *testing.T) {
func Test_Get_ForExpired100Millisecond(t *testing.T) {
db := New()
require.NoError(t, db.Set([]byte("key"), []byte("value"), time.Millisecond*100))
require.NoError(t, db.Set("key", []byte("value"), time.Millisecond*100))
// Anahtarın silinmesini bekle
deadline := time.Now().Add(time.Second)
for time.Now().Before(deadline) {
value, err := db.Get([]byte("key"))
value, err := db.Get("key")
if err == nil && value == nil {
break
}
time.Sleep(time.Millisecond * 10)
}
value, err := db.Get([]byte("key"))
value, err := db.Get("key")
require.Nil(t, err)
require.Nil(t, value)
@@ -87,12 +87,12 @@ func Test_Get_ForExpired100Millisecond(t *testing.T) {
func Test_Delete_WhileThereIsData(t *testing.T) {
db := New()
db.Set([]byte("key"), []byte("value"), time.Second*1)
db.Set("key", []byte("value"), time.Second*1)
err := db.Delete("key")
require.Nil(t, err)
value, err := db.Get([]byte("key"))
value, err := db.Get("key")
require.Nil(t, err)
require.Nil(t, value)
@@ -104,21 +104,21 @@ func Test_Delete_WhileThereIsData(t *testing.T) {
func Test_Reset(t *testing.T) {
db := New()
db.Set([]byte("key1"), []byte("value1"), time.Second*1)
db.Set([]byte("key2"), []byte("value2"), time.Second*1)
db.Set([]byte("key3"), []byte("value3"), time.Second*1)
db.Set("key1", []byte("value1"), time.Second*1)
db.Set("key2", []byte("value2"), time.Second*1)
db.Set("key3", []byte("value3"), time.Second*1)
require.NoError(t, db.Reset())
value, err := db.Get([]byte("key1"))
value, err := db.Get("key1")
require.Nil(t, err)
require.Nil(t, value)
value, err = db.Get([]byte("key2"))
value, err = db.Get("key2")
require.Nil(t, err)
require.Nil(t, value)
value, err = db.Get([]byte("key3"))
value, err = db.Get("key3")
require.Nil(t, err)
require.Nil(t, value)
@@ -144,7 +144,7 @@ func Test_GarbageCollection_AfterWorking(t *testing.T) {
GCInterval: time.Millisecond * 100,
})
require.NoError(t, db.Set([]byte("key"), []byte("value"), time.Millisecond*100))
require.NoError(t, db.Set("key", []byte("value"), time.Millisecond*100))
deadline := time.Now().Add(time.Second)
for time.Now().Before(deadline) {
@@ -171,7 +171,7 @@ func Test_GarbageCollection_BeforeWorking(t *testing.T) {
db := New(Config{
GCInterval: time.Second * 1,
})
require.NoError(t, db.Set([]byte("key"), []byte("value"), time.Second*1))
require.NoError(t, db.Set("key", []byte("value"), time.Second*1))
value, err := db.Conn().Get([]byte("key"), nil)
require.Nil(t, err)
@@ -186,7 +186,7 @@ func Test_GarbageCollection_Interval(t *testing.T) {
db := New(Config{
GCInterval: time.Hour, // Uzun aralık
})
require.NoError(t, db.Set([]byte("key"), []byte("value"), time.Millisecond))
require.NoError(t, db.Set("key", []byte("value"), time.Millisecond))
// GC çalışmadığı için değer hala var olmalı
deadline := time.Now().Add(time.Millisecond * 100)
@@ -225,7 +225,7 @@ func Benchmark_Set(b *testing.B) {
_ = removeAllFiles("./fiber.leveldb")
}()
key := []byte("test_key")
key := "test_key"
value := []byte("test_value")
b.ResetTimer()
@@ -245,7 +245,7 @@ func Benchmark_Get(b *testing.B) {
_ = removeAllFiles("./fiber.leveldb")
}()
key := []byte("test_key")
key := "test_key"
value := []byte("test_value")
if err := db.Set(key, value, 0); err != nil {
b.Fatal(err)
@@ -269,7 +269,7 @@ func Benchmark_Delete(b *testing.B) {
}()
key := "test_key"
if err := db.Set([]byte(key), []byte("test_value"), 0); err != nil {
if err := db.Set(key, []byte("test_value"), 0); err != nil {
b.Fatal(err)
}

View File

@@ -9,8 +9,6 @@ title: Memcache
A Memcache storage driver using [`bradfitz/gomemcache`](https://github.com/bradfitz/gomemcache).
**Note: Requires Go 1.19 and above**
### Table of Contents
- [Signatures](#signatures)
- [Installation](#installation)
@@ -22,13 +20,19 @@ A Memcache storage driver using [`bradfitz/gomemcache`](https://github.com/bradf
```go
func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error
func (s *Storage) Reset() error
func (s *Storage) ResetWithContext(ctx context.Context) error
func (s *Storage) Close() error
func (s *Storage) Conn() *mc.Client
```
**Note:** The context methods are dummy methods and don't have any functionality, as Memcache does not support context cancellation in its client library. They are provided for compliance with the Fiber storage interface.
### Installation
Memory is tested on the 2 last [Go versions](https://golang.org/dl/) with support for modules. So make sure to initialize one first if you didn't do that yet:
```bash

View File

@@ -1,14 +1,65 @@
module github.com/gofiber/storage/memcache/v2
go 1.19
go 1.23.0
toolchain go1.24.1
require (
github.com/bradfitz/gomemcache v0.0.0-20230611145640-acc696258285
github.com/bradfitz/gomemcache v0.0.0-20250403215159-8d39553ac7cf
github.com/stretchr/testify v1.10.0
github.com/testcontainers/testcontainers-go v0.37.0
)
require (
dario.cat/mergo v1.0.1 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/platforms v0.2.1 // indirect
github.com/cpuguy83/dockercfg v0.3.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/docker v28.0.1+incompatible // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/ebitengine/purego v0.8.2 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/klauspost/compress v1.17.4 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/magiconair/properties v1.8.10 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/patternmatcher v0.6.0 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/sys/user v0.1.0 // indirect
github.com/moby/sys/userns v0.1.0 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/shirou/gopsutil/v4 v4.25.1 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel v1.35.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0 // indirect
go.opentelemetry.io/otel/metric v1.35.0 // indirect
go.opentelemetry.io/otel/sdk v1.35.0 // indirect
go.opentelemetry.io/otel/trace v1.35.0 // indirect
go.opentelemetry.io/proto/otlp v1.6.0 // indirect
golang.org/x/crypto v0.37.0 // indirect
golang.org/x/sys v0.32.0 // indirect
google.golang.org/protobuf v1.36.6 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

View File

@@ -1,12 +1,186 @@
github.com/bradfitz/gomemcache v0.0.0-20230611145640-acc696258285 h1:Dr+ezPI5ivhMn/3WOoB86XzMhie146DNaBbhaQWZHMY=
github.com/bradfitz/gomemcache v0.0.0-20230611145640-acc696258285/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA=
dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s=
dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU=
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8=
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8=
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
github.com/bradfitz/gomemcache v0.0.0-20250403215159-8d39553ac7cf h1:TqhNAT4zKbTdLa62d2HDBFdvgSbIGB3eJE8HqhgiL9I=
github.com/bradfitz/gomemcache v0.0.0-20250403215159-8d39553ac7cf/go.mod h1:r5xuitiExdLAJ09PR7vBVENGvp4ZuTBeWTGtxuX3K+c=
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=
github.com/containerd/platforms v0.2.1 h1:zvwtM3rz2YHPQsF2CHYM8+KtB5dvhISiXh5ZpSBQv6A=
github.com/containerd/platforms v0.2.1/go.mod h1:XHCb+2/hzowdiut9rkudds9bE5yJ7npe7dG/wG+uFPw=
github.com/cpuguy83/dockercfg v0.3.2 h1:DlJTyZGBDlXqUZ2Dk2Q3xHs/FtnooJJVaad2S9GKorA=
github.com/cpuguy83/dockercfg v0.3.2/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc=
github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
github.com/docker/docker v28.0.1+incompatible h1:FCHjSRdXhNRFjlHMTv4jUNlIBbTeRjrWfeFuJp7jpo0=
github.com/docker/docker v28.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c=
github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/ebitengine/purego v0.8.2 h1:jPPGWs2sZ1UgOSgD2bClL0MJIqu58nOmIcBuXr62z1I=
github.com/ebitengine/purego v0.8.2/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
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/grpc-ecosystem/grpc-gateway/v2 v2.26.3 h1:5ZPtiqj0JL5oKWmcsq4VMaAW5ukBEgSGXEN89zeH1Jo=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3/go.mod h1:ndYquD05frm2vACXE1nsccT4oJzjhw2arTS2cpUD1PI=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4=
github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4=
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I=
github.com/magiconair/properties v1.8.10 h1:s31yESBquKXCV9a/ScB3ESkOjUYYv+X0rg8SYxI99mE=
github.com/magiconair/properties v1.8.10/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk=
github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc=
github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc=
github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo=
github.com/moby/sys/user v0.1.0 h1:WmZ93f5Ux6het5iituh9x2zAG7NFY9Aqi49jjE1PaQg=
github.com/moby/sys/user v0.1.0/go.mod h1:fKJhFOnsCN6xZ5gSfbM6zaHGgDJMrqt9/reuj4T7MmU=
github.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g=
github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28=
github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=
github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y=
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040=
github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw=
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
github.com/shirou/gopsutil/v4 v4.25.1 h1:QSWkTc+fu9LTAWfkZwZ6j8MSUk4A2LV7rbH0ZqmLjXs=
github.com/shirou/gopsutil/v4 v4.25.1/go.mod h1:RoUCUpndaJFtT+2zsZzzmhvbfGoDCJ7nFXKJf8GqJbI=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.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.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
github.com/testcontainers/testcontainers-go v0.37.0 h1:L2Qc0vkTw2EHWQ08djon0D2uw7Z/PtHS/QzZZ5Ra/hg=
github.com/testcontainers/testcontainers-go v0.37.0/go.mod h1:QPzbxZhQ6Bclip9igjLFj6z0hs01bU8lrl2dHQmgFGM=
github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU=
github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI=
github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk=
github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw=
go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ=
go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0 h1:1fTNlAIJZGWLP5FVu0fikVry1IsiUnXjf7QFvoNN3Xw=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0/go.mod h1:zjPK58DtkqQFn+YUMbx0M2XV3QgKU0gS9LeGohREyK4=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMeyr1aBvBiPVYihXIaeIZba6b8E1bYp7lbdxK8CQg=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0/go.mod h1:oVdCUtjq9MK9BlS7TtucsQwUcXcymNiEDjgDD2jMtZU=
go.opentelemetry.io/otel/metric v1.35.0 h1:0znxYu2SNyuMSQT4Y9WDWej0VpcsxkuklLa4/siN90M=
go.opentelemetry.io/otel/metric v1.35.0/go.mod h1:nKVFgxBZ2fReX6IlyW28MgZojkoAkJGaE8CpgeAU3oE=
go.opentelemetry.io/otel/sdk v1.35.0 h1:iPctf8iprVySXSKJffSS79eOjl9pvxV9ZqOWT0QejKY=
go.opentelemetry.io/otel/sdk v1.35.0/go.mod h1:+ga1bZliga3DxJ3CQGg3updiaAJoNECOgJREo9KHGQg=
go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt/xgMs=
go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc=
go.opentelemetry.io/proto/otlp v1.6.0 h1:jQjP+AQyTf+Fe7OKj/MfkDrmK4MNVtw2NpXsf9fefDI=
go.opentelemetry.io/proto/otlp v1.6.0/go.mod h1:cicgGehlFuNdgZkcALOCh3VE6K/u2tAjzlRhDwmVpZc=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE=
golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY=
golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o=
golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0=
golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU=
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44=
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/genproto/googleapis/api v0.0.0-20250428153025-10db94c68c34 h1:0PeQib/pH3nB/5pEmFeVQJotzGohV0dq4Vcp09H5yhE=
google.golang.org/genproto/googleapis/api v0.0.0-20250428153025-10db94c68c34/go.mod h1:0awUlEkap+Pb1UMeJwJQQAdJQrt3moU7J2moTy69irI=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250428153025-10db94c68c34 h1:h6p3mQqrmT1XkHVTfzLdNz1u7IhINeZkz67/xTbOuWs=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250428153025-10db94c68c34/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A=
google.golang.org/grpc v1.72.0 h1:S7UkcVa60b5AAQTaO6ZKamFp1zMZSU0fGDK2WZLbBnM=
google.golang.org/grpc v1.72.0/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM=
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/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=
gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU=
gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=

View File

@@ -1,6 +1,7 @@
package memcache
import (
"context"
"strings"
"sync"
"time"
@@ -68,10 +69,13 @@ func (s *Storage) Get(key string) ([]byte, error) {
return item.Value, nil
}
// Set key with value
// GetWithContext gets value by key (dummy context support)
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error) {
return s.Get(key)
}
// Set key with value
func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
// Ain't Nobody Got Time For That
if len(key) <= 0 || len(val) <= 0 {
return nil
}
@@ -87,20 +91,34 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
return err
}
// SetWithContext sets key with value (dummy context support)
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error {
return s.Set(key, val, exp)
}
// Delete key by key
func (s *Storage) Delete(key string) error {
// Ain't Nobody Got Time For That
if len(key) <= 0 {
return nil
}
return s.db.Delete(key)
}
// DeleteWithContext deletes key by key (dummy context support)
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error {
return s.Delete(key)
}
// Reset all keys
func (s *Storage) Reset() error {
return s.db.DeleteAll()
}
// ResetWithContext resets all keys (dummy context support)
func (s *Storage) ResetWithContext(ctx context.Context) error {
return s.Reset()
}
// Close the database
func (s *Storage) Close() error {
return nil
@@ -111,7 +129,7 @@ func (s *Storage) acquireItem() *mc.Item {
return s.items.Get().(*mc.Item)
}
// Release item from pool
// Release item back to pool
func (s *Storage) releaseItem(item *mc.Item) {
if item != nil {
item.Key = ""

View File

@@ -1,24 +1,55 @@
package memcache
import (
"context"
"os"
"testing"
"time"
"github.com/stretchr/testify/require"
"github.com/testcontainers/testcontainers-go"
"github.com/testcontainers/testcontainers-go/wait"
)
var testStore *Storage
const (
// memcachedImage is the default image used for running memcached in tests.
memcachedImage = "memcached:latest"
memcachedImageEnvVar string = "TEST_MEMCACHED_IMAGE"
memcachedPort = "11211/tcp"
)
func TestMain(m *testing.M) {
testStore = New(Config{
func newTestStore(t testing.TB) *Storage {
t.Helper()
img := memcachedImage
if imgFromEnv := os.Getenv(memcachedImageEnvVar); imgFromEnv != "" {
img = imgFromEnv
}
ctx := context.Background()
c, err := testcontainers.Run(ctx,
img,
testcontainers.WithExposedPorts(memcachedPort),
testcontainers.WithWaitStrategy(
wait.ForListeningPort(memcachedPort),
),
)
testcontainers.CleanupContainer(t, c)
require.NoError(t, err)
host, err := c.Host(ctx)
require.NoError(t, err)
port, err := c.MappedPort(ctx, memcachedPort)
require.NoError(t, err)
return New(
Config{
Reset: true,
})
code := m.Run()
_ = testStore.Close()
os.Exit(code)
Servers: host + ":" + port.Port(),
},
)
}
func Test_Memcache_Set(t *testing.T) {
@@ -27,6 +58,9 @@ func Test_Memcache_Set(t *testing.T) {
val = []byte("doe")
)
testStore := newTestStore(t)
defer testStore.Close()
err := testStore.Set(key, val, 0)
require.NoError(t, err)
}
@@ -37,6 +71,9 @@ func Test_Memcache_Set_Override(t *testing.T) {
val = []byte("doe")
)
testStore := newTestStore(t)
defer testStore.Close()
err := testStore.Set(key, val, 0)
require.NoError(t, err)
@@ -50,6 +87,9 @@ func Test_Memcache_Get(t *testing.T) {
val = []byte("doe")
)
testStore := newTestStore(t)
defer testStore.Close()
err := testStore.Set(key, val, 0)
require.NoError(t, err)
@@ -65,6 +105,9 @@ func Test_Memcache_Set_Expiration(t *testing.T) {
exp = 1 * time.Second
)
testStore := newTestStore(t)
defer testStore.Close()
err := testStore.Set(key, val, exp)
require.NoError(t, err)
@@ -74,12 +117,18 @@ func Test_Memcache_Set_Expiration(t *testing.T) {
func Test_Memcache_Get_Expired(t *testing.T) {
key := "john"
testStore := newTestStore(t)
defer testStore.Close()
result, err := testStore.Get(key)
require.NoError(t, err)
require.Zero(t, len(result))
}
func Test_Memcache_Get_NotExist(t *testing.T) {
testStore := newTestStore(t)
defer testStore.Close()
result, err := testStore.Get("notexist")
require.NoError(t, err)
require.Zero(t, len(result))
@@ -91,6 +140,9 @@ func Test_Memcache_Delete(t *testing.T) {
val = []byte("doe")
)
testStore := newTestStore(t)
defer testStore.Close()
err := testStore.Set(key, val, 0)
require.NoError(t, err)
@@ -105,6 +157,9 @@ func Test_Memcache_Delete(t *testing.T) {
func Test_Memcache_Reset(t *testing.T) {
val := []byte("doe")
testStore := newTestStore(t)
defer testStore.Close()
err := testStore.Set("john1", val, 0)
require.NoError(t, err)
@@ -124,14 +179,21 @@ func Test_Memcache_Reset(t *testing.T) {
}
func Test_Memcache_Close(t *testing.T) {
testStore := newTestStore(t)
require.Nil(t, testStore.Close())
}
func Test_Memcache_Conn(t *testing.T) {
testStore := newTestStore(t)
defer testStore.Close()
require.True(t, testStore.Conn() != nil)
}
func Benchmark_Memcache_Set(b *testing.B) {
testStore := newTestStore(b)
defer testStore.Close()
b.ReportAllocs()
b.ResetTimer()
@@ -144,6 +206,9 @@ func Benchmark_Memcache_Set(b *testing.B) {
}
func Benchmark_Memcache_Get(b *testing.B) {
testStore := newTestStore(b)
defer testStore.Close()
err := testStore.Set("john", []byte("doe"), 0)
require.NoError(b, err)
@@ -158,6 +223,9 @@ func Benchmark_Memcache_Get(b *testing.B) {
}
func Benchmark_Memcache_SetAndDelete(b *testing.B) {
testStore := newTestStore(b)
defer testStore.Close()
b.ReportAllocs()
b.ResetTimer()

View File

@@ -10,8 +10,6 @@ title: Memory
An in-memory storage driver.
**Note: Requires Go 1.19 and above**
### Table of Contents
- [Signatures](#signatures)
- [Installation](#installation)
@@ -24,14 +22,20 @@ An in-memory storage driver.
```go
func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error
func (s *Storage) Reset() error
func (s *Storage) ResetWithContext(ctx context.Context) error
func (s *Storage) Close() error
func (s *Storage) Conn() map[string]entry
func (s *Storage) Keys() ([][]byte, error)
```
**Note:** The context methods are dummy methods and don't have any functionality, as memory storage does not support context cancellation. They are provided for compliance with the Fiber storage interface.
### Installation
Memory is tested on the 2 last [Go versions](https://golang.org/dl/) with support for modules. So make sure to initialize one first if you didn't do that yet:
```bash

View File

@@ -1,6 +1,6 @@
module github.com/gofiber/storage/memory/v2
go 1.19
go 1.23.0
require github.com/stretchr/testify v1.10.0

View File

@@ -1,6 +1,7 @@
package memory
import (
"context"
"sync"
"sync/atomic"
"time"
@@ -18,8 +19,7 @@ type Storage struct {
type entry struct {
data []byte
// max value is 4294967295 -> Sun Feb 07 2106 06:28:15 GMT+0000
expiry uint32
expiry uint32 // max value is 4294967295 -> Sun Feb 07 2106 06:28:15 GMT+0000
}
// New creates a new memory storage
@@ -49,16 +49,20 @@ func (s *Storage) Get(key string) ([]byte, error) {
s.mux.RLock()
v, ok := s.db[key]
s.mux.RUnlock()
if !ok || v.expiry != 0 && v.expiry <= atomic.LoadUint32(&internal.Timestamp) {
if !ok || (v.expiry != 0 && v.expiry <= atomic.LoadUint32(&internal.Timestamp)) {
return nil, nil
}
return v.data, nil
}
// GetWithContext gets value by key (dummy context support)
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error) {
return s.Get(key)
}
// Set key with value
func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
// Ain't Nobody Got Time For That
if len(key) <= 0 || len(val) <= 0 {
return nil
}
@@ -75,9 +79,13 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
return nil
}
// SetWithContext sets value by key (dummy context support)
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error {
return s.Set(key, val, exp)
}
// Delete key by key
func (s *Storage) Delete(key string) error {
// Ain't Nobody Got Time For That
if len(key) <= 0 {
return nil
}
@@ -87,6 +95,11 @@ func (s *Storage) Delete(key string) error {
return nil
}
// DeleteWithContext deletes key (dummy context support)
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error {
return s.Delete(key)
}
// Reset all keys
func (s *Storage) Reset() error {
ndb := make(map[string]entry)
@@ -96,6 +109,11 @@ func (s *Storage) Reset() error {
return nil
}
// ResetWithContext resets all keys (dummy context support)
func (s *Storage) ResetWithContext(ctx context.Context) error {
return s.Reset()
}
// Close the memory storage
func (s *Storage) Close() error {
s.done <- struct{}{}
@@ -122,8 +140,6 @@ func (s *Storage) gc() {
}
s.mux.RUnlock()
s.mux.Lock()
// Double-checked locking.
// We might have replaced the item in the meantime.
for i := range expired {
v := s.db[expired[i]]
if v.expiry != 0 && v.expiry <= ts {
@@ -135,14 +151,14 @@ func (s *Storage) gc() {
}
}
// Return database client
// Conn returns database client
func (s *Storage) Conn() map[string]entry {
s.mux.RLock()
defer s.mux.RUnlock()
return s.db
}
// Return all the keys
// Keys returns all the keys
func (s *Storage) Keys() ([][]byte, error) {
s.mux.RLock()
defer s.mux.RUnlock()
@@ -154,13 +170,11 @@ func (s *Storage) Keys() ([][]byte, error) {
ts := atomic.LoadUint32(&internal.Timestamp)
keys := make([][]byte, 0, len(s.db))
for key, v := range s.db {
// Filter out the expired keys
if v.expiry == 0 || v.expiry > ts {
keys = append(keys, []byte(key))
}
}
// Double check if no valid keys were found
if len(keys) == 0 {
return nil, nil
}

View File

@@ -11,8 +11,6 @@ title: Minio
A Minio storage driver using [minio/minio-go](https://github.com/minio/minio-go).
**Note: Requires Go 1.19 and above**
### Table of Contents
- [Signatures](#signatures)
- [Installation](#installation)
@@ -24,9 +22,13 @@ A Minio storage driver using [minio/minio-go](https://github.com/minio/minio-go)
```go
func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error
func (s *Storage) Reset() error
func (s *Storage) ResetWithContext(ctx context.Context) error
func (s *Storage) Close() error
func (s *Storage) CheckBucket() error
func (s *Storage) CreateBucket() error

View File

@@ -3,7 +3,7 @@ module github.com/gofiber/storage/minio
go 1.23.0
require (
github.com/minio/minio-go/v7 v7.0.91
github.com/minio/minio-go/v7 v7.0.94
github.com/stretchr/testify v1.10.0
github.com/testcontainers/testcontainers-go v0.37.0
github.com/testcontainers/testcontainers-go/modules/minio v0.37.0
@@ -49,12 +49,14 @@ require (
github.com/morikuni/aec v1.0.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.1 // indirect
github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/rs/xid v1.6.0 // indirect
github.com/shirou/gopsutil/v4 v4.25.1 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/tinylib/msgp v1.3.0 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect

View File

@@ -72,8 +72,8 @@ github.com/minio/crc64nvme v1.0.1 h1:DHQPrYPdqK7jQG/Ls5CTBZWeex/2FMS3G5XGkycuFrY
github.com/minio/crc64nvme v1.0.1/go.mod h1:eVfm2fAzLlxMdUGc0EEBGSMmPwmXD5XiNRpnu9J3bvg=
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
github.com/minio/minio-go/v7 v7.0.91 h1:tWLZnEfo3OZl5PoXQwcwTAPNNrjyWwOh6cbZitW5JQc=
github.com/minio/minio-go/v7 v7.0.91/go.mod h1:uvMUcGrpgeSAAI6+sD3818508nUyMULw94j2Nxku/Go=
github.com/minio/minio-go/v7 v7.0.94 h1:1ZoksIKPyaSt64AVOyaQvhDOgVC3MfZsWM6mZXRUGtM=
github.com/minio/minio-go/v7 v7.0.94/go.mod h1:71t2CqDt3ThzESgZUlU1rBN54mksGGlkLcFgguDnnAc=
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk=
@@ -92,6 +92,8 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040=
github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M=
github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c h1:dAMKvw0MlJT1GshSTtih8C2gDs04w8dReiOGXrGLNoY=
github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@@ -116,6 +118,8 @@ github.com/testcontainers/testcontainers-go v0.37.0 h1:L2Qc0vkTw2EHWQ08djon0D2uw
github.com/testcontainers/testcontainers-go v0.37.0/go.mod h1:QPzbxZhQ6Bclip9igjLFj6z0hs01bU8lrl2dHQmgFGM=
github.com/testcontainers/testcontainers-go/modules/minio v0.37.0 h1:p2LXViCDHBP0JfVfT9hDxkbTxv+BzAL5ZYOF8sj1q1I=
github.com/testcontainers/testcontainers-go/modules/minio v0.37.0/go.mod h1:OhJqQ9L2FOnb/otqLbjskhj7utl1Z5RFt2k6mhG9aeI=
github.com/tinylib/msgp v1.3.0 h1:ULuf7GPooDaIlbyvgAxBV/FI7ynli6LZ1/nVUNu+0ww=
github.com/tinylib/msgp v1.3.0/go.mod h1:ykjzy2wzgrlvpDCRc4LA8UXy6D8bzMSuAF3WD57Gok0=
github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU=
github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI=
github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk=

View File

@@ -18,7 +18,6 @@ import (
type Storage struct {
minio *minio.Client
cfg Config
ctx context.Context
mu sync.Mutex
}
@@ -41,7 +40,7 @@ func New(config ...Config) *Storage {
panic(err)
}
storage := &Storage{minio: minioClient, cfg: cfg, ctx: context.Background()}
storage := &Storage{minio: minioClient, cfg: cfg}
// Reset all entries if set to true
if cfg.Reset {
@@ -63,15 +62,14 @@ func New(config ...Config) *Storage {
return storage
}
// Get value by key
func (s *Storage) Get(key string) ([]byte, error) {
// GetWithContext retrieves the value associated with the given key using the provided context.
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error) {
if len(key) <= 0 {
return nil, errors.New("the key value is required")
}
// get object
object, err := s.minio.GetObject(s.ctx, s.cfg.Bucket, key, s.cfg.GetObjectOptions)
object, err := s.minio.GetObject(ctx, s.cfg.Bucket, key, s.cfg.GetObjectOptions)
if err != nil {
return nil, err
}
@@ -91,9 +89,13 @@ func (s *Storage) Get(key string) ([]byte, error) {
return bb.Bytes(), nil
}
// Set key with value
func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
// Get value by key
func (s *Storage) Get(key string) ([]byte, error) {
return s.GetWithContext(context.Background(), key)
}
// SetWithContext key with value with context
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error {
if len(key) <= 0 {
return errors.New("the key value is required")
}
@@ -106,35 +108,43 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
s.cfg.PutObjectOptions.ContentType = http.DetectContentType(val)
// put object
_, err := s.minio.PutObject(s.ctx, s.cfg.Bucket, key, file, file.Size(), s.cfg.PutObjectOptions)
_, err := s.minio.PutObject(ctx, s.cfg.Bucket, key, file, file.Size(), s.cfg.PutObjectOptions)
s.mu.Unlock()
return err
}
// Set key with value
func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
return s.SetWithContext(context.Background(), key, val, exp)
}
// DeleteWithContext key with value with context
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error {
if len(key) <= 0 {
return errors.New("the key value is required")
}
// remove
err := s.minio.RemoveObject(ctx, s.cfg.Bucket, key, s.cfg.RemoveObjectOptions)
return err
}
// Delete entry by key
func (s *Storage) Delete(key string) error {
if len(key) <= 0 {
return errors.New("the key value is required")
return s.DeleteWithContext(context.Background(), key)
}
// remove
err := s.minio.RemoveObject(s.ctx, s.cfg.Bucket, key, s.cfg.RemoveObjectOptions)
return err
}
// Reset all entries, including unexpired
func (s *Storage) Reset() error {
// ResetWithContext all keys with context
func (s *Storage) ResetWithContext(ctx context.Context) error {
objectsCh := make(chan minio.ObjectInfo)
// Send object names that are needed to be removed to objectsCh
go func() {
defer close(objectsCh)
// List all objects from a bucket-name with a matching prefix.
for object := range s.minio.ListObjects(s.ctx, s.cfg.Bucket, s.cfg.ListObjectsOptions) {
for object := range s.minio.ListObjects(ctx, s.cfg.Bucket, s.cfg.ListObjectsOptions) {
if object.Err != nil {
log.Println(object.Err)
}
@@ -147,13 +157,17 @@ func (s *Storage) Reset() error {
}
var errs []error
for err := range s.minio.RemoveObjects(s.ctx, s.cfg.Bucket, objectsCh, opts) {
for err := range s.minio.RemoveObjects(ctx, s.cfg.Bucket, objectsCh, opts) {
errs = append(errs, err.Err)
}
return errors.Join(errs...)
}
func (s *Storage) Reset() error {
return s.ResetWithContext(context.Background())
}
// Close the storage
func (s *Storage) Close() error {
return nil
@@ -161,7 +175,7 @@ func (s *Storage) Close() error {
// CheckBucket Check to see if bucket already exists
func (s *Storage) CheckBucket() error {
exists, err := s.minio.BucketExists(s.ctx, s.cfg.Bucket)
exists, err := s.minio.BucketExists(context.Background(), s.cfg.Bucket)
if !exists || err != nil {
return errors.New("the specified bucket does not exist")
}
@@ -170,12 +184,12 @@ func (s *Storage) CheckBucket() error {
// CreateBucket Bucket not found so Make a new bucket
func (s *Storage) CreateBucket() error {
return s.minio.MakeBucket(s.ctx, s.cfg.Bucket, minio.MakeBucketOptions{Region: s.cfg.Region})
return s.minio.MakeBucket(context.Background(), s.cfg.Bucket, minio.MakeBucketOptions{Region: s.cfg.Region})
}
// RemoveBucket Bucket remove if bucket is empty
func (s *Storage) RemoveBucket() error {
return s.minio.RemoveBucket(s.ctx, s.cfg.Bucket)
return s.minio.RemoveBucket(context.Background(), s.cfg.Bucket)
}
// Conn Return minio client

View File

@@ -81,6 +81,25 @@ func Test_Get(t *testing.T) {
require.Zero(t, len(result))
}
func Test_GetWithContext(t *testing.T) {
var (
key = "john"
val = []byte("doe")
)
testStore := newTestStore(t)
err := testStore.Set(key, val, 0)
require.NoError(t, err)
ctx, cancel := context.WithCancel(context.Background())
cancel()
result, err := testStore.GetWithContext(ctx, key)
require.ErrorIs(t, err, context.Canceled)
require.Zero(t, len(result))
}
func Test_Get_Empty_Key(t *testing.T) {
var (
key = ""
@@ -137,6 +156,21 @@ func Test_Set(t *testing.T) {
require.NoError(t, err)
}
func Test_SetWithContext(t *testing.T) {
var (
key = "john"
val = []byte("doe")
)
testStore := newTestStore(t)
ctx, cancel := context.WithCancel(context.Background())
cancel()
err := testStore.SetWithContext(ctx, key, val, 0)
require.ErrorIs(t, err, context.Canceled)
}
func Test_Set_Empty_Key(t *testing.T) {
var (
key = ""
@@ -185,6 +219,28 @@ func Test_Delete(t *testing.T) {
require.NoError(t, err)
}
func Test_DeleteWithContext(t *testing.T) {
var (
key = "john"
val = []byte("doe")
)
testStore := newTestStore(t)
err := testStore.Set(key, val, 0)
require.NoError(t, err)
ctx, cancel := context.WithCancel(context.Background())
cancel()
err = testStore.DeleteWithContext(ctx, key)
require.ErrorIs(t, err, context.Canceled)
valRet, err := testStore.Get(key)
require.NoError(t, err)
require.Equal(t, val, valRet)
}
func Test_Delete_Empty_Key(t *testing.T) {
var (
key = ""
@@ -237,6 +293,31 @@ func Test_Reset(t *testing.T) {
require.Zero(t, len(result))
}
func Test_ResetWithContext(t *testing.T) {
var (
val = []byte("doe")
)
testStore := newTestStore(t)
defer testStore.Close()
err := testStore.Set("john1", val, 0)
require.NoError(t, err)
err = testStore.Set("john2", val, 0)
require.NoError(t, err)
ctx, cancel := context.WithCancel(context.Background())
cancel()
err = testStore.ResetWithContext(ctx)
require.ErrorIs(t, err, context.Canceled)
result, err := testStore.Get("john1")
require.NoError(t, err)
require.Equal(t, val, result)
}
func Test_Reset_Not_Exists_Bucket(t *testing.T) {
testStore := newTestStore(t)
defer testStore.Close()

View File

@@ -10,8 +10,6 @@ title: MockStorage
A mock storage implementation for Fiber. This storage is not persistent and is only used for testing purposes.
**Note: Requires Go 1.21 and above**
## Table of Contents
- [Signatures](#signatures)
- [Installation](#installation)

View File

@@ -1,3 +1,11 @@
module github.com/gofiber/storage/mockstorage
go 1.21
go 1.23.0
require github.com/stretchr/testify v1.10.0
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

View File

@@ -0,0 +1,10 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

View File

@@ -1,6 +1,7 @@
package mockstorage
import (
"context"
"errors"
"sync"
"time"
@@ -27,9 +28,13 @@ type Entry struct {
// CustomFuncs allows injecting custom behaviors for testing.
type CustomFuncs struct {
GetFunc func(key string) ([]byte, error)
GetWithContext func(ctx context.Context, key string) ([]byte, error)
SetFunc func(key string, val []byte, exp time.Duration) error
SetWithContext func(ctx context.Context, key string, val []byte, exp time.Duration) error
DeleteFunc func(key string) error
DeleteWithContext func(ctx context.Context, key string) error
ResetFunc func() error
ResetWithContext func(ctx context.Context) error
CloseFunc func() error
ConnFunc func() map[string]Entry
KeysFunc func() ([][]byte, error)
@@ -39,18 +44,9 @@ type CustomFuncs struct {
func New(config ...Config) *Storage {
s := &Storage{
data: make(map[string]Entry),
custom: &CustomFuncs{
GetFunc: nil,
SetFunc: nil,
DeleteFunc: nil,
ResetFunc: nil,
CloseFunc: nil,
ConnFunc: nil,
KeysFunc: nil,
},
custom: &CustomFuncs{}, // default no-op
}
// If a config is provided and it has CustomFuncs, use them
if len(config) > 0 && config[0].CustomFuncs != nil {
s.custom = config[0].CustomFuncs
}
@@ -78,7 +74,15 @@ func (s *Storage) Get(key string) ([]byte, error) {
return e.Value, nil
}
// Set sets the value for a given key with an expiration time.
// GetWithContext retrieves value by key using a context (functional or fallback)
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error) {
if s.custom.GetWithContext != nil {
return s.custom.GetWithContext(ctx, key)
}
return s.Get(key)
}
// Set sets the value for a given key with expiration.
func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
if s.custom.SetFunc != nil {
return s.custom.SetFunc(key, val, exp)
@@ -96,6 +100,14 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error {
return nil
}
// SetWithContext sets value using context.
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error {
if s.custom.SetWithContext != nil {
return s.custom.SetWithContext(ctx, key, val, exp)
}
return s.Set(key, val, exp)
}
// Delete removes a key from the storage.
func (s *Storage) Delete(key string) error {
if s.custom.DeleteFunc != nil {
@@ -104,12 +116,19 @@ func (s *Storage) Delete(key string) error {
s.mu.Lock()
defer s.mu.Unlock()
delete(s.data, key)
return nil
}
// Reset clears all keys from the storage.
// DeleteWithContext deletes key using context.
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error {
if s.custom.DeleteWithContext != nil {
return s.custom.DeleteWithContext(ctx, key)
}
return s.Delete(key)
}
// Reset clears all keys.
func (s *Storage) Reset() error {
if s.custom.ResetFunc != nil {
return s.custom.ResetFunc()
@@ -117,22 +136,27 @@ func (s *Storage) Reset() error {
s.mu.Lock()
defer s.mu.Unlock()
s.data = make(map[string]Entry)
return nil
}
// Close closes the storage (no-op for mock).
// ResetWithContext resets storage using context.
func (s *Storage) ResetWithContext(ctx context.Context) error {
if s.custom.ResetWithContext != nil {
return s.custom.ResetWithContext(ctx)
}
return s.Reset()
}
// Close closes the mock storage (no-op).
func (s *Storage) Close() error {
if s.custom.CloseFunc != nil {
return s.custom.CloseFunc()
}
// No resources to clean up in mock
return nil
}
// Conn returns the internal data map (for testing purposes).
// Conn returns internal map.
func (s *Storage) Conn() map[string]Entry {
if s.custom.ConnFunc != nil {
return s.custom.ConnFunc()
@@ -148,7 +172,7 @@ func (s *Storage) Conn() map[string]Entry {
return copyData
}
// Keys returns all keys in the storage.
// Keys returns all keys.
func (s *Storage) Keys() ([][]byte, error) {
if s.custom.KeysFunc != nil {
return s.custom.KeysFunc()
@@ -164,7 +188,7 @@ func (s *Storage) Keys() ([][]byte, error) {
return keys, nil
}
// SetCustomFuncs allows setting custom function implementations.
// SetCustomFuncs allows runtime injection of function implementations.
func (s *Storage) SetCustomFuncs(custom *CustomFuncs) {
s.custom = custom
}

View File

@@ -2,9 +2,12 @@ package mockstorage
import (
"bytes"
"context"
"errors"
"testing"
"time"
"github.com/stretchr/testify/require"
)
func TestStorageDefaultBehavior(t *testing.T) {
@@ -274,3 +277,153 @@ func TestStorageConnAndKeys(t *testing.T) {
t.Errorf("Keys() = %v, want %v", keys, [][]byte{[]byte("key1")})
}
}
func TestGetWithContext(t *testing.T) {
store := New()
// fallback to Get
_ = store.Set("key1", []byte("val1"), 0)
val, err := store.GetWithContext(context.Background(), "key1")
if err != nil || !bytes.Equal(val, []byte("val1")) {
t.Errorf("GetWithContext fallback failed: got %v, err %v", val, err)
}
// custom override
store.SetCustomFuncs(&CustomFuncs{
GetWithContext: func(ctx context.Context, key string) ([]byte, error) {
if key == "override" {
return []byte("ctx-value"), nil
}
return nil, errors.New("not found")
},
})
val, err = store.GetWithContext(context.TODO(), "override")
if err != nil || !bytes.Equal(val, []byte("ctx-value")) {
t.Errorf("GetWithContext custom failed: got %v, err %v", val, err)
}
}
func TestSetWithContext(t *testing.T) {
store := New()
// fallback to Set
err := store.SetWithContext(context.TODO(), "key2", []byte("val2"), 0)
if err != nil {
t.Errorf("SetWithContext fallback failed: %v", err)
}
val, _ := store.Get("key2")
if !bytes.Equal(val, []byte("val2")) {
t.Errorf("SetWithContext fallback mismatch: got %v", val)
}
// custom override
store.SetCustomFuncs(&CustomFuncs{
SetWithContext: func(ctx context.Context, key string, val []byte, exp time.Duration) error {
if key == "readonly" {
return errors.New("forbidden")
}
return nil
},
})
err = store.SetWithContext(context.TODO(), "readonly", []byte("fail"), 0)
if err == nil || err.Error() != "forbidden" {
t.Errorf("SetWithContext custom override failed: err=%v", err)
}
}
func TestDeleteWithContext(t *testing.T) {
store := New()
// fallback to Delete
_ = store.Set("key3", []byte("val3"), 0)
err := store.DeleteWithContext(context.TODO(), "key3")
if err != nil {
t.Errorf("DeleteWithContext fallback failed: %v", err)
}
val, err := store.Get("key3")
if err == nil {
t.Errorf("expected deletion, but got value: %v", val)
}
// custom override
store.SetCustomFuncs(&CustomFuncs{
DeleteWithContext: func(ctx context.Context, key string) error {
if key == "undeletable" {
return errors.New("blocked")
}
return nil
},
})
err = store.DeleteWithContext(context.TODO(), "undeletable")
if err == nil || err.Error() != "blocked" {
t.Errorf("DeleteWithContext custom override failed: err=%v", err)
}
}
func TestResetWithContext(t *testing.T) {
store := New()
// fallback to Reset
_ = store.Set("key4", []byte("val4"), 0)
err := store.ResetWithContext(context.TODO())
if err != nil {
t.Errorf("ResetWithContext fallback failed: %v", err)
}
val, err := store.Get("key4")
if err == nil {
t.Errorf("expected reset to remove key, but got value: %v", val)
}
// custom override
store.SetCustomFuncs(&CustomFuncs{
ResetWithContext: func(ctx context.Context) error {
return errors.New("custom reset error")
},
})
err = store.ResetWithContext(context.Background())
if err == nil || err.Error() != "custom reset error" {
t.Errorf("ResetWithContext custom override failed: err=%v", err)
}
}
func Benchmark_Mockstorage_Set(b *testing.B) {
testStore := New()
b.ReportAllocs()
b.ResetTimer()
var err error
for i := 0; i < b.N; i++ {
err = testStore.Set("john", []byte("doe"), 0)
}
require.NoError(b, err)
}
func Benchmark_Mockstorage_Get(b *testing.B) {
testStore := New()
err := testStore.Set("john", []byte("doe"), 0)
require.NoError(b, err)
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
_, err = testStore.Get("john")
}
require.NoError(b, err)
}
func Benchmark_Mockstorage_SetAndDelete(b *testing.B) {
testStore := New()
b.ReportAllocs()
b.ResetTimer()
var err error
for i := 0; i < b.N; i++ {
_ = testStore.Set("john", []byte("doe"), 0)
err = testStore.Delete("john")
}
require.NoError(b, err)
}

View File

@@ -9,8 +9,6 @@ title: MongoDB
A MongoDB storage driver using [mongodb/mongo-go-driver](https://github.com/mongodb/mongo-go-driver).
**Note: Requires Go 1.19 and above**
### Table of Contents
- [Signatures](#signatures)
- [Installation](#installation)
@@ -22,9 +20,13 @@ A MongoDB storage driver using [mongodb/mongo-go-driver](https://github.com/mong
```go
func New(config ...Config) Storage
func (s *Storage) Get(key string) ([]byte, error)
func (s *Storage) GetWithContext(ctx context.Context, key string) ([]byte, error)
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
func (s *Storage) SetWithContext(ctx context.Context, key string, val []byte, exp time.Duration) error
func (s *Storage) Delete(key string) error
func (s *Storage) DeleteWithContext(ctx context.Context, key string) error
func (s *Storage) Reset() error
func (s *Storage) ResetWithContext(ctx context.Context) error
func (s *Storage) Close() error
func (s *Storage) Conn() *mongo.Database
```

View File

@@ -6,7 +6,7 @@ require (
github.com/stretchr/testify v1.10.0
github.com/testcontainers/testcontainers-go v0.37.0
github.com/testcontainers/testcontainers-go/modules/mongodb v0.37.0
go.mongodb.org/mongo-driver v1.17.3
go.mongodb.org/mongo-driver v1.17.4
)
require (

View File

@@ -120,8 +120,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
go.mongodb.org/mongo-driver v1.17.3 h1:TQyXhnsWfWtgAhMtOgtYHMTkZIfBTpMTsMnd9ZBeHxQ=
go.mongodb.org/mongo-driver v1.17.3/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ=
go.mongodb.org/mongo-driver v1.17.4 h1:jUorfmVzljjr0FLzYQsGP8cgN/qzzxlY9Vh0C9KFXVw=
go.mongodb.org/mongo-driver v1.17.4/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ=
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk=

Some files were not shown because too many files have changed in this diff Show More