| 73 | } |
| 74 | |
| 75 | func (o *statusCode) RoundTrip(_ *http.Request) (*http.Response, error) { |
| 76 | if o.defaultResp { |
| 77 | o.log.Warn().Msg(ErrNoIngressRulesCLI.Error()) |
| 78 | } |
| 79 | resp := &http.Response{ |
| 80 | StatusCode: o.code, |
| 81 | Status: fmt.Sprintf("%d %s", o.code, http.StatusText(o.code)), |
| 82 | Body: new(NopReadCloser), |
| 83 | } |
| 84 | |
| 85 | return resp, nil |
| 86 | } |
| 87 | |
| 88 | func (o *rawTCPService) EstablishConnection(ctx context.Context, dest string, logger *zerolog.Logger) (OriginConnection, error) { |
| 89 | conn, err := o.dialer.DialContext(ctx, "tcp", dest) |