repo

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: LGPL-2.1 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Memo

type Memo struct {
	*repoutil.Repo[types.Memo]
}

Memo represents the client for memo table

func NewMemo

func NewMemo(gdb *gorm.DB) *Memo

NewMemo returns a new memo database instance

type Service

type Service struct {
	User    *User
	Session *Session
	Memo    *Memo
}

Service provides all databases

func New

func New(db *gorm.DB) *Service

New creates db service

type Session

type Session struct {
	*repoutil.Repo[types.Session]
}

Session represents the client for session table

func NewSession

func NewSession(gdb *gorm.DB) *Session

NewSession returns a new session database instance

func (*Session) DeleteExpired

func (r *Session) DeleteExpired(ctx context.Context, userID string) error

DeleteExpired deletes expired sessions

func (*Session) FindByID

func (r *Session) FindByID(ctx context.Context, id, userID string) (*types.Session, error)

FindByID finds a session by the given ID and preload User

type User

type User struct {
	*repoutil.Repo[types.User]
}

User represents the client for user table

func NewUser

func NewUser(gdb *gorm.DB) *User

NewUser returns a new user database instance

func (*User) FindByEmail

func (r *User) FindByEmail(ctx context.Context, email string) (*types.User, error)

FindByEmail finds a user by the given email

func (*User) List

func (r *User) List(ctx context.Context, output interface{}, count *int64, lc *requestutil.ListCondition[UsersFilter]) error

List reads all users by given conditions

func (*User) UpdateRefreshToken

func (r *User) UpdateRefreshToken(ctx context.Context, userID, refreshToken string) error

UpdateRefreshToken updates the refresh token of the given user

type UsersFilter

type UsersFilter struct {
	Search string
}

UsersFilter represents the filter type for listing and filtering users

Jump to

Keyboard shortcuts

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