user_repo

package
v0.0.0-...-4a192ad Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateUserOpts

type CreateUserOpts struct {
	Name         string
	EMail        string
	UsernameBase string
	Password     string
}

type UsersRepository

type UsersRepository interface {
	CreateUser(ctx context.Context, opts CreateUserOpts) (UserID uuid.UUID, err error)

	GetUsers(ctx context.Context) ([]entities.User, error)
	GetPublicUsers(ctx context.Context) ([]entities.PublicUserInfo, error)
	GetUserByID(ctx context.Context, userID uuid.UUID) (entities.User, error)
	GetUserByUsername(ctx context.Context, username username.Username) (entities.User, error)

	CheckCredsUsername(ctx context.Context, username username.Username, password string) (valid bool, err error)
	CheckCredsID(ctx context.Context, userID uuid.UUID, password string) (valid bool, err error)
	CheckCredsMail(ctx context.Context, mail string, password string) (valid bool, err error)

	RemoveUserByID(ctx context.Context, id uuid.UUID) error
	RemoveUserByUsername(ctx context.Context, uname username.Username) error

	// TestUsername returns available Username ID
	TestUsername(ctx context.Context, username string) (id int, err error)
}

func NewUsersRepository

func NewUsersRepository(pool *pgxpool.Pool) UsersRepository

Jump to

Keyboard shortcuts

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