model

package
v0.0.0-...-61a4d47 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2019 License: MIT Imports: 8 Imported by: 0

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

Jump to

Keyboard shortcuts

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