repositories

package
v0.0.0-...-392719a Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountRepository

type AccountRepository interface {
	CreateAccount(account *models.Account) (int, error)
	UpdateAccount(account *models.Account) error
	GetAccountByProviderAndProviderAccountID(provider string, providerAccountID string) (*models.Account, error)
}

func NewAccountRepository

func NewAccountRepository(db *database.DB) AccountRepository

type Repositories

type Repositories struct {
	User    UserRepository
	Account AccountRepository
	Session SessionRepository
}

func New

func New(db *database.DB) *Repositories

type SessionRepository

type SessionRepository interface {
	CreateSession(session *models.Session) (int, error)
	UpdateSessionExpiresAtByToken(token string, expiresAt time.Time) error
	DeleteSessionByToken(token string) error
	GetSessionByToken(token string) (*models.Session, error)
	DeleteExpiredSessions() error
}

func NewSessionRepository

func NewSessionRepository(db *database.DB) SessionRepository

type UserRepository

type UserRepository interface {
	CreateUser(user *models.User) (int, error)
	UpdateUser(user *models.User) error
	GetAllUsers() ([]*models.User, error)
	GetUserByID(id int) (*models.User, error)
	GetUserByEmail(email string) (*models.User, error)
}

func NewUserRepository

func NewUserRepository(db *database.DB) UserRepository

Jump to

Keyboard shortcuts

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