Your ROOT_URL in app.ini is http://git.slaventius.ru/ but you are visiting http://37.143.12.169/test3k/authDB/blame/commit/6e72707a6a00d4a4cf92b0761981d976ccb97ca0/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,
}
}