| 1 |
package testsuite |
| 2 |
|
| 3 |
import ( |
| 4 |
"net/http" |
| 5 |
|
| 6 |
"github.com/jkroepke/openvpn-auth-oauth2/v2/internal/test/testlogger" |
| 7 |
) |
| 8 |
|
| 9 |
type Options func(*Suite) *Suite |
| 10 |
|
| 11 |
func WithHTTPTransport(rt http.RoundTripper) Options { |
| 12 |
return func(s *Suite) *Suite { |
| 13 |
s.rt = rt |
| 14 |
|
| 15 |
return s |
| 16 |
} |
| 17 |
} |
| 18 |
|
| 19 |
// WithDiscardLogger configures the suite to format logs without retaining them. |
| 20 |
func WithDiscardLogger() Options { |
| 21 |
return func(s *Suite) *Suite { |
| 22 |
s.logger = testlogger.NewDiscard() |
| 23 |
|
| 24 |
return s |
| 25 |
} |
| 26 |
} |