auth

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JWTObj

type JWTObj struct {
	Secret []byte
}

func (*JWTObj) CreateJWT

func (j *JWTObj) CreateJWT(userID string) (string, error)

func (*JWTObj) ValidateJWT

func (j *JWTObj) ValidateJWT(tokenStr string) (string, error)

type JWTValidator

type JWTValidator interface {
	ValidateJWT(token string) (string, error)
}

type MockService

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

func NewMockService

func NewMockService() *MockService

func (*MockService) AddUser

func (m *MockService) AddUser(input models.User)

func (*MockService) DeleteUser

func (m *MockService) DeleteUser(id string)

func (*MockService) GetUserByID

func (m *MockService) GetUserByID(id string) (models.User, error)

func (*MockService) Login

func (m *MockService) Login(input models.LoginAPI) (string, error)

func (*MockService) Register

func (m *MockService) Register(input models.RegisterAPI) (string, error)

type Service

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

func NewService

func NewService(db database.Repository) *Service

func (*Service) GetUserByID

func (s *Service) GetUserByID(id string) (models.User, error)

func (*Service) Login

func (s *Service) Login(data models.LoginAPI) (string, error)

func (*Service) Register

func (s *Service) Register(data models.RegisterAPI) (string, error)

type ServiceInterface

type ServiceInterface interface {
	Register(data models.RegisterAPI) (string, error)
	Login(data models.LoginAPI) (string, error)
	GetUserByID(id string) (models.User, error)
}

Jump to

Keyboard shortcuts

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