Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DB *gorm.DB
)
Functions ¶
This section is empty.
Types ¶
type ShortURLModel ¶
type ShortURLModel struct { ID int64 `gorm:"primary_key;AUTO_INCREMENT;column:id"` Code int64 URL string `gorm:"column:url"` URLHash string `gorm:"column:url_hash"` CreatedAt *time.Time UpdatedAt *time.Time }
func NewShortURL ¶
func NewShortURL(code int64, url string, urlHash string) (*ShortURLModel, error)
func ShortURLByCode ¶
func ShortURLByCode(code int) (*ShortURLModel, error)
func ShortURLByURLHash ¶
func ShortURLByURLHash(hash string) (*ShortURLModel, error)
func (*ShortURLModel) String ¶
func (m *ShortURLModel) String() string
func (*ShortURLModel) TableName ¶
func (m *ShortURLModel) TableName() string
Click to show internal directories.
Click to hide internal directories.