-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
60 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package message | ||
|
||
var ( | ||
GLO_CONF_CH chan Config | ||
GLO_CONF Config | ||
) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package message | ||
|
||
type Message interface { | ||
Send(body Body) error | ||
} | ||
|
||
type Body struct { | ||
Title string | ||
Content string | ||
} | ||
|
||
func GetType() Message { | ||
switch GLO_CONF.MsgType { | ||
case "bark": | ||
return &Bark{ | ||
url: GLO_CONF.BarkUrl, | ||
key: GLO_CONF.BarkKey, | ||
} | ||
case "mail": | ||
return &Mail{ | ||
Host: GLO_CONF.MailHost, | ||
Port: GLO_CONF.MailPort, | ||
Username: GLO_CONF.MailUser, | ||
Password: GLO_CONF.MailPwd, | ||
FromName: GLO_CONF.MailFromName, | ||
To: GLO_CONF.MailTo, | ||
} | ||
} | ||
return nil | ||
} | ||
|
||
func Enabled() bool { | ||
return GLO_CONF.MsgEnabled | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package model | ||
package message | ||
|
||
// Config | ||
// @Description: 配置 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters