Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Name string // クライアント名 SessionID string // セッションID Ws *websocket.Conn // WebSocket接続 }
Client はチャットルームに参加しているユーザーを表す構造体
type Message ¶
type Message struct { RoomID string `json:"room_id"` // ルームID Sentence string `json:"sentence"` // メッセージ本文 Sender string `json:"sender"` // 送信者 Timestamp int64 `json:"timestamp"` // タイムスタンプ }
Message はチャットメッセージを表す構造体
type Room ¶
type Room struct { ID string // ルームID Name string // ルーム名 Owner string // ルームのオーナー Expires time.Time // 有効期限 RequiresAuth bool // 認証が必要かどうか UnauthenticatedClients []*Client // ルームへの接続許可待ちのクライアント AuthenticatedClients []*Client //ルームへの接続許可がされているクライアント Mu sync.Mutex // スレッドセーフにするためのミューテックス }
Room は個々のチャットルームを表す構造体
Click to show internal directories.
Click to hide internal directories.