database

package
v0.0.0-...-a481ea3 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func InitDB

func InitDB(mode string) error

func Shorten

func Shorten(url string, custom ...string) (*shortened, error)

Shorten Shorten the given url

Types

type Shortened

type Shortened interface {
	String() string
	IsValid() bool
	Create() error
	GetOrigin() string
}

func GetOriginal

func GetOriginal(shortUrl string) (Shortened, error)

GetOriginal Get original url of the given short url

func NewShortened

func NewShortened() Shortened

Jump to

Keyboard shortcuts

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