|
|
@ -229,9 +229,9 @@ func forcePathSeparator(path string) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// NewConfigContext initializes configuration context.
|
|
|
|
// NewContext initializes configuration context.
|
|
|
|
// NOTE: do not print any log except error.
|
|
|
|
// NOTE: do not print any log except error.
|
|
|
|
func NewConfigContext() { |
|
|
|
func NewContext() { |
|
|
|
workDir, err := WorkDir() |
|
|
|
workDir, err := WorkDir() |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
log.Fatal(4, "Fail to get work directory: %v", err) |
|
|
|
log.Fatal(4, "Fail to get work directory: %v", err) |
|
|
@ -545,6 +545,7 @@ func newSessionService() { |
|
|
|
|
|
|
|
|
|
|
|
// Mailer represents mail service.
|
|
|
|
// Mailer represents mail service.
|
|
|
|
type Mailer struct { |
|
|
|
type Mailer struct { |
|
|
|
|
|
|
|
QueueLength int |
|
|
|
Name string |
|
|
|
Name string |
|
|
|
Host string |
|
|
|
Host string |
|
|
|
From string |
|
|
|
From string |
|
|
@ -581,6 +582,7 @@ func newMailService() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
MailService = &Mailer{ |
|
|
|
MailService = &Mailer{ |
|
|
|
|
|
|
|
QueueLength: sec.Key("SEND_BUFFER_LEN").MustInt(100), |
|
|
|
Name: sec.Key("NAME").MustString(AppName), |
|
|
|
Name: sec.Key("NAME").MustString(AppName), |
|
|
|
Host: sec.Key("HOST").String(), |
|
|
|
Host: sec.Key("HOST").String(), |
|
|
|
User: sec.Key("USER").String(), |
|
|
|
User: sec.Key("USER").String(), |
|
|
|