Versions in this module Expand all Collapse all v1 v1.0.0 Sep 6, 2020 Changes in this version + func GetAdminBackendListAsMap(t *testing.T, config *TestConfig) map[string]AdminBackend + func GetAdminRequest(t *testing.T, ep string, returnData interface{}) + type AdminActionResponse struct + Reason string + Result string + StatusCode int + func GetAdminActionRequest(t *testing.T, ep string) *AdminActionResponse + func PostAdminActionRequest(t *testing.T, ep string, postData []byte) *AdminActionResponse + func (aar *AdminActionResponse) BadRequest() bool + func (aar *AdminActionResponse) Failed() bool + func (aar *AdminActionResponse) NoActionReqd() bool + func (aar *AdminActionResponse) String() string + func (aar *AdminActionResponse) Successful() bool + type AdminBackend struct + ActiveConnections int + Enabled bool + ID string + TotalConnections int + TotalFailures int + Tripped bool + URL string + func GetAdminBackendList(t *testing.T, config *TestConfig) []AdminBackend + func (ab *AdminBackend) Add(t *testing.T, config *TestConfig, abConfig *NewBackendData) *AdminActionResponse + func (ab *AdminBackend) Config(t *testing.T, config *TestConfig) *NewBackendData + func (ab *AdminBackend) Delete(t *testing.T, config *TestConfig) *AdminActionResponse + func (ab *AdminBackend) Disable(t *testing.T, config *TestConfig) *AdminActionResponse + func (ab *AdminBackend) Enable(t *testing.T, config *TestConfig) *AdminActionResponse + func (ab *AdminBackend) Failover(t *testing.T, config *TestConfig) *AdminActionResponse + func (ab *AdminBackend) Reset(t *testing.T, config *TestConfig) *AdminActionResponse + type AdminFrontend struct + ID string + func GetAdminFrontendList(t *testing.T, config *TestConfig) []AdminFrontend + func (af *AdminFrontend) Pause(t *testing.T, config *TestConfig) *AdminActionResponse + func (af *AdminFrontend) Resume(t *testing.T, config *TestConfig) *AdminActionResponse + type AdminSession struct + BackendID string + ID string + MsgsReceived int + MsgsSent int + Reconnects int + URI string + func GetAdminSessionList(t *testing.T, config *TestConfig) []AdminSession + func (ss *AdminSession) Abort(t *testing.T, config *TestConfig) *AdminActionResponse + func (ss *AdminSession) Failover(t *testing.T, config *TestConfig) *AdminActionResponse + type NewBackendData struct + AbnormalCloseCodes []int + BreakerThreshold int + HandshakeTimeout string + ID string + PassHeaders []string + PingTime string + ReadBufferSize int + URL string + WriteBufferSize int + type SvrBuilder func(*in.ServerConfig, *in.Manager) *http.Server + type TestBackend struct + Connections *TestBackendConnections + CustomAcceptor func(w http.ResponseWriter, r *http.Request) + HTTPServer *http.Server + IgnoreLastTrackers bool + Listening bool + Responder func(*common.WsMessage) *common.WsMessage + ResponseHeader http.Header + Upgrader *websocket.Upgrader + func (ts *TestBackend) CloseAllConnections() + func (ts *TestBackend) CloseAllConnectionsWithCode(closeCode int) + func (ts *TestBackend) ConnectionCount() int + func (ts *TestBackend) EchoResponder(msg *common.WsMessage) *common.WsMessage + func (ts *TestBackend) LastConnectedAt() time.Time + func (ts *TestBackend) LastConnection() *websocket.Conn + func (ts *TestBackend) LastHeader() http.Header + func (ts *TestBackend) LastPingAt() time.Time + func (ts *TestBackend) LastReceived() *common.WsMessage + func (ts *TestBackend) LastSent() *common.WsMessage + func (ts *TestBackend) NilResponder(msg *common.WsMessage) *common.WsMessage + func (ts *TestBackend) ResetStats() + func (ts *TestBackend) ServeWS(w http.ResponseWriter, r *http.Request) + func (ts *TestBackend) Start() + func (ts *TestBackend) TerminateAllConnections() + type TestBackendConfig struct + Addr string + BufferSize int + IgnoreLastTrackers bool + Server *TestBackend + Subprotocol []string + func (cfg *TestBackendConfig) GetServer() *TestBackend + type TestBackendConnections struct + func (tbc *TestBackendConnections) Add(con *websocket.Conn) + func (tbc *TestBackendConnections) Contains(con *websocket.Conn) bool + func (tbc *TestBackendConnections) Delete(con *websocket.Conn) + func (tbc *TestBackendConnections) Len() int + func (tbc *TestBackendConnections) List() []*websocket.Conn + type TestClient struct + Dialer *websocket.Dialer + Endpoint string + LastPongAt time.Time + Received int + Sent int + WsConnection *websocket.Conn + func (tc *TestClient) Connect() (*http.Response, error) + func (tc *TestClient) ConnectWithHeaders(reqHeaders http.Header) (*http.Response, error) + func (tc *TestClient) Ping(data string) error + func (tc *TestClient) ReadMessage() (*common.WsMessage, error) + func (tc *TestClient) ResetStats() + func (tc *TestClient) Send(msg *common.WsMessage) error + func (tc *TestClient) SendBinary(data string) error + func (tc *TestClient) SendRecvTestMessage(t *testing.T, inMsg interface{}, expectFailure bool, expectDiffResponse bool) []byte + func (tc *TestClient) SendText(data string) error + func (tc *TestClient) Subprotocol() string + type TestClientConfig struct + BufferSize int + Connections *TestClientConnections + Endpoint string + HandshakeTimeout time.Duration + Subprotocol []string + func (cfg *TestClientConfig) Close(client *TestClient) error + func (cfg *TestClientConfig) CloseAll() + func (cfg *TestClientConfig) CloseAllWithCode(closeCode int) + func (cfg *TestClientConfig) CloseWithCode(client *TestClient, closeCode int) error + func (cfg *TestClientConfig) GetClient() *TestClient + func (cfg *TestClientConfig) GetConnected(t *testing.T, headers http.Header, expectFailure bool, expectedStatusCode int) *TestClient + type TestClientConnections struct + func (tcc *TestClientConnections) Add(con *TestClient) + func (tcc *TestClientConnections) Contains(con *TestClient) bool + func (tcc *TestClientConnections) Delete(con *TestClient) + func (tcc *TestClientConnections) Len() int + func (tcc *TestClientConnections) List() []*TestClient + type TestConfig struct + AdmSerer *http.Server + Backends []*TestBackendConfig + Clients []*TestClientConfig + FeServer *http.Server + InManager *in.Manager + InitialRoutines int + OutManager *out.Manager + RunParallel bool + Server in.ServerConfig + Upstream out.UpstreamConfig + ValidateTestLeaks bool + func GetFourBkConfig() *TestConfig + func GetOneBkConfig() *TestConfig + func GetTwoBkConfig() *TestConfig + func LoadConfig(config string) *TestConfig + func (tc *TestConfig) ForParallelTest() *TestConfig + func (tc *TestConfig) ForTest() *TestConfig + func (tc *TestConfig) GetLatestBackend() *TestBackend + func (tc *TestConfig) ResetStats() + func (tc *TestConfig) StartAll() + func (tc *TestConfig) StartBalancer() + func (tc *TestConfig) StopAll() + func (tc *TestConfig) StopBalancer() + func (tc *TestConfig) StopForTest()