Documentation ¶
Overview ¶
Copyright (C) 2022-2023 ikafly144
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Copyright (C) 2022-2023 ikafly144
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Copyright (C) 2022-2023 ikafly144
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Copyright (C) 2022-2023 ikafly144
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Index ¶
- func HandlerGuildFeatureDelete(w http.ResponseWriter, r *http.Request)
- func HandlerGuildFeatureGet(w http.ResponseWriter, r *http.Request)
- func HandlerGuildFeaturePost(w http.ResponseWriter, r *http.Request)
- func Run()
- type Event
- type GuildFeature
- type MessageLog
- type Model
- type WebsocketHandler
- func (h *WebsocketHandler) Broadcast(f func(*websocket.Conn))
- func (h *WebsocketHandler) Handle(w http.ResponseWriter, r *http.Request)
- func (h *WebsocketHandler) HandlerGuildCreate(w http.ResponseWriter, r *http.Request)
- func (h *WebsocketHandler) HandlerGuildDelete(w http.ResponseWriter, r *http.Request)
- func (h *WebsocketHandler) HandlerMessageCreate(w http.ResponseWriter, r *http.Request)
- func (h *WebsocketHandler) HandlerStaticsUserMessage(w http.ResponseWriter, r *http.Request)
- func (h *WebsocketHandler) Listen(c *websocket.Conn)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandlerGuildFeatureDelete ¶
func HandlerGuildFeatureDelete(w http.ResponseWriter, r *http.Request)
func HandlerGuildFeatureGet ¶
func HandlerGuildFeatureGet(w http.ResponseWriter, r *http.Request)
func HandlerGuildFeaturePost ¶
func HandlerGuildFeaturePost(w http.ResponseWriter, r *http.Request)
Types ¶
type Event ¶
type Event struct { Operation int `json:"op"` Sequence int64 `json:"s"` Type string `json:"t"` RawData json.RawMessage `json:"d"` // Structはこのファイルのその他の型の一つを含む // TODO:よくわからん Struct any `json:"-"` }
イベントを格納する構造体
type GuildFeature ¶
type MessageLog ¶
type WebsocketHandler ¶
ウェブソケットをハンドルする
func (*WebsocketHandler) Broadcast ¶
func (h *WebsocketHandler) Broadcast(f func(*websocket.Conn))
渡された関数をゴルーチンですべてのウェブソケット接続で実行する
TODO: もっといい方法があるはず
func (*WebsocketHandler) Handle ¶
func (h *WebsocketHandler) Handle(w http.ResponseWriter, r *http.Request)
ウェブソケット接続をハンドルする
func (*WebsocketHandler) HandlerGuildCreate ¶
func (h *WebsocketHandler) HandlerGuildCreate(w http.ResponseWriter, r *http.Request)
ギルド作成イベントを処理する 受け取ったギルドをキャッシュに登録しクライアントにステータス更新イベントを送る
func (*WebsocketHandler) HandlerGuildDelete ¶
func (h *WebsocketHandler) HandlerGuildDelete(w http.ResponseWriter, r *http.Request)
ギルド削除イベントを受け取る 受け取ったギルドをキャッシュから削除しクライアントにステータス更新イベントを送る
func (*WebsocketHandler) HandlerMessageCreate ¶
func (h *WebsocketHandler) HandlerMessageCreate(w http.ResponseWriter, r *http.Request)
func (*WebsocketHandler) HandlerStaticsUserMessage ¶
func (h *WebsocketHandler) HandlerStaticsUserMessage(w http.ResponseWriter, r *http.Request)
func (*WebsocketHandler) Listen ¶
func (h *WebsocketHandler) Listen(c *websocket.Conn)