From ede36dd76170e26dfa481cd50c516ad380320012 Mon Sep 17 00:00:00 2001 From: eshitachandwani Date: Sat, 30 Nov 2024 00:07:07 +0530 Subject: [PATCH] comment --- internal/testutils/proxy.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/testutils/proxy.go b/internal/testutils/proxy.go index c7044e0232c9..8361efcdc5b1 100644 --- a/internal/testutils/proxy.go +++ b/internal/testutils/proxy.go @@ -30,7 +30,8 @@ import ( const defaultTestTimeout = 10 * time.Second -type proxyServer struct { +// ProxyServer is a proxy server that is used for testing. +type ProxyServer struct { lis net.Listener in net.Conn out net.Conn @@ -39,7 +40,7 @@ type proxyServer struct { } // Stop functions stops and cleans up the proxy server. -func (p *proxyServer) Stop() { +func (p *ProxyServer) Stop() { p.lis.Close() if p.in != nil { p.in.Close() @@ -50,8 +51,8 @@ func (p *proxyServer) Stop() { } // NewProxyServer create and starts a proxy server. -func NewProxyServer(lis net.Listener, requestCheck func(*http.Request) error, errCh chan error, doneCh chan struct{}, backendAddr string, resolutionOnClient bool, proxyServerStarted func()) *proxyServer { - p := &proxyServer{ +func NewProxyServer(lis net.Listener, requestCheck func(*http.Request) error, errCh chan error, doneCh chan struct{}, backendAddr string, resolutionOnClient bool, proxyServerStarted func()) *ProxyServer { + p := &ProxyServer{ lis: lis, requestCheck: requestCheck, }