models

package
v0.0.0-...-7ed03d2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupModels

func SetupModels(db *gorm.DB)

func ShortExists

func ShortExists(short string, db *gorm.DB) (bool, error)

Types

type UrlPair

type UrlPair struct {
	gorm.Model
	Short string `json:"short"`
	Long  string `json:"long"`
}

func NewUrlPair

func NewUrlPair(long string, short string) *UrlPair

* Just called New because external users will * use urlPair.New()

func (*UrlPair) BeforeSave

func (urlPair *UrlPair) BeforeSave(db *gorm.DB) (err error)

Jump to

Keyboard shortcuts

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