mirror of
https://github.com/gofiber/storage.git
synced 2025-09-28 05:12:19 +08:00
Compare commits
139 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f112c6ddff | ||
![]() |
070dec8c74 | ||
![]() |
8125d5ae39 | ||
![]() |
45e450a3d8 | ||
![]() |
737624d914 | ||
![]() |
1401f6b804 | ||
![]() |
8c679bf3a2 | ||
![]() |
fc7eb4fd27 | ||
![]() |
7486445385 | ||
![]() |
dfdfd7fbf3 | ||
![]() |
87862b1ac6 | ||
![]() |
bbfc356c01 | ||
![]() |
d8d446b1a5 | ||
![]() |
6ba900f18c | ||
![]() |
dc7bef5d10 | ||
![]() |
dff3b2aa26 | ||
![]() |
560664ab5a | ||
![]() |
68c1b99eac | ||
![]() |
998df25440 | ||
![]() |
b59617e2a6 | ||
![]() |
c6162ed666 | ||
![]() |
31f94813cf | ||
![]() |
1f256f5391 | ||
![]() |
a299404c1b | ||
![]() |
72b47afe1e | ||
![]() |
ce744287b7 | ||
![]() |
9f14918a5a | ||
![]() |
11aacc8bd1 | ||
![]() |
01da118ae2 | ||
![]() |
94d968b7f7 | ||
![]() |
57c24a378b | ||
![]() |
fdea0f9267 | ||
![]() |
58364534e9 | ||
![]() |
bc10416921 | ||
![]() |
c30115270c | ||
![]() |
2c315e1ce7 | ||
![]() |
ff64bffed1 | ||
![]() |
34200e124b | ||
![]() |
20a6c8a79b | ||
![]() |
d2569fbe93 | ||
![]() |
bf76d31f6c | ||
![]() |
551c37101c | ||
![]() |
23f59994f8 | ||
![]() |
109c6b6f4f | ||
![]() |
fc6b3c841b | ||
![]() |
0b3e720b84 | ||
![]() |
7bcf46ac24 | ||
![]() |
0b31353707 | ||
![]() |
872f038e0b | ||
![]() |
b08cc03b22 | ||
![]() |
328c5ce28f | ||
![]() |
3e54ad6cac | ||
![]() |
7990d6d708 | ||
![]() |
95f32bf522 | ||
![]() |
95f98b0c41 | ||
![]() |
b0af7b2d2e | ||
![]() |
51f7507c86 | ||
![]() |
0965ae08a9 | ||
![]() |
2e6aade129 | ||
![]() |
7d29b5bbf0 | ||
![]() |
6666191087 | ||
![]() |
43b37e9b7e | ||
![]() |
6c53e5e46e | ||
![]() |
d178fca7df | ||
![]() |
230c3a6c5b | ||
![]() |
9b85e40cc6 | ||
![]() |
e38e2dcbba | ||
![]() |
a5d0a37b49 | ||
![]() |
808d103448 | ||
![]() |
30e0b8afa8 | ||
![]() |
da887624a4 | ||
![]() |
5eb8d57c09 | ||
![]() |
89493b1be0 | ||
![]() |
7ad1f0f105 | ||
![]() |
ffa78322a4 | ||
![]() |
ad9cf6da5d | ||
![]() |
a5a18bb80b | ||
![]() |
81764f4072 | ||
![]() |
327c871825 | ||
![]() |
4126450357 | ||
![]() |
8e81d7cded | ||
![]() |
94977c4028 | ||
![]() |
278f9d748a | ||
![]() |
d5f9d825aa | ||
![]() |
3a4eb3934d | ||
![]() |
d0b6aa2131 | ||
![]() |
310758fc7a | ||
![]() |
c1ab36765b | ||
![]() |
f24af60e42 | ||
![]() |
7d0bbde770 | ||
![]() |
efffcc135b | ||
![]() |
1b233673bb | ||
![]() |
07bde5f757 | ||
![]() |
ce174aed64 | ||
![]() |
cff33471cf | ||
![]() |
e211b33874 | ||
![]() |
05c149e84f | ||
![]() |
bf50899345 | ||
![]() |
b2f8339751 | ||
![]() |
e0435cd1a0 | ||
![]() |
d03bf4584c | ||
![]() |
e40f7b86df | ||
![]() |
3a8b8d4f71 | ||
![]() |
c38c925975 | ||
![]() |
d27ddd4739 | ||
![]() |
0aec65bb77 | ||
![]() |
671a3e4a04 | ||
![]() |
cbc4d3d251 | ||
![]() |
fe8cc5f97c | ||
![]() |
af3630ee22 | ||
![]() |
602260698d | ||
![]() |
ad27e8bcbb | ||
![]() |
d4ddc46c29 | ||
![]() |
ac29a7e86c | ||
![]() |
daa2dc7ee4 | ||
![]() |
1e822400d5 | ||
![]() |
57f7bb86d5 | ||
![]() |
ba65508bc9 | ||
![]() |
30e23d86d0 | ||
![]() |
7c79c78623 | ||
![]() |
caf28d82f7 | ||
![]() |
28ae1f71fb | ||
![]() |
bdea86b669 | ||
![]() |
2ec5a2cf70 | ||
![]() |
841d5eaedd | ||
![]() |
9ee4838edf | ||
![]() |
12203cbbe8 | ||
![]() |
e2ce496727 | ||
![]() |
4c11a63573 | ||
![]() |
725abe0123 | ||
![]() |
81c40a28df | ||
![]() |
2465b14c41 | ||
![]() |
d002c1076e | ||
![]() |
c3e5299489 | ||
![]() |
2d113619b3 | ||
![]() |
2fdd8600ad | ||
![]() |
dbc7a0636d | ||
![]() |
382fd19d57 | ||
![]() |
364ffb1dda |
76
.github/dependabot.yml
vendored
76
.github/dependabot.yml
vendored
@@ -2,129 +2,93 @@
|
|||||||
|
|
||||||
version: 2
|
version: 2
|
||||||
updates:
|
updates:
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: daily
|
||||||
|
labels:
|
||||||
|
- "🤖 Dependencies"
|
||||||
- package-ecosystem: "gomod"
|
- package-ecosystem: "gomod"
|
||||||
directory: "/" # Location of package manifests
|
directory: "/" # Location of package manifests
|
||||||
default_labels:
|
labels:
|
||||||
- "🤖 Dependencies"
|
- "🤖 Dependencies"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: "daily"
|
||||||
automerged_updates:
|
|
||||||
- match:
|
|
||||||
dependency_name: "gofiber/fiber/*"
|
|
||||||
- package-ecosystem: "gomod"
|
- package-ecosystem: "gomod"
|
||||||
directory: "/arangodb/" # Location of package manifests
|
directory: "/arangodb/" # Location of package manifests
|
||||||
default_labels:
|
labels:
|
||||||
- "🤖 Dependencies"
|
- "🤖 Dependencies"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: "daily"
|
||||||
automerged_updates:
|
|
||||||
- match:
|
|
||||||
dependency_name: "gofiber/fiber/*"
|
|
||||||
- package-ecosystem: "gomod"
|
- package-ecosystem: "gomod"
|
||||||
directory: "/badger/" # Location of package manifests
|
directory: "/badger/" # Location of package manifests
|
||||||
default_labels:
|
labels:
|
||||||
- "🤖 Dependencies"
|
- "🤖 Dependencies"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: "daily"
|
||||||
automerged_updates:
|
|
||||||
- match:
|
|
||||||
dependency_name: "gofiber/fiber/*"
|
|
||||||
- package-ecosystem: "gomod"
|
- package-ecosystem: "gomod"
|
||||||
directory: "/dynamodb/" # Location of package manifests
|
directory: "/dynamodb/" # Location of package manifests
|
||||||
default_labels:
|
labels:
|
||||||
- "🤖 Dependencies"
|
- "🤖 Dependencies"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: "daily"
|
||||||
automerged_updates:
|
|
||||||
- match:
|
|
||||||
dependency_name: "gofiber/fiber/*"
|
|
||||||
- package-ecosystem: "gomod"
|
- package-ecosystem: "gomod"
|
||||||
directory: "/memcache/" # Location of package manifests
|
directory: "/memcache/" # Location of package manifests
|
||||||
default_labels:
|
labels:
|
||||||
- "🤖 Dependencies"
|
- "🤖 Dependencies"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: "daily"
|
||||||
automerged_updates:
|
|
||||||
- match:
|
|
||||||
dependency_name: "gofiber/fiber/*"
|
|
||||||
- package-ecosystem: "gomod"
|
- package-ecosystem: "gomod"
|
||||||
directory: "/memory/" # Location of package manifests
|
directory: "/memory/" # Location of package manifests
|
||||||
default_labels:
|
labels:
|
||||||
- "🤖 Dependencies"
|
- "🤖 Dependencies"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: "daily"
|
||||||
automerged_updates:
|
|
||||||
- match:
|
|
||||||
dependency_name: "gofiber/fiber/*"
|
|
||||||
- package-ecosystem: "gomod"
|
- package-ecosystem: "gomod"
|
||||||
directory: "/mongodb/" # Location of package manifests
|
directory: "/mongodb/" # Location of package manifests
|
||||||
default_labels:
|
labels:
|
||||||
- "🤖 Dependencies"
|
- "🤖 Dependencies"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: "daily"
|
||||||
automerged_updates:
|
|
||||||
- match:
|
|
||||||
dependency_name: "gofiber/fiber/*"
|
|
||||||
- package-ecosystem: "gomod"
|
- package-ecosystem: "gomod"
|
||||||
directory: "/mysql/" # Location of package manifests
|
directory: "/mysql/" # Location of package manifests
|
||||||
default_labels:
|
labels:
|
||||||
- "🤖 Dependencies"
|
- "🤖 Dependencies"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: "daily"
|
||||||
automerged_updates:
|
|
||||||
- match:
|
|
||||||
dependency_name: "gofiber/fiber/*"
|
|
||||||
- package-ecosystem: "gomod"
|
- package-ecosystem: "gomod"
|
||||||
directory: "/postgres/" # Location of package manifests
|
directory: "/postgres/" # Location of package manifests
|
||||||
default_labels:
|
labels:
|
||||||
- "🤖 Dependencies"
|
- "🤖 Dependencies"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: "daily"
|
||||||
automerged_updates:
|
|
||||||
- match:
|
|
||||||
dependency_name: "gofiber/fiber/*"
|
|
||||||
- package-ecosystem: "gomod"
|
- package-ecosystem: "gomod"
|
||||||
directory: "/redis/" # Location of package manifests
|
directory: "/redis/" # Location of package manifests
|
||||||
default_labels:
|
labels:
|
||||||
- "🤖 Dependencies"
|
- "🤖 Dependencies"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: "daily"
|
||||||
automerged_updates:
|
|
||||||
- match:
|
|
||||||
dependency_name: "gofiber/fiber/*"
|
|
||||||
- package-ecosystem: "gomod"
|
- package-ecosystem: "gomod"
|
||||||
directory: "/sqlite3/" # Location of package manifests
|
directory: "/sqlite3/" # Location of package manifests
|
||||||
default_labels:
|
labels:
|
||||||
- "🤖 Dependencies"
|
- "🤖 Dependencies"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: "daily"
|
||||||
automerged_updates:
|
|
||||||
- match:
|
|
||||||
dependency_name: "gofiber/fiber/*"
|
|
||||||
- package-ecosystem: "gomod"
|
- package-ecosystem: "gomod"
|
||||||
directory: "/ristretto/" # Location of package manifests
|
directory: "/ristretto/" # Location of package manifests
|
||||||
default_labels:
|
labels:
|
||||||
- "🤖 Dependencies"
|
- "🤖 Dependencies"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: "daily"
|
||||||
automerged_updates:
|
|
||||||
- match:
|
|
||||||
dependency_name: "gofiber/fiber/*"
|
|
||||||
- package-ecosystem: "gomod"
|
- package-ecosystem: "gomod"
|
||||||
directory: "/s3/" # Location of package manifests
|
directory: "/s3/" # Location of package manifests
|
||||||
default_labels:
|
labels:
|
||||||
- "🤖 Dependencies"
|
- "🤖 Dependencies"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: "daily"
|
||||||
automerged_updates:
|
|
||||||
- match:
|
|
||||||
dependency_name: "gofiber/fiber/*"
|
|
||||||
- package-ecosystem: "gomod"
|
- package-ecosystem: "gomod"
|
||||||
directory: "/bbolt/" # Location of package manifests
|
directory: "/bbolt/" # Location of package manifests
|
||||||
default_labels:
|
labels:
|
||||||
- "🤖 Dependencies"
|
- "🤖 Dependencies"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: "daily"
|
||||||
automerged_updates:
|
|
||||||
- match:
|
|
||||||
dependency_name: "gofiber/fiber/*"
|
|
||||||
|
3
.github/release-drafter.yml
vendored
3
.github/release-drafter.yml
vendored
@@ -16,6 +16,7 @@ categories:
|
|||||||
- '📒 Documentation'
|
- '📒 Documentation'
|
||||||
change-template: '- $TITLE (#$NUMBER)'
|
change-template: '- $TITLE (#$NUMBER)'
|
||||||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
|
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
|
||||||
|
sort-by: 'title'
|
||||||
version-resolver:
|
version-resolver:
|
||||||
major:
|
major:
|
||||||
labels:
|
labels:
|
||||||
@@ -90,4 +91,6 @@ autolabeler:
|
|||||||
template: |
|
template: |
|
||||||
$CHANGES
|
$CHANGES
|
||||||
|
|
||||||
|
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
|
||||||
|
|
||||||
Thank you $CONTRIBUTORS for making this update possible.
|
Thank you $CONTRIBUTORS for making this update possible.
|
||||||
|
8
.github/workflows/codeql-analysis.yml
vendored
8
.github/workflows/codeql-analysis.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
# We must fetch at least the immediate parents so that if this is
|
# We must fetch at least the immediate parents so that if this is
|
||||||
# a pull request then we can checkout the head.
|
# a pull request then we can checkout the head.
|
||||||
@@ -29,7 +29,7 @@ jobs:
|
|||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
# Initializes the CodeQL tools for scanning.
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v1
|
uses: github/codeql-action/init@v2
|
||||||
# Override language selection by uncommenting this and choosing your languages
|
# Override language selection by uncommenting this and choosing your languages
|
||||||
with:
|
with:
|
||||||
languages: go
|
languages: go
|
||||||
@@ -37,7 +37,7 @@ jobs:
|
|||||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||||
# If this step fails, then you should remove it and run the build manually (see below)
|
# If this step fails, then you should remove it and run the build manually (see below)
|
||||||
- name: Autobuild
|
- name: Autobuild
|
||||||
uses: github/codeql-action/autobuild@v1
|
uses: github/codeql-action/autobuild@v2
|
||||||
|
|
||||||
# ℹ️ Command-line programs to run using the OS shell.
|
# ℹ️ Command-line programs to run using the OS shell.
|
||||||
# 📚 https://git.io/JvXDl
|
# 📚 https://git.io/JvXDl
|
||||||
@@ -51,4 +51,4 @@ jobs:
|
|||||||
# make release
|
# make release
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@v1
|
uses: github/codeql-action/analyze@v2
|
||||||
|
39
.github/workflows/dependabot_automerge.yml
vendored
Normal file
39
.github/workflows/dependabot_automerge.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
name: Dependabot auto-merge
|
||||||
|
on: pull_request
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
wait_for_checks:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Wait for check is finished
|
||||||
|
uses: lewagon/wait-on-check-action@v1.1.2
|
||||||
|
id: wait_for_checks
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
||||||
|
running-workflow-name: wait_for_checks
|
||||||
|
check-regexp: Tests
|
||||||
|
repo-token: ${{ secrets.PR_TOKEN }}
|
||||||
|
wait-interval: 10
|
||||||
|
dependabot:
|
||||||
|
needs: [wait_for_checks]
|
||||||
|
name: Dependabot auto-merge
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.actor == 'dependabot[bot]' }}
|
||||||
|
steps:
|
||||||
|
- name: Dependabot metadata
|
||||||
|
id: metadata
|
||||||
|
uses: dependabot/fetch-metadata@v1.3.4
|
||||||
|
with:
|
||||||
|
github-token: "${{ secrets.PR_TOKEN }}"
|
||||||
|
- name: Enable auto-merge for Dependabot PRs
|
||||||
|
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
|
||||||
|
run: |
|
||||||
|
gh pr review --approve "$PR_URL"
|
||||||
|
gh pr merge --auto --merge "$PR_URL"
|
||||||
|
env:
|
||||||
|
PR_URL: ${{github.event.pull_request.html_url}}
|
||||||
|
GITHUB_TOKEN: ${{secrets.PR_TOKEN}}
|
4
.github/workflows/linter.yml
vendored
4
.github/workflows/linter.yml
vendored
@@ -5,8 +5,8 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Fetch Repository
|
- name: Fetch Repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
- name: Run Golint
|
- name: Run Golint
|
||||||
uses: reviewdog/action-golangci-lint@v1
|
uses: reviewdog/action-golangci-lint@v2
|
||||||
with:
|
with:
|
||||||
golangci_lint_flags: "--tests=false"
|
golangci_lint_flags: "--tests=false"
|
||||||
|
4
.github/workflows/security.yml
vendored
4
.github/workflows/security.yml
vendored
@@ -5,9 +5,9 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Fetch Repository
|
- name: Fetch Repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: '^1.17.6'
|
go-version: '^1.17.6'
|
||||||
- name: Install Gosec
|
- name: Install Gosec
|
||||||
|
98
.github/workflows/test-arangodb.yml
vendored
98
.github/workflows/test-arangodb.yml
vendored
@@ -1,49 +1,51 @@
|
|||||||
'on':
|
on:
|
||||||
- push
|
push:
|
||||||
- pull_request
|
branches:
|
||||||
name: ArangoDB
|
- master
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
name: "Tests ArangoDB"
|
||||||
jobs:
|
jobs:
|
||||||
Tests:
|
Tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
services:
|
services:
|
||||||
arangodb:
|
arangodb:
|
||||||
image: 'arangodb:latest'
|
image: 'arangodb:latest'
|
||||||
env:
|
env:
|
||||||
ARANGO_NO_AUTH: 1
|
ARANGO_NO_AUTH: 1
|
||||||
ports:
|
ports:
|
||||||
- '8529:8529'
|
- '8529:8529'
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version:
|
go-version:
|
||||||
- 1.14.x
|
- 1.14.x
|
||||||
- 1.15.x
|
- 1.16.x
|
||||||
- 1.16.x
|
- 1.19.x
|
||||||
- 1.17.x
|
platform:
|
||||||
platform:
|
- ubuntu-latest
|
||||||
- ubuntu-latest
|
- windows-latest
|
||||||
- windows-latest
|
steps:
|
||||||
steps:
|
- name: Install Go
|
||||||
- name: Install Go
|
uses: actions/setup-go@v3
|
||||||
uses: actions/setup-go@v1
|
with:
|
||||||
with:
|
go-version: '${{ matrix.go-version }}'
|
||||||
go-version: '${{ matrix.go-version }}'
|
- name: Setup Golang caches
|
||||||
- name: Setup Golang caches
|
uses: actions/cache@v3
|
||||||
uses: actions/cache@v3
|
with:
|
||||||
with:
|
# In order:
|
||||||
# In order:
|
# * Module download cache
|
||||||
# * Module download cache
|
# * Build cache (Linux)
|
||||||
# * Build cache (Linux)
|
# * Build cache (Mac)
|
||||||
# * Build cache (Mac)
|
# * Build cache (Windows)
|
||||||
# * Build cache (Windows)
|
path: |
|
||||||
path: |
|
~/go/pkg/mod
|
||||||
~/go/pkg/mod
|
~/.cache/go-build
|
||||||
~/.cache/go-build
|
~/Library/Caches/go-build
|
||||||
~/Library/Caches/go-build
|
~\AppData\Local\go-build
|
||||||
~\AppData\Local\go-build
|
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
|
||||||
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
|
restore-keys: |
|
||||||
restore-keys: |
|
${{ runner.os }}-go-${{ matrix.go-version }}-
|
||||||
${{ runner.os }}-go-${{ matrix.go-version }}-
|
- name: Fetch Repository
|
||||||
- name: Fetch Repository
|
uses: actions/checkout@v3
|
||||||
uses: actions/checkout@v2
|
- name: Run Test
|
||||||
- name: Run Test
|
run: cd ./arangodb && go test ./... -v -race
|
||||||
run: cd ./arangodb && go test ./... -v -race
|
|
||||||
|
82
.github/workflows/test-bbolt.yml
vendored
82
.github/workflows/test-bbolt.yml
vendored
@@ -1,40 +1,44 @@
|
|||||||
'on':
|
on:
|
||||||
- push
|
push:
|
||||||
- pull_request
|
branches:
|
||||||
name: Bbolt
|
- master
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
name: "Tests Bbolt"
|
||||||
jobs:
|
jobs:
|
||||||
Tests:
|
Tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version:
|
go-version:
|
||||||
- 1.16.x
|
- 1.14.x
|
||||||
- 1.17.x
|
- 1.16.x
|
||||||
platform:
|
- 1.19.x
|
||||||
- ubuntu-latest
|
platform:
|
||||||
- windows-latest
|
- ubuntu-latest
|
||||||
steps:
|
- windows-latest
|
||||||
- name: Install Go
|
steps:
|
||||||
uses: actions/setup-go@v1
|
- name: Install Go
|
||||||
with:
|
uses: actions/setup-go@v3
|
||||||
go-version: '${{ matrix.go-version }}'
|
with:
|
||||||
- name: Setup Golang caches
|
go-version: '${{ matrix.go-version }}'
|
||||||
uses: actions/cache@v3
|
- name: Setup Golang caches
|
||||||
with:
|
uses: actions/cache@v3
|
||||||
# In order:
|
with:
|
||||||
# * Module download cache
|
# In order:
|
||||||
# * Build cache (Linux)
|
# * Module download cache
|
||||||
# * Build cache (Mac)
|
# * Build cache (Linux)
|
||||||
# * Build cache (Windows)
|
# * Build cache (Mac)
|
||||||
path: |
|
# * Build cache (Windows)
|
||||||
~/go/pkg/mod
|
path: |
|
||||||
~/.cache/go-build
|
~/go/pkg/mod
|
||||||
~/Library/Caches/go-build
|
~/.cache/go-build
|
||||||
~\AppData\Local\go-build
|
~/Library/Caches/go-build
|
||||||
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
|
~\AppData\Local\go-build
|
||||||
restore-keys: |
|
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
|
||||||
${{ runner.os }}-go-${{ matrix.go-version }}-
|
restore-keys: |
|
||||||
- name: Fetch Repository
|
${{ runner.os }}-go-${{ matrix.go-version }}-
|
||||||
uses: actions/checkout@v2
|
- name: Fetch Repository
|
||||||
- name: Run Test
|
uses: actions/checkout@v3
|
||||||
run: cd ./bbolt && go mod tidy && go test ./... -v -race
|
- name: Run Test
|
||||||
|
run: cd ./bbolt && go mod tidy && go test ./... -v -race
|
||||||
|
94
.github/workflows/test-dynamodb.yml
vendored
94
.github/workflows/test-dynamodb.yml
vendored
@@ -1,47 +1,49 @@
|
|||||||
'on':
|
on:
|
||||||
- push
|
push:
|
||||||
- pull_request
|
branches:
|
||||||
name: DynamoDB
|
- master
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
name: "Tests DynamoDB"
|
||||||
jobs:
|
jobs:
|
||||||
Tests:
|
Tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
services:
|
services:
|
||||||
mongo:
|
mongo:
|
||||||
image: 'amazon/dynamodb-local:latest'
|
image: 'amazon/dynamodb-local:latest'
|
||||||
ports:
|
ports:
|
||||||
- '8000:8000'
|
- '8000:8000'
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version:
|
go-version:
|
||||||
- 1.14.x
|
- 1.14.x
|
||||||
- 1.15.x
|
- 1.16.x
|
||||||
- 1.16.x
|
- 1.19.x
|
||||||
- 1.17.x
|
platform:
|
||||||
platform:
|
- ubuntu-latest
|
||||||
- ubuntu-latest
|
- windows-latest
|
||||||
- windows-latest
|
steps:
|
||||||
steps:
|
- name: Install Go
|
||||||
- name: Install Go
|
uses: actions/setup-go@v3
|
||||||
uses: actions/setup-go@v1
|
with:
|
||||||
with:
|
go-version: '${{ matrix.go-version }}'
|
||||||
go-version: '${{ matrix.go-version }}'
|
- name: Setup Golang caches
|
||||||
- name: Setup Golang caches
|
uses: actions/cache@v3
|
||||||
uses: actions/cache@v3
|
with:
|
||||||
with:
|
# In order:
|
||||||
# In order:
|
# * Module download cache
|
||||||
# * Module download cache
|
# * Build cache (Linux)
|
||||||
# * Build cache (Linux)
|
# * Build cache (Mac)
|
||||||
# * Build cache (Mac)
|
# * Build cache (Windows)
|
||||||
# * Build cache (Windows)
|
path: |
|
||||||
path: |
|
~/go/pkg/mod
|
||||||
~/go/pkg/mod
|
~/.cache/go-build
|
||||||
~/.cache/go-build
|
~/Library/Caches/go-build
|
||||||
~/Library/Caches/go-build
|
~\AppData\Local\go-build
|
||||||
~\AppData\Local\go-build
|
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
|
||||||
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
|
restore-keys: |
|
||||||
restore-keys: |
|
${{ runner.os }}-go-${{ matrix.go-version }}-
|
||||||
${{ runner.os }}-go-${{ matrix.go-version }}-
|
- name: Fetch Repository
|
||||||
- name: Fetch Repository
|
uses: actions/checkout@v3
|
||||||
uses: actions/checkout@v2
|
- name: Run Test
|
||||||
- name: Run Test
|
run: cd ./dynamodb && go test ./... -v -race
|
||||||
run: cd ./dynamodb && go test ./... -v -race
|
|
||||||
|
94
.github/workflows/test-memcache.yml
vendored
94
.github/workflows/test-memcache.yml
vendored
@@ -1,47 +1,49 @@
|
|||||||
'on':
|
on:
|
||||||
- push
|
push:
|
||||||
- pull_request
|
branches:
|
||||||
name: Memcache
|
- master
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
name: "Tests Memcache"
|
||||||
jobs:
|
jobs:
|
||||||
Tests:
|
Tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
services:
|
services:
|
||||||
mongo:
|
mongo:
|
||||||
image: 'memcached:latest'
|
image: 'memcached:latest'
|
||||||
ports:
|
ports:
|
||||||
- '11211:11211'
|
- '11211:11211'
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version:
|
go-version:
|
||||||
- 1.14.x
|
- 1.14.x
|
||||||
- 1.15.x
|
- 1.16.x
|
||||||
- 1.16.x
|
- 1.19.x
|
||||||
- 1.17.x
|
platform:
|
||||||
platform:
|
- ubuntu-latest
|
||||||
- ubuntu-latest
|
- windows-latest
|
||||||
- windows-latest
|
steps:
|
||||||
steps:
|
- name: Install Go
|
||||||
- name: Install Go
|
uses: actions/setup-go@v3
|
||||||
uses: actions/setup-go@v1
|
with:
|
||||||
with:
|
go-version: '${{ matrix.go-version }}'
|
||||||
go-version: '${{ matrix.go-version }}'
|
- name: Setup Golang caches
|
||||||
- name: Setup Golang caches
|
uses: actions/cache@v3
|
||||||
uses: actions/cache@v3
|
with:
|
||||||
with:
|
# In order:
|
||||||
# In order:
|
# * Module download cache
|
||||||
# * Module download cache
|
# * Build cache (Linux)
|
||||||
# * Build cache (Linux)
|
# * Build cache (Mac)
|
||||||
# * Build cache (Mac)
|
# * Build cache (Windows)
|
||||||
# * Build cache (Windows)
|
path: |
|
||||||
path: |
|
~/go/pkg/mod
|
||||||
~/go/pkg/mod
|
~/.cache/go-build
|
||||||
~/.cache/go-build
|
~/Library/Caches/go-build
|
||||||
~/Library/Caches/go-build
|
~\AppData\Local\go-build
|
||||||
~\AppData\Local\go-build
|
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
|
||||||
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
|
restore-keys: |
|
||||||
restore-keys: |
|
${{ runner.os }}-go-${{ matrix.go-version }}-
|
||||||
${{ runner.os }}-go-${{ matrix.go-version }}-
|
- name: Fetch Repository
|
||||||
- name: Fetch Repository
|
uses: actions/checkout@v3
|
||||||
uses: actions/checkout@v2
|
- name: Run Test
|
||||||
- name: Run Test
|
run: cd ./memcache && go test ./... -v -race
|
||||||
run: cd ./memcache && go test ./... -v -race
|
|
||||||
|
94
.github/workflows/test-mongodb.yml
vendored
94
.github/workflows/test-mongodb.yml
vendored
@@ -1,47 +1,49 @@
|
|||||||
'on':
|
on:
|
||||||
- push
|
push:
|
||||||
- pull_request
|
branches:
|
||||||
name: MongoDB
|
- master
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
name: "Tests Mongodb"
|
||||||
jobs:
|
jobs:
|
||||||
Tests:
|
Tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
services:
|
services:
|
||||||
mongo:
|
mongo:
|
||||||
image: 'mongo:latest'
|
image: 'mongo:latest'
|
||||||
ports:
|
ports:
|
||||||
- '27017:27017'
|
- '27017:27017'
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version:
|
go-version:
|
||||||
- 1.14.x
|
- 1.14.x
|
||||||
- 1.15.x
|
- 1.16.x
|
||||||
- 1.16.x
|
- 1.19.x
|
||||||
- 1.17.x
|
platform:
|
||||||
platform:
|
- ubuntu-latest
|
||||||
- ubuntu-latest
|
- windows-latest
|
||||||
- windows-latest
|
steps:
|
||||||
steps:
|
- name: Install Go
|
||||||
- name: Install Go
|
uses: actions/setup-go@v3
|
||||||
uses: actions/setup-go@v1
|
with:
|
||||||
with:
|
go-version: '${{ matrix.go-version }}'
|
||||||
go-version: '${{ matrix.go-version }}'
|
- name: Setup Golang caches
|
||||||
- name: Setup Golang caches
|
uses: actions/cache@v3
|
||||||
uses: actions/cache@v3
|
with:
|
||||||
with:
|
# In order:
|
||||||
# In order:
|
# * Module download cache
|
||||||
# * Module download cache
|
# * Build cache (Linux)
|
||||||
# * Build cache (Linux)
|
# * Build cache (Mac)
|
||||||
# * Build cache (Mac)
|
# * Build cache (Windows)
|
||||||
# * Build cache (Windows)
|
path: |
|
||||||
path: |
|
~/go/pkg/mod
|
||||||
~/go/pkg/mod
|
~/.cache/go-build
|
||||||
~/.cache/go-build
|
~/Library/Caches/go-build
|
||||||
~/Library/Caches/go-build
|
~\AppData\Local\go-build
|
||||||
~\AppData\Local\go-build
|
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
|
||||||
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
|
restore-keys: |
|
||||||
restore-keys: |
|
${{ runner.os }}-go-${{ matrix.go-version }}-
|
||||||
${{ runner.os }}-go-${{ matrix.go-version }}-
|
- name: Fetch Repository
|
||||||
- name: Fetch Repository
|
uses: actions/checkout@v3
|
||||||
uses: actions/checkout@v2
|
- name: Run Test
|
||||||
- name: Run Test
|
run: cd ./mongodb && go test ./... -v -race
|
||||||
run: cd ./mongodb && go test ./... -v -race
|
|
||||||
|
118
.github/workflows/test-mysql.yml
vendored
118
.github/workflows/test-mysql.yml
vendored
@@ -1,59 +1,61 @@
|
|||||||
'on':
|
on:
|
||||||
- push
|
push:
|
||||||
- pull_request
|
branches:
|
||||||
name: MySQL
|
- master
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
name: "Tests MySQL"
|
||||||
jobs:
|
jobs:
|
||||||
Tests:
|
Tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
services:
|
services:
|
||||||
mysql:
|
mysql:
|
||||||
image: 'mysql:latest'
|
image: 'mysql:latest'
|
||||||
env:
|
env:
|
||||||
MYSQL_DATABASE: fiber
|
MYSQL_DATABASE: fiber
|
||||||
MYSQL_USER: username
|
MYSQL_USER: username
|
||||||
MYSQL_PASSWORD: password
|
MYSQL_PASSWORD: password
|
||||||
MYSQL_ROOT_PASSWORD: password
|
MYSQL_ROOT_PASSWORD: password
|
||||||
ports:
|
ports:
|
||||||
- '3306:3306'
|
- '3306:3306'
|
||||||
options: >-
|
options: >-
|
||||||
--health-cmd "mysqladmin ping" --health-interval 10s --health-timeout
|
--health-cmd "mysqladmin ping" --health-interval 10s --health-timeout
|
||||||
5s --health-retries 5
|
5s --health-retries 5
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version:
|
go-version:
|
||||||
- 1.14.x
|
- 1.14.x
|
||||||
- 1.15.x
|
- 1.16.x
|
||||||
- 1.16.x
|
- 1.19.x
|
||||||
- 1.17.x
|
platform:
|
||||||
platform:
|
- ubuntu-latest
|
||||||
- ubuntu-latest
|
- windows-latest
|
||||||
- windows-latest
|
steps:
|
||||||
steps:
|
- name: Install Go
|
||||||
- name: Install Go
|
uses: actions/setup-go@v3
|
||||||
uses: actions/setup-go@v1
|
with:
|
||||||
with:
|
go-version: '${{ matrix.go-version }}'
|
||||||
go-version: '${{ matrix.go-version }}'
|
- name: Setup Golang caches
|
||||||
- name: Setup Golang caches
|
uses: actions/cache@v3
|
||||||
uses: actions/cache@v3
|
with:
|
||||||
with:
|
# In order:
|
||||||
# In order:
|
# * Module download cache
|
||||||
# * Module download cache
|
# * Build cache (Linux)
|
||||||
# * Build cache (Linux)
|
# * Build cache (Mac)
|
||||||
# * Build cache (Mac)
|
# * Build cache (Windows)
|
||||||
# * Build cache (Windows)
|
path: |
|
||||||
path: |
|
~/go/pkg/mod
|
||||||
~/go/pkg/mod
|
~/.cache/go-build
|
||||||
~/.cache/go-build
|
~/Library/Caches/go-build
|
||||||
~/Library/Caches/go-build
|
~\AppData\Local\go-build
|
||||||
~\AppData\Local\go-build
|
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
|
||||||
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
|
restore-keys: |
|
||||||
restore-keys: |
|
${{ runner.os }}-go-${{ matrix.go-version }}-
|
||||||
${{ runner.os }}-go-${{ matrix.go-version }}-
|
- name: Fetch Repository
|
||||||
- name: Fetch Repository
|
uses: actions/checkout@v3
|
||||||
uses: actions/checkout@v2
|
- name: Run Test
|
||||||
- name: Run Test
|
run: cd ./mysql && go test ./... -v -race
|
||||||
run: cd ./mysql && go test ./... -v -race
|
env:
|
||||||
env:
|
MYSQL_USERNAME: username
|
||||||
MYSQL_USERNAME: username
|
MYSQL_PASSWORD: password
|
||||||
MYSQL_PASSWORD: password
|
MYSQL_DATABASE: fiber
|
||||||
MYSQL_DATABASE: fiber
|
|
||||||
|
116
.github/workflows/test-postgres.yml
vendored
116
.github/workflows/test-postgres.yml
vendored
@@ -1,58 +1,60 @@
|
|||||||
'on':
|
on:
|
||||||
- push
|
push:
|
||||||
- pull_request
|
branches:
|
||||||
name: Postgres
|
- master
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
name: "Tests Postgres"
|
||||||
jobs:
|
jobs:
|
||||||
Tests:
|
Tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
image: 'postgres:latest'
|
image: 'postgres:latest'
|
||||||
ports:
|
ports:
|
||||||
- '5432:5432'
|
- '5432:5432'
|
||||||
env:
|
env:
|
||||||
POSTGRES_DB: fiber
|
POSTGRES_DB: fiber
|
||||||
POSTGRES_USER: username
|
POSTGRES_USER: username
|
||||||
POSTGRES_PASSWORD: password
|
POSTGRES_PASSWORD: password
|
||||||
options: >-
|
options: >-
|
||||||
--health-cmd pg_isready --health-interval 10s --health-timeout 5s
|
--health-cmd pg_isready --health-interval 10s --health-timeout 5s
|
||||||
--health-retries 5
|
--health-retries 5
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version:
|
go-version:
|
||||||
- 1.14.x
|
- 1.14.x
|
||||||
- 1.15.x
|
- 1.16.x
|
||||||
- 1.16.x
|
- 1.19.x
|
||||||
- 1.17.x
|
platform:
|
||||||
platform:
|
- ubuntu-latest
|
||||||
- ubuntu-latest
|
- windows-latest
|
||||||
- windows-latest
|
steps:
|
||||||
steps:
|
- name: Install Go
|
||||||
- name: Install Go
|
uses: actions/setup-go@v3
|
||||||
uses: actions/setup-go@v1
|
with:
|
||||||
with:
|
go-version: '${{ matrix.go-version }}'
|
||||||
go-version: '${{ matrix.go-version }}'
|
- name: Setup Golang caches
|
||||||
- name: Setup Golang caches
|
uses: actions/cache@v3
|
||||||
uses: actions/cache@v3
|
with:
|
||||||
with:
|
# In order:
|
||||||
# In order:
|
# * Module download cache
|
||||||
# * Module download cache
|
# * Build cache (Linux)
|
||||||
# * Build cache (Linux)
|
# * Build cache (Mac)
|
||||||
# * Build cache (Mac)
|
# * Build cache (Windows)
|
||||||
# * Build cache (Windows)
|
path: |
|
||||||
path: |
|
~/go/pkg/mod
|
||||||
~/go/pkg/mod
|
~/.cache/go-build
|
||||||
~/.cache/go-build
|
~/Library/Caches/go-build
|
||||||
~/Library/Caches/go-build
|
~\AppData\Local\go-build
|
||||||
~\AppData\Local\go-build
|
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
|
||||||
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
|
restore-keys: |
|
||||||
restore-keys: |
|
${{ runner.os }}-go-${{ matrix.go-version }}-
|
||||||
${{ runner.os }}-go-${{ matrix.go-version }}-
|
- name: Fetch Repository
|
||||||
- name: Fetch Repository
|
uses: actions/checkout@v3
|
||||||
uses: actions/checkout@v2
|
- name: Run Test
|
||||||
- name: Run Test
|
run: cd ./postgres && go test ./... -v -race
|
||||||
run: cd ./postgres && go test ./... -v -race
|
env:
|
||||||
env:
|
POSTGRES_DATABASE: fiber
|
||||||
POSTGRES_DATABASE: fiber
|
POSTGRES_USERNAME: username
|
||||||
POSTGRES_USERNAME: username
|
POSTGRES_PASSWORD: password
|
||||||
POSTGRES_PASSWORD: password
|
|
||||||
|
110
.github/workflows/test-redis.yml
vendored
110
.github/workflows/test-redis.yml
vendored
@@ -1,60 +1,62 @@
|
|||||||
'on':
|
on:
|
||||||
- push
|
push:
|
||||||
- pull_request
|
branches:
|
||||||
name: Redis
|
- master
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
name: "Tests Redis"
|
||||||
jobs:
|
jobs:
|
||||||
Tests:
|
Tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version:
|
go-version:
|
||||||
- 1.14.x
|
- 1.14.x
|
||||||
- 1.15.x
|
- 1.16.x
|
||||||
- 1.16.x
|
- 1.19.x
|
||||||
- 1.17.x
|
platform:
|
||||||
platform:
|
- ubuntu-latest
|
||||||
- ubuntu-latest
|
- windows-latest
|
||||||
- windows-latest
|
steps:
|
||||||
steps:
|
- name: Fetch Repository
|
||||||
- name: Fetch Repository
|
uses: actions/checkout@v3
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Setup Redis
|
- name: Setup Redis
|
||||||
uses: shogo82148/actions-setup-redis@v1
|
uses: shogo82148/actions-setup-redis@v1
|
||||||
with:
|
with:
|
||||||
redis-version: '6.x'
|
redis-version: '6.x'
|
||||||
auto-start: 'false'
|
auto-start: 'false'
|
||||||
redis-port: '6379'
|
redis-port: '6379'
|
||||||
redis-tls-port: '6380'
|
redis-tls-port: '6380'
|
||||||
|
|
||||||
- name: Run Redis
|
- name: Run Redis
|
||||||
run: |
|
run: |
|
||||||
redis-server --tls-port 6380 --port 6379 \
|
redis-server --tls-port 6380 --port 6379 \
|
||||||
--tls-cert-file ./redis/tests/tls/redis.crt \
|
--tls-cert-file ./redis/tests/tls/redis.crt \
|
||||||
--tls-key-file ./redis/tests/tls/redis.key \
|
--tls-key-file ./redis/tests/tls/redis.key \
|
||||||
--tls-ca-cert-file ./redis/tests/tls/ca.crt&
|
--tls-ca-cert-file ./redis/tests/tls/ca.crt&
|
||||||
|
|
||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v1
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: '${{ matrix.go-version }}'
|
go-version: '${{ matrix.go-version }}'
|
||||||
|
|
||||||
- name: Setup Golang caches
|
- name: Setup Golang caches
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
# In order:
|
# In order:
|
||||||
# * Module download cache
|
# * Module download cache
|
||||||
# * Build cache (Linux)
|
# * Build cache (Linux)
|
||||||
# * Build cache (Mac)
|
# * Build cache (Mac)
|
||||||
# * Build cache (Windows)
|
# * Build cache (Windows)
|
||||||
path: |
|
path: |
|
||||||
~/go/pkg/mod
|
~/go/pkg/mod
|
||||||
~/.cache/go-build
|
~/.cache/go-build
|
||||||
~/Library/Caches/go-build
|
~/Library/Caches/go-build
|
||||||
~\AppData\Local\go-build
|
~\AppData\Local\go-build
|
||||||
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
|
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-go-${{ matrix.go-version }}-
|
${{ runner.os }}-go-${{ matrix.go-version }}-
|
||||||
|
|
||||||
- name: Run Test
|
- name: Run Test
|
||||||
run: cd ./redis && go test ./... -v -race
|
run: cd ./redis && go test ./... -v -race
|
||||||
|
82
.github/workflows/test-ristretto.yml
vendored
82
.github/workflows/test-ristretto.yml
vendored
@@ -1,40 +1,44 @@
|
|||||||
'on':
|
on:
|
||||||
- push
|
push:
|
||||||
- pull_request
|
branches:
|
||||||
name: Ristretto
|
- master
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
name: "Tests Ristretto"
|
||||||
jobs:
|
jobs:
|
||||||
Tests:
|
Tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version:
|
go-version:
|
||||||
- 1.16.x
|
- 1.14.x
|
||||||
- 1.17.x
|
- 1.16.x
|
||||||
platform:
|
- 1.19.x
|
||||||
- ubuntu-latest
|
platform:
|
||||||
- windows-latest
|
- ubuntu-latest
|
||||||
steps:
|
- windows-latest
|
||||||
- name: Install Go
|
steps:
|
||||||
uses: actions/setup-go@v1
|
- name: Install Go
|
||||||
with:
|
uses: actions/setup-go@v3
|
||||||
go-version: '${{ matrix.go-version }}'
|
with:
|
||||||
- name: Setup Golang caches
|
go-version: '${{ matrix.go-version }}'
|
||||||
uses: actions/cache@v3
|
- name: Setup Golang caches
|
||||||
with:
|
uses: actions/cache@v3
|
||||||
# In order:
|
with:
|
||||||
# * Module download cache
|
# In order:
|
||||||
# * Build cache (Linux)
|
# * Module download cache
|
||||||
# * Build cache (Mac)
|
# * Build cache (Linux)
|
||||||
# * Build cache (Windows)
|
# * Build cache (Mac)
|
||||||
path: |
|
# * Build cache (Windows)
|
||||||
~/go/pkg/mod
|
path: |
|
||||||
~/.cache/go-build
|
~/go/pkg/mod
|
||||||
~/Library/Caches/go-build
|
~/.cache/go-build
|
||||||
~\AppData\Local\go-build
|
~/Library/Caches/go-build
|
||||||
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
|
~\AppData\Local\go-build
|
||||||
restore-keys: |
|
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
|
||||||
${{ runner.os }}-go-${{ matrix.go-version }}-
|
restore-keys: |
|
||||||
- name: Fetch Repository
|
${{ runner.os }}-go-${{ matrix.go-version }}-
|
||||||
uses: actions/checkout@v2
|
- name: Fetch Repository
|
||||||
- name: Run Test
|
uses: actions/checkout@v3
|
||||||
run: cd ./ristretto && go mod tidy && go test ./... -v -race
|
- name: Run Test
|
||||||
|
run: cd ./ristretto && go mod tidy && go test ./... -v -race
|
||||||
|
98
.github/workflows/test-s3.yml
vendored
98
.github/workflows/test-s3.yml
vendored
@@ -1,51 +1,53 @@
|
|||||||
'on':
|
on:
|
||||||
- push
|
push:
|
||||||
- pull_request
|
branches:
|
||||||
name: S3
|
- master
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
name: "Tests S3"
|
||||||
jobs:
|
jobs:
|
||||||
Tests:
|
Tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version:
|
go-version:
|
||||||
- 1.14.x
|
- 1.14.x
|
||||||
- 1.15.x
|
- 1.16.x
|
||||||
- 1.16.x
|
- 1.19.x
|
||||||
- 1.17.x
|
platform:
|
||||||
platform:
|
- ubuntu-latest
|
||||||
- ubuntu-latest
|
- windows-latest
|
||||||
- windows-latest
|
steps:
|
||||||
steps:
|
- name: Install MinIO
|
||||||
- name: Install MinIO
|
run: |
|
||||||
run: |
|
docker run -d -p 9000:9000 --name minio minio/minio server /data
|
||||||
docker run -d -p 9000:9000 --name minio minio/minio server /data
|
|
||||||
|
|
||||||
export AWS_ACCESS_KEY_ID=minioadmin
|
export AWS_ACCESS_KEY_ID=minioadmin
|
||||||
export AWS_SECRET_ACCESS_KEY=minioadmin
|
export AWS_SECRET_ACCESS_KEY=minioadmin
|
||||||
export AWS_EC2_METADATA_DISABLED=true
|
export AWS_EC2_METADATA_DISABLED=true
|
||||||
|
|
||||||
aws --endpoint-url http://127.0.0.1:9000/ s3 mb s3://testbucket
|
aws --endpoint-url http://127.0.0.1:9000/ s3 mb s3://testbucket
|
||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v1
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: '${{ matrix.go-version }}'
|
go-version: '${{ matrix.go-version }}'
|
||||||
- name: Setup Golang caches
|
- name: Setup Golang caches
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
# In order:
|
# In order:
|
||||||
# * Module download cache
|
# * Module download cache
|
||||||
# * Build cache (Linux)
|
# * Build cache (Linux)
|
||||||
# * Build cache (Mac)
|
# * Build cache (Mac)
|
||||||
# * Build cache (Windows)
|
# * Build cache (Windows)
|
||||||
path: |
|
path: |
|
||||||
~/go/pkg/mod
|
~/go/pkg/mod
|
||||||
~/.cache/go-build
|
~/.cache/go-build
|
||||||
~/Library/Caches/go-build
|
~/Library/Caches/go-build
|
||||||
~\AppData\Local\go-build
|
~\AppData\Local\go-build
|
||||||
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
|
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-go-${{ matrix.go-version }}-
|
${{ runner.os }}-go-${{ matrix.go-version }}-
|
||||||
- name: Fetch Repository
|
- name: Fetch Repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
- name: Run Test
|
- name: Run Test
|
||||||
run: cd ./s3 && go test ./... -v -race
|
run: cd ./s3 && go test ./... -v -race
|
||||||
|
97
.github/workflows/test.yml
vendored
97
.github/workflows/test.yml
vendored
@@ -1,46 +1,53 @@
|
|||||||
'on':
|
on:
|
||||||
- push
|
push:
|
||||||
- pull_request
|
branches:
|
||||||
name: Local Storage
|
- master
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
name: "Tests Local Storage"
|
||||||
jobs:
|
jobs:
|
||||||
Tests:
|
Tests:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version:
|
go-version:
|
||||||
- 1.14.x
|
- 1.14.x
|
||||||
- 1.15.x
|
- 1.16.x
|
||||||
- 1.16.x
|
- 1.19.x
|
||||||
- 1.17.x
|
platform:
|
||||||
platform:
|
- ubuntu-latest
|
||||||
- ubuntu-latest
|
- windows-latest
|
||||||
- windows-latest
|
runs-on: '${{ matrix.platform }}'
|
||||||
runs-on: '${{ matrix.platform }}'
|
steps:
|
||||||
steps:
|
- name: Install Go
|
||||||
- name: Install Go
|
uses: actions/setup-go@v3
|
||||||
uses: actions/setup-go@v1
|
with:
|
||||||
with:
|
go-version: '${{ matrix.go-version }}'
|
||||||
go-version: '${{ matrix.go-version }}'
|
- name: Setup Golang caches
|
||||||
- name: Setup Golang caches
|
uses: actions/cache@v3
|
||||||
uses: actions/cache@v3
|
with:
|
||||||
with:
|
# In order:
|
||||||
# In order:
|
# * Module download cache
|
||||||
# * Module download cache
|
# * Build cache (Linux)
|
||||||
# * Build cache (Linux)
|
# * Build cache (Mac)
|
||||||
# * Build cache (Mac)
|
# * Build cache (Windows)
|
||||||
# * Build cache (Windows)
|
path: |
|
||||||
path: |
|
~/go/pkg/mod
|
||||||
~/go/pkg/mod
|
~/.cache/go-build
|
||||||
~/.cache/go-build
|
~/Library/Caches/go-build
|
||||||
~/Library/Caches/go-build
|
~\AppData\Local\go-build
|
||||||
~\AppData\Local\go-build
|
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
|
||||||
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
|
restore-keys: |
|
||||||
restore-keys: |
|
${{ runner.os }}-go-${{ matrix.go-version }}-
|
||||||
${{ runner.os }}-go-${{ matrix.go-version }}-
|
|
||||||
- name: Fetch Repository
|
- name: Fetch Repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
- name: Test Badger
|
- name: Test Badger
|
||||||
run: cd ./badger && go test ./... -v -race
|
run: cd ./badger && go test ./... -v -race
|
||||||
- name: Test Memory
|
- name: Test Memory
|
||||||
run: cd ./memory && go test ./... -v -race
|
run: cd ./memory && go test ./... -v -race
|
||||||
- name: Test SQLite3
|
- name: Test SQLite3 - with -race check
|
||||||
run: cd ./sqlite3 && go test ./... -v -race
|
if: runner.os != 'Windows'
|
||||||
|
run: cd ./sqlite3 && go test ./... -v -race
|
||||||
|
- name: Test SQLite3 - without -race check
|
||||||
|
if: runner.os == 'Windows'
|
||||||
|
run: cd ./sqlite3 && go test ./... -v
|
||||||
|
@@ -57,6 +57,9 @@ type Storage interface {
|
|||||||
* [Badger](/badger) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Local+Storage%22">
|
* [Badger](/badger) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Local+Storage%22">
|
||||||
<img src="https://img.shields.io/github/workflow/status/gofiber/storage/Local%20Storage?label=%F0%9F%A7%AA%20&style=flat&color=75C46B">
|
<img src="https://img.shields.io/github/workflow/status/gofiber/storage/Local%20Storage?label=%F0%9F%A7%AA%20&style=flat&color=75C46B">
|
||||||
</a>
|
</a>
|
||||||
|
* [Bbolt](/bbolt) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Bbolt%22">
|
||||||
|
<img src="https://img.shields.io/github/workflow/status/gofiber/storage/Bbolt?label=%F0%9F%A7%AA%20&style=flat&color=75C46B">
|
||||||
|
</a>
|
||||||
* [DynamoDB](/dynamodb) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22DynamoDB%22">
|
* [DynamoDB](/dynamodb) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22DynamoDB%22">
|
||||||
<img src="https://img.shields.io/github/workflow/status/gofiber/storage/DynamoDB?label=%F0%9F%A7%AA%20&style=flat&color=75C46B">
|
<img src="https://img.shields.io/github/workflow/status/gofiber/storage/DynamoDB?label=%F0%9F%A7%AA%20&style=flat&color=75C46B">
|
||||||
</a>
|
</a>
|
||||||
@@ -83,7 +86,4 @@ type Storage interface {
|
|||||||
</a>
|
</a>
|
||||||
* [S3](/s3) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22S3%22">
|
* [S3](/s3) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22S3%22">
|
||||||
<img src="https://img.shields.io/github/workflow/status/gofiber/storage/S3?label=%F0%9F%A7%AA%20&style=flat&color=75C46B">
|
<img src="https://img.shields.io/github/workflow/status/gofiber/storage/S3?label=%F0%9F%A7%AA%20&style=flat&color=75C46B">
|
||||||
</a>
|
|
||||||
* [Bbolt](/bbolt) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Bbolt%22">
|
|
||||||
<img src="https://img.shields.io/github/workflow/status/gofiber/storage/Bbolt?label=%F0%9F%A7%AA%20&style=flat&color=75C46B">
|
|
||||||
</a>
|
</a>
|
@@ -16,6 +16,7 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
|||||||
func (s *Storage) Delete(key string) error
|
func (s *Storage) Delete(key string) error
|
||||||
func (s *Storage) Reset() error
|
func (s *Storage) Reset() error
|
||||||
func (s *Storage) Close() error
|
func (s *Storage) Close() error
|
||||||
|
func (s *Storage) Conn() driver.Client
|
||||||
```
|
```
|
||||||
### Installation
|
### Installation
|
||||||
ArangoDB is tested on the 2 last (1.14/1.15) [Go versions](https://golang.org/dl/) with support for modules. So make sure to initialize one first if you didn't do that yet:
|
ArangoDB is tested on the 2 last (1.14/1.15) [Go versions](https://golang.org/dl/) with support for modules. So make sure to initialize one first if you didn't do that yet:
|
||||||
|
@@ -246,3 +246,8 @@ func (s *Storage) gc() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return database client
|
||||||
|
func (s *Storage) Conn() driver.Client {
|
||||||
|
return s.client
|
||||||
|
}
|
||||||
|
@@ -132,3 +132,7 @@ func Test_ARANGODB_Non_UTF8(t *testing.T) {
|
|||||||
func Test_ARANGODB_Close(t *testing.T) {
|
func Test_ARANGODB_Close(t *testing.T) {
|
||||||
utils.AssertEqual(t, nil, testStore.Close())
|
utils.AssertEqual(t, nil, testStore.Close())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Test_ARANGODB_Conn(t *testing.T) {
|
||||||
|
utils.AssertEqual(t, true, testStore.Conn() != nil)
|
||||||
|
}
|
||||||
|
@@ -19,6 +19,7 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
|||||||
func (s *Storage) Delete(key string) error
|
func (s *Storage) Delete(key string) error
|
||||||
func (s *Storage) Reset() error
|
func (s *Storage) Reset() error
|
||||||
func (s *Storage) Close() error
|
func (s *Storage) Close() error
|
||||||
|
func (s *Storage) Conn() *badger.DB
|
||||||
```
|
```
|
||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
|
@@ -123,3 +123,8 @@ func (s *Storage) gc() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return database client
|
||||||
|
func (s *Storage) Conn() *badger.DB {
|
||||||
|
return s.db
|
||||||
|
}
|
||||||
|
@@ -119,3 +119,7 @@ func Test_Badger_Reset(t *testing.T) {
|
|||||||
func Test_Badger_Close(t *testing.T) {
|
func Test_Badger_Close(t *testing.T) {
|
||||||
utils.AssertEqual(t, nil, testStore.Close())
|
utils.AssertEqual(t, nil, testStore.Close())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Test_Badger_Conn(t *testing.T) {
|
||||||
|
utils.AssertEqual(t, true, testStore.Conn() != nil)
|
||||||
|
}
|
@@ -17,6 +17,7 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
|||||||
func (s *Storage) Delete(key string) error
|
func (s *Storage) Delete(key string) error
|
||||||
func (s *Storage) Reset() error
|
func (s *Storage) Reset() error
|
||||||
func (s *Storage) Close() error
|
func (s *Storage) Close() error
|
||||||
|
func (s *Storage) Conn() *bbolt.DB
|
||||||
```
|
```
|
||||||
### Installation
|
### 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:
|
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:
|
||||||
|
@@ -104,3 +104,8 @@ func (s *Storage) Reset() error {
|
|||||||
func (s *Storage) Close() error {
|
func (s *Storage) Close() error {
|
||||||
return s.conn.Close()
|
return s.conn.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return database client
|
||||||
|
func (s *Storage) Conn() *bbolt.DB {
|
||||||
|
return s.conn
|
||||||
|
}
|
||||||
|
@@ -95,3 +95,7 @@ func Test_Bbolt_Reset(t *testing.T) {
|
|||||||
func Test_Bbolt_Close(t *testing.T) {
|
func Test_Bbolt_Close(t *testing.T) {
|
||||||
utils.AssertEqual(t, nil, testStore.Close())
|
utils.AssertEqual(t, nil, testStore.Close())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Test_Bbolt_Conn(t *testing.T) {
|
||||||
|
utils.AssertEqual(t, true, testStore.Conn() != nil)
|
||||||
|
}
|
||||||
|
@@ -23,6 +23,7 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
|||||||
func (s *Storage) Delete(key string) error
|
func (s *Storage) Delete(key string) error
|
||||||
func (s *Storage) Reset() error
|
func (s *Storage) Reset() error
|
||||||
func (s *Storage) Close() error
|
func (s *Storage) Close() error
|
||||||
|
func (s *Storage) Conn() *awsdynamodb.Client
|
||||||
```
|
```
|
||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
|
@@ -264,3 +264,8 @@ func returnAWSConfig(cfg Config) (aws.Config, error) {
|
|||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return database client
|
||||||
|
func (s *Storage) Conn() *awsdynamodb.Client {
|
||||||
|
return s.db
|
||||||
|
}
|
||||||
|
@@ -105,3 +105,7 @@ func Test_DynamoDB_Reset(t *testing.T) {
|
|||||||
func Test_DynamoDB_Close(t *testing.T) {
|
func Test_DynamoDB_Close(t *testing.T) {
|
||||||
utils.AssertEqual(t, nil, testStore.Close())
|
utils.AssertEqual(t, nil, testStore.Close())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Test_DynamoDB_Conn(t *testing.T) {
|
||||||
|
utils.AssertEqual(t, true, testStore.Conn() != nil)
|
||||||
|
}
|
||||||
|
@@ -3,10 +3,10 @@ module github.com/gofiber/storage/dynamodb
|
|||||||
go 1.14
|
go 1.14
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/aws/aws-sdk-go-v2 v1.16.8
|
github.com/aws/aws-sdk-go-v2 v1.16.16
|
||||||
github.com/aws/aws-sdk-go-v2/config v1.15.15
|
github.com/aws/aws-sdk-go-v2/config v1.17.8
|
||||||
github.com/aws/aws-sdk-go-v2/credentials v1.12.10
|
github.com/aws/aws-sdk-go-v2/credentials v1.12.21
|
||||||
github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.9.8
|
github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.10.0
|
||||||
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.15.10
|
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.17.1
|
||||||
github.com/gofiber/utils v0.1.2
|
github.com/gofiber/utils v0.1.2
|
||||||
)
|
)
|
||||||
|
@@ -1,35 +1,37 @@
|
|||||||
github.com/aws/aws-sdk-go-v2 v1.16.8 h1:gOe9UPR98XSf7oEJCcojYg+N2/jCRm4DdeIsP85pIyQ=
|
github.com/aws/aws-sdk-go-v2 v1.16.16 h1:M1fj4FE2lB4NzRb9Y0xdWsn2P0+2UHVxwKyOa4YJNjk=
|
||||||
github.com/aws/aws-sdk-go-v2 v1.16.8/go.mod h1:6CpKuLXg2w7If3ABZCl/qZ6rEgwtjZTn4eAf4RcEyuw=
|
github.com/aws/aws-sdk-go-v2 v1.16.16/go.mod h1:SwiyXi/1zTUZ6KIAmLK5V5ll8SiURNUYOqTerZPaF9k=
|
||||||
github.com/aws/aws-sdk-go-v2/config v1.15.15 h1:yBV+J7Au5KZwOIrIYhYkTGJbifZPCkAnCFSvGsF3ui8=
|
github.com/aws/aws-sdk-go-v2/config v1.17.8 h1:b9LGqNnOdg9vR4Q43tBTVWk4J6F+W774MSchvKJsqnE=
|
||||||
github.com/aws/aws-sdk-go-v2/config v1.15.15/go.mod h1:A1Lzyy/o21I5/s2FbyX5AevQfSVXpvvIDCoVFD0BC4E=
|
github.com/aws/aws-sdk-go-v2/config v1.17.8/go.mod h1:UkCI3kb0sCdvtjiXYiU4Zx5h07BOpgBTtkPu/49r+kA=
|
||||||
github.com/aws/aws-sdk-go-v2/credentials v1.12.10 h1:7gGcMQePejwiKoDWjB9cWnpfVdnz/e5JwJFuT6OrroI=
|
github.com/aws/aws-sdk-go-v2/credentials v1.12.21 h1:4tjlyCD0hRGNQivh5dN8hbP30qQhMLBE/FgQR1vHHWM=
|
||||||
github.com/aws/aws-sdk-go-v2/credentials v1.12.10/go.mod h1:g5eIM5XRs/OzIIK81QMBl+dAuDyoLN0VYaLP+tBqEOk=
|
github.com/aws/aws-sdk-go-v2/credentials v1.12.21/go.mod h1:O+4XyAt4e+oBAoIwNUYkRg3CVMscaIJdmZBOcPgJ8D8=
|
||||||
github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.9.8 h1:0ip7KxkhaxsDsxOGHl8/6PRzuvkBnNCKQQNXCrmBRA4=
|
github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.10.0 h1:bKbdstt7+PzIRSIXZ11Yo8Qh8t0AHn6jEYUfsbVcLjE=
|
||||||
github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.9.8/go.mod h1:gYOUOID0SE7Sc7b/5TocldT6Veh7Hftd0RgszK0B9kg=
|
github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.10.0/go.mod h1:+CBJZMhsb1pTUcB/NTdS505bDX10xS4xnPMqDZj2Ptw=
|
||||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.9 h1:hz8tc+OW17YqxyFFPSkvfSikbqWcyyHRyPVSTzC0+aI=
|
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.17 h1:r08j4sbZu/RVi+BNxkBJwPMUYY3P8mgSDuKkZ/ZN1lE=
|
||||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.9/go.mod h1:KDCCm4ONIdHtUloDcFvK2+vshZvx4Zmj7UMDfusuz5s=
|
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.17/go.mod h1:yIkQcCDYNsZfXpd5UX2Cy+sWA1jPgIhGTw9cOBzfVnQ=
|
||||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.15 h1:bx5F2mr6H6FC7zNIQoDoUr8wEKnvmwRncujT3FYRtic=
|
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.23 h1:s4g/wnzMf+qepSNgTvaQQHNxyMLKSawNhKCPNy++2xY=
|
||||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.15/go.mod h1:pWrr2OoHlT7M/Pd2y4HV3gJyPb3qj5qMmnPkKSNPYK4=
|
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.23/go.mod h1:2DFxAQ9pfIRy0imBCJv+vZ2X6RKxves6fbnEuSry6b4=
|
||||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.9 h1:5sbyznZC2TeFpa4fvtpvpcGbzeXEEs1l1Jo51ynUNsQ=
|
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.17 h1:/K482T5A3623WJgWT8w1yRAFK4RzGzEl7y39yhtn9eA=
|
||||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.9/go.mod h1:08tUpeSGN33QKSO7fwxXczNfiwCpbj+GxK6XKwqWVv0=
|
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.17/go.mod h1:pRwaTYCJemADaqCbUAxltMoHKata7hmB5PjEXeu0kfg=
|
||||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.16 h1:f0ySVcmQhwmzn7zQozd8wBM3yuGBfzdpsOaKQ0/Epzw=
|
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.24 h1:wj5Rwc05hvUSvKuOF29IYb9QrCLjU+rHAy/x/o0DK2c=
|
||||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.16/go.mod h1:CYmI+7x03jjJih8kBEEFKRQc40UjUokT0k7GbvrhhTc=
|
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.24/go.mod h1:jULHjqqjDlbyTa7pfM7WICATnOv+iOhjletM3N0Xbu8=
|
||||||
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.15.10 h1:GLklbtMUQCToju09LyT+AjbwTQ0KCQudNLTA0H2xbBk=
|
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.17.1 h1:1QpTkQIAaZpR387it1L+erjB5bStGFCJRvmXsodpPEU=
|
||||||
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.15.10/go.mod h1:zM5dQf0mZfcW4s8OsJFXvzedbY5n1rO581X4xei6XcA=
|
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.17.1/go.mod h1:BZhn/C3z13ULTSstVi2Kymc62bgjFh/JwLO9Tm2OFYI=
|
||||||
github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.13.11 h1:ZhmeOIq1SIn2QRYbVX1RC+k2+V3o/Cb6Rb8l4NNs8sA=
|
github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.13.20 h1:V9q4A0qnUfDsfivspY1LQRQTOG3Y9FLHvXIaTbcU7XM=
|
||||||
github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.13.11/go.mod h1:SfaTqHKnCntSSFP9xjozom2kJVhNF4s9cxWdmMoc8Bo=
|
github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.13.20/go.mod h1:7qWU48SMzlrfOlNhHpazW3psFWlOIWrq4SmOr2/ESmk=
|
||||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.3 h1:4n4KCtv5SUoT5Er5XV41huuzrCqepxlW3SDI9qHQebc=
|
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.9 h1:Lh1AShsuIJTwMkoxVCAYPJgNG5H+eN6SmoUn8nOZ5wE=
|
||||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.3/go.mod h1:gkb2qADY+OHaGLKNTYxMaQNacfeyQpZ4csDTQMeFmcw=
|
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.9/go.mod h1:a9j48l6yL5XINLHLcOKInjdvknN+vWqPBxqeIDw7ktw=
|
||||||
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.7.9 h1:COsLtfmOSgPGnKUreE99/5pIgtmGLzmLtVrQa12QzU4=
|
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.7.17 h1:o0Ia3nb56m8+8NvhbCDiSBiZRNUwIknVWobx5vks0Vk=
|
||||||
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.7.9/go.mod h1:IixPDVckNk0HhYDQwUmTonTAfQlfABg9E72whAbq5k0=
|
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.7.17/go.mod h1:WJD9FbkwzM2a1bZ36ntH6+5Jc+x41Q4K2AcLeHDLAS8=
|
||||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.9 h1:sHfDuhbOuuWSIAEDd3pma6p0JgUcR2iePxtCE8gfCxQ=
|
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.17 h1:Jrd/oMh0PKQc6+BowB+pLEwLIgaQF29eYbe7E1Av9Ug=
|
||||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.9/go.mod h1:yQowTpvdZkFVuHrLBXmczat4W+WJKg/PafBZnGBLga0=
|
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.17/go.mod h1:4nYOrY41Lrbk2170/BGkcJKBhws9Pfn8MG3aGqjjeFI=
|
||||||
github.com/aws/aws-sdk-go-v2/service/sso v1.11.13 h1:DQpf+al+aWozOEmVEdml67qkVZ6vdtGUi71BZZWw40k=
|
github.com/aws/aws-sdk-go-v2/service/sso v1.11.23 h1:pwvCchFUEnlceKIgPUouBJwK81aCkQ8UDMORfeFtW10=
|
||||||
github.com/aws/aws-sdk-go-v2/service/sso v1.11.13/go.mod h1:d7ptRksDDgvXaUvxyHZ9SYh+iMDymm94JbVcgvSYSzU=
|
github.com/aws/aws-sdk-go-v2/service/sso v1.11.23/go.mod h1:/w0eg9IhFGjGyyncHIQrXtU8wvNsTJOP0R6PPj0wf80=
|
||||||
github.com/aws/aws-sdk-go-v2/service/sts v1.16.10 h1:7tquJrhjYz2EsCBvA9VTl+sBAAh1bv7h/sGASdZOGGo=
|
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.6 h1:OwhhKc1P9ElfWbMKPIbMMZBV6hzJlL2JKD76wNNVzgQ=
|
||||||
github.com/aws/aws-sdk-go-v2/service/sts v1.16.10/go.mod h1:cftkHYN6tCDNfkSasAmclSfl4l7cySoay8vz7p/ce0E=
|
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.6/go.mod h1:csZuQY65DAdFBt1oIjO5hhBR49kQqop4+lcuCjf2arA=
|
||||||
github.com/aws/smithy-go v1.12.0 h1:gXpeZel/jPoWQ7OEmLIgCUnhkFftqNfwWUwAHSlp1v0=
|
github.com/aws/aws-sdk-go-v2/service/sts v1.16.19 h1:9pPi0PsFNAGILFfPCk8Y0iyEBGc6lu6OQ97U7hmdesg=
|
||||||
github.com/aws/smithy-go v1.12.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=
|
github.com/aws/aws-sdk-go-v2/service/sts v1.16.19/go.mod h1:h4J3oPZQbxLhzGnk+j9dfYHi5qIOVJ5kczZd658/ydM=
|
||||||
|
github.com/aws/smithy-go v1.13.3 h1:l7LYxGuzK6/K+NzJ2mC+VvLUbae0sL3bXU//04MkmnA=
|
||||||
|
github.com/aws/smithy-go v1.13.3/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=
|
||||||
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
|
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/gofiber/utils v0.1.2 h1:1SH2YEz4RlNS0tJlMJ0bGwO0JkqPqvq6TbHK9tXZKtk=
|
github.com/gofiber/utils v0.1.2 h1:1SH2YEz4RlNS0tJlMJ0bGwO0JkqPqvq6TbHK9tXZKtk=
|
||||||
|
2
go.mod
2
go.mod
@@ -1,3 +1,3 @@
|
|||||||
module github.com/gofiber/storage
|
module github.com/gofiber/storage
|
||||||
|
|
||||||
go 1.14
|
go 1.14
|
||||||
|
@@ -17,6 +17,7 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
|||||||
func (s *Storage) Delete(key string) error
|
func (s *Storage) Delete(key string) error
|
||||||
func (s *Storage) Reset() error
|
func (s *Storage) Reset() error
|
||||||
func (s *Storage) Close() error
|
func (s *Storage) Close() error
|
||||||
|
func (s *Storage) Conn() *mc.Client
|
||||||
```
|
```
|
||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
|
@@ -122,3 +122,8 @@ func (s *Storage) releaseItem(item *mc.Item) {
|
|||||||
s.items.Put(item)
|
s.items.Put(item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return database client
|
||||||
|
func (s *Storage) Conn() *mc.Client {
|
||||||
|
return s.db
|
||||||
|
}
|
||||||
|
@@ -119,3 +119,7 @@ func Test_Memcache_Reset(t *testing.T) {
|
|||||||
func Test_Memcache_Close(t *testing.T) {
|
func Test_Memcache_Close(t *testing.T) {
|
||||||
utils.AssertEqual(t, nil, testStore.Close())
|
utils.AssertEqual(t, nil, testStore.Close())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Test_Memcache_Conn(t *testing.T) {
|
||||||
|
utils.AssertEqual(t, true, testStore.Conn() != nil)
|
||||||
|
}
|
||||||
|
@@ -18,6 +18,7 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
|||||||
func (s *Storage) Delete(key string) error
|
func (s *Storage) Delete(key string) error
|
||||||
func (s *Storage) Reset() error
|
func (s *Storage) Reset() error
|
||||||
func (s *Storage) Close() error
|
func (s *Storage) Close() error
|
||||||
|
func (s *Storage) Conn() map[string]entry
|
||||||
```
|
```
|
||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
|
@@ -116,3 +116,8 @@ func (s *Storage) gc() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return database client
|
||||||
|
func (s *Storage) Conn() map[string]entry {
|
||||||
|
return s.db
|
||||||
|
}
|
||||||
|
@@ -119,3 +119,7 @@ func Test_Memory_Reset(t *testing.T) {
|
|||||||
func Test_Memory_Close(t *testing.T) {
|
func Test_Memory_Close(t *testing.T) {
|
||||||
utils.AssertEqual(t, nil, testStore.Close())
|
utils.AssertEqual(t, nil, testStore.Close())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Test_Memory_Conn(t *testing.T) {
|
||||||
|
utils.AssertEqual(t, true, testStore.Conn() != nil)
|
||||||
|
}
|
@@ -17,6 +17,7 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
|||||||
func (s *Storage) Delete(key string) error
|
func (s *Storage) Delete(key string) error
|
||||||
func (s *Storage) Reset() error
|
func (s *Storage) Reset() error
|
||||||
func (s *Storage) Close() error
|
func (s *Storage) Close() error
|
||||||
|
func (s *Storage) Conn() *mongo.Database
|
||||||
```
|
```
|
||||||
### Installation
|
### Installation
|
||||||
MongoDB 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:
|
MongoDB 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:
|
||||||
|
@@ -6,5 +6,5 @@ require (
|
|||||||
github.com/gofiber/utils v0.1.2
|
github.com/gofiber/utils v0.1.2
|
||||||
github.com/golang/snappy v0.0.4 // indirect
|
github.com/golang/snappy v0.0.4 // indirect
|
||||||
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect
|
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect
|
||||||
go.mongodb.org/mongo-driver v1.10.1
|
go.mongodb.org/mongo-driver v1.10.2
|
||||||
)
|
)
|
||||||
|
@@ -35,8 +35,8 @@ github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgk
|
|||||||
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA=
|
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA=
|
||||||
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a h1:fZHgsYlfvtyqToslyjUt3VOPF4J7aK/3MPcK7xp3PDk=
|
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a h1:fZHgsYlfvtyqToslyjUt3VOPF4J7aK/3MPcK7xp3PDk=
|
||||||
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a/go.mod h1:ul22v+Nro/R083muKhosV54bj5niojjWZvU8xrevuH4=
|
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a/go.mod h1:ul22v+Nro/R083muKhosV54bj5niojjWZvU8xrevuH4=
|
||||||
go.mongodb.org/mongo-driver v1.10.1 h1:NujsPveKwHaWuKUer/ceo9DzEe7HIj1SlJ6uvXZG0S4=
|
go.mongodb.org/mongo-driver v1.10.2 h1:4Wk3cnqOrQCn0P92L3/mmurMxzdvWWs5J9jinAVKD+k=
|
||||||
go.mongodb.org/mongo-driver v1.10.1/go.mod h1:z4XpeoU6w+9Vht+jAFyLgVrD+jGSQQe0+CBWFHNiHt8=
|
go.mongodb.org/mongo-driver v1.10.2/go.mod h1:z4XpeoU6w+9Vht+jAFyLgVrD+jGSQQe0+CBWFHNiHt8=
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||||
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d h1:sK3txAijHtOK88l68nt020reeT1ZdKLIYetKl95FzVY=
|
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d h1:sK3txAijHtOK88l68nt020reeT1ZdKLIYetKl95FzVY=
|
||||||
|
@@ -199,3 +199,8 @@ func (s *Storage) releaseItem(item *item) {
|
|||||||
s.items.Put(item)
|
s.items.Put(item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return database client
|
||||||
|
func (s *Storage) Conn() *mongo.Database {
|
||||||
|
return s.db
|
||||||
|
}
|
||||||
|
@@ -121,3 +121,7 @@ func Test_MongoDB_Reset(t *testing.T) {
|
|||||||
func Test_MongoDB_Close(t *testing.T) {
|
func Test_MongoDB_Close(t *testing.T) {
|
||||||
utils.AssertEqual(t, nil, testStore.Close())
|
utils.AssertEqual(t, nil, testStore.Close())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Test_MongoDB_Conn(t *testing.T) {
|
||||||
|
utils.AssertEqual(t, true, testStore.Conn() != nil)
|
||||||
|
}
|
||||||
|
@@ -17,6 +17,7 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
|||||||
func (s *Storage) Delete(key string) error
|
func (s *Storage) Delete(key string) error
|
||||||
func (s *Storage) Reset() error
|
func (s *Storage) Reset() error
|
||||||
func (s *Storage) Close() error
|
func (s *Storage) Close() error
|
||||||
|
func (s *Storage) Conn() *sql.DB
|
||||||
```
|
```
|
||||||
### Installation
|
### Installation
|
||||||
MySQL 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:
|
MySQL 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:
|
||||||
@@ -48,11 +49,23 @@ store := mysql.New(mysql.Config{
|
|||||||
Reset: false,
|
Reset: false,
|
||||||
GCInterval: 10 * time.Second,
|
GCInterval: 10 * time.Second,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Initialize custom config using connection string
|
||||||
|
store := postgres.New(postgres.Config{
|
||||||
|
ConnectionURI: "mysql://user:password@localhost:3306/fiber"
|
||||||
|
Reset: false,
|
||||||
|
GCInterval: 10 * time.Second,
|
||||||
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
### Config
|
### Config
|
||||||
```go
|
```go
|
||||||
type Config struct {
|
type Config struct {
|
||||||
|
// Connection string to use for DB. Will override all other authentication values if used
|
||||||
|
//
|
||||||
|
// Optional. Default is ""
|
||||||
|
ConnectionURI string
|
||||||
|
|
||||||
// Host name where the DB is hosted
|
// Host name where the DB is hosted
|
||||||
//
|
//
|
||||||
// Optional. Default is "127.0.0.1"
|
// Optional. Default is "127.0.0.1"
|
||||||
@@ -98,6 +111,7 @@ type Config struct {
|
|||||||
### Default Config
|
### Default Config
|
||||||
```go
|
```go
|
||||||
var ConfigDefault = Config{
|
var ConfigDefault = Config{
|
||||||
|
ConnectionURI: "",
|
||||||
Host: "127.0.0.1",
|
Host: "127.0.0.1",
|
||||||
Port: 3306,
|
Port: 3306,
|
||||||
Database: "fiber",
|
Database: "fiber",
|
||||||
|
@@ -7,6 +7,11 @@ import (
|
|||||||
|
|
||||||
// Config defines the config for storage.
|
// Config defines the config for storage.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
|
// Connection string to use for DB. Will override all other authentication values if used
|
||||||
|
//
|
||||||
|
// Optional. Default is ""
|
||||||
|
ConnectionURI string
|
||||||
|
|
||||||
// Host name where the DB is hosted
|
// Host name where the DB is hosted
|
||||||
//
|
//
|
||||||
// Optional. Default is "127.0.0.1"
|
// Optional. Default is "127.0.0.1"
|
||||||
@@ -58,6 +63,7 @@ type Config struct {
|
|||||||
|
|
||||||
// ConfigDefault is the default config
|
// ConfigDefault is the default config
|
||||||
var ConfigDefault = Config{
|
var ConfigDefault = Config{
|
||||||
|
ConnectionURI: "",
|
||||||
Host: "127.0.0.1",
|
Host: "127.0.0.1",
|
||||||
Port: 3306,
|
Port: 3306,
|
||||||
Database: "fiber",
|
Database: "fiber",
|
||||||
@@ -70,6 +76,9 @@ var ConfigDefault = Config{
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c Config) dsn() string {
|
func (c Config) dsn() string {
|
||||||
|
if c.ConnectionURI != "" {
|
||||||
|
return c.ConnectionURI
|
||||||
|
}
|
||||||
return fmt.Sprintf("%s:%s@tcp(%s:%d)/%s", c.Username, c.Password, c.Host, c.Port, c.Database)
|
return fmt.Sprintf("%s:%s@tcp(%s:%d)/%s", c.Username, c.Password, c.Host, c.Port, c.Database)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -165,6 +165,11 @@ func (s *Storage) Close() error {
|
|||||||
return s.db.Close()
|
return s.db.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return database client
|
||||||
|
func (s *Storage) Conn() *sql.DB {
|
||||||
|
return s.db
|
||||||
|
}
|
||||||
|
|
||||||
// gcTicker starts the gc ticker
|
// gcTicker starts the gc ticker
|
||||||
func (s *Storage) gcTicker() {
|
func (s *Storage) gcTicker() {
|
||||||
ticker := time.NewTicker(s.gcInterval)
|
ticker := time.NewTicker(s.gcInterval)
|
||||||
|
@@ -162,3 +162,7 @@ func Test_MYSQL_Non_UTF8(t *testing.T) {
|
|||||||
func Test_MYSQL_Close(t *testing.T) {
|
func Test_MYSQL_Close(t *testing.T) {
|
||||||
utils.AssertEqual(t, nil, testStore.Close())
|
utils.AssertEqual(t, nil, testStore.Close())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Test_MYSQL_Conn(t *testing.T) {
|
||||||
|
utils.AssertEqual(t, true, testStore.Conn() != nil)
|
||||||
|
}
|
||||||
|
@@ -17,6 +17,7 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
|||||||
func (s *Storage) Delete(key string) error
|
func (s *Storage) Delete(key string) error
|
||||||
func (s *Storage) Reset() error
|
func (s *Storage) Reset() error
|
||||||
func (s *Storage) Close() error
|
func (s *Storage) Close() error
|
||||||
|
func (s *Storage) Conn() *sql.DB
|
||||||
```
|
```
|
||||||
### Installation
|
### Installation
|
||||||
Postgres 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:
|
Postgres 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:
|
||||||
@@ -49,12 +50,24 @@ store := postgres.New(postgres.Config{
|
|||||||
GCInterval: 10 * time.Second,
|
GCInterval: 10 * time.Second,
|
||||||
SslMode: "disable",
|
SslMode: "disable",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Initialize custom config using connection string
|
||||||
|
store := postgres.New(postgres.Config{
|
||||||
|
ConnectionURI: "postgresql://user:password@localhost:5432/fiber"
|
||||||
|
Reset: false,
|
||||||
|
GCInterval: 10 * time.Second,
|
||||||
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
### Config
|
### Config
|
||||||
```go
|
```go
|
||||||
// Config defines the config for storage.
|
// Config defines the config for storage.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
|
// Connection string to use for DB. Will override all other authentication values if used
|
||||||
|
//
|
||||||
|
// Optional. Default is ""
|
||||||
|
ConnectionURI string
|
||||||
|
|
||||||
// Host name where the DB is hosted
|
// Host name where the DB is hosted
|
||||||
//
|
//
|
||||||
// Optional. Default is "127.0.0.1"
|
// Optional. Default is "127.0.0.1"
|
||||||
@@ -105,6 +118,7 @@ type Config struct {
|
|||||||
### Default Config
|
### Default Config
|
||||||
```go
|
```go
|
||||||
var ConfigDefault = Config{
|
var ConfigDefault = Config{
|
||||||
|
ConnectionURI: "",
|
||||||
Host: "127.0.0.1",
|
Host: "127.0.0.1",
|
||||||
Port: 5432,
|
Port: 5432,
|
||||||
Database: "fiber",
|
Database: "fiber",
|
||||||
|
@@ -6,6 +6,11 @@ import (
|
|||||||
|
|
||||||
// Config defines the config for storage.
|
// Config defines the config for storage.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
|
// Connection string to use for DB. Will override all other authentication values if used
|
||||||
|
//
|
||||||
|
// Optional. Default is ""
|
||||||
|
ConnectionURI string
|
||||||
|
|
||||||
// Host name where the DB is hosted
|
// Host name where the DB is hosted
|
||||||
//
|
//
|
||||||
// Optional. Default is "127.0.0.1"
|
// Optional. Default is "127.0.0.1"
|
||||||
@@ -90,6 +95,7 @@ type Config struct {
|
|||||||
|
|
||||||
// ConfigDefault is the default config
|
// ConfigDefault is the default config
|
||||||
var ConfigDefault = Config{
|
var ConfigDefault = Config{
|
||||||
|
ConnectionURI: "",
|
||||||
Host: "127.0.0.1",
|
Host: "127.0.0.1",
|
||||||
Port: 5432,
|
Port: 5432,
|
||||||
Database: "fiber",
|
Database: "fiber",
|
||||||
|
@@ -4,5 +4,5 @@ go 1.14
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/gofiber/utils v0.1.2
|
github.com/gofiber/utils v0.1.2
|
||||||
github.com/lib/pq v1.10.6
|
github.com/lib/pq v1.10.7
|
||||||
)
|
)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
github.com/gofiber/utils v0.1.2 h1:1SH2YEz4RlNS0tJlMJ0bGwO0JkqPqvq6TbHK9tXZKtk=
|
github.com/gofiber/utils v0.1.2 h1:1SH2YEz4RlNS0tJlMJ0bGwO0JkqPqvq6TbHK9tXZKtk=
|
||||||
github.com/gofiber/utils v0.1.2/go.mod h1:pacRFtghAE3UoknMOUiXh2Io/nLWSUHtQCi/3QASsOc=
|
github.com/gofiber/utils v0.1.2/go.mod h1:pacRFtghAE3UoknMOUiXh2Io/nLWSUHtQCi/3QASsOc=
|
||||||
github.com/lib/pq v1.10.6 h1:jbk+ZieJ0D7EVGJYpL9QTz7/YW6UHbmdnZWYyK5cdBs=
|
github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw=
|
||||||
github.com/lib/pq v1.10.6/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||||
|
@@ -46,26 +46,31 @@ func New(config ...Config) *Storage {
|
|||||||
cfg := configDefault(config...)
|
cfg := configDefault(config...)
|
||||||
|
|
||||||
// Create data source name
|
// Create data source name
|
||||||
var dsn string = "postgresql://"
|
var dsn string
|
||||||
if cfg.Username != "" {
|
if cfg.ConnectionURI != "" {
|
||||||
dsn += url.QueryEscape(cfg.Username)
|
dsn = cfg.ConnectionURI
|
||||||
}
|
|
||||||
if cfg.Password != "" {
|
|
||||||
dsn += ":" + cfg.Password
|
|
||||||
}
|
|
||||||
if cfg.Username != "" || cfg.Password != "" {
|
|
||||||
dsn += "@"
|
|
||||||
}
|
|
||||||
// unix socket host path
|
|
||||||
if strings.HasPrefix(cfg.Host, "/") {
|
|
||||||
dsn += fmt.Sprintf("%s:%d", cfg.Host, cfg.Port)
|
|
||||||
} else {
|
} else {
|
||||||
dsn += fmt.Sprintf("%s:%d", url.QueryEscape(cfg.Host), cfg.Port)
|
dsn = "postgresql://"
|
||||||
|
if cfg.Username != "" {
|
||||||
|
dsn += url.QueryEscape(cfg.Username)
|
||||||
|
}
|
||||||
|
if cfg.Password != "" {
|
||||||
|
dsn += ":" + cfg.Password
|
||||||
|
}
|
||||||
|
if cfg.Username != "" || cfg.Password != "" {
|
||||||
|
dsn += "@"
|
||||||
|
}
|
||||||
|
// unix socket host path
|
||||||
|
if strings.HasPrefix(cfg.Host, "/") {
|
||||||
|
dsn += fmt.Sprintf("%s:%d", cfg.Host, cfg.Port)
|
||||||
|
} else {
|
||||||
|
dsn += fmt.Sprintf("%s:%d", url.QueryEscape(cfg.Host), cfg.Port)
|
||||||
|
}
|
||||||
|
dsn += fmt.Sprintf("/%s?connect_timeout=%d&sslmode=%s",
|
||||||
|
url.QueryEscape(cfg.Database),
|
||||||
|
int64(cfg.timeout.Seconds()),
|
||||||
|
cfg.SslMode)
|
||||||
}
|
}
|
||||||
dsn += fmt.Sprintf("/%s?connect_timeout=%d&sslmode=%s",
|
|
||||||
url.QueryEscape(cfg.Database),
|
|
||||||
int64(cfg.timeout.Seconds()),
|
|
||||||
cfg.SslMode)
|
|
||||||
|
|
||||||
// Create db
|
// Create db
|
||||||
db, err := sql.Open("postgres", dsn)
|
db, err := sql.Open("postgres", dsn)
|
||||||
@@ -184,6 +189,11 @@ func (s *Storage) Close() error {
|
|||||||
return s.db.Close()
|
return s.db.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return database client
|
||||||
|
func (s *Storage) Conn() *sql.DB {
|
||||||
|
return s.db
|
||||||
|
}
|
||||||
|
|
||||||
// gcTicker starts the gc ticker
|
// gcTicker starts the gc ticker
|
||||||
func (s *Storage) gcTicker() {
|
func (s *Storage) gcTicker() {
|
||||||
ticker := time.NewTicker(s.gcInterval)
|
ticker := time.NewTicker(s.gcInterval)
|
||||||
|
@@ -177,3 +177,7 @@ func Test_SslRequiredMode(t *testing.T) {
|
|||||||
func Test_Postgres_Close(t *testing.T) {
|
func Test_Postgres_Close(t *testing.T) {
|
||||||
utils.AssertEqual(t, nil, testStore.Close())
|
utils.AssertEqual(t, nil, testStore.Close())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Test_Postgres_Conn(t *testing.T) {
|
||||||
|
utils.AssertEqual(t, true, testStore.Conn() != nil)
|
||||||
|
}
|
||||||
|
@@ -17,6 +17,7 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
|||||||
func (s *Storage) Delete(key string) error
|
func (s *Storage) Delete(key string) error
|
||||||
func (s *Storage) Reset() error
|
func (s *Storage) Reset() error
|
||||||
func (s *Storage) Close() error
|
func (s *Storage) Close() error
|
||||||
|
func (s *Storage) Conn() *redis.Client
|
||||||
```
|
```
|
||||||
### Installation
|
### Installation
|
||||||
Redis 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:
|
Redis 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:
|
||||||
@@ -86,11 +87,11 @@ type Config struct {
|
|||||||
// Optional. Default is 0
|
// Optional. Default is 0
|
||||||
Database int
|
Database int
|
||||||
|
|
||||||
// URL the standard format redis url to parse all other options. If this is set all other config options, Host, Port, Username, Password, Database have no effect.
|
// URL the standard format redis url to parse all other options. If this is set all other config options, Host, Port, Username, Password, Database have no effect.
|
||||||
//
|
//
|
||||||
// Example: redis://<user>:<pass>@localhost:6379/<db>
|
// Example: redis://<user>:<pass>@localhost:6379/<db>
|
||||||
// Optional. Default is ""
|
// Optional. Default is ""
|
||||||
URL string
|
URL string
|
||||||
|
|
||||||
// Reset clears any existing keys in existing Collection
|
// Reset clears any existing keys in existing Collection
|
||||||
//
|
//
|
||||||
|
@@ -99,3 +99,8 @@ func (s *Storage) Reset() error {
|
|||||||
func (s *Storage) Close() error {
|
func (s *Storage) Close() error {
|
||||||
return s.db.Close()
|
return s.db.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return database client
|
||||||
|
func (s *Storage) Conn() *redis.Client {
|
||||||
|
return s.db
|
||||||
|
}
|
||||||
|
@@ -123,6 +123,10 @@ func Test_Redis_Close(t *testing.T) {
|
|||||||
utils.AssertEqual(t, nil, testStore.Close())
|
utils.AssertEqual(t, nil, testStore.Close())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Test_Redis_Conn(t *testing.T) {
|
||||||
|
utils.AssertEqual(t, true, testStore.Conn() != nil)
|
||||||
|
}
|
||||||
|
|
||||||
func Test_Redis_Initalize_WithURL(t *testing.T) {
|
func Test_Redis_Initalize_WithURL(t *testing.T) {
|
||||||
testStoreUrl := New(Config{
|
testStoreUrl := New(Config{
|
||||||
URL: "redis://localhost:6379",
|
URL: "redis://localhost:6379",
|
||||||
|
@@ -18,6 +18,7 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
|||||||
func (s *Storage) Delete(key string) error
|
func (s *Storage) Delete(key string) error
|
||||||
func (s *Storage) Reset() error
|
func (s *Storage) Reset() error
|
||||||
func (s *Storage) Close() error
|
func (s *Storage) Close() error
|
||||||
|
func (s *Storage) Conn() *ristretto.Cache
|
||||||
```
|
```
|
||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
|
@@ -89,3 +89,8 @@ func (s *Storage) Close() error {
|
|||||||
s.cache.Close()
|
s.cache.Close()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return database client
|
||||||
|
func (s *Storage) Conn() *ristretto.Cache {
|
||||||
|
return s.cache
|
||||||
|
}
|
||||||
|
@@ -126,3 +126,7 @@ func Test_Ristretto_Reset(t *testing.T) {
|
|||||||
func Test_Ristretto_Close(t *testing.T) {
|
func Test_Ristretto_Close(t *testing.T) {
|
||||||
utils.AssertEqual(t, nil, testStore.Close())
|
utils.AssertEqual(t, nil, testStore.Close())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Test_Ristretto_Conn(t *testing.T) {
|
||||||
|
utils.AssertEqual(t, true, testStore.Conn() != nil)
|
||||||
|
}
|
||||||
|
@@ -20,6 +20,7 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
|||||||
func (s *Storage) Delete(key string) error
|
func (s *Storage) Delete(key string) error
|
||||||
func (s *Storage) Reset() error
|
func (s *Storage) Reset() error
|
||||||
func (s *Storage) Close() error
|
func (s *Storage) Close() error
|
||||||
|
func (s *Storage) Conn() *s3.Client
|
||||||
```
|
```
|
||||||
### Installation
|
### Installation
|
||||||
S3 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:
|
S3 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:
|
||||||
|
10
s3/go.mod
10
s3/go.mod
@@ -3,10 +3,10 @@ module github.com/gofiber/storage/s3
|
|||||||
go 1.16
|
go 1.16
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/aws/aws-sdk-go-v2 v1.13.0
|
github.com/aws/aws-sdk-go-v2 v1.16.16
|
||||||
github.com/aws/aws-sdk-go-v2/config v1.13.1
|
github.com/aws/aws-sdk-go-v2/config v1.17.8
|
||||||
github.com/aws/aws-sdk-go-v2/credentials v1.8.0
|
github.com/aws/aws-sdk-go-v2/credentials v1.12.21
|
||||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.9.1
|
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.34
|
||||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.24.1
|
github.com/aws/aws-sdk-go-v2/service/s3 v1.27.11
|
||||||
github.com/gofiber/utils v0.1.2
|
github.com/gofiber/utils v0.1.2
|
||||||
)
|
)
|
||||||
|
77
s3/go.sum
77
s3/go.sum
@@ -1,42 +1,47 @@
|
|||||||
github.com/aws/aws-sdk-go-v2 v1.13.0 h1:1XIXAfxsEmbhbj5ry3D3vX+6ZcUYvIqSm4CWWEuGZCA=
|
github.com/aws/aws-sdk-go-v2 v1.16.16 h1:M1fj4FE2lB4NzRb9Y0xdWsn2P0+2UHVxwKyOa4YJNjk=
|
||||||
github.com/aws/aws-sdk-go-v2 v1.13.0/go.mod h1:L6+ZpqHaLbAaxsqV0L4cvxZY7QupWJB4fhkf8LXvC7w=
|
github.com/aws/aws-sdk-go-v2 v1.16.16/go.mod h1:SwiyXi/1zTUZ6KIAmLK5V5ll8SiURNUYOqTerZPaF9k=
|
||||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.2.0 h1:scBthy70MB3m4LCMFaBcmYCyR2XWOz6MxSfdSu/+fQo=
|
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.8 h1:tcFliCWne+zOuUfKNRn8JdFBuWPDuISDH08wD2ULkhk=
|
||||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.2.0/go.mod h1:oZHzg1OVbuCiRTY0oRPM+c2HQvwnFCGJwKeSqqAJ/yM=
|
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.8/go.mod h1:JTnlBSot91steJeti4ryyu/tLd4Sk84O5W22L7O2EQU=
|
||||||
github.com/aws/aws-sdk-go-v2/config v1.13.1 h1:yLv8bfNoT4r+UvUKQKqRtdnvuWGMK5a82l4ru9Jvnuo=
|
github.com/aws/aws-sdk-go-v2/config v1.17.8 h1:b9LGqNnOdg9vR4Q43tBTVWk4J6F+W774MSchvKJsqnE=
|
||||||
github.com/aws/aws-sdk-go-v2/config v1.13.1/go.mod h1:Ba5Z4yL/UGbjQUzsiaN378YobhFo0MLfueXGiOsYtEs=
|
github.com/aws/aws-sdk-go-v2/config v1.17.8/go.mod h1:UkCI3kb0sCdvtjiXYiU4Zx5h07BOpgBTtkPu/49r+kA=
|
||||||
github.com/aws/aws-sdk-go-v2/credentials v1.8.0 h1:8Ow0WcyDesGNL0No11jcgb1JAtE+WtubqXjgxau+S0o=
|
github.com/aws/aws-sdk-go-v2/credentials v1.12.21 h1:4tjlyCD0hRGNQivh5dN8hbP30qQhMLBE/FgQR1vHHWM=
|
||||||
github.com/aws/aws-sdk-go-v2/credentials v1.8.0/go.mod h1:gnMo58Vwx3Mu7hj1wpcG8DI0s57c9o42UQ6wgTQT5to=
|
github.com/aws/aws-sdk-go-v2/credentials v1.12.21/go.mod h1:O+4XyAt4e+oBAoIwNUYkRg3CVMscaIJdmZBOcPgJ8D8=
|
||||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.10.0 h1:NITDuUZO34mqtOwFWZiXo7yAHj7kf+XPE+EiKuCBNUI=
|
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.17 h1:r08j4sbZu/RVi+BNxkBJwPMUYY3P8mgSDuKkZ/ZN1lE=
|
||||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.10.0/go.mod h1:I6/fHT/fH460v09eg2gVrd8B/IqskhNdpcLH0WNO3QI=
|
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.17/go.mod h1:yIkQcCDYNsZfXpd5UX2Cy+sWA1jPgIhGTw9cOBzfVnQ=
|
||||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.9.1 h1:oUCLhAKNaXyTqdJyw+KEjDVVBs1V5mCy8YDLMi08LL8=
|
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.34 h1:1PNtaCM+2ruo1dfYL2RweUdtbuPvinjAejjNcPa/RQY=
|
||||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.9.1/go.mod h1:pB38jI+AdaPoLAgaL9bwxDdy6rjwO6LIArBZDLjq6zs=
|
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.34/go.mod h1:+Six+CXNHYllXam32j+YW8ixk82+am345ei89kEz8p4=
|
||||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.4 h1:CRiQJ4E2RhfDdqbie1ZYDo8QtIo75Mk7oTdJSfwJTMQ=
|
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.23 h1:s4g/wnzMf+qepSNgTvaQQHNxyMLKSawNhKCPNy++2xY=
|
||||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.4/go.mod h1:XHgQ7Hz2WY2GAn//UXHofLfPXWh+s62MbMOijrg12Lw=
|
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.23/go.mod h1:2DFxAQ9pfIRy0imBCJv+vZ2X6RKxves6fbnEuSry6b4=
|
||||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.2.0 h1:3ADoioDMOtF4uiK59vCpplpCwugEU+v4ZFD29jDL3RQ=
|
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.17 h1:/K482T5A3623WJgWT8w1yRAFK4RzGzEl7y39yhtn9eA=
|
||||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.2.0/go.mod h1:BsCSJHx5DnDXIrOcqB8KN1/B+hXLG/bi4Y6Vjcx/x9E=
|
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.17/go.mod h1:pRwaTYCJemADaqCbUAxltMoHKata7hmB5PjEXeu0kfg=
|
||||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.5 h1:ixotxbfTCFpqbuwFv/RcZwyzhkxPSYDYEMcj4niB5Uk=
|
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.24 h1:wj5Rwc05hvUSvKuOF29IYb9QrCLjU+rHAy/x/o0DK2c=
|
||||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.5/go.mod h1:R3sWUqPcfXSiF/LSFJhjyJmpg9uV6yP2yv3YZZjldVI=
|
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.24/go.mod h1:jULHjqqjDlbyTa7pfM7WICATnOv+iOhjletM3N0Xbu8=
|
||||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.7.0 h1:F1diQIOkNn8jcez4173r+PLPdkWK7chy74r3fKpDrLI=
|
github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.14 h1:ZSIPAkAsCCjYrhqfw2+lNzWDzxzHXEckFkTePL5RSWQ=
|
||||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.7.0/go.mod h1:8ctElVINyp+SjhoZZceUAZw78glZH6R8ox5MVNu5j2s=
|
github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.14/go.mod h1:AyGgqiKv9ECM6IZeNQtdT8NnMvUb3/2wokeq2Fgryto=
|
||||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.7.0 h1:4QAOB3KrvI1ApJK14sliGr3Ie2pjyvNypn/lfzDHfUw=
|
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.9 h1:Lh1AShsuIJTwMkoxVCAYPJgNG5H+eN6SmoUn8nOZ5wE=
|
||||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.7.0/go.mod h1:K/qPe6AP2TGYv4l6n7c88zh9jWBDf6nHhvg1fx/EWfU=
|
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.9/go.mod h1:a9j48l6yL5XINLHLcOKInjdvknN+vWqPBxqeIDw7ktw=
|
||||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.11.0 h1:XAe+PDnaBELHr25qaJKfB415V4CKFWE8H+prUreql8k=
|
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.18 h1:BBYoNQt2kUZUUK4bIPsKrCcjVPUMNsgQpNAwhznK/zo=
|
||||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.11.0/go.mod h1:RMlgnt1LbOT2BxJ3cdw+qVz7KL84714LFkWtF6sLI7A=
|
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.18/go.mod h1:NS55eQ4YixUJPTC+INxi2/jCqe1y2Uw3rnh9wEOVJxY=
|
||||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.24.1 h1:zAU2P99CLTz8kUGl+IptU2ycAXuMaLAvgIv+UH4U8pY=
|
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.17 h1:Jrd/oMh0PKQc6+BowB+pLEwLIgaQF29eYbe7E1Av9Ug=
|
||||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.24.1/go.mod h1:oIUXg/5F0x0gy6nkwEnlxZboueddwPEKO6Xl+U6/3a0=
|
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.17/go.mod h1:4nYOrY41Lrbk2170/BGkcJKBhws9Pfn8MG3aGqjjeFI=
|
||||||
github.com/aws/aws-sdk-go-v2/service/sso v1.9.0 h1:1qLJeQGBmNQW3mBNzK2CFmrQNmoXWrscPqsrAaU1aTA=
|
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.17 h1:HfVVR1vItaG6le+Bpw6P4midjBDMKnjMyZnw9MXYUcE=
|
||||||
github.com/aws/aws-sdk-go-v2/service/sso v1.9.0/go.mod h1:vCV4glupK3tR7pw7ks7Y4jYRL86VvxS+g5qk04YeWrU=
|
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.17/go.mod h1:YqMdV+gEKCQ59NrB7rzrJdALeBIsYiVi8Inj3+KcqHI=
|
||||||
github.com/aws/aws-sdk-go-v2/service/sts v1.14.0 h1:ksiDXhvNYg0D2/UFkLejsaz3LqpW5yjNQ8Nx9Sn2c0E=
|
github.com/aws/aws-sdk-go-v2/service/s3 v1.27.11 h1:3/gm/JTX9bX8CpzTgIlrtYpB3EVBDxyg/GY/QdcIEZw=
|
||||||
github.com/aws/aws-sdk-go-v2/service/sts v1.14.0/go.mod h1:u0xMJKDvvfocRjiozsoZglVNXRG19043xzp3r2ivLIk=
|
github.com/aws/aws-sdk-go-v2/service/s3 v1.27.11/go.mod h1:fmgDANqTUCxciViKl9hb/zD5LFbvPINFRgWhDbR+vZo=
|
||||||
github.com/aws/smithy-go v1.10.0 h1:gsoZQMNHnX+PaghNw4ynPsyGP7aUCqx5sY2dlPQsZ0w=
|
github.com/aws/aws-sdk-go-v2/service/sso v1.11.23 h1:pwvCchFUEnlceKIgPUouBJwK81aCkQ8UDMORfeFtW10=
|
||||||
github.com/aws/smithy-go v1.10.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E=
|
github.com/aws/aws-sdk-go-v2/service/sso v1.11.23/go.mod h1:/w0eg9IhFGjGyyncHIQrXtU8wvNsTJOP0R6PPj0wf80=
|
||||||
|
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.6 h1:OwhhKc1P9ElfWbMKPIbMMZBV6hzJlL2JKD76wNNVzgQ=
|
||||||
|
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.6/go.mod h1:csZuQY65DAdFBt1oIjO5hhBR49kQqop4+lcuCjf2arA=
|
||||||
|
github.com/aws/aws-sdk-go-v2/service/sts v1.16.19 h1:9pPi0PsFNAGILFfPCk8Y0iyEBGc6lu6OQ97U7hmdesg=
|
||||||
|
github.com/aws/aws-sdk-go-v2/service/sts v1.16.19/go.mod h1:h4J3oPZQbxLhzGnk+j9dfYHi5qIOVJ5kczZd658/ydM=
|
||||||
|
github.com/aws/smithy-go v1.13.3 h1:l7LYxGuzK6/K+NzJ2mC+VvLUbae0sL3bXU//04MkmnA=
|
||||||
|
github.com/aws/smithy-go v1.13.3/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=
|
||||||
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
|
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/gofiber/utils v0.1.2 h1:1SH2YEz4RlNS0tJlMJ0bGwO0JkqPqvq6TbHK9tXZKtk=
|
github.com/gofiber/utils v0.1.2 h1:1SH2YEz4RlNS0tJlMJ0bGwO0JkqPqvq6TbHK9tXZKtk=
|
||||||
github.com/gofiber/utils v0.1.2/go.mod h1:pacRFtghAE3UoknMOUiXh2Io/nLWSUHtQCi/3QASsOc=
|
github.com/gofiber/utils v0.1.2/go.mod h1:pacRFtghAE3UoknMOUiXh2Io/nLWSUHtQCi/3QASsOc=
|
||||||
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
|
||||||
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
|
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
|
||||||
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
|
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
|
||||||
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
|
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
|
||||||
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
|
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
|
||||||
@@ -44,8 +49,6 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfC
|
|||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
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/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
|
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
|
||||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
5
s3/s3.go
5
s3/s3.go
@@ -159,6 +159,11 @@ func (s *Storage) Close() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return database client
|
||||||
|
func (s *Storage) Conn() *s3.Client {
|
||||||
|
return s.svc
|
||||||
|
}
|
||||||
|
|
||||||
// Context for making requests will timeout if a non-zero timeout is configured
|
// Context for making requests will timeout if a non-zero timeout is configured
|
||||||
func (s *Storage) requestContext() (context.Context, context.CancelFunc) {
|
func (s *Storage) requestContext() (context.Context, context.CancelFunc) {
|
||||||
if s.requestTimeout > 0 {
|
if s.requestTimeout > 0 {
|
||||||
|
@@ -105,3 +105,7 @@ func Test_S3_Reset(t *testing.T) {
|
|||||||
func Test_S3_Close(t *testing.T) {
|
func Test_S3_Close(t *testing.T) {
|
||||||
utils.AssertEqual(t, nil, testStore.Close())
|
utils.AssertEqual(t, nil, testStore.Close())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Test_S3_Conn(t *testing.T) {
|
||||||
|
utils.AssertEqual(t, true, testStore.Conn() != nil)
|
||||||
|
}
|
||||||
|
@@ -17,6 +17,7 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
|||||||
func (s *Storage) Delete(key string) error
|
func (s *Storage) Delete(key string) error
|
||||||
func (s *Storage) Reset() error
|
func (s *Storage) Reset() error
|
||||||
func (s *Storage) Close() error
|
func (s *Storage) Close() error
|
||||||
|
func (s *Storage) Conn() *sql.DB
|
||||||
```
|
```
|
||||||
### Installation
|
### Installation
|
||||||
SQLite3 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:
|
SQLite3 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:
|
||||||
|
@@ -4,5 +4,5 @@ go 1.14
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/gofiber/utils v0.1.2
|
github.com/gofiber/utils v0.1.2
|
||||||
github.com/mattn/go-sqlite3 v1.14.13
|
github.com/mattn/go-sqlite3 v1.14.15
|
||||||
)
|
)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
github.com/gofiber/utils v0.1.2 h1:1SH2YEz4RlNS0tJlMJ0bGwO0JkqPqvq6TbHK9tXZKtk=
|
github.com/gofiber/utils v0.1.2 h1:1SH2YEz4RlNS0tJlMJ0bGwO0JkqPqvq6TbHK9tXZKtk=
|
||||||
github.com/gofiber/utils v0.1.2/go.mod h1:pacRFtghAE3UoknMOUiXh2Io/nLWSUHtQCi/3QASsOc=
|
github.com/gofiber/utils v0.1.2/go.mod h1:pacRFtghAE3UoknMOUiXh2Io/nLWSUHtQCi/3QASsOc=
|
||||||
github.com/mattn/go-sqlite3 v1.14.13 h1:1tj15ngiFfcZzii7yd82foL+ks+ouQcj8j/TPq3fk1I=
|
github.com/mattn/go-sqlite3 v1.14.15 h1:vfoHhTN1af61xCRSWzFIWzx2YskyMTwHLrExkBOjvxI=
|
||||||
github.com/mattn/go-sqlite3 v1.14.13/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
|
github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=
|
||||||
|
@@ -169,3 +169,8 @@ func (s *Storage) gcTicker() {
|
|||||||
func (s *Storage) gc(t time.Time) {
|
func (s *Storage) gc(t time.Time) {
|
||||||
_, _ = s.db.Exec(s.sqlGC, t.Unix())
|
_, _ = s.db.Exec(s.sqlGC, t.Unix())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return database client
|
||||||
|
func (s *Storage) Conn() *sql.DB {
|
||||||
|
return s.db
|
||||||
|
}
|
||||||
|
@@ -159,3 +159,7 @@ func Test_SQLite3_Non_UTF8(t *testing.T) {
|
|||||||
func Test_SQLite3_Close(t *testing.T) {
|
func Test_SQLite3_Close(t *testing.T) {
|
||||||
utils.AssertEqual(t, nil, testStore.Close())
|
utils.AssertEqual(t, nil, testStore.Close())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Test_SQLite3_Conn(t *testing.T) {
|
||||||
|
utils.AssertEqual(t, true, testStore.Conn() != nil)
|
||||||
|
}
|
Reference in New Issue
Block a user