interfaces

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthRepository

type AuthRepository interface {
	RegisterUser(user entities.RegisterUserDTO) (int, error)
	CreateRefreshToken(userID int, refreshToken string, ttl time.Duration) (int, error)
	GetRefreshTokenByUserID(userID int) (*entities.RefreshToken, error)
	ExpireRefreshToken(refreshToken string) error
}

type AuthService

type AuthService interface {
	RegisterUser(userData entities.RegisterUserDTO) (int, error)
	CreateRefreshToken(userID int, refreshToken string, ttl time.Duration) (int, error)
	GetRefreshTokenByUserID(userID int) (*entities.RefreshToken, error)
	ExpireRefreshToken(refreshToken string) error
}

type Controller

type Controller interface {
	Run()
	Stop()
}

type DBConnector added in v0.0.7

type DBConnector interface {
	Connect() error
	CloseConnection()
	GetTransaction() (*sql.Tx, error)
	GetConnection() *sql.DB
}

type UseCases

type UseCases interface {
	GetUserByID(id int) (*entities.User, error)
	GetAllUsers() ([]*entities.User, error)
	RegisterUser(userData entities.RegisterUserDTO) (int, error)
	LoginUser(userData entities.LoginUserDTO) (*entities.TokensDTO, error)
	GetMe(accessToken string) (*entities.User, error)
	RefreshTokens(refreshTokensData entities.TokensDTO) (*entities.TokensDTO, error)
}

type UsersRepository

type UsersRepository interface {
	GetUserByID(id int) (*entities.User, error)
	GetAllUsers() ([]*entities.User, error)
	GetUserByEmail(email string) (*entities.User, error)
}

type UsersService

type UsersService interface {
	GetAllUsers() ([]*entities.User, error)
	GetUserByID(id int) (*entities.User, error)
	GetUserByEmail(email string) (*entities.User, error)
}

Jump to

Keyboard shortcuts

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