2015-01-17 01:37:21 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
)
|
|
|
|
|
|
|
|
type WSRequest struct {
|
|
|
|
Type string `json:"type"`
|
|
|
|
Request json.RawMessage `json:"request"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type WSResponse struct {
|
|
|
|
Type string `json:"type"`
|
|
|
|
Response *json.RawMessage `json:"response"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type Connect struct {
|
|
|
|
Server string `json:"server"`
|
2015-01-29 23:38:51 +00:00
|
|
|
TLS bool `json:"tls"`
|
2015-02-02 00:54:26 +00:00
|
|
|
Name string `json:"name"`
|
2015-01-17 01:37:21 +00:00
|
|
|
Nick string `json:"nick"`
|
|
|
|
Username string `json:"username"`
|
|
|
|
}
|
|
|
|
|
2015-01-31 22:35:38 +00:00
|
|
|
type Nick struct {
|
|
|
|
Server string `json:"server"`
|
|
|
|
Old string `json:"old"`
|
|
|
|
New string `json:"new"`
|
|
|
|
}
|
|
|
|
|
2015-01-17 01:37:21 +00:00
|
|
|
type Join struct {
|
|
|
|
Server string `json:"server"`
|
|
|
|
User string `json:"user"`
|
|
|
|
Channels []string `json:"channels"`
|
|
|
|
}
|
|
|
|
|
2015-02-01 00:56:56 +00:00
|
|
|
type Part struct {
|
|
|
|
Join
|
|
|
|
Reason string `json:"reason,omitempty"`
|
|
|
|
}
|
|
|
|
|
2015-01-25 01:35:46 +00:00
|
|
|
type Mode struct {
|
|
|
|
Server string `json:"server"`
|
|
|
|
Channel string `json:"channel"`
|
|
|
|
User string `json:"user"`
|
|
|
|
Add string `json:"add"`
|
|
|
|
Remove string `json:"remove"`
|
|
|
|
}
|
|
|
|
|
2015-01-21 02:06:34 +00:00
|
|
|
type Quit struct {
|
|
|
|
Server string `json:"server"`
|
|
|
|
User string `json:"user"`
|
2015-02-01 00:56:56 +00:00
|
|
|
Reason string `json:"reason,omitempty"`
|
2015-01-21 02:06:34 +00:00
|
|
|
}
|
|
|
|
|
2015-01-17 01:37:21 +00:00
|
|
|
type Chat struct {
|
|
|
|
Server string `json:"server"`
|
|
|
|
From string `json:"from"`
|
|
|
|
To string `json:"to"`
|
|
|
|
Message string `json:"message"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type Topic struct {
|
|
|
|
Server string `json:"server"`
|
|
|
|
Channel string `json:"channel"`
|
|
|
|
Topic string `json:"topic"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type Userlist struct {
|
|
|
|
Server string `json:"server"`
|
|
|
|
Channel string `json:"channel"`
|
|
|
|
Users []string `json:"users"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type MOTD struct {
|
2015-02-01 01:08:38 +00:00
|
|
|
Server string `json:"server"`
|
|
|
|
Title string `json:"title"`
|
|
|
|
Content []string `json:"content"`
|
2015-01-17 01:37:21 +00:00
|
|
|
}
|
2015-01-29 23:38:51 +00:00
|
|
|
|
|
|
|
type Error struct {
|
|
|
|
Server string `json:"server"`
|
|
|
|
Message string `json:"message"`
|
|
|
|
}
|