db

package
v0.0.0-...-cdf9605 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresRepository

type PostgresRepository struct {
	DB *sql.DB
}

func (*PostgresRepository) CheckIfUserCanViewProfile

func (s *PostgresRepository) CheckIfUserCanViewProfile(guest_id, host_id int) (bool, error)

func (*PostgresRepository) CheckUserExistance

func (s *PostgresRepository) CheckUserExistance(userUserName string) (bool, error)

func (*PostgresRepository) DeleteUserIntrests

func (s *PostgresRepository) DeleteUserIntrests(user_id int) error

func (*PostgresRepository) GetChatList

func (s *PostgresRepository) GetChatList(guest_id int, obj *s3.S3) (*pb.ChatListResponse, error)

func (*PostgresRepository) GetHouseImagesCount

func (s *PostgresRepository) GetHouseImagesCount(user_id int) (int, error)

func (*PostgresRepository) GetIdFromUsername

func (s *PostgresRepository) GetIdFromUsername(username string) (int, error)

func (*PostgresRepository) GetInterestsOfUser

func (s *PostgresRepository) GetInterestsOfUser(user_id int) ([]string, error)

func (*PostgresRepository) GetLanguagesOfUser

func (s *PostgresRepository) GetLanguagesOfUser(user_id int) ([]string, error)

func (*PostgresRepository) GetPublicProfile

func (s *PostgresRepository) GetPublicProfile(username string) (*pb.PublicProfileResponse, int, error)

func (*PostgresRepository) GetPublicProfileHost

func (s *PostgresRepository) GetPublicProfileHost(guest_id int, host_username string) (*pb.PublicProfileHostResponse, string, error)

func (*PostgresRepository) GetUserDetails

func (s *PostgresRepository) GetUserDetails(username string) (*pb.ProfileDetailsResponse, error)

func (*PostgresRepository) GetUserNameByID

func (s *PostgresRepository) GetUserNameByID(user_id int) (string, error)

func (*PostgresRepository) GetUserPassword

func (s *PostgresRepository) GetUserPassword(username string) (string, error)

func (*PostgresRepository) InsertChatList

func (s *PostgresRepository) InsertChatList(host_id, guest_id, announcement_id int) error

func (*PostgresRepository) InsertUserInterest

func (s *PostgresRepository) InsertUserInterest(user_id int, interest string) error

func (*PostgresRepository) InsertUserLanguage

func (s *PostgresRepository) InsertUserLanguage(user_id int, lang string) error

func (*PostgresRepository) UpdateOfferStatus

func (s *PostgresRepository) UpdateOfferStatus(announcement_id, host_id int) error

func (*PostgresRepository) UpdateUserInformation

func (s *PostgresRepository) UpdateUserInformation(username string, userInfo *pb.EditProfileRequest) error

type Repository

type Repository interface {
	GetUserDetails(usename string) (*pb.ProfileDetailsResponse, error)
	UpdateUserInformation(username string, userInfo *pb.EditProfileRequest) error
	CheckUserExistance(userUserName string) (bool, error)
	GetUserPassword(username string) (string, error)
	GetPublicProfile(username string) (*pb.PublicProfileResponse, int, error)
	GetPublicProfileHost(guest_id int, host_username string) (*pb.PublicProfileHostResponse, string, error)
	GetIdFromUsername(username string) (int, error)
	InsertChatList(host_id, guest_id, announcement_id int) error
	GetChatList(guest_id int, obj *s3.S3) (*pb.ChatListResponse, error)
	GetHouseImagesCount(user_id int) (int, error)
	UpdateOfferStatus(announcement_id, host_id int) error
	InsertUserLanguage(user_id int, lang string) error
	InsertUserInterest(user_id int, interest string) error
	GetLanguagesOfUser(user_id int) ([]string, error)
	GetInterestsOfUser(user_id int) ([]string, error)
	DeleteUserIntrests(user_id int) error
}

func NewPostgresRepository

func NewPostgresRepository(db *sql.DB) Repository

Jump to

Keyboard shortcuts

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