mock

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector struct {
	PrivateConnectionsGauge int32
	SubscribedChannelsCount *atomicFloat64
	OpenConnectionsCount    *atomicFloat64
	PrivateConnectionsCount *atomicFloat64
}

func NewCollector

func NewCollector() *Collector

func (*Collector) OpenConnections

func (c *Collector) OpenConnections(val float64)

func (*Collector) PrivateConnections

func (c *Collector) PrivateConnections(val float64)

func (*Collector) PrivateConnectionsDec

func (c *Collector) PrivateConnectionsDec()

func (*Collector) PrivateConnectionsInc

func (c *Collector) PrivateConnectionsInc()

func (*Collector) SubscribedChannels

func (c *Collector) SubscribedChannels(val float64)

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(id string, userID *string, authFunc func() error) *Connection

func (Connection) Authenticate

func (c Connection) Authenticate() error

func (Connection) Close

func (c Connection) Close()

func (Connection) ID

func (c Connection) ID() string

func (Connection) Message

func (c Connection) Message() <-chan []byte

func (Connection) SendMessage

func (c Connection) SendMessage(data []byte) error

func (Connection) UserID

func (c Connection) UserID() *string

func (Connection) WithError

func (c Connection) WithError(err error) Connection

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger(t *testing.T) *Logger

func (Logger) Debug

func (l Logger) Debug(msg string, keyValues ...interface{})

func (Logger) Error

func (l Logger) Error(msg string, keyValues ...interface{})

func (*Logger) Expected

func (l *Logger) Expected(expected ...interface{})

func (Logger) Info

func (l Logger) Info(msg string, keyValues ...interface{})

func (Logger) Warn

func (l Logger) Warn(msg string, keyValues ...interface{})

type Store

type Store struct {
	// contains filtered or unexported fields
}

func NewStore

func NewStore(userConnections map[string]common.ConnectionWrapper) *Store

func (Store) ConnectionByUserID

func (s Store) ConnectionByUserID(_ context.Context, _ channel.Channel, userID string) common.ConnectionWrapper

func (Store) Connections

func (Store) Receive

func (s Store) Receive() string

func (Store) UnsubscribeUserID

func (s Store) UnsubscribeUserID(_ context.Context, _ string, _ string, ch channel.Channel)

Jump to

Keyboard shortcuts

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