Make the testKeys extractions methods more robust
This commit is contained in:
parent
bc5fe7d8bf
commit
1879f8e961
9 changed files with 128 additions and 52 deletions
|
|
@ -24,7 +24,7 @@ type FacebookMessengerTestKeys struct {
|
|||
}
|
||||
|
||||
// GetTestKeys generates a summary for a test run
|
||||
func (h FacebookMessenger) GetTestKeys(tk map[string]interface{}) interface{} {
|
||||
func (h FacebookMessenger) GetTestKeys(tk map[string]interface{}) (interface{}, error) {
|
||||
var (
|
||||
dnsBlocking bool
|
||||
tcpBlocking bool
|
||||
|
|
@ -45,7 +45,7 @@ func (h FacebookMessenger) GetTestKeys(tk map[string]interface{}) interface{} {
|
|||
DNSBlocking: dnsBlocking,
|
||||
TCPBlocking: tcpBlocking,
|
||||
IsAnomaly: dnsBlocking || tcpBlocking,
|
||||
}
|
||||
}, nil
|
||||
}
|
||||
|
||||
// LogSummary writes the summary to the standard output
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ type TelegramTestKeys struct {
|
|||
}
|
||||
|
||||
// GetTestKeys generates a summary for a test run
|
||||
func (h Telegram) GetTestKeys(tk map[string]interface{}) interface{} {
|
||||
func (h Telegram) GetTestKeys(tk map[string]interface{}) (interface{}, error) {
|
||||
var (
|
||||
tcpBlocking bool
|
||||
httpBlocking bool
|
||||
|
|
@ -53,7 +53,7 @@ func (h Telegram) GetTestKeys(tk map[string]interface{}) interface{} {
|
|||
HTTPBlocking: httpBlocking,
|
||||
WebBlocking: webBlocking,
|
||||
IsAnomaly: webBlocking || httpBlocking || tcpBlocking,
|
||||
}
|
||||
}, nil
|
||||
}
|
||||
|
||||
// LogSummary writes the summary to the standard output
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ type WhatsAppTestKeys struct {
|
|||
}
|
||||
|
||||
// GetTestKeys generates a summary for a test run
|
||||
func (h WhatsApp) GetTestKeys(tk map[string]interface{}) interface{} {
|
||||
func (h WhatsApp) GetTestKeys(tk map[string]interface{}) (interface{}, error) {
|
||||
var (
|
||||
webBlocking bool
|
||||
registrationBlocking bool
|
||||
|
|
@ -51,7 +51,7 @@ func (h WhatsApp) GetTestKeys(tk map[string]interface{}) interface{} {
|
|||
WebBlocking: webBlocking,
|
||||
EndpointsBlocking: endpointsBlocking,
|
||||
IsAnomaly: registrationBlocking || webBlocking || endpointsBlocking,
|
||||
}
|
||||
}, nil
|
||||
}
|
||||
|
||||
// LogSummary writes the summary to the standard output
|
||||
|
|
|
|||
Loading…
Reference in a new issue