Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *gorm.DB
Functions ¶
Types ¶
type Short ¶
type Short struct { BaseModel TargetURL string `gorm:"not null" json:"targetUrl"` VisitCount uint `gorm:"default:0;not null" json:"visitCount,omitempty"` ExpiresAt *time.Time `json:"expiresAt,omitempty"` MaxUses *uint `json:"maxUses,omitempty"` OwnerID *uint `json:"ownerId,omitempty"` }
func GetShortByID ¶
type User ¶
type User struct { BaseModel Username string `gorm:"unique;not null"` HashedPassword []byte `gorm:"not null" json:"-"` OwnedShorts []Short `gorm:"foreignkey:OwnerID;references:id" json:"-"` }
func GetUserByID ¶
func GetUserByUsername ¶
func (*User) IsPasswordMatch ¶
Check if password matches the hashed stored one
func (*User) SetPassword ¶
Set a new password (hashing it)
Click to show internal directories.
Click to hide internal directories.