From fb68a3ddafbaabf87fca6c0aa343b4aec9bb0ba2 Mon Sep 17 00:00:00 2001 From: Wangjunqi123 Date: Thu, 19 Oct 2023 16:20:31 +0800 Subject: [PATCH] add neo4j configuration to config file --- .gitignore | 2 +- conf/config_server.yaml.templete | 9 ++++++--- server/conf/config.go | 9 +++++++++ server/dao/init.go | 2 +- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 2f823d8..ad26911 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,4 @@ server/handler/index.html web/node_modules web/dist/ -go.work \ No newline at end of file +go.work* \ No newline at end of file diff --git a/conf/config_server.yaml.templete b/conf/config_server.yaml.templete index ca3fac7..7bbb261 100644 --- a/conf/config_server.yaml.templete +++ b/conf/config_server.yaml.templete @@ -1,6 +1,7 @@ topo: server_addr: "localhost:9991" agent_port: "9992" + database: "neo4j" period: 60 PilotGo: http_addr: "localhost:8888" @@ -10,6 +11,8 @@ log: path: /opt/PilotGo/plugin/topology/server/log/toposerver.log max_file: 1 max_size: 10485760 -arangodb: - addr: "http://localhost:8529" - database: "pilotgo-topo" \ No newline at end of file +neo4j: + addr: "bolt://10.41.121.1:7687" + username: "" + password: "" + DB: "neo4j" \ No newline at end of file diff --git a/server/conf/config.go b/server/conf/config.go index 7578ed1..adaf289 100644 --- a/server/conf/config.go +++ b/server/conf/config.go @@ -9,6 +9,7 @@ import ( type TopoConf struct { Server_addr string `yaml:"server_addr"` Agent_port string `yaml:"agent_port"` + Database string `yaml:"database"` Period int `yaml:"period"` } @@ -21,11 +22,19 @@ type ArangodbConf struct { Database string `yaml:"database"` } +type Neo4jConf struct { + Addr string `yaml:"addr"` + Username string `yaml:"username"` + Password string `yaml:"password"` + DB string `yaml:"DB"` +} + type ServerConfig struct { Topo *TopoConf `yaml:"topo"` PilotGo *PilotGoConf `yaml:"PilotGo"` Logopts *logger.LogOpts `yaml:"log"` Arangodb *ArangodbConf `yaml:"arangodb"` + Neo4j *Neo4jConf `yaml:"neo4j"` } const config_type = "config_server.yaml" diff --git a/server/dao/init.go b/server/dao/init.go index 484b525..07a0cc0 100755 --- a/server/dao/init.go +++ b/server/dao/init.go @@ -1 +1 @@ -package controller \ No newline at end of file +package dao -- Gitee