You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library supports sending alert as email and as message card to Ms Teams' channel. It is built with go version go1.12.9
Installing
*go get
go get -u github.com/rakutentech/go-alertnotification
Configurations
This package use golang environmrnt variable as setting. It uses os.Getenv to get the configuration values. You can use any enivronment setting package. However, in the unittest and example example use godotenv from https://github.com/joho/godotenv.
General Configs
No
Environment Variable
default
Explanation
1
APP_ENV
""
application envinronment to be appeared in email/teams message
2
APP_NAME
""
application name to be appeared in email/teams message
Enabled by default to avoid sending too many notification. Set it to "false" to disable. Enable this it will send notification only 1 for the same error within THROTTLE_DURATION. Otherwise, it will send each occurence of the error. Recommended to be enable.
//importimport n "github.com/rakutentech/go-alertnotification"//Create New Alertalert:=n.NewAlert(err, ignoringErr);
//Send notificationalert.Notify();
// To remove all current throttlingalert.RemoveCurrentThrotting()