Documentation ¶
Index ¶
- Constants
- type Chat
- type ChatCreateDTO
- type ChatParticipant
- type ChatParticipantsDTO
- type Event
- type EventChatInvite
- type EventChatMessage
- type EventPost
- type Friend
- type Message
- type MessageDTO
- type MessageList
- type MessageSendDTO
- type Post
- type PostDTO
- type PostPojo
- type User
- type UserSettings
- type WsEvent
Constants ¶
View Source
const ( EventTypeInvite string = "invite" EventTypePost string = "post" EventTypeMessage string = "message" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chat ¶
type Chat struct { Id int64 `db:"id" json:"id,omitempty"` Title string `db:"title" json:"title,omitempty"` CreatedAt time.Time `db:"created_at" json:"created_at,omitempty"` Closed bool `db:"closed" json:"closed,omitempty"` }
Chat Чат общение между двумя и более участниками
type ChatCreateDTO ¶
type ChatParticipant ¶
type ChatParticipant struct { Id int64 `json:"id,omitempty" db:"id"` ChatId int64 `json:"chat_id" db:"chat_id"` UserId int64 `json:"user_id" db:"user_id"` Status int8 `json:"status" db:"status"` }
ChatParticipant Список участников чата
type ChatParticipantsDTO ¶
type ChatParticipantsDTO struct { UserName string `json:"user_name"` Status string `json:"status"` }
ChatParticipantsDTO Участник чата (для отображения Клиенту)
type EventChatInvite ¶
EventChatInvite Событие приглашение в чат
func (*EventChatInvite) GetType ¶
func (e *EventChatInvite) GetType() string
func (*EventChatInvite) String ¶
func (e *EventChatInvite) String() string
type EventChatMessage ¶
type EventChatMessage struct { EventType string `json:"event"` Chat Chat `json:"chat"` MessageDTO `json:"data"` }
EventChatMessage Событие Сообщение в чате
func (*EventChatMessage) GetType ¶
func (e *EventChatMessage) GetType() string
func (*EventChatMessage) String ¶
func (e *EventChatMessage) String() string
type Friend ¶
type Friend struct { UserId int64 `json:"user_id" db:"user_id"` FriendId int64 `json:"friend_id" db:"friend_id"` }
Friend Друг друга
type Message ¶
type Message struct { Id int64 `json:"id,omitempty" db:"id"` ChatId int64 `json:"chat_id" db:"chat_id"` UserFrom int64 `json:"user_from" db:"user_from"` SendAt time.Time `json:"send_at" db:"send_at"` Message string `json:"message" db:"message"` }
Message Сообщение, которое сохраняется в БД
type MessageDTO ¶
type MessageDTO struct { Id int64 `json:"id"` UserFrom string `json:"user_from"` Date time.Time `json:"date"` Message string `json:"message"` }
MessageDTO Сообщение (для отображения Клиентом)
type MessageList ¶
type MessageList struct { Chat Chat `json:"chat"` List []MessageDTO `json:"list"` }
MessageList Список сообщений чата
type MessageSendDTO ¶
type Post ¶
type Post struct { Id int64 `json:"id" db:"id" fake:"skip"` UserId int64 `json:"user_id" db:"user_id" fake:"skip"` Title string `json:"title" db:"title" fake:"{sentence}"` Message string `json:"message" db:"message" fake:"{sentence}"` CreatedAt time.Time `json:"created_at" db:"created_at" fake:"skip"` UpdateAt time.Time `json:"updated_at" db:"updated_at" fake:"skip"` Deleted bool `json:"deleted" db:"deleted" fake:"skip"` }
Post model
type PostDTO ¶
type PostDTO struct { UserFrom string `json:"user_from"` Title string `json:"title"` Message string `json:"message"` }
PostDTO Публикация (для отображения на клиенте)
type PostPojo ¶
type PostPojo struct { UserId int64 `fake:"skip"` Title string `json:"title" db:"title" fake:"{sentence}"` Message string `json:"message" db:"message" fake:"{sentence}"` }
PostPojo model
type User ¶
type User struct { UserId int64 `json:"id" db:"user_id" fake:"skip"` Login string `json:"login" db:"login" fake:"{regex:[abcdefghijklmnopqrstuvwxyz0123456789]{10}}"` Email string `json:"email" db:"email" fake:"{email}"` Phone string `json:"phone" db:"phone" fake:"{phone}"` Name string `json:"name" db:"name" fake:"{firstname}"` Surname string `json:"surname" db:"surname" fake:"{lastname}"` Age int `json:"age" db:"age" fake:"{number:1,100}"` Sex string `json:"sex" db:"sex" fake:"{randomstring:[male,female]}""` Country string `json:"country" db:"country" fake:"{country}"` City string `json:"city" db:"city" fake:"{city}"` Interests string `json:"interests" db:"interests" fake:"{sentence}"` Password string `json:"password,omitempty" db:"-" fake:"{password}"` PasswordHash string `json:"-" db:"password" fake:"skip"` ShardId string `json:"-" db:"shard_id"` Settings UserSettings `json:"settings,omitempty" db:"-"` }
User model
func (*User) ValidateRegister ¶
func (*User) ValidateUpdate ¶
type UserSettings ¶
type UserSettings struct {
WSConnect string `json:"ws_connect_uri"`
}
Click to show internal directories.
Click to hide internal directories.