model

package
v0.0.0-...-1d517b5 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityType

type ActivityType uint8
const (
	ActivityTypeClick ActivityType = iota
	ActivityTypeVisit
	ActivityTypeRedirect
)

type ShortURL

type ShortURL struct {
	gorm.Model
	CreatedBy uint      `json:"created_by"`
	Active    bool      `gorm:"default:true" json:"active"`
	UrlID     uint32    `gorm:"uniqueIndex;not null;" json:"url_id"`
	Alias     string    `gorm:"uniqueIndex;size:255;" json:"alias"`
	Name      string    `gorm:"not null;" json:"name"`
	Long      string    `gorm:"not null;" json:"long"`
	ExpiresAt time.Time `json:"expires_at"`
}

type UrlStats

type UrlStats struct {
	UrlID        uint32       `json:"short_url_id"`
	ActivityTime time.Time    `json:"activity_time"`
	ActivityType ActivityType `json:"activity_type"`
	TimeZone     string       `json:"time_zone"`
	IpAddress    string       `json:"ip_address"`
	Location     string       `json:"location"`
	UserAgent    string       `json:"user_agent"`
}

type User

type User struct {
	gorm.Model
	Email    string `gorm:"uniqueIndex;not null;size:255;" validate:"required,email" json:"email"`
	Password string `gorm:"not null;" validate:"required,min=6,max=50" json:"password"`
}

Jump to

Keyboard shortcuts

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