services

package
v0.0.0-...-b718ee8 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthRepository

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

func (*AuthRepository) CreateUser

func (authRepository *AuthRepository) CreateUser(ctx context.Context, user *models.User) error

func (*AuthRepository) DeleteUser

func (authRepository *AuthRepository) DeleteUser(ctx context.Context, id string) error

func (*AuthRepository) FindUserByEmail

func (authRepository *AuthRepository) FindUserByEmail(ctx context.Context, email string) (*models.User, error)

func (*AuthRepository) FindUserByID

func (authRepository *AuthRepository) FindUserByID(ctx context.Context, id string) (*models.User, error)

func (*AuthRepository) FindUserByUsername

func (authRepository *AuthRepository) FindUserByUsername(ctx context.Context, username string) (*models.User, error)

func (*AuthRepository) UpdateUser

func (authRepository *AuthRepository) UpdateUser(ctx context.Context, user *models.User) error

type AuthRepositoryInterface

type AuthRepositoryInterface interface {
	FindUserByEmail(ctx context.Context, email string) (*models.User, error)
	FindUserByUsername(ctx context.Context, username string) (*models.User, error)
	FindUserByID(ctx context.Context, id string) (*models.User, error)
	CreateUser(ctx context.Context, user *models.User) error
	UpdateUser(ctx context.Context, user *models.User) error
	DeleteUser(ctx context.Context, id string) error
}

func GetAuthRepository

func GetAuthRepository(database *mongo.Database) AuthRepositoryInterface

func NewAuthRepository

func NewAuthRepository(database *mongo.Database) AuthRepositoryInterface

type AuthService

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

func (*AuthService) SignIn

func (authService *AuthService) SignIn(c *fiber.Ctx, req *types.SignInRequest) error

func (*AuthService) SignOut

func (authService *AuthService) SignOut(c *fiber.Ctx) error

func (*AuthService) SignUp

func (authService *AuthService) SignUp(c *fiber.Ctx, req *types.SignUpRequest) error

SignUp creates a new user in the database

type AuthServiceInterface

type AuthServiceInterface interface {
	SignUp(c *fiber.Ctx, req *types.SignUpRequest) error
	SignIn(c *fiber.Ctx, req *types.SignInRequest) error
	SignOut(c *fiber.Ctx) error
}

func GetAuthService

func GetAuthService(ctx context.Context, database *mongo.Database) AuthServiceInterface

func InitializeAuthService

func InitializeAuthService(ctx context.Context, database *mongo.Database) AuthServiceInterface

type TaskRepository

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

func (*TaskRepository) CreateTask

func (taskRepository *TaskRepository) CreateTask(ctx context.Context, task *models.Task) error

func (*TaskRepository) DeleteTask

func (taskRepository *TaskRepository) DeleteTask(ctx context.Context, id string, userID string) error

func (*TaskRepository) GetTask

func (taskRepository *TaskRepository) GetTask(ctx context.Context, id string, userID string) (*models.Task, error)

func (*TaskRepository) ListTasks

func (taskRepository *TaskRepository) ListTasks(ctx context.Context, userID string) ([]*models.Task, error)

func (*TaskRepository) UpdateTask

func (taskRepository *TaskRepository) UpdateTask(ctx context.Context, task *models.Task) error

type TaskRepositoryInterface

type TaskRepositoryInterface interface {
	CreateTask(ctx context.Context, task *models.Task) error
	UpdateTask(ctx context.Context, task *models.Task) error
	DeleteTask(ctx context.Context, id string, userID string) error
	GetTask(ctx context.Context, id string, userID string) (*models.Task, error)
	ListTasks(ctx context.Context, userID string) ([]*models.Task, error)
}

func GetTaskRepository

func GetTaskRepository(database *mongo.Database) TaskRepositoryInterface

func NewTaskRepository

func NewTaskRepository(database *mongo.Database) TaskRepositoryInterface

type TaskService

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

func (*TaskService) CreateTask

func (taskService *TaskService) CreateTask(c *fiber.Ctx, req *types.CreateTaskRequest) error

func (*TaskService) DeleteTask

func (taskService *TaskService) DeleteTask(c *fiber.Ctx) error

func (*TaskService) GetTask

func (taskService *TaskService) GetTask(c *fiber.Ctx) error

func (*TaskService) ListTasks

func (taskService *TaskService) ListTasks(c *fiber.Ctx, req *types.ListTasksRequest) error

func (*TaskService) UpdateTask

func (taskService *TaskService) UpdateTask(c *fiber.Ctx, req *types.UpdateTaskRequest) error

type TaskServiceInterface

type TaskServiceInterface interface {
	CreateTask(c *fiber.Ctx, req *types.CreateTaskRequest) error
	UpdateTask(c *fiber.Ctx, req *types.UpdateTaskRequest) error
	GetTask(c *fiber.Ctx) error
	DeleteTask(c *fiber.Ctx) error
	ListTasks(c *fiber.Ctx, req *types.ListTasksRequest) error
}

func GetTaskService

func GetTaskService(taskRepository TaskRepositoryInterface) TaskServiceInterface

func NewTaskService

func NewTaskService(taskRepository TaskRepositoryInterface) TaskServiceInterface

Jump to

Keyboard shortcuts

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