data

package
v0.0.0-...-a5936d2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create() error

func Insert

func Insert(url Url) error

func Open

func Open() (*gorm.DB, error)

func Recreate

func Recreate() error

Types

type Url

type Url struct {
	Id           int       `gorm:"PRIMARY_KEY;AUTO_INCREMENT;NOT NULL"`
	FullUrl      string    `gorm:"type:VARCHAR(100);NOT NULL"`
	ShortUrl     string    `gorm:"type:VARCHAR(50);NOT NULL"`
	CreatedAt    time.Time `gorm:"type:DATETIME;NOT NULL"`
	ValidUntil   time.Time `gorm:"type:DATETIME"`
	MinutesValid int
}

func Get

func Get(url string) ([]Url, error)

func GetUrlsFromRows

func GetUrlsFromRows(db *gorm.DB, rows *sql.Rows) ([]Url, error)

func (Url) TableName

func (Url) TableName() string

Jump to

Keyboard shortcuts

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