Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NotificationSettings ¶
type NotificationSettings struct {
CreatedAt time.Time
UpdatedAt time.Time
ID int64 `gorm:"primarykey"`
NotifyAlways bool `json:"notifyAlways" gorm:"default:true"`
NotifyPriceDrop bool `json:"notifyPriceDrop" gorm:"default:false"`
NotifyPriceRise bool `json:"notifyPriceRise" gorm:"default:false"`
NotifyAbove bool `json:"notifyAbove" gorm:"default:false"`
NotifyBelow bool `json:"notifyBelow" gorm:"default:false"`
AbovePrice float64 `json:"abovePrice" gorm:"default:0"`
BelowPrice float64 `json:"belowPrice" gorm:"default:0"`
}
func (NotificationSettings) String ¶
func (ns NotificationSettings) String() string
type PriceAgent ¶
type PriceAgent struct {
CreatedAt time.Time
ID int64 `json:"id" gorm:"primarykey;autoIncrement:true"`
Name string `json:"name"`
UserID int64 `json:"user_id" gorm:"not null;default:null;index:user_entity_idx,unique"`
User User `json:"user" gorm:"foreignkey:UserID"`
EntityID int64 `json:"-" gorm:"index:user_entity_idx,unique"`
Entity geizhals.Entity `json:"entity" gorm:"foreignkey:EntityID"`
Location string `json:"location" gorm:"default:de"`
NotificationID int64 `json:"-"`
NotificationSettings NotificationSettings `json:"notificationSettings" gorm:"foreignkey:NotificationID;constraint:OnDelete:CASCADE;"`
Enabled bool `json:"enabled" gorm:"default:1"`
}
func (PriceAgent) CurrentEntityPrice ¶
func (pa PriceAgent) CurrentEntityPrice() geizhals.EntityPrice
func (PriceAgent) CurrentPrice ¶
func (pa PriceAgent) CurrentPrice() float64
func (PriceAgent) EntityURL ¶
func (pa PriceAgent) EntityURL() string
func (PriceAgent) GetCurrency ¶
func (pa PriceAgent) GetCurrency() geizhals.Currency
func (PriceAgent) String ¶
func (pa PriceAgent) String() string
type User ¶
type User struct {
ID int64 `json:"id" gorm:"unique;primaryKey"`
CreatedAt time.Time `json:"-"`
UpdatedAt time.Time `json:"-"`
Username string `json:"username"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
LangCode string `json:"language_code"`
DarkMode bool `json:"dark_mode" gorm:"default:1"`
PriceAgents []PriceAgent `json:"-"`
}
Click to show internal directories.
Click to hide internal directories.