models

package
v0.0.0-...-b23ed02 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 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 APIKey

type APIKey struct {
	gorm.Model

	Key            string `gorm:"type:varchar(255)"`
	ExpirationDate *time.Time
	Enabled        bool
}

APIKey is used for signing in via REST interface

type Domain

type Domain struct {
	ID uint `gorm:"primary_key"`

	Authority string `gorm:"type:varchar(255)"`

	ShortURLs []ShortURL
}

Domain is something im not sure in shlink

type ShortURL

type ShortURL struct {
	gorm.Model
	DomainID    uint
	OriginalURL string `gorm:"type:varchar(2048)"`
	ShortCode   string `gorm:"type:varchar(255)"`
	ValidSince  *time.Time
	ValidUntil  *time.Time
	MaxVisits   uint

	Tags []Tag `gorm:"many2many:short_urls_in_tags"`
}

ShortURL is the struct that saves short-urls

type Tag

type Tag struct {
	ID        uint       `gorm:"primary_key"`
	Name      string     `gorm:"type:varchar(255)"`
	ShortURLs []ShortURL `gorm:"many2many:short_urls_in_tags"`
}

Tag is a GORM short url Tag

Jump to

Keyboard shortcuts

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