Decouple chat from core and add chat rest api (#25)
* Decouple the chat package from the core * Add rest api endpoints for the chat aspect
This commit is contained in:
@@ -2,6 +2,8 @@ package models
|
||||
|
||||
//ChatMessage represents a single chat message
|
||||
type ChatMessage struct {
|
||||
ClientID string `json:"-"`
|
||||
|
||||
Author string `json:"author"`
|
||||
Body string `json:"body"`
|
||||
Image string `json:"image"`
|
||||
@@ -14,3 +16,8 @@ type ChatMessage struct {
|
||||
func (s ChatMessage) String() string {
|
||||
return s.Author + " says " + s.Body
|
||||
}
|
||||
|
||||
//Valid checks to ensure the message is valid
|
||||
func (s ChatMessage) Valid() bool {
|
||||
return s.Author != "" && s.Body != "" && s.ID != ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user