services

package
v0.0.0-...-bbcf6c5 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: MIT Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type AuthService

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

func NewAuthService

func NewAuthService(authRepository repositories.AuthRepository, userService UserService, config lib.Config, db lib.Database, authMail mails.AuthMail) AuthService

func (AuthService) Authenticate

func (s AuthService) Authenticate(ctx echo.Context) (*models.User, error)

func (AuthService) GenerateToken

func (s AuthService) GenerateToken(user *models.User) (*dto.JWTResponse, error)

func (AuthService) Login

func (s AuthService) Login(login *dto.LoginRequest) (*dto.LoginResponse, error)

func (AuthService) ParseToken

func (s AuthService) ParseToken(tokenStr string) (*dto.JWTClaims, error)

func (AuthService) Register

func (s AuthService) Register(register *dto.RegisterRequest) (*dto.RegisterResponse, error)

type PostService

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

func NewPostService

func NewPostService(postRepository repositories.PostRepository, postMail mails.PostMail) PostService

func (PostService) Create

func (s PostService) Create(params *dto.PostRequest, user *models.User) (*dto.PostResponse, error)

func (PostService) Delete

func (s PostService) Delete(post *models.Post) error

func (PostService) Get

func (PostService) Query

func (PostService) Update

func (s PostService) Update(post *models.Post, params *dto.PostUpdateRequest) (*dto.PostResponse, error)

type UserService

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

func NewUserService

func NewUserService(logger lib.Logger, userRepository repositories.UserRepository, profileRepository repositories.ProfileRepository) UserService

func (*UserService) Delete

func (s *UserService) Delete(user *models.User) error

func (*UserService) GetByUsername

func (s *UserService) GetByUsername(username string) (*models.User, error)

func (*UserService) Query

func (UserService) Register

func (s UserService) Register(params *dto.RegisterRequest) (*models.User, error)

func (UserService) Verify

func (s UserService) Verify(username string, password string) (*models.User, error)

Jump to

Keyboard shortcuts

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