messagebusiness

package
v0.0.0-...-435fad9 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

messagebusiness contains the business logic for message operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MessageService

type MessageService struct {
	// contains filtered or unexported fields
}

MessageService provides methods for message operations.

func NewMessageService

func NewMessageService(messageStore messagestorage.MessageStore) *MessageService

NewMessageService creates a new MessageService.

func (*MessageService) CheckThreadExists

func (ms *MessageService) CheckThreadExists(threadID uuid.UUID) (bool, error)

CheckThreadExists verifies if a thread exists in the database.

func (*MessageService) CreateMessage

func (ms *MessageService) CreateMessage(userID uuid.UUID, message *messagemodel.ChatMessage) error

CreateMessage adds a new message to a chat thread.

func (*MessageService) CreateThread

func (ms *MessageService) CreateThread(thread *messagemodel.ChatThread) error

CreateThread handles the creation of a new chat thread.

func (*MessageService) DeleteThread

func (ms *MessageService) DeleteThread(threadID uuid.UUID, userID uuid.UUID) error

DeleteThread deletes a chat thread.

func (*MessageService) GetAllThreads

func (ms *MessageService) GetAllThreads(userID uuid.UUID) ([]messagemodel.ChatThread, error)

GetAllThreads retrieves all chat threads for a specific user.

func (*MessageService) GetMessagesByThreadID

func (ms *MessageService) GetMessagesByThreadID(threadID uuid.UUID, limit, offset int, userID uuid.UUID) ([]messagemodel.ChatMessageResponse, error)

GetMessagesByThreadID retrieves messages of a chat thread with pagination.

func (*MessageService) GetThreadByID

func (ms *MessageService) GetThreadByID(threadID uuid.UUID) (*messagemodel.ChatThread, error)

GetThreadByID retrieves a chat thread by its ID.

func (*MessageService) GetThreadsByUserID

func (ms *MessageService) GetThreadsByUserID(userID uuid.UUID, limit, offset int) ([]messagemodel.ChatThread, error)

GetThreadsByUserID retrieves all chat threads for a specific user.

func (*MessageService) IsUserThreadOwner

func (ms *MessageService) IsUserThreadOwner(threadID, userID uuid.UUID) bool

Jump to

Keyboard shortcuts

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