Documentation ¶
Index ¶
- Variables
- type RefreshTokenService
- func (r *RefreshTokenService) GetLatestTokenInSession(token domain.RefreshToken) (*domain.RefreshToken, error)
- func (r *RefreshTokenService) ReplaceRefreshToken(token domain.RefreshToken) error
- func (r *RefreshTokenService) RevokeLatestRefreshTokenByNonce(token domain.RefreshToken) error
- func (r *RefreshTokenService) SaveNewRefreshToken(token domain.RefreshToken) (uint, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ProviderProductionSet provides a new RefreshTokenService for use in production. ProviderProductionSet = wire.NewSet(Provide, wire.Bind(new(domain.RefreshTokenService), new(*RefreshTokenService))) )
Functions ¶
This section is empty.
Types ¶
type RefreshTokenService ¶
type RefreshTokenService struct {
// contains filtered or unexported fields
}
RefreshTokenService manages operations on RefreshTokens.
func Provide ¶
func Provide(repository domain.RefreshTokenRepository) *RefreshTokenService
Provide provides a new RefreshTokenService configured with the given RefreshTokenRepository.
func (*RefreshTokenService) GetLatestTokenInSession ¶
func (r *RefreshTokenService) GetLatestTokenInSession(token domain.RefreshToken) (*domain.RefreshToken, error)
GetLatestTokenInSession gets the first found RefreshToken in the repository that has the same nonce hash as the provided RefreshToken.
func (*RefreshTokenService) ReplaceRefreshToken ¶
func (r *RefreshTokenService) ReplaceRefreshToken(token domain.RefreshToken) error
ReplaceRefreshToken deletes the existing RefreshToken in the repository that has the same nonce hash as the provided RefreshToken and then stores the provided RefreshToken in the repository.
func (*RefreshTokenService) RevokeLatestRefreshTokenByNonce ¶
func (r *RefreshTokenService) RevokeLatestRefreshTokenByNonce(token domain.RefreshToken) error
RevokeLatestRefreshTokenByNonce revokes the first found RefreshToken in the repository that contains the same nonce as the provided RefreshToken.
func (*RefreshTokenService) SaveNewRefreshToken ¶
func (r *RefreshTokenService) SaveNewRefreshToken(token domain.RefreshToken) (uint, error)
SaveNewRefreshToken saves a new RefreshToken to the repository.