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: 0

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
JackTT - Gopher 🇻🇳