Documentation
¶
Index ¶
- Constants
- type Chat
- type ChatDTO
- type ChatFromRequest
- type ChatStorer
- func (cs ChatStorer) Begin() (*sql.Tx, error)
- func (cs ChatStorer) Create(dto ChatDTO) (*Chat, error)
- func (cs ChatStorer) CreateInTx(tx *sql.Tx, dto ChatDTO) (*Chat, error)
- func (cs ChatStorer) Delete(id int) (*Chat, error)
- func (cs ChatStorer) GetOne(id int) (*Chat, error)
- func (cs ChatStorer) GetUserChats(userId int) ([]Chat, error)
- func (cs ChatStorer) Update(chat Chat) (*Chat, error)
- type ChatUser
- type IChatStorer
- type IMessageStorer
- type IParticipantStorer
- type IUserStorer
- type Message
- type MessageDTO
- type MessageFromRequest
- type MessageStorer
- func (cs MessageStorer) Create(tdo MessageDTO) (*Message, error)
- func (cs MessageStorer) Delete(id int) (*Message, error)
- func (cs MessageStorer) DeleteAll(chatId int) (sql.Result, error)
- func (cs MessageStorer) GetChatMessages(chatId, page int) ([]Message, error)
- func (cs MessageStorer) GetOne(id int) (*Message, error)
- func (cs MessageStorer) Update(message Message) (*Message, error)
- type Participant
- type ParticipantFromRequest
- type ParticipantStorer
- func (ps ParticipantStorer) Create(participant Participant) (*Participant, error)
- func (ps ParticipantStorer) CreateInTx(tx *sql.Tx, participant Participant) (*Participant, error)
- func (ps ParticipantStorer) Delete(participant Participant) (*Participant, error)
- func (ps ParticipantStorer) DeleteAll(chatId int) (sql.Result, error)
- func (ps ParticipantStorer) GetChatUsers(chatId int) ([]ChatUser, error)
- func (ps ParticipantStorer) GetOne(userId, chatId int) (*Participant, error)
- func (ps ParticipantStorer) Update(participant Participant) (*Participant, error)
- type User
- type UserDTO
- type UserStorer
Constants ¶
View Source
const PAGE_SIZE = 50
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatFromRequest ¶
type ChatFromRequest struct {
Title string `json:"title"`
}
type ChatStorer ¶
func NewChatStorer ¶
func NewChatStorer(db *sql.DB) ChatStorer
func (ChatStorer) CreateInTx ¶
func (ChatStorer) GetUserChats ¶
func (cs ChatStorer) GetUserChats(userId int) ([]Chat, error)
type ChatUser ¶
type ChatUser struct { Participant Name string `json:"name"` }
type IChatStorer ¶
type IMessageStorer ¶
type IParticipantStorer ¶
type IParticipantStorer interface { Create(participant Participant) (*Participant, error) CreateInTx(tx *sql.Tx, participant Participant) (*Participant, error) GetOne(userId, chatId int) (*Participant, error) GetChatUsers(chatId int) ([]ChatUser, error) Update(participant Participant) (*Participant, error) Delete(participant Participant) (*Participant, error) DeleteAll(chatId int) (sql.Result, error) }
type IUserStorer ¶
type MessageDTO ¶
type MessageFromRequest ¶
type MessageStorer ¶
func NewMessageStorer ¶
func NewMessageStorer(db *sql.DB) MessageStorer
func (MessageStorer) Create ¶
func (cs MessageStorer) Create(tdo MessageDTO) (*Message, error)
func (MessageStorer) GetChatMessages ¶
func (cs MessageStorer) GetChatMessages(chatId, page int) ([]Message, error)
type Participant ¶
type ParticipantFromRequest ¶
type ParticipantStorer ¶
func NewParticipantStorer ¶
func NewParticipantStorer(db *sql.DB) ParticipantStorer
func (ParticipantStorer) Create ¶
func (ps ParticipantStorer) Create(participant Participant) (*Participant, error)
func (ParticipantStorer) CreateInTx ¶
func (ps ParticipantStorer) CreateInTx(tx *sql.Tx, participant Participant) (*Participant, error)
func (ParticipantStorer) Delete ¶
func (ps ParticipantStorer) Delete(participant Participant) (*Participant, error)
func (ParticipantStorer) DeleteAll ¶
func (ps ParticipantStorer) DeleteAll(chatId int) (sql.Result, error)
func (ParticipantStorer) GetChatUsers ¶
func (ps ParticipantStorer) GetChatUsers(chatId int) ([]ChatUser, error)
func (ParticipantStorer) GetOne ¶
func (ps ParticipantStorer) GetOne(userId, chatId int) (*Participant, error)
func (ParticipantStorer) Update ¶
func (ps ParticipantStorer) Update(participant Participant) (*Participant, error)
type UserStorer ¶
func NewUserStorer ¶
func NewUserStorer(db *sql.DB) UserStorer
Click to show internal directories.
Click to hide internal directories.