chats

package
v0.0.0-...-dfd90ba Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateMessageParams

type CreateMessageParams struct {
	AuthorID int
	ChatID   int
	Text     string
}

type CreateParams

type CreateParams struct {
	User1ID int
	User2ID int
}

type Repository

type Repository interface {
	Create(params *CreateParams) (models.Chat, error)
	ListByUser(userId int) ([]models.Chat, error)
	Get(id int) (models.Chat, error)

	MessagesList(chatID int) ([]models.Message, error)
	CreateMessage(params *CreateMessageParams) (*models.Message, error)

	ChatExists(user1ID, user2ID int) (bool, error)
	GetByUsers(user1ID, user2ID int) (models.Chat, error)
}

type Service

type Service interface {
	Create(params *CreateParams) (models.Chat, error)
	ListByUser(userID int) ([]models.Chat, error)
	Get(id int) (models.Chat, error)

	MessagesList(chatID int) ([]models.Message, error)
	CreateMessage(params *CreateMessageParams) (*models.Message, error)

	ChatExists(user1ID, user2ID int) (bool, error)
	GetByUsers(user1ID, user2ID int) (models.Chat, error)
}

Directories

Path Synopsis
delivery
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
repository

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL