Documentation
¶
Index ¶
- type Ad
- type AdCategory
- type AdPicture
- type ChangeAllCrawlJobsStatusParams
- type CheckCrawlJobExistsParams
- type CrawlJob
- type CreateAdParams
- type CreateAdPictureParams
- type CreateCrawlJobParams
- type CreatePriceParams
- type CreatePublisherParams
- type CreateUserAdParams
- type CreateUserFavoriteAdParams
- type CreateUserParams
- type DBTX
- type DeleteUserFavoriteAdParams
- type FavoriteAd
- type FilterAdsParams
- type FilterAdsPriceBuyParams
- type FilterAdsPriceMortgageParams
- type FilterAdsPriceRentParams
- type GetAdByIDParams
- type GetAdByIDRow
- type GetAllAdsParams
- type GetAllUsersParams
- type GetFirstMatchingCrawlJobParams
- type HouseType
- type NullAdCategory
- type NullHouseType
- type NullUserRole
- type Price
- type Publisher
- type Queries
- func (q *Queries) ChangeAllCrawlJobsStatus(ctx context.Context, arg ChangeAllCrawlJobsStatusParams) error
- func (q *Queries) CheckCrawlJobExists(ctx context.Context, arg CheckCrawlJobExistsParams) (bool, error)
- func (q *Queries) CountAds(ctx context.Context) (int64, error)
- func (q *Queries) CreateAd(ctx context.Context, arg CreateAdParams) (Ad, error)
- func (q *Queries) CreateAdPicture(ctx context.Context, arg CreateAdPictureParams) (AdPicture, error)
- func (q *Queries) CreateCrawlJob(ctx context.Context, arg CreateCrawlJobParams) (CrawlJob, error)
- func (q *Queries) CreatePrice(ctx context.Context, arg CreatePriceParams) (Price, error)
- func (q *Queries) CreatePublisher(ctx context.Context, arg CreatePublisherParams) (Publisher, error)
- func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
- func (q *Queries) CreateUserAd(ctx context.Context, arg CreateUserAdParams) error
- func (q *Queries) CreateUserFavoriteAd(ctx context.Context, arg CreateUserFavoriteAdParams) error
- func (q *Queries) DeleteAd(ctx context.Context, id *int64) error
- func (q *Queries) DeleteAllPicturesOfAd(ctx context.Context, adID *int64) error
- func (q *Queries) DeletePictureByID(ctx context.Context, id int64) error
- func (q *Queries) DeletePublisher(ctx context.Context, id *int32) error
- func (q *Queries) DeleteUser(ctx context.Context, tgID string) error
- func (q *Queries) DeleteUserFavoriteAd(ctx context.Context, arg DeleteUserFavoriteAdParams) error
- func (q *Queries) FilterAds(ctx context.Context, arg FilterAdsParams) ([]Ad, error)
- func (q *Queries) FilterAdsPriceBuy(ctx context.Context, arg FilterAdsPriceBuyParams) ([]Ad, error)
- func (q *Queries) FilterAdsPriceMortgage(ctx context.Context, arg FilterAdsPriceMortgageParams) ([]Ad, error)
- func (q *Queries) FilterAdsPriceRent(ctx context.Context, arg FilterAdsPriceRentParams) ([]Ad, error)
- func (q *Queries) GetAdByID(ctx context.Context, arg GetAdByIDParams) (GetAdByIDRow, error)
- func (q *Queries) GetAdByPublisherAdKey(ctx context.Context, adKey string) (int64, error)
- func (q *Queries) GetAdPictures(ctx context.Context, adID *int64) ([]AdPicture, error)
- func (q *Queries) GetAdsByIds(ctx context.Context, adIds []int64) ([]Ad, error)
- func (q *Queries) GetAdsByPublisher(ctx context.Context, publisherID *int32) ([]Ad, error)
- func (q *Queries) GetAdsPublisherByAdKey(ctx context.Context, adKey *int64) (string, error)
- func (q *Queries) GetAdsWithoutPrice(ctx context.Context) ([]Ad, error)
- func (q *Queries) GetAllAds(ctx context.Context, arg GetAllAdsParams) ([]Ad, error)
- func (q *Queries) GetAllPricesByAdID(ctx context.Context, id int64) ([]Price, error)
- func (q *Queries) GetAllUsers(ctx context.Context, arg GetAllUsersParams) ([]User, error)
- func (q *Queries) GetFirstCrawlJobByStatus(ctx context.Context, status string) (CrawlJob, error)
- func (q *Queries) GetFirstMatchingCrawlJob(ctx context.Context, arg GetFirstMatchingCrawlJobParams) (CrawlJob, error)
- func (q *Queries) GetLatestPriceByAdID(ctx context.Context, id int64) (Price, error)
- func (q *Queries) GetNextAdmin(ctx context.Context, offset int32) (User, error)
- func (q *Queries) GetPictureByID(ctx context.Context, id int64) (AdPicture, error)
- func (q *Queries) GetPublisherByName(ctx context.Context, name *string) (Publisher, error)
- func (q *Queries) GetUserAds(ctx context.Context, userID string) ([]int64, error)
- func (q *Queries) GetUserByTGID(ctx context.Context, tgID string) (User, error)
- func (q *Queries) GetUserFavoriteAds(ctx context.Context, userID string) ([]int64, error)
- func (q *Queries) UpdateAd(ctx context.Context, arg UpdateAdParams) (Ad, error)
- func (q *Queries) UpdateCrawlJobStatus(ctx context.Context, arg UpdateCrawlJobStatusParams) (int64, error)
- func (q *Queries) UpdatePublisherUrl(ctx context.Context, arg UpdatePublisherUrlParams) (Publisher, error)
- func (q *Queries) UpdateUserPeriod(ctx context.Context, arg UpdateUserPeriodParams) (User, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type UpdateAdParams
- type UpdateCrawlJobStatusParams
- type UpdatePublisherUrlParams
- type UpdateUserPeriodParams
- type User
- type UserAd
- type UserRole
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ad ¶
type Ad struct { ID int64 `json:"id"` PublisherAdKey string `json:"publisher_ad_key"` PublisherID *int32 `json:"publisher_id"` CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` PublishedAt *time.Time `json:"published_at"` Category string `json:"category"` Author *string `json:"author"` Url *string `json:"url"` Title *string `json:"title"` Description *string `json:"description"` City *string `json:"city"` Neighborhood *string `json:"neighborhood"` HouseType string `json:"house_type"` Meterage *int32 `json:"meterage"` RoomsCount *int32 `json:"rooms_count"` Year *int32 `json:"year"` Floor *int32 `json:"floor"` TotalFloors *int32 `json:"total_floors"` HasWarehouse *bool `json:"has_warehouse"` HasElevator *bool `json:"has_elevator"` HasParking *bool `json:"has_parking"` Lat *float64 `json:"lat"` Lng *float64 `json:"lng"` }
type AdCategory ¶
type AdCategory string
const ( AdCategoryRent AdCategory = "rent" AdCategoryBuy AdCategory = "buy" AdCategoryMortgage AdCategory = "mortgage" AdCategoryOther AdCategory = "other" )
func (*AdCategory) Scan ¶
func (e *AdCategory) Scan(src interface{}) error
type CreateAdParams ¶
type CreateAdParams struct { PublisherAdKey string `json:"publisher_ad_key"` PublisherID *int32 `json:"publisher_id"` PublishedAt *time.Time `json:"published_at"` Category string `json:"category"` Author *string `json:"author"` Url *string `json:"url"` Title *string `json:"title"` Description *string `json:"description"` City *string `json:"city"` Neighborhood *string `json:"neighborhood"` HouseType string `json:"house_type"` Meterage *int32 `json:"meterage"` RoomsCount *int32 `json:"rooms_count"` Year *int32 `json:"year"` Floor *int32 `json:"floor"` TotalFloors *int32 `json:"total_floors"` HasWarehouse *bool `json:"has_warehouse"` HasElevator *bool `json:"has_elevator"` HasParking *bool `json:"has_parking"` Lat *float64 `json:"lat"` Lng *float64 `json:"lng"` }
type CreateAdPictureParams ¶
type CreateCrawlJobParams ¶
type CreatePriceParams ¶
type CreatePublisherParams ¶
type CreateUserAdParams ¶
type CreateUserParams ¶
type CreateUserParams struct { TgID string `json:"tg_id"` Role NullUserRole `json:"role"` WatchlistPeriod *int32 `json:"watchlist_period"` }
type FavoriteAd ¶
type FilterAdsParams ¶
type FilterAdsParams struct { PublisherID *int32 `json:"publisher_id"` MinPublishedAt *time.Time `json:"min_published_at"` MaxPublishedAt *time.Time `json:"max_published_at"` Category *string `json:"category"` Author *string `json:"author"` City *string `json:"city"` Neighborhood *string `json:"neighborhood"` HouseType *string `json:"house_type"` MinMeterage *int32 `json:"min_meterage"` MaxMeterage *int32 `json:"max_meterage"` MinRooms *int32 `json:"min_rooms"` MaxRooms *int32 `json:"max_rooms"` MinYear *int32 `json:"min_year"` MaxYear *int32 `json:"max_year"` MinFloor *int32 `json:"min_floor"` MaxFloor *int32 `json:"max_floor"` MinTotalFloors *int32 `json:"min_total_floors"` MaxTotalFloors *int32 `json:"max_total_floors"` HasWarehouse *bool `json:"has_warehouse"` HasElevator *bool `json:"has_elevator"` HasParking *bool `json:"has_parking"` Lat *float64 `json:"lat"` Lng *float64 `json:"lng"` Radius *int32 `json:"radius"` Offset *int32 `json:"offset"` Limit *int32 `json:"limit"` }
type FilterAdsPriceBuyParams ¶
type GetAdByIDParams ¶
type GetAdByIDRow ¶
type GetAdByIDRow struct { ID int64 `json:"id"` PublisherAdKey string `json:"publisher_ad_key"` PublisherID *int32 `json:"publisher_id"` CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` PublishedAt *time.Time `json:"published_at"` Category string `json:"category"` Author *string `json:"author"` Url *string `json:"url"` Title *string `json:"title"` Description *string `json:"description"` City *string `json:"city"` Neighborhood *string `json:"neighborhood"` HouseType string `json:"house_type"` Meterage *int32 `json:"meterage"` RoomsCount *int32 `json:"rooms_count"` Year *int32 `json:"year"` Floor *int32 `json:"floor"` TotalFloors *int32 `json:"total_floors"` HasWarehouse *bool `json:"has_warehouse"` HasElevator *bool `json:"has_elevator"` HasParking *bool `json:"has_parking"` Lat *float64 `json:"lat"` Lng *float64 `json:"lng"` FavoriteStatus bool `json:"favorite_status"` }
type GetAllAdsParams ¶
type GetAllUsersParams ¶
type NullAdCategory ¶
type NullAdCategory struct { AdCategory AdCategory `json:"ad_category"` Valid bool `json:"valid"` // Valid is true if AdCategory is not NULL }
func (*NullAdCategory) Scan ¶
func (ns *NullAdCategory) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullHouseType ¶
type NullHouseType struct { HouseType HouseType `json:"house_type"` Valid bool `json:"valid"` // Valid is true if HouseType is not NULL }
func (*NullHouseType) Scan ¶
func (ns *NullHouseType) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullUserRole ¶
type NullUserRole struct { UserRole UserRole `json:"user_role"` Valid bool `json:"valid"` // Valid is true if UserRole is not NULL }
func (*NullUserRole) Scan ¶
func (ns *NullUserRole) Scan(value interface{}) error
Scan implements the Scanner interface.
type Price ¶
type Price struct { ID int32 `json:"id"` AdID int64 `json:"ad_id"` FetchedAt *time.Time `json:"fetched_at"` HasPrice *bool `json:"has_price"` TotalPrice *int64 `json:"total_price"` PricePerMeter *int64 `json:"price_per_meter"` Mortgage *int64 `json:"mortgage"` NormalPrice *int64 `json:"normal_price"` WeekendPrice *int64 `json:"weekend_price"` }
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) ChangeAllCrawlJobsStatus ¶
func (q *Queries) ChangeAllCrawlJobsStatus(ctx context.Context, arg ChangeAllCrawlJobsStatusParams) error
new_status: text current_statuses: text[]
func (*Queries) CheckCrawlJobExists ¶
func (q *Queries) CheckCrawlJobExists(ctx context.Context, arg CheckCrawlJobExistsParams) (bool, error)
url: text statuses: text[]
func (*Queries) CreateAdPicture ¶
func (q *Queries) CreateAdPicture(ctx context.Context, arg CreateAdPictureParams) (AdPicture, error)
Assign a picture to a Ad
func (*Queries) CreateCrawlJob ¶
Insert a new crawl job
func (*Queries) CreatePrice ¶
Insert a new price entry for a specific ad
func (*Queries) CreatePublisher ¶
func (q *Queries) CreatePublisher(ctx context.Context, arg CreatePublisherParams) (Publisher, error)
Insert a new publisher
func (*Queries) CreateUser ¶
Create a new user
func (*Queries) CreateUserAd ¶
func (q *Queries) CreateUserAd(ctx context.Context, arg CreateUserAdParams) error
Assign an ad to a user as creator of that ad
func (*Queries) CreateUserFavoriteAd ¶
func (q *Queries) CreateUserFavoriteAd(ctx context.Context, arg CreateUserFavoriteAdParams) error
Assign an ad to a user as creator of that ad
func (*Queries) DeleteAllPicturesOfAd ¶
func (*Queries) DeletePictureByID ¶
func (*Queries) DeletePublisher ¶
Delete publisher by ID
func (*Queries) DeleteUser ¶
Delete a user by Telegram ID
func (*Queries) DeleteUserFavoriteAd ¶
func (q *Queries) DeleteUserFavoriteAd(ctx context.Context, arg DeleteUserFavoriteAdParams) error
Delete an ad from user's favorite list
func (*Queries) FilterAds ¶
Comprehensive ad search with all attribute filters, including ranges and additional fields
func (*Queries) FilterAdsPriceBuy ¶
Filter ads based on list of IDs and price range (buy category)
func (*Queries) FilterAdsPriceMortgage ¶
func (q *Queries) FilterAdsPriceMortgage(ctx context.Context, arg FilterAdsPriceMortgageParams) ([]Ad, error)
Filter ads based on list of IDs and price range (mortgage category)
func (*Queries) FilterAdsPriceRent ¶
func (q *Queries) FilterAdsPriceRent(ctx context.Context, arg FilterAdsPriceRentParams) ([]Ad, error)
Filter ads based on list of IDs and price range (rent category)
func (*Queries) GetAdByID ¶
func (q *Queries) GetAdByID(ctx context.Context, arg GetAdByIDParams) (GetAdByIDRow, error)
Get Ad by its ID
func (*Queries) GetAdByPublisherAdKey ¶
func (*Queries) GetAdPictures ¶
func (*Queries) GetAdsByIds ¶
Get ads based on list of IDs
func (*Queries) GetAdsByPublisher ¶
Get ads by publisher ID
func (*Queries) GetAdsPublisherByAdKey ¶
Get PublisherAdKey for one specific ad
func (*Queries) GetAdsWithoutPrice ¶
Get ads without associated price
func (*Queries) GetAllPricesByAdID ¶
Get all prices for a specific ad by its id
func (*Queries) GetAllUsers ¶
Get all users with pagination
func (*Queries) GetFirstCrawlJobByStatus ¶
func (*Queries) GetFirstMatchingCrawlJob ¶
func (q *Queries) GetFirstMatchingCrawlJob(ctx context.Context, arg GetFirstMatchingCrawlJobParams) (CrawlJob, error)
url: text statuses: text[]
func (*Queries) GetLatestPriceByAdID ¶
Get the latest price for a specific ad by its id
func (*Queries) GetNextAdmin ¶
func (*Queries) GetPictureByID ¶
func (*Queries) GetPublisherByName ¶
Get publisher by its name
func (*Queries) GetUserAds ¶
Avoid duplicate entries Get any ad that's created by user
func (*Queries) GetUserByTGID ¶
Get user by Telegram ID
func (*Queries) GetUserFavoriteAds ¶
Avoid duplicate entries Get all user's favorite ads
func (*Queries) UpdateCrawlJobStatus ¶
func (*Queries) UpdatePublisherUrl ¶
func (q *Queries) UpdatePublisherUrl(ctx context.Context, arg UpdatePublisherUrlParams) (Publisher, error)
Update publisher URL by ID
func (*Queries) UpdateUserPeriod ¶
Update user role and watchlist period
type UpdateAdParams ¶
type UpdateAdParams struct { PublisherAdKey *string `json:"publisher_ad_key"` PublisherID *int32 `json:"publisher_id"` PublishedAt *time.Time `json:"published_at"` Category string `json:"category"` Author *string `json:"author"` Url *string `json:"url"` Title *string `json:"title"` Description *string `json:"description"` City *string `json:"city"` Neighborhood *string `json:"neighborhood"` HouseType string `json:"house_type"` Meterage *int32 `json:"meterage"` RoomsCount *int32 `json:"rooms_count"` Year *int32 `json:"year"` Floor *int32 `json:"floor"` TotalFloors *int32 `json:"total_floors"` HasWarehouse *bool `json:"has_warehouse"` HasElevator *bool `json:"has_elevator"` HasParking *bool `json:"has_parking"` Lat *float64 `json:"lat"` Lng *float64 `json:"lng"` }
type UpdateUserPeriodParams ¶
type User ¶
type User struct { TgID string `json:"tg_id"` Role NullUserRole `json:"role"` WatchlistPeriod *int32 `json:"watchlist_period"` }