services

package
v0.0.0-...-de20da1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractToken

func ExtractToken(ctx *gin.Context) string

ExtractToken Extract token

func ExtractTokenID

func ExtractTokenID(c *gin.Context) (uint, error)

ExtractTokenID Extract User Id from token.

func GenerateTokenPair

func GenerateTokenPair(userId uint) (string, string, error)

func SendEmail

func SendEmail(toEmail, subject, token string, data serializers.OTPSerializer) error

func TokenValid

func TokenValid(ctx *gin.Context) error

TokenValid Check token valid or not

Types

type IRoleService

type IRoleService interface {
	CreateRoleService(role *serializers.Role) (bool, error)
	GetAllRolesService(limit string, offset string) (int64, []serializers.RoleResponse)
}

type IUserServiceInterface

type IUserServiceInterface interface {
	CreateUserService(user serializers.RegisterSerializer) (bool, error)
	VerifyCredentialService(email string, password string) (bool, uint, bool)
	VerifyEmailService(token string) error
}

type RoleService

type RoleService struct{}

func (*RoleService) CreateRoleService

func (r *RoleService) CreateRoleService(role *serializers.Role) (bool, error)

CreateRoleService for creating Service

func (*RoleService) GetAllRolesService

func (r *RoleService) GetAllRolesService(limit string, offset string) (int64, []serializers.RoleResponse)

GetAllRolesService GetAllRoles service

type UserService

type UserService struct{}

func (*UserService) CreateUserService

func (u *UserService) CreateUserService(user serializers.RegisterSerializer) (bool, error)

func (*UserService) VerifyCredentialService

func (u *UserService) VerifyCredentialService(email string, password string) (bool, uint, bool)

func (*UserService) VerifyEmailService

func (u *UserService) VerifyEmailService(token string) error

Jump to

Keyboard shortcuts

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