Discover Packages
github.com/esirangelomub/go-chat-application
internal
entity
package
Version:
v0.0.0-...-f349414
Opens a new window with list of versions in this module.
Published: Nov 3, 2023
License: MIT
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
View Source
var (
ErrChatroomIDIsRequired = errors .New ("chatroom_id is required")
ErrInvalidChatroomID = errors .New ("invalid chatroom_id")
ErrUserIDIsRequired = errors .New ("user_id is required")
ErrInvalidUserID = errors .New ("invalid user_id")
)
type Chatroom struct {
ID entity .ID `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
CreatedAt time .Time `json:"created_at"`
}
type Message struct {
ID entity .ID `json:"id"`
ChatroomID entity .ID `json:"chatroom_id"`
Chatroom Chatroom `json:"chatroom"`
UserID entity .ID `json:"user_id"`
User User `json:"user"`
Content string `json:"content"`
CreatedAt time .Time `json:"created_at"`
}
type User struct {
ID entity .ID `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
Password string `json:"-"`
Type UserType `json:"type" gorm:"type:varchar(4);default:'USER'"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.