Injected context cancellation for dial and retry cancellation.

This commit is contained in:
Jay
2026-04-18 17:11:22 -04:00
parent e1cdc1cf9c
commit b4c5c897e8
12 changed files with 182 additions and 230 deletions

View File

@@ -12,11 +12,15 @@ import (
// Dialer Mocks
type MockDialer struct {
DialFunc func(string, http.Header) (types.Socket, *http.Response, error)
DialContextFunc func(
context.Context, string, http.Header,
) (types.Socket, *http.Response, error)
}
func (m *MockDialer) Dial(url string, h http.Header) (types.Socket, *http.Response, error) {
return m.DialFunc(url, h)
func (m *MockDialer) DialContext(
ctx context.Context, url string, h http.Header,
) (types.Socket, *http.Response, error) {
return m.DialContextFunc(ctx, url, h)
}
// Socket Mocks