Documentation ¶
Index ¶
- type PropertyImages
- func (r PropertyImages) Create(ctx context.Context, image *properties.Image) error
- func (r PropertyImages) Delete(ctx context.Context, id string) error
- func (r PropertyImages) DeletePropertyImages(ctx context.Context, id int) error
- func (r PropertyImages) Get(ctx context.Context, id string) (*properties.Image, error)
- func (r PropertyImages) GetAll(ctx context.Context, id int) ([]properties.Image, error)
- func (r PropertyImages) GetPropertyImage(ctx context.Context, propId int, id string) (*properties.Image, error)
- func (r PropertyImages) GetUser(ctx context.Context, propertyId int, id string) (*properties.Image, error)
- type PropertyRepository
- func (r PropertyRepository) Create(ctx context.Context, property *properties.Property) error
- func (r PropertyRepository) Delete(ctx context.Context, property *properties.Property) error
- func (r PropertyRepository) DeleteAll(ctx context.Context) error
- func (r PropertyRepository) Get(ctx context.Context, id int) (*properties.Property, error)
- func (r PropertyRepository) GetByUser(ctx context.Context, id, userID int) (*properties.Property, error)
- func (r PropertyRepository) SearchQueryBuilder() SearchPropertyQueryBuilder
- func (r PropertyRepository) Update(ctx context.Context, property *properties.Property) error
- func (r PropertyRepository) UpdateActivity(ctx context.Context, userID int, active bool) error
- type PropertySearchRepository
- func (r PropertySearchRepository) Count(ctx context.Context, q SearchPropertyQueryBuilder) (int, error)
- func (r PropertySearchRepository) Search(ctx context.Context, queryBuilder SearchPropertyQueryBuilder) (properties.Properties, error)
- func (r PropertySearchRepository) SearchQueryBuilder() SearchPropertyQueryBuilder
- type SavedHomes
- func (r SavedHomes) Add(ctx context.Context, home properties.UserSavedHome) error
- func (r SavedHomes) Delete(ctx context.Context, home properties.UserSavedHome) error
- func (r SavedHomes) Exists(ctx context.Context, home properties.UserSavedHome) (bool, error)
- func (r SavedHomes) List(ctx context.Context, userID int, pagination domain.Pagination) ([]properties.UserSavedHome, error)
- type SearchFilters
- func (r SearchFilters) Create(ctx context.Context, search *domain.UserSearchFilters) error
- func (r SearchFilters) Delete(ctx context.Context, searchID, userID int) error
- func (r SearchFilters) Get(ctx context.Context, userID, searchID int) (*domain.UserSearchFilters, error)
- func (r SearchFilters) List(ctx context.Context, userID int) ([]domain.UserSearchFilters, error)
- func (r SearchFilters) Update(ctx context.Context, search *domain.UserSearchFilters) error
- type SearchPropertyQueryBuilder
- type SearchQueryBuilder
- func (q *SearchQueryBuilder) Query() *bun.SelectQuery
- func (q *SearchQueryBuilder) SetAC(hasAC *bool)
- func (q *SearchQueryBuilder) SetActive(active bool)
- func (q *SearchQueryBuilder) SetArea(p fmt.Stringer)
- func (q *SearchQueryBuilder) SetBathroom(count uint8, exact bool)
- func (q *SearchQueryBuilder) SetBedroom(count uint8, exact bool)
- func (q *SearchQueryBuilder) SetCity(city string)
- func (q *SearchQueryBuilder) SetCondition(condition []int)
- func (q *SearchQueryBuilder) SetHomeSizeRange(min, max float32)
- func (q *SearchQueryBuilder) SetHomeType(homeType []int)
- func (q *SearchQueryBuilder) SetIds(ids []int, required bool)
- func (q *SearchQueryBuilder) SetLotSizeRange(min, max float32)
- func (q *SearchQueryBuilder) SetPaging(page, limit int)
- func (q *SearchQueryBuilder) SetParking(parking *uint8)
- func (q *SearchQueryBuilder) SetPriceRange(min, max float32)
- func (q *SearchQueryBuilder) SetPropertyType(propertyType uint8)
- func (q *SearchQueryBuilder) SetSort(sort int)
- func (q *SearchQueryBuilder) SetSortByIds(ids []int)
- func (q *SearchQueryBuilder) SetUserId(userID int)
- func (q *SearchQueryBuilder) SetYearBuiltRange(min, max uint16)
- type SimilarPropertyQueryBuilder
- type SimilarPropertySearchRepository
- func (r SimilarPropertySearchRepository) Count(ctx context.Context, q SimilarPropertyQueryBuilder) (int, error)
- func (r SimilarPropertySearchRepository) Search(ctx context.Context, queryBuilder SimilarPropertyQueryBuilder, ...) (properties.Properties, error)
- func (r SimilarPropertySearchRepository) SearchQueryBuilder() SimilarPropertyQueryBuilder
- type SimilarSearchQueryBuilder
- func (q *SimilarSearchQueryBuilder) Query() *bun.SelectQuery
- func (q *SimilarSearchQueryBuilder) SetActive(active bool)
- func (q *SimilarSearchQueryBuilder) SetAreaWithin(p fmt.Stringer, distanceMeters int)
- func (q *SimilarSearchQueryBuilder) SetHomeSizeRange(min, max float32)
- func (q *SimilarSearchQueryBuilder) SetLimit(limit int)
- func (q *SimilarSearchQueryBuilder) SetMinBedroom(count uint8)
- func (q *SimilarSearchQueryBuilder) SetNotIds(ids []int)
- func (q *SimilarSearchQueryBuilder) SetPriceRange(min, max float32)
- func (q *SimilarSearchQueryBuilder) SetPropertyType(propertyType uint8)
- type UserRepository
- func (r UserRepository) Create(ctx context.Context, user domain.User, token domain.UserTokenAction) error
- func (r UserRepository) CreateUser(ctx context.Context, user *domain.User) error
- func (r UserRepository) Delete(ctx context.Context, id int) error
- func (r UserRepository) EmailExists(ctx context.Context, email string) (bool, error)
- func (r UserRepository) Get(ctx context.Context, id int) (*domain.User, error)
- func (r UserRepository) GetByEmail(ctx context.Context, email string) (*domain.User, error)
- func (r UserRepository) List(ctx context.Context, limit, offset int) ([]*domain.User, error)
- func (r UserRepository) SetNewPwd(ctx context.Context, user *domain.User) error
- func (r UserRepository) Update(ctx context.Context, user *domain.User) error
- func (r UserRepository) UpdateActivity(ctx context.Context, userID int, active bool) error
- type UserTokenActionRepo
- func (r UserTokenActionRepo) Create(ctx context.Context, tokenAction *domain.UserTokenAction) error
- func (r UserTokenActionRepo) Delete(ctx context.Context, token string) error
- func (r UserTokenActionRepo) GetByToken(ctx context.Context, token string) (*domain.UserTokenAction, error)
- func (r UserTokenActionRepo) Update(ctx context.Context, tokenAction *domain.UserTokenAction) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PropertyImages ¶
type PropertyImages struct {
// contains filtered or unexported fields
}
func NewPropertyImages ¶
func NewPropertyImages(db *bun.DB) PropertyImages
func (PropertyImages) Create ¶
func (r PropertyImages) Create(ctx context.Context, image *properties.Image) error
func (PropertyImages) Delete ¶
func (r PropertyImages) Delete(ctx context.Context, id string) error
Delete deletes image from database
func (PropertyImages) DeletePropertyImages ¶
func (r PropertyImages) DeletePropertyImages(ctx context.Context, id int) error
DeletePropertyImages deletes images from database
func (PropertyImages) Get ¶
func (r PropertyImages) Get(ctx context.Context, id string) (*properties.Image, error)
func (PropertyImages) GetAll ¶
func (r PropertyImages) GetAll(ctx context.Context, id int) ([]properties.Image, error)
func (PropertyImages) GetPropertyImage ¶
func (r PropertyImages) GetPropertyImage(ctx context.Context, propId int, id string) (*properties.Image, error)
func (PropertyImages) GetUser ¶
func (r PropertyImages) GetUser(ctx context.Context, propertyId int, id string) (*properties.Image, error)
type PropertyRepository ¶
type PropertyRepository struct {
// contains filtered or unexported fields
}
func NewProperty ¶
func NewProperty(db *bun.DB) PropertyRepository
func (PropertyRepository) Create ¶
func (r PropertyRepository) Create(ctx context.Context, property *properties.Property) error
func (PropertyRepository) Delete ¶
func (r PropertyRepository) Delete(ctx context.Context, property *properties.Property) error
func (PropertyRepository) DeleteAll ¶
func (r PropertyRepository) DeleteAll(ctx context.Context) error
func (PropertyRepository) Get ¶
func (r PropertyRepository) Get(ctx context.Context, id int) (*properties.Property, error)
func (PropertyRepository) GetByUser ¶
func (r PropertyRepository) GetByUser(ctx context.Context, id, userID int) (*properties.Property, error)
func (PropertyRepository) SearchQueryBuilder ¶
func (r PropertyRepository) SearchQueryBuilder() SearchPropertyQueryBuilder
func (PropertyRepository) Update ¶
func (r PropertyRepository) Update(ctx context.Context, property *properties.Property) error
func (PropertyRepository) UpdateActivity ¶
type PropertySearchRepository ¶
type PropertySearchRepository struct {
// contains filtered or unexported fields
}
func NewPropertySearch ¶
func NewPropertySearch(db *bun.DB) PropertySearchRepository
func (PropertySearchRepository) Count ¶
func (r PropertySearchRepository) Count(ctx context.Context, q SearchPropertyQueryBuilder) (int, error)
func (PropertySearchRepository) Search ¶
func (r PropertySearchRepository) Search(ctx context.Context, queryBuilder SearchPropertyQueryBuilder) (properties.Properties, error)
func (PropertySearchRepository) SearchQueryBuilder ¶
func (r PropertySearchRepository) SearchQueryBuilder() SearchPropertyQueryBuilder
type SavedHomes ¶
type SavedHomes struct {
// contains filtered or unexported fields
}
func NewSavedHomes ¶
func NewSavedHomes(db *bun.DB) SavedHomes
func (SavedHomes) Add ¶
func (r SavedHomes) Add(ctx context.Context, home properties.UserSavedHome) error
func (SavedHomes) Delete ¶
func (r SavedHomes) Delete(ctx context.Context, home properties.UserSavedHome) error
func (SavedHomes) Exists ¶
func (r SavedHomes) Exists(ctx context.Context, home properties.UserSavedHome) (bool, error)
func (SavedHomes) List ¶
func (r SavedHomes) List( ctx context.Context, userID int, pagination domain.Pagination, ) ([]properties.UserSavedHome, error)
type SearchFilters ¶
type SearchFilters struct {
// contains filtered or unexported fields
}
func NewSearchFilters ¶
func NewSearchFilters(db *bun.DB) SearchFilters
func (SearchFilters) Create ¶
func (r SearchFilters) Create(ctx context.Context, search *domain.UserSearchFilters) error
func (SearchFilters) Delete ¶
func (r SearchFilters) Delete(ctx context.Context, searchID, userID int) error
func (SearchFilters) Get ¶
func (r SearchFilters) Get(ctx context.Context, userID, searchID int) (*domain.UserSearchFilters, error)
func (SearchFilters) List ¶
func (r SearchFilters) List(ctx context.Context, userID int) ([]domain.UserSearchFilters, error)
func (SearchFilters) Update ¶
func (r SearchFilters) Update(ctx context.Context, search *domain.UserSearchFilters) error
type SearchPropertyQueryBuilder ¶
type SearchPropertyQueryBuilder interface { Query() *bun.SelectQuery SetArea(p fmt.Stringer) SetPaging(page, limit int) SetUserId(userID int) SetSort(sortType int) SetCity(city string) SetSortByIds(ids []int) SetIds(ids []int, required bool) SetBathroom(count uint8, exact bool) SetBedroom(count uint8, exact bool) SetPriceRange(min, max float32) SetLotSizeRange(min, max float32) SetHomeSizeRange(min, max float32) SetPropertyType(propertyType uint8) SetCondition(condition []int) SetHomeType(homeType []int) SetYearBuiltRange(min, max uint16) SetParking(parking *uint8) SetAC(hasAC *bool) SetActive(active bool) }
type SearchQueryBuilder ¶
type SearchQueryBuilder struct {
// contains filtered or unexported fields
}
func NewSearchQueryBuilder ¶
func NewSearchQueryBuilder(query *bun.SelectQuery) *SearchQueryBuilder
func (*SearchQueryBuilder) Query ¶
func (q *SearchQueryBuilder) Query() *bun.SelectQuery
func (*SearchQueryBuilder) SetAC ¶
func (q *SearchQueryBuilder) SetAC(hasAC *bool)
func (*SearchQueryBuilder) SetActive ¶
func (q *SearchQueryBuilder) SetActive(active bool)
SetActive filters only active properties
func (*SearchQueryBuilder) SetArea ¶
func (q *SearchQueryBuilder) SetArea(p fmt.Stringer)
func (*SearchQueryBuilder) SetBathroom ¶
func (q *SearchQueryBuilder) SetBathroom(count uint8, exact bool)
func (*SearchQueryBuilder) SetBedroom ¶
func (q *SearchQueryBuilder) SetBedroom(count uint8, exact bool)
func (*SearchQueryBuilder) SetCity ¶
func (q *SearchQueryBuilder) SetCity(city string)
func (*SearchQueryBuilder) SetCondition ¶
func (q *SearchQueryBuilder) SetCondition(condition []int)
func (*SearchQueryBuilder) SetHomeSizeRange ¶
func (q *SearchQueryBuilder) SetHomeSizeRange(min, max float32)
func (*SearchQueryBuilder) SetHomeType ¶
func (q *SearchQueryBuilder) SetHomeType(homeType []int)
func (*SearchQueryBuilder) SetIds ¶
func (q *SearchQueryBuilder) SetIds(ids []int, required bool)
func (*SearchQueryBuilder) SetLotSizeRange ¶
func (q *SearchQueryBuilder) SetLotSizeRange(min, max float32)
func (*SearchQueryBuilder) SetPaging ¶
func (q *SearchQueryBuilder) SetPaging(page, limit int)
func (*SearchQueryBuilder) SetParking ¶
func (q *SearchQueryBuilder) SetParking(parking *uint8)
func (*SearchQueryBuilder) SetPriceRange ¶
func (q *SearchQueryBuilder) SetPriceRange(min, max float32)
func (*SearchQueryBuilder) SetPropertyType ¶
func (q *SearchQueryBuilder) SetPropertyType(propertyType uint8)
func (*SearchQueryBuilder) SetSort ¶
func (q *SearchQueryBuilder) SetSort(sort int)
func (*SearchQueryBuilder) SetSortByIds ¶
func (q *SearchQueryBuilder) SetSortByIds(ids []int)
func (*SearchQueryBuilder) SetUserId ¶
func (q *SearchQueryBuilder) SetUserId(userID int)
func (*SearchQueryBuilder) SetYearBuiltRange ¶
func (q *SearchQueryBuilder) SetYearBuiltRange(min, max uint16)
type SimilarPropertyQueryBuilder ¶
type SimilarPropertyQueryBuilder interface { Query() *bun.SelectQuery SetAreaWithin(p fmt.Stringer, distanceMeters int) SetNotIds(ids []int) SetLimit(num int) SetMinBedroom(count uint8) SetPriceRange(min, max float32) SetHomeSizeRange(min, max float32) SetPropertyType(propertyType uint8) SetActive(active bool) }
type SimilarPropertySearchRepository ¶
type SimilarPropertySearchRepository struct {
// contains filtered or unexported fields
}
func NewSimilarPropertySearch ¶
func NewSimilarPropertySearch(db *bun.DB) SimilarPropertySearchRepository
func (SimilarPropertySearchRepository) Count ¶
func (r SimilarPropertySearchRepository) Count(ctx context.Context, q SimilarPropertyQueryBuilder) (int, error)
func (SimilarPropertySearchRepository) Search ¶
func (r SimilarPropertySearchRepository) Search(ctx context.Context, queryBuilder SimilarPropertyQueryBuilder, originalLocation string) ( properties.Properties, error, )
func (SimilarPropertySearchRepository) SearchQueryBuilder ¶
func (r SimilarPropertySearchRepository) SearchQueryBuilder() SimilarPropertyQueryBuilder
type SimilarSearchQueryBuilder ¶
type SimilarSearchQueryBuilder struct {
// contains filtered or unexported fields
}
func NewSimilarSearchQueryBuilder ¶
func NewSimilarSearchQueryBuilder(query *bun.SelectQuery) *SimilarSearchQueryBuilder
func (*SimilarSearchQueryBuilder) Query ¶
func (q *SimilarSearchQueryBuilder) Query() *bun.SelectQuery
func (*SimilarSearchQueryBuilder) SetActive ¶
func (q *SimilarSearchQueryBuilder) SetActive(active bool)
SetActive filters only active properties
func (*SimilarSearchQueryBuilder) SetAreaWithin ¶
func (q *SimilarSearchQueryBuilder) SetAreaWithin(p fmt.Stringer, distanceMeters int)
func (*SimilarSearchQueryBuilder) SetHomeSizeRange ¶
func (q *SimilarSearchQueryBuilder) SetHomeSizeRange(min, max float32)
func (*SimilarSearchQueryBuilder) SetLimit ¶
func (q *SimilarSearchQueryBuilder) SetLimit(limit int)
func (*SimilarSearchQueryBuilder) SetMinBedroom ¶
func (q *SimilarSearchQueryBuilder) SetMinBedroom(count uint8)
func (*SimilarSearchQueryBuilder) SetNotIds ¶
func (q *SimilarSearchQueryBuilder) SetNotIds(ids []int)
func (*SimilarSearchQueryBuilder) SetPriceRange ¶
func (q *SimilarSearchQueryBuilder) SetPriceRange(min, max float32)
func (*SimilarSearchQueryBuilder) SetPropertyType ¶
func (q *SimilarSearchQueryBuilder) SetPropertyType(propertyType uint8)
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
func NewUser ¶
func NewUser(db *bun.DB) UserRepository
func (UserRepository) Create ¶
func (r UserRepository) Create(ctx context.Context, user domain.User, token domain.UserTokenAction) error
Create creates a new user in the database.
func (UserRepository) CreateUser ¶
Create creates a new user in the database.
func (UserRepository) Delete ¶
func (r UserRepository) Delete(ctx context.Context, id int) error
Delete deletes a user with the given ID from the database.
func (UserRepository) EmailExists ¶
EmailExists check if email exists in db
func (UserRepository) GetByEmail ¶
GetByEmail retrieves a user with the given email address from the database.
func (UserRepository) UpdateActivity ¶
UpdateActivity deactivates an existing user in the database.
type UserTokenActionRepo ¶
type UserTokenActionRepo struct {
// contains filtered or unexported fields
}
func NewUserTokenAction ¶
func NewUserTokenAction(db *bun.DB) UserTokenActionRepo
func (UserTokenActionRepo) Create ¶
func (r UserTokenActionRepo) Create(ctx context.Context, tokenAction *domain.UserTokenAction) error
func (UserTokenActionRepo) Delete ¶
func (r UserTokenActionRepo) Delete(ctx context.Context, token string) error
func (UserTokenActionRepo) GetByToken ¶
func (r UserTokenActionRepo) GetByToken(ctx context.Context, token string) (*domain.UserTokenAction, error)
func (UserTokenActionRepo) Update ¶
func (r UserTokenActionRepo) Update(ctx context.Context, tokenAction *domain.UserTokenAction) error
Click to show internal directories.
Click to hide internal directories.