Documentation
¶
Index ¶
- func ConnectErrorToToHTTPResponse(err error, transforms []configtypes.ConnectCodeToHTTPResponseTransform) (configtypes.TransformedConnectErrorHttpResponse, bool)
- func FileExists(filename string) bool
- func GenerateConfig(f string) error
- func GetLogAddresses(addresses []string) string
- func IsASCII(s string) bool
- func NodeWithMemoryEngine() *centrifuge.Node
- func NodeWithMemoryEngineNoHandlers() *centrifuge.Node
- func OptionalStringChoice(value string, choices []string) (string, error)
- func PathExists(path string) (bool, error)
- func RedactedLogURLs(urls ...string) []string
- func SecureCompare(given, actual []byte) bool
- func SecureCompareString(given, actual string) bool
- func StripPassword(address string) string
- func WritePidFile(pidFile string) error
- type CommonGRPCProxyTestCase
- type CommonHTTPProxyTestCase
- type TestClientMock
- func (m *TestClientMock) AcquireStorage() (map[string]any, func(map[string]any))
- func (m *TestClientMock) Context() context.Context
- func (m *TestClientMock) Disconnect(disconnect ...centrifuge.Disconnect)
- func (m *TestClientMock) ID() string
- func (m *TestClientMock) IsSubscribed(s string) bool
- func (m *TestClientMock) Send(bytes []byte) error
- func (m *TestClientMock) Transport() centrifuge.TransportInfo
- func (m *TestClientMock) Unsubscribe(ch string, unsubscribe ...centrifuge.Unsubscribe)
- func (m *TestClientMock) UserID() string
- func (m *TestClientMock) WritePublication(channel string, publication *centrifuge.Publication, ...) error
- type TestTransport
- func (t *TestTransport) Close(disconnect centrifuge.Disconnect) error
- func (t *TestTransport) DisabledPushFlags() uint64
- func (t *TestTransport) Emulation() bool
- func (t *TestTransport) Name() string
- func (t *TestTransport) PingPongConfig() centrifuge.PingPongConfig
- func (t *TestTransport) Protocol() centrifuge.ProtocolType
- func (t *TestTransport) ProtocolVersion() centrifuge.ProtocolVersion
- func (t *TestTransport) Unidirectional() bool
- func (t *TestTransport) Write(message []byte) error
- func (t *TestTransport) WriteMany(messages ...[]byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectErrorToToHTTPResponse ¶
func ConnectErrorToToHTTPResponse(err error, transforms []configtypes.ConnectCodeToHTTPResponseTransform) (configtypes.TransformedConnectErrorHttpResponse, bool)
func FileExists ¶
func GenerateConfig ¶
GenerateConfig generates configuration file at provided path.
func GetLogAddresses ¶
GetLogAddresses returns a string with addresses (concatenated with comma) with password stripped from each address.
func NodeWithMemoryEngine ¶
func NodeWithMemoryEngine() *centrifuge.Node
NodeWithMemoryEngine - builder for centrifuge node with memory engine
func NodeWithMemoryEngineNoHandlers ¶
func NodeWithMemoryEngineNoHandlers() *centrifuge.Node
NodeWithMemoryEngineNoHandlers - builder for centrifuge node with memory engine
func OptionalStringChoice ¶
func PathExists ¶
PathExists returns whether the given file or directory exists or not
func RedactedLogURLs ¶
RedactedLogURLs prepares URLs to be logged or shown in UI stripping auth info from them.
func SecureCompare ¶
SecureCompare use constant time function to compare the two given array.
func SecureCompareString ¶
SecureCompareString use constant time function to compare the two given string.
func WritePidFile ¶
Types ¶
type CommonGRPCProxyTestCase ¶
type CommonGRPCProxyTestCase struct { Node *centrifuge.Node Client *centrifuge.Client ClientCloseFunc centrifuge.ClientCloseFunc Server *grpc.Server Listener *bufconn.Listener }
func NewCommonGRPCProxyTestCase ¶
func NewCommonGRPCProxyTestCase(ctx context.Context, srv proxyproto.CentrifugoProxyServer) *CommonGRPCProxyTestCase
func (*CommonGRPCProxyTestCase) Teardown ¶
func (c *CommonGRPCProxyTestCase) Teardown()
type CommonHTTPProxyTestCase ¶
type CommonHTTPProxyTestCase struct { Node *centrifuge.Node Client *centrifuge.Client ClientCloseFunc centrifuge.ClientCloseFunc Server *httptest.Server Mux *http.ServeMux }
func NewCommonHTTPProxyTestCase ¶
func NewCommonHTTPProxyTestCase(ctx context.Context) *CommonHTTPProxyTestCase
func (*CommonHTTPProxyTestCase) Teardown ¶
func (c *CommonHTTPProxyTestCase) Teardown()
type TestClientMock ¶
type TestClientMock struct { IDFunc func() string UserIDFunc func() string IsSubscribedFunc func(string) bool ContextFunc func() context.Context TransportFunc func() centrifuge.TransportInfo // contains filtered or unexported fields }
func (*TestClientMock) AcquireStorage ¶
func (m *TestClientMock) AcquireStorage() (map[string]any, func(map[string]any))
func (*TestClientMock) Context ¶
func (m *TestClientMock) Context() context.Context
func (*TestClientMock) Disconnect ¶
func (m *TestClientMock) Disconnect(disconnect ...centrifuge.Disconnect)
func (*TestClientMock) ID ¶
func (m *TestClientMock) ID() string
func (*TestClientMock) IsSubscribed ¶
func (m *TestClientMock) IsSubscribed(s string) bool
func (*TestClientMock) Send ¶
func (m *TestClientMock) Send(bytes []byte) error
func (*TestClientMock) Transport ¶
func (m *TestClientMock) Transport() centrifuge.TransportInfo
func (*TestClientMock) Unsubscribe ¶
func (m *TestClientMock) Unsubscribe(ch string, unsubscribe ...centrifuge.Unsubscribe)
func (*TestClientMock) UserID ¶
func (m *TestClientMock) UserID() string
func (*TestClientMock) WritePublication ¶
func (m *TestClientMock) WritePublication(channel string, publication *centrifuge.Publication, sp centrifuge.StreamPosition) error
type TestTransport ¶
type TestTransport struct {
// contains filtered or unexported fields
}
TestTransport - test transport
func NewTestTransport ¶
func NewTestTransport() *TestTransport
NewTestTransport - builder for TestTransport
func (*TestTransport) Close ¶
func (t *TestTransport) Close(disconnect centrifuge.Disconnect) error
Close - ...
func (*TestTransport) DisabledPushFlags ¶
func (t *TestTransport) DisabledPushFlags() uint64
DisabledPushFlags - ...
func (*TestTransport) PingPongConfig ¶
func (t *TestTransport) PingPongConfig() centrifuge.PingPongConfig
PingPongConfig ...
func (*TestTransport) Protocol ¶
func (t *TestTransport) Protocol() centrifuge.ProtocolType
Protocol - ...
func (*TestTransport) ProtocolVersion ¶
func (t *TestTransport) ProtocolVersion() centrifuge.ProtocolVersion
ProtocolVersion returns transport protocol version.
func (*TestTransport) Unidirectional ¶
func (t *TestTransport) Unidirectional() bool
Unidirectional - ...
func (*TestTransport) WriteMany ¶
func (t *TestTransport) WriteMany(messages ...[]byte) error
WriteMany - ...