Documentation ¶
Index ¶
- Constants
- func Wire()
- type AuthService
- type AuthServiceImpl
- func (s *AuthServiceImpl) Login(ctx context.Context, username, password string) (null.String, null.String, error)
- func (s *AuthServiceImpl) Logout(ctx context.Context, refreshToken string) error
- func (s *AuthServiceImpl) RefreshToken(ctx context.Context, refreshToken string) (null.String, null.String, error)
- type BooksService
- type BooksServiceImpl
- type TokenHeader
- type TokensService
- type TokensServiceImpl
Constants ¶
View Source
const ( UsernameMaxLength = 40 UsernameOptimalGeneratedLength = 20 )
View Source
const TOKEN_ISSUER = "example.com"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthService ¶
type AuthServiceImpl ¶
type AuthServiceImpl struct {
// contains filtered or unexported fields
}
func NewAuthServiceImpl ¶
func NewAuthServiceImpl(usersRepository models.UsersRepository, refreshTokensRepository models.RefreshTokensRepository, tokensService TokensService) *AuthServiceImpl
func (*AuthServiceImpl) Login ¶
func (s *AuthServiceImpl) Login(ctx context.Context, username, password string) (null.String, null.String, error)
func (*AuthServiceImpl) Logout ¶
func (s *AuthServiceImpl) Logout(ctx context.Context, refreshToken string) error
func (*AuthServiceImpl) RefreshToken ¶
func (s *AuthServiceImpl) RefreshToken(ctx context.Context, refreshToken string) (null.String, null.String, error)
type BooksService ¶
type BooksServiceImpl ¶
type BooksServiceImpl struct {
// contains filtered or unexported fields
}
func NewBooksServiceImpl ¶
func NewBooksServiceImpl(booksRepository models.BooksRepository) *BooksServiceImpl
func (*BooksServiceImpl) CreateBook ¶
func (*BooksServiceImpl) DeleteBookById ¶
func (s *BooksServiceImpl) DeleteBookById(ctx context.Context, id string) error
func (*BooksServiceImpl) GetBookById ¶
type TokenHeader ¶
type TokensService ¶
type TokensServiceImpl ¶
type TokensServiceImpl struct {
// contains filtered or unexported fields
}
func NewTokensServiceImpl ¶
func NewTokensServiceImpl(encodedPrivateKey, encodedPublicKey string, tokensRepository models.RefreshTokensRepository, usersRepository models.UsersRepository) *TokensServiceImpl
func (*TokensServiceImpl) CheckToken ¶
func (*TokensServiceImpl) CreateNewTokens ¶
Click to show internal directories.
Click to hide internal directories.