Discover Packages
github.com/aramceballos/chat-group-server
pkg
entities
package
Version:
v1.0.0
Opens a new window with list of versions in this module.
Published: Mar 13, 2024
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
type ChangePasswordInput struct {
OldPassword string `json:"old_password"`
NewPassword string `json:"new_password"`
}
type Channel struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
ImageURL string `json:"image_url"`
CreatedAt string `json:"created_at,omitempty"`
Members []User `json:"members,omitempty"`
Messages []Message `json:"messages,omitempty"`
}
type CreateChannelInput struct {
Name string `json:"name" validate:"required"`
Description string `json:"description" validate:"required"`
ImageURL string `json:"ImageURL"`
}
type JoinChannelInput struct {
ChannelID string `json:"channel_id"`
}
type LoginInput struct {
Identity string `json:"identity"`
Password string `json:"password"`
}
type Membership struct {
ID int64 `json:"id"`
UserID int64 `json:"user_id"`
ChannelID int `json:"channel_id"`
User User `json:"-"`
}
type Message struct {
ID int `json:"id"`
UserID int64 `json:"user_id"`
ChannelID int `json:"channel_id"`
Content string `json:"content"`
CreatedAt string `json:"created_at"`
User User `json:"user,omitempty"`
}
type SignupInput struct {
Name string `json:"name"`
UserName string `json:"username"`
Email string `json:"email"`
Password string `json:"password"`
AvatarURL string `json:"avatar_url"`
CreatedAt string `json:"created_at"`
}
type UpdateUserInput struct {
Name string `json:"name" validate:"required,min=5" error:"name is required"`
Username string `json:"username" validate:"required,min=5,max=20" error:"username is required"`
Email string `json:"email" validate:"required,min=5" error:"email is required"`
}
type User struct {
ID int64 `json:"id"`
Name string `json:"name"`
UserName string `json:"username"`
Email string `json:"email"`
Password string `json:"-"`
AvatarURL string `json:"avatar_url"`
Role string `json:"role,omitempty"`
CreatedAt string `json:"created_at"`
}
type UserData struct {
ID int64 `json:"id"`
UserName string `json:"username"`
Email string `json:"email"`
Password string `json:"password"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.