repo

package
v0.0.0-...-e46c3b8 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2021 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessData

type AccessData struct {
	UserID   uuid.UUID
	AccessID uuid.UUID
	Since    time.Time
}

AccessData is the data for creating access record.

type AccessRepo

type AccessRepo interface {
	Create(ctx context.Context, data AccessData) error
	Find(ctx context.Context, data AccessData) (model.Access, error)
	Delete(ctx context.Context, data AccessData) error
	RemExpired(ctx context.Context) error
}

AccessRepo is an abstraction for access repository.

func AccessRepoForDB

func AccessRepoForDB(db *sql.DB) AccessRepo

AccessRepoForDB returns AccessRepo for the given db.

type UserData

type UserData struct {
	Name         string
	Email        string
	PasswordHash []byte
}

UserData is the data needed to create new user.

type UserRepo

type UserRepo interface {
	Create(ctx context.Context, data UserData) error
	FindByEmail(ctx context.Context, email string) (model.User, error)
}

UserRepo is an abstraction for user repository.

func UserRepoForDB

func UserRepoForDB(db *sql.DB) UserRepo

UserRepoForDB returns UserRepo for the given db.

Jump to

Keyboard shortcuts

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