Skip to content
This repository was archived by the owner on Sep 7, 2024. It is now read-only.

Commit 24609c3

Browse files
authored
chore: config structure updated (#60)
1 parent 529b548 commit 24609c3

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

config/config.go

+12-7
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type Log struct {
3030

3131
type User struct {
3232
Name string `yaml:"name"`
33-
PassWord string `yaml:"pass_word"`
33+
Password string `yaml:"password"`
3434
Cmds []string `yaml:"cmds"`
3535
}
3636

@@ -42,14 +42,19 @@ func (conf *Config) BasicCheck() error {
4242
}
4343

4444
func DefaultConfig() *Config {
45-
config := &Config{}
46-
config.Log.Path = "ttrace.log"
47-
config.Name = "time_trace"
48-
config.Server.IP = "localhost"
49-
config.Server.Port = "7070"
45+
config := &Config{
46+
Server: Server{
47+
IP: "localhost",
48+
Port: "7070",
49+
},
50+
Log: Log{
51+
Path: "ttrace.log",
52+
},
53+
Name: "time_trace",
54+
}
5055
rootUser := User{
5156
Name: "root",
52-
PassWord: "super_secret_password",
57+
Password: "super_secret_password",
5358
Cmds: []string{"*"},
5459
}
5560
config.Users = append(config.Users, rootUser)

config/config.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ log:
99

1010
users:
1111
- name: root
12-
pass_word: super_secret_password
12+
password: super_secret_password
1313
cmds:
1414
- '*'
15+
1516
# Also you can use this for multiple users and limited commands
1617
# users:
1718
# - name: root
18-
# pass_word: super_secret_password
19+
# password: super_secret_password
1920
# cmd:
2021
# - * # all commands.
2122
# - name: developer

0 commit comments

Comments
 (0)