session

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Upgrader = websocket.Upgrader{
	CheckOrigin: func(r *http.Request) bool {
		return true
	},
}

Functions

This section is empty.

Types

type Session

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

模拟会话结构

func (*Session) Close

func (s *Session) Close()

func (*Session) Send

func (s *Session) Send(message string) error

type SessionManager

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

模拟会话管理器

func NewSessionManager

func NewSessionManager() *SessionManager

func (*SessionManager) Add

func (m *SessionManager) Add(ws *websocket.Conn)

func (*SessionManager) Broadcast

func (m *SessionManager) Broadcast(msg string)

func (*SessionManager) Remove

func (m *SessionManager) Remove(ws *websocket.Conn)

Jump to

Keyboard shortcuts

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