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

33 lines
558 B

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,
}
}