pgbd

package
v0.0.0-...-697c109 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MembershipRepo

type MembershipRepo struct {
	*postgres.Postgres
}

func NewMembershipRepo

func NewMembershipRepo(pb *postgres.Postgres) *MembershipRepo

func (*MembershipRepo) AddUserSlugs

func (r *MembershipRepo) AddUserSlugs(ctx context.Context, slugs []int, userId int) error

func (*MembershipRepo) AddUserToSlug

func (r *MembershipRepo) AddUserToSlug(ctx context.Context, slugsToAdd []int, slugsToDelete []int, userId int) error

func (*MembershipRepo) DeleteUserSlugs

func (r *MembershipRepo) DeleteUserSlugs(ctx context.Context, slugs []int, userId int) error

func (*MembershipRepo) GetActiveSlugs

func (r *MembershipRepo) GetActiveSlugs(ctx context.Context, userId int) ([]entities.Slug, error)

type SlugRepo

type SlugRepo struct {
	*postgres.Postgres
}

func NewSlugRepo

func NewSlugRepo(pg *postgres.Postgres) *SlugRepo

func (*SlugRepo) CreateSlug

func (r *SlugRepo) CreateSlug(ctx context.Context, slug entities.Slug) (int, error)

func (*SlugRepo) DeleteSlug

func (r *SlugRepo) DeleteSlug(ctx context.Context, slugName string) error

func (*SlugRepo) GetSlugByName

func (r *SlugRepo) GetSlugByName(ctx context.Context, slugName string) (entities.Slug, error)

type UserRepo

type UserRepo struct {
	*postgres.Postgres
}

func NewUserRepo

func NewUserRepo(pg *postgres.Postgres) *UserRepo

func (*UserRepo) CreateUser

func (r *UserRepo) CreateUser(ctx context.Context, user entities.User) (int, error)

func (*UserRepo) GetUserById

func (r *UserRepo) GetUserById(ctx context.Context, id int) (entities.User, error)

func (*UserRepo) GetUserByUsername

func (r *UserRepo) GetUserByUsername(ctx context.Context, username string) (entities.User, error)

func (*UserRepo) GetUserByUsernameAndPassword

func (r *UserRepo) GetUserByUsernameAndPassword(ctx context.Context, username, password string) (entities.User, error)

Jump to

Keyboard shortcuts

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