Documentation ¶
Index ¶
- func DeleteCizzor(id uint64) error
- func DeleteUser(id uint64) error
- func Setup()
- type Cizzor
- func CreateCizzor(cizzor Cizzor) (Cizzor, error)
- func GetAllCizzors(userID uint64) ([]Cizzor, error)
- func GetCizzorById(id uint64) (Cizzor, error)
- func GetCizzorByShortUrl(shortUrl string) (Cizzor, error)
- func UpdateCizzor(userID uint64, cizzor Cizzor) (Cizzor, error)
- func UpdateCizzorCount(cizzor Cizzor) (Cizzor, error)
- type ClickSource
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteCizzor ¶
func DeleteUser ¶
Types ¶
type Cizzor ¶
type Cizzor struct { ID uint64 `json:"id" gorm:"primary_key"` Url string `json:"url" gorm:"not null"` ShortUrl string `json:"short_url" gorm:"not null"` Count int `json:"count"` Random bool `json:"random"` OwnerId uint64 `json:"owner_id" gorm:"foreignKey:UserID"` ClickSources []ClickSource `json:"-" gorm:"foreignKey:CizzorID"` CreatedAt time.Time `json:"created_at" gorm:"type:timestamp with time zone;autoCreateTime"` UpdatedAt time.Time `json:"updated_at" gorm:"type:timestamp with time zone;autoUpdateTime"` }
func CreateCizzor ¶
func GetAllCizzors ¶
func GetCizzorById ¶
func GetCizzorByShortUrl ¶
func UpdateCizzorCount ¶
func (*Cizzor) UpdateClickSourceCount ¶
type ClickSource ¶
type ClickSource struct { ID uint64 `json:"id" gorm:"primary_key"` CizzorID uint64 `json:"cizzor_id" gorm:"foreignKey:CizzorID"` IpAddress string `json:"ip_address" gorm:"not null"` Location string `json:"location" gorm:"not null"` Count uint64 `json:"count"` CreatedAt time.Time `json:"created_at" gorm:"type:timestamp with time zone;autoCreateTime"` UpdatedAt time.Time `json:"updated_at" gorm:"type:timestamp with time zone;autoUpdateTime"` }
func GetClickSources ¶
func GetClickSources(userID, cizzorID uint64) (ClickSource, error)
type User ¶
type User struct { ID uint64 `json:"id" gorm:"primary_key"` Username string `json:"username" gorm:"not null;unique"` Email string `json:"email" gorm:"not null;unique"` Password string `json:"password" gorm:"not null"` CreatedAt time.Time `json:"created_at" gorm:"type:timestamp with time zone;autoCreateTime"` UpdatedAt time.Time `json:"updated_at" gorm:"type:timestamp with time zone;autoUpdateTime"` }
func CreateUser ¶
func GetUserByID ¶
func UpdateUser ¶
Click to show internal directories.
Click to hide internal directories.