refreshtokenrepo

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ProviderSet provides an RefreshTokenRepo for use in production.
	ProviderSet = wire.NewSet(Provide, wire.Bind(new(domain.RefreshTokenRepository), new(*RefreshTokenRepo)))
)

Functions

This section is empty.

Types

type RefreshTokenRepo

type RefreshTokenRepo struct {
	DB *gorm.DB
}

func Provide

func Provide(manager *database.Manager) *RefreshTokenRepo

Provide returns a RefreshTokenRepo configured with the provided Manager.

func (*RefreshTokenRepo) Create

func (r *RefreshTokenRepo) Create(token domain.RefreshToken) (uint, error)

Create creates a new RefreshToken in the database.

func (*RefreshTokenRepo) Delete

func (r *RefreshTokenRepo) Delete(ID uint) error

Delete deletes the RefreshToken from the database with the given ID.

func (*RefreshTokenRepo) GetAll

func (r *RefreshTokenRepo) GetAll() ([]*domain.RefreshToken, error)

GetAll gets all RefreshTokens in the database.

func (*RefreshTokenRepo) GetByToken

func (r *RefreshTokenRepo) GetByToken(token domain.RefreshToken) (*domain.RefreshToken, error)

GetByToken gets a RefreshToken from the database where the token_hash field matches the provided RefreshToken's hash.

func (*RefreshTokenRepo) GetByTokenNonceHash

func (r *RefreshTokenRepo) GetByTokenNonceHash(nonceHash string) (*domain.RefreshToken, error)

GetByTokenNonceHash gets the first found RefreshToken in the database where the token_nonce_hash field matches the provided nonceHash.

func (*RefreshTokenRepo) Update

func (r *RefreshTokenRepo) Update(token *domain.RefreshToken) error

Update updates the revoked status in the database for the provided RefreshToken.

Jump to

Keyboard shortcuts

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