From fa647c6645f74e3c0e6fded658f5f8b5882b0e01 Mon Sep 17 00:00:00 2001 From: Will Hawkins Date: Wed, 4 May 2022 10:45:06 -0400 Subject: Fully support self-signed certificates (and add debug levels) Two unrelated changes: 1. Add full support for self-signed HTTPS certificates on the server 2. Add support for multiple log levels: So far we only use one, but adding support for additional levels will help us tier the levels to filter out excessive messages. --- timeoutat/timeoutat.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'timeoutat') diff --git a/timeoutat/timeoutat.go b/timeoutat/timeoutat.go index 0e13a9f..eac57f2 100644 --- a/timeoutat/timeoutat.go +++ b/timeoutat/timeoutat.go @@ -18,17 +18,20 @@ import ( "context" "fmt" "time" + + "github.com/network-quality/goresponsiveness/constants" + "github.com/network-quality/goresponsiveness/utilities" ) func TimeoutAt( ctx context.Context, when time.Time, - debug bool, + debug constants.DebugLevel, ) (response chan interface{}) { response = make(chan interface{}) go func(ctx context.Context) { go func() { - if debug { + if utilities.IsDebug(debug) { fmt.Printf("Timeout expected to end at %v\n", when) } select { @@ -36,7 +39,7 @@ func TimeoutAt( case <-ctx.Done(): } response <- struct{}{} - if debug { + if utilities.IsDebug(debug) { fmt.Printf("Timeout ended at %v\n", time.Now()) } }() -- cgit v1.2.3