tools

package
v3.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecoderConfig

func DecoderConfig(output interface{}) *mapstructure.DecoderConfig

DecoderConfig returns default mapstructure.DecoderConfig with support of time.Duration values & string slices & Duration

func ErrorMessageFromConfigError added in v3.2.0

func ErrorMessageFromConfigError(err error, configPath string) string

ErrorMessageFromConfigError tries building a more human-friendly error from a configuration error. At the moment we can additionally extract JSON syntax error line and column. Related issue: https://github.com/golang/go/issues/43513.

func GenerateConfig

func GenerateConfig(f string) error

GenerateConfig generates configuration file at provided path.

func GetLogAddresses

func GetLogAddresses(addresses []string) string

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 StringToDurationHookFunc

func StringToDurationHookFunc() mapstructure.DecodeHookFunc

StringToDurationHookFunc returns a DecodeHookFunc that converts strings to time.Duration.

func StripPassword

func StripPassword(address string) string

StripPassword from URL address.

Types

type CommonGRPCProxyTestCase added in v3.0.1

type CommonGRPCProxyTestCase struct {
	Node            *centrifuge.Node
	Client          *centrifuge.Client
	ClientCloseFunc centrifuge.ClientCloseFunc
	Server          *grpc.Server
	Listener        *bufconn.Listener
}

func NewCommonGRPCProxyTestCase added in v3.0.1

func NewCommonGRPCProxyTestCase(ctx context.Context, srv proxyproto.CentrifugoProxyServer) *CommonGRPCProxyTestCase

func (*CommonGRPCProxyTestCase) Teardown added in v3.0.1

func (c *CommonGRPCProxyTestCase) Teardown()

type CommonHTTPProxyTestCase added in v3.0.1

type CommonHTTPProxyTestCase struct {
	Node            *centrifuge.Node
	Client          *centrifuge.Client
	ClientCloseFunc centrifuge.ClientCloseFunc
	Server          *httptest.Server
	Mux             *http.ServeMux
}

func NewCommonHTTPProxyTestCase added in v3.0.1

func NewCommonHTTPProxyTestCase(ctx context.Context) *CommonHTTPProxyTestCase

func (*CommonHTTPProxyTestCase) Teardown added in v3.0.1

func (c *CommonHTTPProxyTestCase) Teardown()

type Duration

type Duration time.Duration

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) 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) AppLevelPing added in v3.2.0

func (t *TestTransport) AppLevelPing() centrifuge.AppLevelPing

AppLevelPing ...

func (*TestTransport) Close

func (t *TestTransport) Close(disconnect centrifuge.Disconnect) error

Close - ...

func (*TestTransport) DisabledPushFlags

func (t *TestTransport) DisabledPushFlags() uint64

DisabledPushFlags - ...

func (*TestTransport) Emulation added in v3.2.0

func (t *TestTransport) Emulation() bool

Emulation ...

func (*TestTransport) Name

func (t *TestTransport) Name() string

Name - ...

func (*TestTransport) Protocol

func (t *TestTransport) Protocol() centrifuge.ProtocolType

Protocol - ...

func (*TestTransport) ProtocolVersion added in v3.2.0

func (t *TestTransport) ProtocolVersion() centrifuge.ProtocolVersion

ProtocolVersion returns transport protocol version.

func (*TestTransport) Unidirectional

func (t *TestTransport) Unidirectional() bool

Unidirectional - ...

func (*TestTransport) Write

func (t *TestTransport) Write(message []byte) error

Write - ...

func (*TestTransport) WriteMany

func (t *TestTransport) WriteMany(messages ...[]byte) error

WriteMany - ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL