Files
kuberay/ray-operator/controllers/ray/utils/fake_httpproxy_httpclient.go
Kai-Hsun ChenandGitHub 0cabd142f8 [Bug] Service (Serve) changing port from 8000 to 9000 doesn't work (#1081)
Service (Serve) changing port from 8000 to 9000 doesn't work
2023-05-15 13:36:59 -07:00

33 lines
627 B
Go

package utils
import (
"fmt"
"net/http"
"time"
)
func GetFakeRayHttpProxyClient() RayHttpProxyClientInterface {
return &FakeRayHttpProxyClient{}
}
type FakeRayHttpProxyClient struct {
client http.Client
httpProxyURL string
}
func (r *FakeRayHttpProxyClient) InitClient() {
r.client = http.Client{
Timeout: 20 * time.Millisecond,
}
}
func (r *FakeRayHttpProxyClient) SetHostIp(hostIp string, port int) {
r.httpProxyURL = fmt.Sprintf("http://%s:%d", hostIp, port)
}
func (r *FakeRayHttpProxyClient) CheckHealth() error {
// TODO: test check return error cases.
// Always return successful.
return nil
}