postgres

package
v0.0.0-...-88cfa3e Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound        = errors.New("not found")
	ErrAlreadyExists   = errors.New("already exists")
	ErrInternalFailure = errors.New("internal failure") // FIXME пока-что не юзаю, а смысл?
)

Functions

func NewPool

func NewPool(dsn string) *pgxpool.Pool

func NewRolesRepository

func NewRolesRepository(db *pgxpool.Pool) repository.RolesRepository

func NewUsersRepository

func NewUsersRepository(db *pgxpool.Pool) repository.UsersRepository

Types

type RolesRepository

type RolesRepository struct {
	// contains filtered or unexported fields
}

func (*RolesRepository) RolesById

func (r *RolesRepository) RolesById(ctx context.Context, id string) ([]string, error)

func (*RolesRepository) RolesPermissions

func (r *RolesRepository) RolesPermissions(ctx context.Context, roles []string) ([]string, error)

type UsersRepository

type UsersRepository struct {
	// contains filtered or unexported fields
}

func (*UsersRepository) AssignRoleById

func (r *UsersRepository) AssignRoleById(ctx context.Context, id string, role string) error

func (*UsersRepository) Delete

func (r *UsersRepository) Delete(ctx context.Context, id string) error

SOFT-DELETION METHOD

func (*UsersRepository) FindByEmail

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

func (*UsersRepository) FindById

func (r *UsersRepository) FindById(ctx context.Context, id string) (*entities.User, error)

func (*UsersRepository) RevokeRoleById

func (r *UsersRepository) RevokeRoleById(ctx context.Context, id string, role string) error

func (*UsersRepository) Save

func (r *UsersRepository) Save(ctx context.Context, user *entities.User) error

func (*UsersRepository) Update

func (r *UsersRepository) Update(ctx context.Context, user *entities.User) error

Jump to

Keyboard shortcuts

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