socket

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Acknowledgement

type Acknowledgement interface {
	SendUDPMessage(int, string) error
}

type Broadcaster

type Broadcaster interface {
	Broadcast([]byte)
}

type Client

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

type ClientManager

type ClientManager interface {
	GetClientsInfo()
}

type Config

type Config struct {
	WsAddr string
	Router *fiber.App
	Kafka  kafka.StreamProvider
	DB     db.ReadOnlyRedisDB
}

type ConnectionManager

type ConnectionManager interface {
	RegisterClient(*websocket.Conn)
	UnRegisterClient(*websocket.Conn)
}

type MsgProcessor

type MsgProcessor interface {
	ProcessMsg([]byte) error
}

type Service

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

func NewService

func NewService(ctx context.Context, cfg *Config) (*Service, error)

func (*Service) Broadcast

func (s *Service) Broadcast(msgData []byte)

func (*Service) Conn

func (s *Service) Conn() error

func (*Service) GetClientsInfo

func (s *Service) GetClientsInfo()

func (*Service) InitMessageChannel

func (s *Service) InitMessageChannel()

func (*Service) InitRouter

func (s *Service) InitRouter() error

func (*Service) ProcessMsg

func (s *Service) ProcessMsg(msgData []byte) error

func (*Service) RegisterClient

func (s *Service) RegisterClient(connection *websocket.Conn)

func (*Service) SendUDPMessage

func (s *Service) SendUDPMessage(version int, msg string) error

func (*Service) Start

func (s *Service) Start()

func (*Service) Stop

func (s *Service) Stop() error

func (*Service) UnRegisterClient

func (s *Service) UnRegisterClient(connection *websocket.Conn)

Jump to

Keyboard shortcuts

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