Your ROOT_URL in app.ini is http://git.slaventius.ru/ but you are visiting http://37.143.12.169/test3k/authDB/blame/commit/18cfdd6371e9f219b2642e2ceed88271e834f99c/internal/transport/arango/connection.go You should set ROOT_URL correctly, otherwise the web may not work correctly.

34 lines
558 B

2 years ago
package arango_db
import (
"context"
"log"
"net"
"strconv"
driver "github.com/arangodb/go-driver"
"github.com/arangodb/go-driver/http"
)
type Connection struct {
conn driver.Connection
ctx context.Context
}
func NewConnection(ctx context.Context, host string, port int) *Connection {
connString := "http://" + net.JoinHostPort(host, strconv.Itoa(port))
conn, err := http.NewConnection(http.ConnectionConfig{
Endpoints: []string{connString},
})
//
if err != nil {
log.Fatal(err)
}
return &Connection{
ctx: ctx,
conn: conn,
}
}