mirror of
https://github.com/gofiber/storage.git
synced 2025-10-05 08:37:10 +08:00
🩹 fix test
This commit is contained in:
2
.github/workflows/test-arangodb.yml
vendored
2
.github/workflows/test-arangodb.yml
vendored
@@ -33,6 +33,6 @@ jobs:
|
||||
- name: Run Test
|
||||
run: cd ./arangodb && go test ./... -v -race
|
||||
env:
|
||||
ARANGO_DATABASE: fiber
|
||||
ARANGO_USERNAME: username
|
||||
ARANGO_PASSWORD: password
|
||||
ARANGO_DATABASE: fiber
|
||||
|
@@ -40,7 +40,7 @@ func New(config Config) *Storage {
|
||||
|
||||
// create connection object to arango
|
||||
conn, err := http.NewConnection(http.ConnectionConfig{
|
||||
Endpoints: []string{cfg.hostComposed()},
|
||||
Endpoints: []string{fmt.Sprintf("%s:%d", cfg.Host, cfg.Port)},
|
||||
})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package arangodb
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
@@ -20,12 +19,12 @@ type Config struct {
|
||||
|
||||
// Server username
|
||||
//
|
||||
// Mandatory
|
||||
// Optional. Default is ""
|
||||
Username string
|
||||
|
||||
// Server password
|
||||
//
|
||||
// Mandatory
|
||||
// Optional. Default is ""
|
||||
Password string
|
||||
|
||||
// Database name
|
||||
@@ -58,10 +57,6 @@ var ConfigDefault = Config{
|
||||
GCInterval: 10 * time.Second,
|
||||
}
|
||||
|
||||
func (c Config) hostComposed() string {
|
||||
return fmt.Sprintf("%s:%d", c.Host, c.Port)
|
||||
}
|
||||
|
||||
// Helper function to set default values
|
||||
func configDefault(cfg Config) Config {
|
||||
// Set default values
|
||||
|
Reference in New Issue
Block a user