repository

package
v0.0.0-...-93b1a64 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Token

type Token interface {
	Blacklist(userId int, t time.Time, ttl time.Duration) error
	IsBlacklisted(userId int) (time.Time, bool, error)
}

func NewTokenRepository

func NewTokenRepository(redis *redis.Client) Token

type User

type User struct {
	Id        int    `db:"id"`
	FirstName string `db:"first_name"`
	LastName  string `db:"last_name"`
	Email     string `db:"email"`
	PassHash  string `db:"pass_hash"`
}

type UserRepository

type UserRepository interface {
	CreateNewUser(firstName, lastName, email, hash string) error
	GetUserByEmail(email string) (*User, error)
	GetUserById(id int) (*User, error)
}

func NewUserRepository

func NewUserRepository(db *pgx.Conn) UserRepository

Jump to

Keyboard shortcuts

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