Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
lichenggang
/
web_log
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6ecaf9d1
authored
Dec 31, 2020
by
lichenggang
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
用户配置
parent
6a33c7bb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
config/config.go
config/users.json
config/config.go
View file @
6ecaf9d1
package
config
import
"os"
import
(
"log"
"os"
"strings"
)
var
Directory
string
var
UserConfigPath
string
func
GetCurrentPath
()
string
{
dir
,
err
:=
os
.
Getwd
()
if
err
!=
nil
{
log
.
Fatal
(
err
)
}
return
strings
.
Replace
(
dir
,
"
\\
"
,
"/"
,
-
1
)
}
func
InitConfig
()
{
Directory
=
"E:
\\
test_logs"
// directory of the log
UserConfigPath
=
"E:
\\
users.json"
logenv
:=
os
.
Getenv
(
"GOLOGENV"
)
if
logenv
==
"TEST"
{
Directory
=
"/data/soft/bigdatav3.0/test_rsync_log"
UserConfigPath
=
"/home/lic/users.json"
}
if
logenv
==
"PRODUCT"
{
Directory
=
"/data/soft/rsync_log"
UserConfigPath
=
"/data/users.json"
Directory
=
"/data/inotify_logs"
}
UserConfigPath
=
GetCurrentPath
()
+
"/config/users.json"
}
config/users.json
0 → 100644
View file @
6ecaf9d1
{
"weblog"
:
"824d8eb068e6917d21e8d39db9edffe7"
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment