Add WebSocket types
This commit is contained in:
parent
54c27ff977
commit
a90e43691d
@ -1,6 +1,7 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
@ -28,5 +29,5 @@ func (le LemmyError) Error() string {
|
||||
|
||||
type LemmyWebSocketMsg struct {
|
||||
Op UserOperation `json:"op"`
|
||||
Data any `json:"data"`
|
||||
Data json.RawMessage `json:"data"`
|
||||
}
|
||||
|
37
types/websocket.go
Normal file
37
types/websocket.go
Normal file
@ -0,0 +1,37 @@
|
||||
package types
|
||||
|
||||
type UserJoin struct {
|
||||
Auth string `json:"auth"`
|
||||
}
|
||||
|
||||
type UserJoinResponse struct {
|
||||
Joined bool `json:"joined"`
|
||||
LemmyResponse
|
||||
}
|
||||
|
||||
type CommunityJoin struct {
|
||||
CommunityID int `json:"community_id"`
|
||||
}
|
||||
|
||||
type CommunityJoinResponse struct {
|
||||
Joined bool `json:"joined"`
|
||||
LemmyResponse
|
||||
}
|
||||
|
||||
type ModJoin struct {
|
||||
CommunityID int `json:"community_id"`
|
||||
}
|
||||
|
||||
type ModJoinResponse struct {
|
||||
Joined bool `json:"joined"`
|
||||
LemmyResponse
|
||||
}
|
||||
|
||||
type PostJoin struct {
|
||||
PostID int `json:"post_id"`
|
||||
}
|
||||
|
||||
type PostJoinResponse struct {
|
||||
Joined bool `json:"joined"`
|
||||
LemmyResponse
|
||||
}
|
Loading…
Reference in New Issue
Block a user