Example #1
0
func startUp() {
	loggerConfig := gomol.NewConsoleLoggerConfig()
	consoleLogger, _ := gomol.NewConsoleLogger(loggerConfig)
	gomol.AddLogger(consoleLogger)
	gomol.InitLoggers()
	gomol.Info("Initialized console logger")
}
Example #2
0
func SendIncomingWebhook(model *IncomingWebhook) (int, error) {

	payload, err := makePostPayload(model)
	if err != nil {
		return 0, err
	}
	req, err := makeRequest(Config.WebhookUrl, payload)
	if err != nil {
		return 0, err
	}

	code, err := sendRequest(req)
	if err != nil {
		return 0, err
	}

	gomol.Info("Sent an IncomingWebhook")
	return code, nil
}
Example #3
0
func cleanUp() {
	gomol.Info("Shutting down loggers")
	gomol.ShutdownLoggers()
}