Documentation ¶
Overview ¶
Package proxy is a generated GoMock package.
Package proxy is a generated GoMock package.
Package proxy is a generated GoMock package.
Index ¶
- func Perform(ctx *fasthttp.RequestCtx, proxyPool Pool) error
- type FastHTTPWebSocketClient
- type FastHTTPWebSocketConn
- func (f *FastHTTPWebSocketConn) Close() error
- func (f *FastHTTPWebSocketConn) ReadMessage() (messageType int, p []byte, err error)
- func (f *FastHTTPWebSocketConn) SendCloseConnection(closeType int) error
- func (f *FastHTTPWebSocketConn) SendComplete(messageType int, id string) error
- func (f *FastHTTPWebSocketConn) SendError(messageType int, msgID string, requestErrors error) error
- func (f *FastHTTPWebSocketConn) WriteMessage(messageType int, data []byte) error
- type GqlWSErrorMessage
- type HTTPClient
- type MockHTTPClient
- type MockHTTPClientMockRecorder
- type MockPool
- type MockPoolMockRecorder
- type MockWebSocketClient
- type MockWebSocketClientMockRecorder
- type MockWebSocketConn
- func (m *MockWebSocketConn) Close() error
- func (m *MockWebSocketConn) EXPECT() *MockWebSocketConnMockRecorder
- func (m *MockWebSocketConn) ReadMessage() (int, []byte, error)
- func (m *MockWebSocketConn) SendCloseConnection(closeType int) error
- func (m *MockWebSocketConn) SendComplete(messageType int, id string) error
- func (m *MockWebSocketConn) SendError(messageType int, msgID string, requestErrors error) error
- func (m *MockWebSocketConn) WriteMessage(messageType int, data []byte) error
- type MockWebSocketConnMockRecorder
- func (mr *MockWebSocketConnMockRecorder) Close() *gomock.Call
- func (mr *MockWebSocketConnMockRecorder) ReadMessage() *gomock.Call
- func (mr *MockWebSocketConnMockRecorder) SendCloseConnection(closeType interface{}) *gomock.Call
- func (mr *MockWebSocketConnMockRecorder) SendComplete(messageType, id interface{}) *gomock.Call
- func (mr *MockWebSocketConnMockRecorder) SendError(messageType, msgID, requestErrors interface{}) *gomock.Call
- func (mr *MockWebSocketConnMockRecorder) WriteMessage(messageType, data interface{}) *gomock.Call
- type Options
- type Pool
- type WSClientOptions
- type WebSocketClient
- type WebSocketConn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FastHTTPWebSocketClient ¶ added in v0.6.13
type FastHTTPWebSocketClient struct { Dialer *websocket.Dialer ConnStr string Logger *logrus.Logger }
FastHTTPWebSocketClient implements the WebSocketClient interface
func (*FastHTTPWebSocketClient) GetConn ¶ added in v0.6.13
func (f *FastHTTPWebSocketClient) GetConn(ctx *fasthttp.RequestCtx) (*FastHTTPWebSocketConn, error)
type FastHTTPWebSocketConn ¶ added in v0.6.13
type FastHTTPWebSocketConn struct { Conn *websocket.Conn Logger *logrus.Logger Ctx *fasthttp.RequestCtx // contains filtered or unexported fields }
FastHTTPWebSocketConn implements the WebSocketConn interface
func (*FastHTTPWebSocketConn) Close ¶ added in v0.6.13
func (f *FastHTTPWebSocketConn) Close() error
func (*FastHTTPWebSocketConn) ReadMessage ¶ added in v0.6.13
func (f *FastHTTPWebSocketConn) ReadMessage() (messageType int, p []byte, err error)
func (*FastHTTPWebSocketConn) SendCloseConnection ¶ added in v0.6.13
func (f *FastHTTPWebSocketConn) SendCloseConnection(closeType int) error
func (*FastHTTPWebSocketConn) SendComplete ¶ added in v0.6.13
func (f *FastHTTPWebSocketConn) SendComplete(messageType int, id string) error
func (*FastHTTPWebSocketConn) SendError ¶ added in v0.6.13
func (f *FastHTTPWebSocketConn) SendError(messageType int, msgID string, requestErrors error) error
func (*FastHTTPWebSocketConn) WriteMessage ¶ added in v0.6.13
func (f *FastHTTPWebSocketConn) WriteMessage(messageType int, data []byte) error
type GqlWSErrorMessage ¶ added in v0.6.13
type GqlWSErrorMessage struct { ID string `json:"id"` Type string `json:"type"` Payload graphql.RequestErrors `json:"payload,omitempty"` }
type HTTPClient ¶
type MockHTTPClient ¶ added in v0.6.9
type MockHTTPClient struct {
// contains filtered or unexported fields
}
MockHTTPClient is a mock of HTTPClient interface.
func NewMockHTTPClient ¶ added in v0.6.9
func NewMockHTTPClient(ctrl *gomock.Controller) *MockHTTPClient
NewMockHTTPClient creates a new mock instance.
func (*MockHTTPClient) EXPECT ¶ added in v0.6.9
func (m *MockHTTPClient) EXPECT() *MockHTTPClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockHTTPClientMockRecorder ¶ added in v0.6.9
type MockHTTPClientMockRecorder struct {
// contains filtered or unexported fields
}
MockHTTPClientMockRecorder is the mock recorder for MockHTTPClient.
func (*MockHTTPClientMockRecorder) Do ¶ added in v0.6.9
func (mr *MockHTTPClientMockRecorder) Do(req, resp interface{}) *gomock.Call
Do indicates an expected call of Do.
type MockPool ¶ added in v0.6.9
type MockPool struct {
// contains filtered or unexported fields
}
MockPool is a mock of Pool interface.
func NewMockPool ¶ added in v0.6.9
func NewMockPool(ctrl *gomock.Controller) *MockPool
NewMockPool creates a new mock instance.
func (*MockPool) EXPECT ¶ added in v0.6.9
func (m *MockPool) EXPECT() *MockPoolMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockPool) Get ¶ added in v0.6.9
func (m *MockPool) Get() (HTTPClient, error)
Get mocks base method.
func (*MockPool) Put ¶ added in v0.6.9
func (m *MockPool) Put(arg0 HTTPClient) error
Put mocks base method.
type MockPoolMockRecorder ¶ added in v0.6.9
type MockPoolMockRecorder struct {
// contains filtered or unexported fields
}
MockPoolMockRecorder is the mock recorder for MockPool.
func (*MockPoolMockRecorder) Close ¶ added in v0.6.9
func (mr *MockPoolMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockPoolMockRecorder) Get ¶ added in v0.6.9
func (mr *MockPoolMockRecorder) Get() *gomock.Call
Get indicates an expected call of Get.
func (*MockPoolMockRecorder) Len ¶ added in v0.6.9
func (mr *MockPoolMockRecorder) Len() *gomock.Call
Len indicates an expected call of Len.
func (*MockPoolMockRecorder) Put ¶ added in v0.6.9
func (mr *MockPoolMockRecorder) Put(arg0 interface{}) *gomock.Call
Put indicates an expected call of Put.
type MockWebSocketClient ¶ added in v0.6.13
type MockWebSocketClient struct {
// contains filtered or unexported fields
}
MockWebSocketClient is a mock of WebSocketClient interface.
func NewMockWebSocketClient ¶ added in v0.6.13
func NewMockWebSocketClient(ctrl *gomock.Controller) *MockWebSocketClient
NewMockWebSocketClient creates a new mock instance.
func (*MockWebSocketClient) EXPECT ¶ added in v0.6.13
func (m *MockWebSocketClient) EXPECT() *MockWebSocketClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockWebSocketClient) GetConn ¶ added in v0.6.13
func (m *MockWebSocketClient) GetConn(ctx *fasthttp.RequestCtx) (*FastHTTPWebSocketConn, error)
GetConn mocks base method.
type MockWebSocketClientMockRecorder ¶ added in v0.6.13
type MockWebSocketClientMockRecorder struct {
// contains filtered or unexported fields
}
MockWebSocketClientMockRecorder is the mock recorder for MockWebSocketClient.
func (*MockWebSocketClientMockRecorder) GetConn ¶ added in v0.6.13
func (mr *MockWebSocketClientMockRecorder) GetConn(ctx interface{}) *gomock.Call
GetConn indicates an expected call of GetConn.
type MockWebSocketConn ¶ added in v0.6.13
type MockWebSocketConn struct {
// contains filtered or unexported fields
}
MockWebSocketConn is a mock of WebSocketConn interface.
func NewMockWebSocketConn ¶ added in v0.6.13
func NewMockWebSocketConn(ctrl *gomock.Controller) *MockWebSocketConn
NewMockWebSocketConn creates a new mock instance.
func (*MockWebSocketConn) Close ¶ added in v0.6.13
func (m *MockWebSocketConn) Close() error
Close mocks base method.
func (*MockWebSocketConn) EXPECT ¶ added in v0.6.13
func (m *MockWebSocketConn) EXPECT() *MockWebSocketConnMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockWebSocketConn) ReadMessage ¶ added in v0.6.13
func (m *MockWebSocketConn) ReadMessage() (int, []byte, error)
ReadMessage mocks base method.
func (*MockWebSocketConn) SendCloseConnection ¶ added in v0.6.13
func (m *MockWebSocketConn) SendCloseConnection(closeType int) error
SendCloseConnection mocks base method.
func (*MockWebSocketConn) SendComplete ¶ added in v0.6.13
func (m *MockWebSocketConn) SendComplete(messageType int, id string) error
SendComplete mocks base method.
func (*MockWebSocketConn) SendError ¶ added in v0.6.13
func (m *MockWebSocketConn) SendError(messageType int, msgID string, requestErrors error) error
SendError mocks base method.
func (*MockWebSocketConn) WriteMessage ¶ added in v0.6.13
func (m *MockWebSocketConn) WriteMessage(messageType int, data []byte) error
WriteMessage mocks base method.
type MockWebSocketConnMockRecorder ¶ added in v0.6.13
type MockWebSocketConnMockRecorder struct {
// contains filtered or unexported fields
}
MockWebSocketConnMockRecorder is the mock recorder for MockWebSocketConn.
func (*MockWebSocketConnMockRecorder) Close ¶ added in v0.6.13
func (mr *MockWebSocketConnMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockWebSocketConnMockRecorder) ReadMessage ¶ added in v0.6.13
func (mr *MockWebSocketConnMockRecorder) ReadMessage() *gomock.Call
ReadMessage indicates an expected call of ReadMessage.
func (*MockWebSocketConnMockRecorder) SendCloseConnection ¶ added in v0.6.13
func (mr *MockWebSocketConnMockRecorder) SendCloseConnection(closeType interface{}) *gomock.Call
SendCloseConnection indicates an expected call of SendCloseConnection.
func (*MockWebSocketConnMockRecorder) SendComplete ¶ added in v0.6.13
func (mr *MockWebSocketConnMockRecorder) SendComplete(messageType, id interface{}) *gomock.Call
SendComplete indicates an expected call of SendComplete.
func (*MockWebSocketConnMockRecorder) SendError ¶ added in v0.6.13
func (mr *MockWebSocketConnMockRecorder) SendError(messageType, msgID, requestErrors interface{}) *gomock.Call
SendError indicates an expected call of SendError.
func (*MockWebSocketConnMockRecorder) WriteMessage ¶ added in v0.6.13
func (mr *MockWebSocketConnMockRecorder) WriteMessage(messageType, data interface{}) *gomock.Call
WriteMessage indicates an expected call of WriteMessage.
type Pool ¶
type Pool interface { // Get returns a new ReverseProxy from the pool. Get() (HTTPClient, error) // Put the ReverseProxy puts it back to the Pool. Put(HTTPClient) error // Close closes the pool and all its connections. After Close() the pool is // no longer usable. Close() // Len returns the current number of connections of the pool. Len() int }
type WSClientOptions ¶ added in v0.6.13
type WebSocketClient ¶ added in v0.6.13
type WebSocketClient interface {
GetConn(ctx *fasthttp.RequestCtx) (*FastHTTPWebSocketConn, error)
}
WebSocketClient defines the interface for WebSocket connections Pool
func NewWSClient ¶ added in v0.6.13
func NewWSClient(logger *logrus.Logger, options *WSClientOptions) (WebSocketClient, error)
type WebSocketConn ¶ added in v0.6.13
type WebSocketConn interface { ReadMessage() (messageType int, p []byte, err error) WriteMessage(messageType int, data []byte) error SendError(messageType int, msgID string, requestErrors error) error SendComplete(messageType int, id string) error SendCloseConnection(closeType int) error Close() error }
WebSocketConn defines the interface for WebSocket connections