model

package
v0.0.0-...-39d7215 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBMigrate

func DBMigrate(db *gorm.DB) *gorm.DB

Types

type Link struct {
	Model
	Url        string     `json:"url"`
	Permalink  string     `json:"permalink"`
	Visits     int        `json:"visits"`
	ValidUntil *time.Time `json:"validUntil"`
}

func (*Link) IsValid

func (l *Link) IsValid() bool

func (*Link) WithHashId

func (l *Link) WithHashId() *Link

type Model

type Model struct {
	ID        uint       `gorm:"primary_key" json:"-"`
	HashID    string     `sql:"-" json:"id"`
	CreatedAt time.Time  `json:"createdAt"`
	UpdatedAt time.Time  `json:"updatedAt"`
	DeletedAt *time.Time `sql:"index" json:"deletedAt"`
}

type User

type User struct {
	Id            string `json:"id"`
	Email         string `json:"email"`
	VerifiedEmail bool   `json:"verified_email"`
	Picture       string `json:"picture"`
}

Jump to

Keyboard shortcuts

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