service

package
v0.0.0-...-d809d1c Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConversationService

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

func (*ConversationService) ConversationExists

func (s *ConversationService) ConversationExists(ctx context.Context, senderID, receiverID string) (bool, error)

func (*ConversationService) CreateConversation

func (s *ConversationService) CreateConversation(ctx context.Context, senderID, receiverID string) error

func (*ConversationService) GetConversations

func (s *ConversationService) GetConversations(ctx context.Context) ([]*domain.Conversation, error)

type MessageService

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

func NewMessageService

func NewMessageService(messageRepo domain.MessageRepository) *MessageService

func (*MessageService) GetUnDeliveredMessages

func (s *MessageService) GetUnDeliveredMessages(ctx context.Context, c domain.MsgChan) error

func (*MessageService) PopulateMessage

func (*MessageService) PopulateMessage(m domain.MessageSent, sndr *domain.User) *domain.Message

func (*MessageService) ProcessSentMessages

func (s *MessageService) ProcessSentMessages(ctx context.Context, m *domain.Message) error

func (*MessageService) SaveMessage

func (s *MessageService) SaveMessage(ctx context.Context, m *domain.Message) error

type TokenService

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

func NewTokenService

func NewTokenService(tokenRepo domain.TokenRepository) *TokenService

func (*TokenService) DeleteAllForUser

func (s *TokenService) DeleteAllForUser(ctx context.Context, userID string, scope string) error

func (*TokenService) GenerateToken

func (s *TokenService) GenerateToken(ctx context.Context, userID string, scope string) (string, error)

GenerateToken generates OTP if scope is ScopeActivation & AuthenticationToken if scope is ScopeAuthentication

type UserService

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

func NewUserService

func NewUserService(userRepo domain.UserRepository) *UserService

func (*UserService) ActivateUser

func (s *UserService) ActivateUser(ctx context.Context, user *domain.User) error

func (*UserService) AuthenticateUser

func (s *UserService) AuthenticateUser(ctx context.Context, u *domain.UserAuth) (string, error)

func (*UserService) ExistsUser

func (s *UserService) ExistsUser(ctx context.Context, email string) (bool, error)

func (*UserService) GetByQuery

func (s *UserService) GetByQuery(
	ctx context.Context,
	queryParam string,
	filter domain.Filter,
) ([]*domain.User, *domain.Metadata, error)

func (*UserService) GetByUniqueField

func (s *UserService) GetByUniqueField(ctx context.Context, fieldValue string) (*domain.User, error)

func (*UserService) GetForToken

func (s *UserService) GetForToken(ctx context.Context, scope string, plainToken string) (*domain.User, error)

func (*UserService) RegisterUser

func (s *UserService) RegisterUser(ctx context.Context, u *domain.UserRegister) (string, error)

func (*UserService) SetOnlineUsersLastSeen

func (s *UserService) SetOnlineUsersLastSeen(ctx context.Context, t time.Time) error

func (*UserService) UpdateUser

func (s *UserService) UpdateUser(ctx context.Context, u *domain.UserUpdate) error

func (*UserService) UpdateUserOnlineStatus

func (s *UserService) UpdateUserOnlineStatus(ctx context.Context, usr *domain.User, online bool) error

Jump to

Keyboard shortcuts

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