Documentation
¶
Index ¶
- Constants
- type CreateNotificationParams
- type CreateSubscriptionParams
- type DBTX
- type GetListingsByIsNeedSendRow
- type GetListingsBySubscriptionIDRow
- type Listing
- type Notification
- type NullStatus
- type Queries
- func (q *Queries) CreateNotification(ctx context.Context, arg CreateNotificationParams) (Notification, error)
- func (q *Queries) CreateSubscription(ctx context.Context, arg CreateSubscriptionParams) (Subscription, error)
- func (q *Queries) DeleteListingsBySubscriptionIDs(ctx context.Context, dollar_1 []pgtype.UUID) error
- func (q *Queries) DeleteSubscriptionByID(ctx context.Context, id pgtype.UUID) error
- func (q *Queries) DeleteSubscriptionsByUserID(ctx context.Context, userID int64) error
- func (q *Queries) DeleteUserByID(ctx context.Context, id int64) error
- func (q *Queries) GetAllSubscriptions(ctx context.Context) ([]Subscription, error)
- func (q *Queries) GetListingsByIsNeedSend(ctx context.Context, isNeedSend bool) ([]GetListingsByIsNeedSendRow, error)
- func (q *Queries) GetListingsBySubscriptionID(ctx context.Context, subscriptionID pgtype.UUID) ([]GetListingsBySubscriptionIDRow, error)
- func (q *Queries) GetSubscriptionByID(ctx context.Context, id pgtype.UUID) (Subscription, error)
- func (q *Queries) GetSubscriptionsByUserID(ctx context.Context, userID int64) ([]Subscription, error)
- func (q *Queries) UpsertListing(ctx context.Context, arg UpsertListingParams) error
- func (q *Queries) UpsertUser(ctx context.Context, arg UpsertUserParams) (User, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type Status
- type Subscription
- type UpsertListingParams
- type UpsertUserParams
- type User
Constants ¶
View Source
const CreateNotification = `` /* 384-byte string literal not displayed */
View Source
const CreateSubscription = `` /* 613-byte string literal not displayed */
View Source
const DeleteListingsBySubscriptionIDs = `-- name: DeleteListingsBySubscriptionIDs :exec
DELETE
FROM listings
WHERE subscription_id = ANY ($1::uuid[])
`
View Source
const DeleteSubscriptionByID = `-- name: DeleteSubscriptionByID :exec
DELETE
FROM subscriptions
WHERE id = $1
`
View Source
const DeleteSubscriptionsByUserID = `-- name: DeleteSubscriptionsByUserID :exec
DELETE
FROM subscriptions
WHERE user_id = $1
`
View Source
const DeleteUserByID = `-- name: DeleteUserByID :exec
DELETE
FROM users
WHERE id = $1
`
View Source
const GetAllSubscriptions = `` /* 247-byte string literal not displayed */
View Source
const GetListingsByIsNeedSend = `` /* 355-byte string literal not displayed */
View Source
const GetListingsBySubscriptionID = `` /* 362-byte string literal not displayed */
View Source
const GetSubscriptionByID = `` /* 260-byte string literal not displayed */
View Source
const GetSubscriptionsByUserID = `` /* 271-byte string literal not displayed */
View Source
const UpsertListing = `` /* 1481-byte string literal not displayed */
View Source
const UpsertUser = `` /* 544-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateSubscriptionParams ¶
type CreateSubscriptionParams struct { UserID int64 `json:"user_id"` Brand string `json:"brand"` Model []string `json:"model"` Chassis []string `json:"chassis"` PriceFrom string `json:"price_from"` PriceTo string `json:"price_to"` YearFrom string `json:"year_from"` YearTo string `json:"year_to"` Region []string `json:"region"` }
type GetListingsByIsNeedSendRow ¶ added in v1.2.0
type GetListingsByIsNeedSendRow struct { ID pgtype.UUID `json:"id"` ListingID string `json:"listing_id"` SubscriptionID pgtype.UUID `json:"subscription_id"` Title string `json:"title"` Price string `json:"price"` NewPrice pgtype.Text `json:"new_price"` EngineVolume string `json:"engine_volume"` Transmission string `json:"transmission"` BodyType string `json:"body_type"` Mileage string `json:"mileage"` Location string `json:"location"` Link string `json:"link"` Date pgtype.Timestamp `json:"date"` IsNeedSend bool `json:"is_need_send"` CreatedAt pgtype.Timestamp `json:"created_at"` UpdatedAt pgtype.Timestamp `json:"updated_at"` }
type GetListingsBySubscriptionIDRow ¶ added in v1.2.0
type GetListingsBySubscriptionIDRow struct { ID pgtype.UUID `json:"id"` ListingID string `json:"listing_id"` SubscriptionID pgtype.UUID `json:"subscription_id"` Title string `json:"title"` Price string `json:"price"` NewPrice pgtype.Text `json:"new_price"` EngineVolume string `json:"engine_volume"` Transmission string `json:"transmission"` BodyType string `json:"body_type"` Mileage string `json:"mileage"` Location string `json:"location"` Link string `json:"link"` Date pgtype.Timestamp `json:"date"` IsNeedSend bool `json:"is_need_send"` CreatedAt pgtype.Timestamp `json:"created_at"` UpdatedAt pgtype.Timestamp `json:"updated_at"` }
type Listing ¶
type Listing struct { ID pgtype.UUID `json:"id"` ListingID string `json:"listing_id"` SubscriptionID pgtype.UUID `json:"subscription_id"` Title string `json:"title"` Price string `json:"price"` EngineVolume string `json:"engine_volume"` Transmission string `json:"transmission"` BodyType string `json:"body_type"` Mileage string `json:"mileage"` Location string `json:"location"` Link string `json:"link"` Date pgtype.Timestamp `json:"date"` IsNeedSend bool `json:"is_need_send"` CreatedAt pgtype.Timestamp `json:"created_at"` UpdatedAt pgtype.Timestamp `json:"updated_at"` NewPrice pgtype.Text `json:"new_price"` }
type Notification ¶
type NullStatus ¶
type NullStatus struct { Status Status `json:"status"` Valid bool `json:"valid"` // Valid is true if Status is not NULL }
func (*NullStatus) Scan ¶
func (ns *NullStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CreateNotification ¶
func (q *Queries) CreateNotification(ctx context.Context, arg CreateNotificationParams) (Notification, error)
func (*Queries) CreateSubscription ¶
func (q *Queries) CreateSubscription(ctx context.Context, arg CreateSubscriptionParams) (Subscription, error)
func (*Queries) DeleteListingsBySubscriptionIDs ¶
func (*Queries) DeleteSubscriptionByID ¶
func (*Queries) DeleteSubscriptionsByUserID ¶
func (*Queries) DeleteUserByID ¶
func (*Queries) GetAllSubscriptions ¶
func (q *Queries) GetAllSubscriptions(ctx context.Context) ([]Subscription, error)
func (*Queries) GetListingsByIsNeedSend ¶
func (*Queries) GetListingsBySubscriptionID ¶
func (*Queries) GetSubscriptionByID ¶
func (*Queries) GetSubscriptionsByUserID ¶
func (*Queries) UpsertListing ¶
func (q *Queries) UpsertListing(ctx context.Context, arg UpsertListingParams) error
func (*Queries) UpsertUser ¶
type Subscription ¶
type Subscription struct { ID pgtype.UUID `json:"id"` UserID int64 `json:"user_id"` Brand string `json:"brand"` Model []string `json:"model"` Chassis []string `json:"chassis"` PriceFrom string `json:"price_from"` PriceTo string `json:"price_to"` YearFrom string `json:"year_from"` YearTo string `json:"year_to"` Region []string `json:"region"` CreatedAt pgtype.Timestamp `json:"created_at"` UpdatedAt pgtype.Timestamp `json:"updated_at"` }
type UpsertListingParams ¶
type UpsertListingParams struct { ListingID string `json:"listing_id"` SubscriptionID pgtype.UUID `json:"subscription_id"` Title string `json:"title"` Price string `json:"price"` NewPrice pgtype.Text `json:"new_price"` EngineVolume string `json:"engine_volume"` Transmission string `json:"transmission"` BodyType string `json:"body_type"` Mileage string `json:"mileage"` Location string `json:"location"` Link string `json:"link"` Date pgtype.Timestamp `json:"date"` IsNeedSend bool `json:"is_need_send"` }
type UpsertUserParams ¶
Click to show internal directories.
Click to hide internal directories.