model

package
v0.0.0-...-9c25b7e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateShortCat

func CreateShortCat(shortcat Shortcat) error

func DeleteShortCatById

func DeleteShortCatById(id uint64) error

func Setup

func Setup()

func UpdateShortCat

func UpdateShortCat(shortcat Shortcat) error

Types

type Shortcat

type Shortcat struct {
	ID        uint64    `json:"id" gorm:"primaryKey"`
	Url       string    `json:"url" gorm:"not null"`
	ShortUrl  string    `json:"short_url" gorm:"not null;unique"`
	Clicks    uint64    `json:"clicks"`
	CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
}

func GetAllShortCats

func GetAllShortCats() ([]Shortcat, error)

func GetShortCatById

func GetShortCatById(id uint64) (Shortcat, error)

func GetShortCatByShortUrl

func GetShortCatByShortUrl(shortUrl string) (Shortcat, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL