✏ update readme

This commit is contained in:
Fenny
2020-11-27 15:24:50 +01:00
parent 2fc023c798
commit b9c23a2736

View File

@@ -35,17 +35,17 @@ import "github.com/gofiber/storage/arangodb"
You can use the following possibilities to create a storage: You can use the following possibilities to create a storage:
```go ```go
// Initialize default config
store := arangodb.New()
// Initialize custom config // Initialize custom config
// *http* is mandatory
store := arangodb.New(arangodb.Config{ store := arangodb.New(arangodb.Config{
Host: "http://127.0.0.1", Host: "http://127.0.0.1",
Port: "8529", Port: 8529,
Username: "username", Database: "fiber",
Password: "password" Collection: "fiber_storage",
Database: "fiber", Reset: false,
Collection: "fiber_storage", GCInterval: 10 * time.Second,
Reset: false,
GCInterval: 10 * time.Second,
}) })
``` ```
@@ -60,16 +60,16 @@ type Config struct {
// Port where the DB is listening on // Port where the DB is listening on
// //
// Optional. Default is 8529 // Optional. Default is 8529
Port string Port int
// Server username // Server username
// //
// Mandatory // Optional. Default is ""
Username string Username string
// Server password // Server password
// //
// Mandatory // Optional. Default is ""
Password string Password string
// Database name // Database name
@@ -98,7 +98,7 @@ Used only for optional fields
```go ```go
var ConfigDefault = Config{ var ConfigDefault = Config{
Host: "http://127.0.0.1", Host: "http://127.0.0.1",
Port: "8529", Port: 8529,
Database: "fiber", Database: "fiber",
Collection: "fiber_storage", Collection: "fiber_storage",
Reset: false, Reset: false,