Work on common provider interface to make adding new providers easier

This commit is contained in:
TwinProduction
2020-09-26 14:23:43 -04:00
parent 7dcd462883
commit ac5ad9d173
7 changed files with 63 additions and 73 deletions

View File

@ -4,6 +4,7 @@ import (
"bytes"
"fmt"
"github.com/TwinProduction/gatus/client"
"github.com/TwinProduction/gatus/core"
"io/ioutil"
"net/http"
"strings"
@ -20,6 +21,10 @@ func (provider *AlertProvider) IsValid() bool {
return len(provider.Url) > 0
}
func (provider *AlertProvider) ToCustomAlertProvider(service *core.Service, alert *core.Alert, result *core.Result, resolved bool) *AlertProvider {
return provider
}
func (provider *AlertProvider) buildRequest(serviceName, alertDescription string, resolved bool) *http.Request {
body := provider.Body
providerUrl := provider.Url