users can send and receive messages
parent
4b4b44f448
commit
fe8addb0ae
@ -0,0 +1,42 @@
|
||||
package main
|
||||
|
||||
import ()
|
||||
|
||||
type Message struct {
|
||||
Key []byte
|
||||
From []byte
|
||||
To string
|
||||
Text []byte
|
||||
}
|
||||
|
||||
func (m Message) Kind() string {
|
||||
return "message"
|
||||
}
|
||||
|
||||
type ListMessages struct {
|
||||
N int
|
||||
}
|
||||
|
||||
func (l ListMessages) Kind() string {
|
||||
return "list-messages"
|
||||
}
|
||||
|
||||
type ListMessagesResponseItem struct {
|
||||
Id int
|
||||
Key []byte
|
||||
From []byte
|
||||
}
|
||||
|
||||
type ListMessagesResponse []ListMessagesResponseItem
|
||||
|
||||
func (l ListMessagesResponse) Kind() string {
|
||||
return "list-messages-response"
|
||||
}
|
||||
|
||||
type GetMessage struct {
|
||||
Id int
|
||||
}
|
||||
|
||||
func (g GetMessage) Kind() string {
|
||||
return "get-message"
|
||||
}
|
Loading…
Reference in New Issue