Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
AuthService - service
func NewAuthService ¶
func NewAuthService(repo repository.Authorization) *AuthService
NewAuthService - constructor
func (*AuthService) CreateAccount ¶
func (s *AuthService) CreateAccount(account models.Account) (int, error)
func (*AuthService) GenerateToken ¶
func (s *AuthService) GenerateToken(username, password string) (string, error)
GenerateToken - token generation
func (*AuthService) GetAccountById ¶
func (s *AuthService) GetAccountById(accountId int) (models.Account, error)
func (*AuthService) ParseToken ¶
func (s *AuthService) ParseToken(accessToken string) (int, error)
ParseToken - getting authorized data from token
type Authorization ¶
type Authorization interface { CreateAccount(account models.Account) (int, error) GenerateToken(username, password string) (string, error) ParseToken(token string) (int, error) GetAccountById(accountId int) (models.Account, error) }
Authorization - signup/signin
Click to show internal directories.
Click to hide internal directories.