diff --git a/.github/logo-dark.svg b/.github/logo-dark.svg new file mode 100644 index 00000000..6d49ccc4 --- /dev/null +++ b/.github/logo-dark.svg @@ -0,0 +1,9 @@ + + diff --git a/.github/logo.svg b/.github/logo.svg new file mode 100644 index 00000000..a37011b2 --- /dev/null +++ b/.github/logo.svg @@ -0,0 +1,9 @@ + + diff --git a/.github/scripts/sync_docs.sh b/.github/scripts/sync_docs.sh new file mode 100755 index 00000000..8b2d553e --- /dev/null +++ b/.github/scripts/sync_docs.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +# Some env variables +BRANCH="main" +REPO="storage" +REPO_URL="github.com/gofiber/docs.git" +AUTHOR_EMAIL="github-actions[bot]@users.noreply.github.com" +AUTHOR_USERNAME="github-actions[bot]" + +# Set commit author +git config --global user.email "${AUTHOR_EMAIL}" +git config --global user.name "${AUTHOR_USERNAME}" + +# Exit if event is not PUSH +if [ "$EVENT" != "push" ]; then + exit 0 +fi + +latest_commit=$(git rev-parse --short HEAD) + +git clone https://${TOKEN}@${REPO_URL} fiber-docs +for f in $(find . -type f -name "*.md" -not -path "./fiber-docs/*"); do + log_output=$(git log --oneline "${BRANCH}" HEAD~1..HEAD --name-status -- "${f}") + + if [[ $log_output != "" || ! -f "fiber-docs/docs/$REPO/$f" ]]; then + mkdir -p fiber-docs/docs/$REPO/$(dirname $f) + cp "${f}" fiber-docs/docs/$REPO/$f + fi +done + +# Push changes for storage instance docs +cd fiber-docs/ || return +git add . +git commit -m "Add docs from https://github.com/gofiber/$REPO/commit/${latest_commit}" +git push https://${TOKEN}@${REPO_URL} \ No newline at end of file diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml new file mode 100644 index 00000000..e13d8df4 --- /dev/null +++ b/.github/workflows/sync-docs.yml @@ -0,0 +1,25 @@ +name: 'Sync docs' + +on: + push: + branches: + - master + - main + paths: + - '**/*.md' + +jobs: + sync-docs: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 2 + + - name: Sync docs + run: ./.github/scripts/sync_docs.sh + env: + EVENT: ${{ github.event_name }} + TOKEN: ${{ secrets.DOC_SYNC_TOKEN }} diff --git a/MIGRATE.md b/MIGRATE.md deleted file mode 100644 index 8b2776dd..00000000 --- a/MIGRATE.md +++ /dev/null @@ -1,22 +0,0 @@ -This document contains instructions for migrating to various storage versions. - -### 0.1 -> 0.2 -v0.2 fixes [a bug](https://github.com/gofiber/fiber/issues/1258) in MYSQL, Postgres and Arangodb in which -inserting non-UTF8 characters would trigger a panic due to the values being saved in a TEXT column instead of a -BYTEA/BLOB column. Migration instructions (note you may need to adjust the table names if you have supplied a custom -config to the storage): - -**Postgres** -```sql -ALTER TABLE fiber_storage -ALTER COLUMN v TYPE BYTEA USING v::bytea; -``` - -**MYSQL** -```sql -ALTER TABLE fiber_storage MODIFY COLUMN v BLOB; -``` - -**Arangodb** - -No migration other then updating the library is necessary. diff --git a/README.md b/README.md index 6b1daae6..c014d097 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,13 @@ +--- +title: 👋 Welcome +description: 📦 Premade storage drivers for 🚀 Fiber. +sidebar_position: 1 +--- +
+
@@ -48,54 +54,21 @@ type Storage interface {
## 📑 Storage Implementations
-- [ArangoDB](/arangodb)
-
-
-- [AzureBlob](/azureblob)
-
-
-- [Badger](/badger)
-
-
-- [Bbolt](/bbolt)
-
-
-- [Couchbase](/couchbase)
-
-
-- [DynamoDB](/dynamodb)
-
-
-- [Etcd](/etcd)
-
-
-- [Memcache](/memcache)
-
-
-- [Memory](/memory)
-
-
-- [MongoDB](/mongodb)
-
-
-- [MSSQL](/mssql)
-
-
-- [MySQL](/mysql)
-
-
-- [Pebble](/pebble)
-
-
-- [Postgres](/postgres)
-
-
-- [Redis](/redis)
-
-
-- [SQLite3](/sqlite3)
-
-
-- [S3](/s3)
-
+- [ArangoDB](./arangodb/README.md)
+- [AzureBlob](./azureblob/README.md)
+- [Badger](./badger/README.md)
+- [Bbolt](./bbolt)
+- [Couchbase](./couchbase/README.md)
+- [DynamoDB](./dynamodb/README.md)
+- [Etcd](./etcd/README.md)
+- [Memcache](./memcache/README.md)
+- [Memory](./memory/README.md)
+- [MongoDB](./mongodb/README.md)
+- [MSSQL](./mssql/README.md)
+- [MySQL](./mysql/README.md)
+- [Pebble](./pebble/README.md)
+- [Postgres](./postgres/README.md)
+- [Redis](./redis/README.md)
+- [S3](./s3/README.md)
+- [SQLite3](./sqlite3/README.md)
diff --git a/arangodb/README.md b/arangodb/README.md
index 7e91ceb6..ce8352bb 100644
--- a/arangodb/README.md
+++ b/arangodb/README.md
@@ -1,4 +1,14 @@
-# ArangoDB
+---
+id: arangodb
+title: ArangoDB
+---
+
+
+[](https://gofiber.io/discord)
+
+
+
+
A ArangoDB storage driver using `arangodb/go-driver` and [arangodb/go-driver](https://github.com/arangodb/go-driver).
### Table of Contents
diff --git a/azureblob/README.md b/azureblob/README.md
index 3f6bd371..1a18a958 100644
--- a/azureblob/README.md
+++ b/azureblob/README.md
@@ -1,4 +1,13 @@
-# Azure blob
+---
+id: azureblob
+title: Azure Blob
+---
+
+
+[](https://gofiber.io/discord)
+
+
+
[Azure Blob storage](https://azure.microsoft.com/en-us/products/storage/blobs/#overview) is Microsoft's object storage solution for the cloud.
diff --git a/badger/README.md b/badger/README.md
index cd40a98e..d80cd01d 100644
--- a/badger/README.md
+++ b/badger/README.md
@@ -1,4 +1,13 @@
-# Badger
+---
+id: badger
+title: Badger
+---
+
+
+[](https://gofiber.io/discord)
+
+
+
A fast key-value DB using [dgraph-io/badger](https://github.com/dgraph-io/badger)
diff --git a/bbolt/README.md b/bbolt/README.md
index 63988417..b0eb3046 100644
--- a/bbolt/README.md
+++ b/bbolt/README.md
@@ -1,4 +1,14 @@
-# Bbolt
+---
+id: bbolt
+title: Bbolt
+---
+
+
+[](https://gofiber.io/discord)
+
+
+
+
A Bbolt storage driver using [etcd-io/bbolt](https://github.com/etcd-io/bbolt). Bolt is a pure Go key/value store inspired by [Howard Chu's](https://twitter.com/hyc_symas) [LMDB project](https://www.symas.com/symas-embedded-database-lmdb). The goal of the project is to provide a simple, fast, and reliable database for projects that don't require a full database server such as Postgres or MySQL.
diff --git a/couchbase/README.md b/couchbase/README.md
index d90ca284..3739255a 100644
--- a/couchbase/README.md
+++ b/couchbase/README.md
@@ -1,4 +1,13 @@
-# Couchbase
+---
+id: couchbase
+title: Couchbase
+---
+
+
+[](https://gofiber.io/discord)
+
+
+
A Couchbase storage driver using [couchbase/gocb](https://github.com/couchbase/gocb).
diff --git a/dynamodb/README.md b/dynamodb/README.md
index 35779e4d..38be3fb9 100644
--- a/dynamodb/README.md
+++ b/dynamodb/README.md
@@ -1,4 +1,14 @@
-# DynamoDB
+---
+id: dynamodb
+title: DynamoDB
+---
+
+
+[](https://gofiber.io/discord)
+
+
+
+
A DynamoDB storage driver using [aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2).
**Note:** If config fields of credentials not given, credentials are using from the environment variables, ~/.aws/credentials, or EC2 instance role. If config fields of credentials given, credentials are using from config. Look at: [specifying credentials](https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk/#specifying-credentials)
diff --git a/etcd/README.md b/etcd/README.md
index 728d2524..11c128df 100644
--- a/etcd/README.md
+++ b/etcd/README.md
@@ -1,4 +1,13 @@
-# Etcd
+---
+id: etcd
+title: Etcd
+---
+
+
+[](https://gofiber.io/discord)
+
+
+
A Etcd storage driver using [`etcd-io/etcd`](https://github.com/etcd-io/etcd).
diff --git a/memcache/README.md b/memcache/README.md
index 126551e1..07336693 100644
--- a/memcache/README.md
+++ b/memcache/README.md
@@ -1,4 +1,13 @@
-# Memcache
+---
+id: memcache
+title: Memcache
+---
+
+
+[](https://gofiber.io/discord)
+
+
+
A Memcache storage driver using [`bradfitz/gomemcache`](https://github.com/bradfitz/gomemcache).
diff --git a/memory/README.md b/memory/README.md
index 26931cb3..fcd9c3dd 100644
--- a/memory/README.md
+++ b/memory/README.md
@@ -1,4 +1,13 @@
-# Memory
+---
+id: memory
+title: Memory
+---
+
+
+[](https://gofiber.io/discord)
+
+
+
An in-memory storage driver.
diff --git a/mongodb/README.md b/mongodb/README.md
index 0a0cf213..6efdea99 100644
--- a/mongodb/README.md
+++ b/mongodb/README.md
@@ -1,4 +1,13 @@
-# MongoDB
+---
+id: mongodb
+title: MongoDB
+---
+
+
+[](https://gofiber.io/discord)
+
+
+
A MongoDB storage driver using [mongodb/mongo-go-driver](https://github.com/mongodb/mongo-go-driver).
diff --git a/mssql/README.md b/mssql/README.md
index b14e28b5..5c37e93b 100644
--- a/mssql/README.md
+++ b/mssql/README.md
@@ -1,4 +1,13 @@
-# MSSQL
+---
+id: mssql
+title: MSSQL
+---
+
+
+[](https://gofiber.io/discord)
+
+
+
A MSSQL storage driver using [microsoft/go-mssqldb](https://github.com/microsoft/go-mssqldb).
diff --git a/mysql/README.md b/mysql/README.md
index 1a3c28ea..793ed3b2 100644
--- a/mysql/README.md
+++ b/mysql/README.md
@@ -1,4 +1,13 @@
-# MySQL
+---
+id: mysql
+title: MySQL
+---
+
+
+[](https://gofiber.io/discord)
+
+
+
A MySQL storage driver using `database/sql` and [go-sql-driver/mysql](https://github.com/go-sql-driver/mysql).
diff --git a/pebble/README.md b/pebble/README.md
index 5ee19b92..eb1e0ddd 100644
--- a/pebble/README.md
+++ b/pebble/README.md
@@ -1,4 +1,13 @@
-# Pebble
+---
+id: pebble
+title: Pebble
+---
+
+
+[](https://gofiber.io/discord)
+
+
+
A fast key-value DB using [cockroachdb/pebble](https://github.com/cockroachdb/pebble)
diff --git a/postgres/README.md b/postgres/README.md
index a8f777c9..e5f41993 100644
--- a/postgres/README.md
+++ b/postgres/README.md
@@ -1,4 +1,13 @@
-# Postgres
+---
+id: postgres
+title: Postgres
+---
+
+
+[](https://gofiber.io/discord)
+
+
+
A Postgres storage driver using [jackc/pgx](https://github.com/jackc/pgx).
diff --git a/redis/README.md b/redis/README.md
index 03bff384..1d5586cc 100644
--- a/redis/README.md
+++ b/redis/README.md
@@ -1,4 +1,13 @@
-# Redis
+---
+id: redis
+title: Redis
+---
+
+
+[](https://gofiber.io/discord)
+
+
+
A Redis storage driver using [go-redis/redis](https://github.com/go-redis/redis).
diff --git a/ristretto/README.md b/ristretto/README.md
index 96ee2fba..ed3e22a3 100644
--- a/ristretto/README.md
+++ b/ristretto/README.md
@@ -1,4 +1,13 @@
-# Ristretto
+---
+id: ristretto
+title: Ristretto
+---
+
+
+[](https://gofiber.io/discord)
+
+
+
A Memory-bound storage driver using [`dgraph-io/ristretto`](https://github.com/dgraph-io/ristretto).
diff --git a/s3/README.md b/s3/README.md
index f7ca7bee..49ffe762 100644
--- a/s3/README.md
+++ b/s3/README.md
@@ -1,4 +1,13 @@
-# S3
+---
+id: s3
+title: S3
+---
+
+
+[](https://gofiber.io/discord)
+
+
+
A S3 storage driver using [aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2).
diff --git a/sqlite3/README.md b/sqlite3/README.md
index 4c2f1eb7..844007f6 100644
--- a/sqlite3/README.md
+++ b/sqlite3/README.md
@@ -1,4 +1,13 @@
-# SQLite3
+---
+id: sqlite3
+title: SQLite3
+---
+
+
+[](https://gofiber.io/discord)
+
+
+
A SQLite3 storage driver using [mattn/go-sqlite3](https://github.com/mattn/go-sqlite3).