mirror of
https://github.com/owncast/owncast.git
synced 2024-11-24 21:59:43 +03:00
25 lines
509 B
Go
25 lines
509 B
Go
package main
|
|
|
|
type ChatMessage struct {
|
|
Author string `json:"author"`
|
|
Body string `json:"body"`
|
|
Image string `json:"image"`
|
|
ID string `json:"id"`
|
|
MessageType string `json:"type"`
|
|
}
|
|
|
|
func (s *ChatMessage) AsJson() string {
|
|
return s.Author + " says " + s.Body
|
|
}
|
|
|
|
func (s *ChatMessage) String() string {
|
|
return s.Author + " says " + s.Body
|
|
}
|
|
|
|
type PingMessage struct {
|
|
MessageType string `json:"type"`
|
|
}
|
|
|
|
func (self *PingMessage) AsJson() string {
|
|
return "{type: \"PING\"}"
|
|
}
|