hub

package
v1.13.4 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultSocketServer

func DefaultSocketServer(handler websocket.Handler) socketServer

func ParseURL

func ParseURL(url string) (string, string, string)

the url starts with '/'

Types

type Hub

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

func NewHub

func NewHub(cfg *config.Config, logger logx.Logger) (*Hub, error)

func NewHubWithDB

func NewHubWithDB(db loader.Loader, cfg *config.Config, logger logx.Logger) (*Hub, error)

func (*Hub) ApiRouter

func (h *Hub) ApiRouter(version string) http.Handler

func (*Hub) ApiV1Router added in v1.13.0

func (h *Hub) ApiV1Router() http.Handler

func (*Hub) Close

func (h *Hub) Close()

this is purely for testing (see simulator.go)

func (*Hub) ConnCount

func (h *Hub) ConnCount() int

func (*Hub) Debug

func (h *Hub) Debug(w http.ResponseWriter, r *http.Request)

func (*Hub) DeleteRoom

func (h *Hub) DeleteRoom(id string)

func (*Hub) ExtRouter

func (h *Hub) ExtRouter() http.Handler

func (*Hub) GetOrCreateRoom

func (h *Hub) GetOrCreateRoom(roomID string) *room.Room

func (*Hub) GetRoom

func (h *Hub) GetRoom(id string) (*room.Room, error)

func (*Hub) HandleOp

func (h *Hub) HandleOp(op, roomID string) string

func (*Hub) Handler

func (h *Hub) Handler(ec event.EventChannel, roomID string)

func (*Hub) HandlerWrapper

func (h *Hub) HandlerWrapper(ws *websocket.Conn)

func (*Hub) Heartbeat

func (h *Hub) Heartbeat(roomID string)

func (*Hub) Load

func (h *Hub) Load()

func (*Hub) MessageCount

func (h *Hub) MessageCount() int

func (*Hub) MessageLoop

func (h *Hub) MessageLoop()

func (*Hub) ReadMessages

func (h *Hub) ReadMessages()

func (*Hub) RoomCount

func (h *Hub) RoomCount() int

func (*Hub) Save

func (h *Hub) Save()

func (*Hub) SendMessages

func (h *Hub) SendMessages()

func (*Hub) SetRoom

func (h *Hub) SetRoom(id string, r *room.Room)

func (*Hub) Sgf

func (h *Hub) Sgf(w http.ResponseWriter, r *http.Request)

func (*Hub) Sgfix

func (h *Hub) Sgfix(w http.ResponseWriter, r *http.Request)

func (*Hub) SocketRouter

func (h *Hub) SocketRouter() http.Handler

func (*Hub) TwitchRouter

func (h *Hub) TwitchRouter() http.Handler

func (*Hub) Upload

func (h *Hub) Upload(w http.ResponseWriter, r *http.Request)

func (*Hub) WebRouter

func (h *Hub) WebRouter() http.Handler

type MockSocketServer

type MockSocketServer struct {
}

func NewMockSocketServer

func NewMockSocketServer() *MockSocketServer

func (*MockSocketServer) ServeHTTP

func (ms *MockSocketServer) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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