Documentation
¶
Index ¶
- Variables
- type AuthService
- func (s AuthService) Authenticate(ctx *gin.Context) (*models.User, error)
- func (s AuthService) GenerateToken(user *models.User) (*dto.JWTResponse, error)
- func (s AuthService) Login(login *dto.LoginRequest) (*dto.LoginResponse, error)
- func (s AuthService) ParseToken(tokenString string) (*dto.JWTClaims, error)
- func (s AuthService) Register(register *dto.RegisterRequest) (*dto.RegisterResponse, error)
- type PostService
- func (s PostService) Create(params *dto.PostRequest, user *models.User) (*dto.PostResponse, error)
- func (s PostService) Delete(post *models.Post) error
- func (s PostService) Get(id string) (*models.Post, error)
- func (s PostService) Query(params *dto.PostQueryParam) (*dto.PostPaginationResponse, error)
- func (s PostService) Update(post *models.Post, params *dto.PostUpdateRequest) (*dto.PostResponse, error)
- type UserService
- func (s UserService) Delete(user *models.User) error
- func (s UserService) GetByUsername(username string) (*models.User, error)
- func (s UserService) Query(params *dto.UserQueryParam) (*dto.UserPaginationResponse, error)
- func (s UserService) Register(params *dto.RegisterRequest) (*models.User, error)
- func (s UserService) Verify(username, password string) (*models.User, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Options( fx.Provide(NewUserService), fx.Provide(NewAuthService), fx.Provide(NewPostService), )
Functions ¶
This section is empty.
Types ¶
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
func NewAuthService ¶
func NewAuthService(config lib.Config, userService UserService, authMail mails.AuthMail, db lib.Database) AuthService
func (AuthService) Authenticate ¶
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(tokenString 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) Query ¶
func (s PostService) Query(params *dto.PostQueryParam) (*dto.PostPaginationResponse, error)
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(db lib.Database, userRepository repositories.UserRepository, profileRepository repositories.ProfileRepository, authMail mails.AuthMail) UserService
func (UserService) GetByUsername ¶
func (s UserService) GetByUsername(username string) (*models.User, error)
func (UserService) Query ¶
func (s UserService) Query(params *dto.UserQueryParam) (*dto.UserPaginationResponse, error)
func (UserService) Register ¶
func (s UserService) Register(params *dto.RegisterRequest) (*models.User, error)
Click to show internal directories.
Click to hide internal directories.