models

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Link struct {
	ID      string `json:"id"` // the short name of a link
	URL     string `json:"url"`
	Created int64  `json:"created"` // epoch time
	Hits    int64  `json:"hits"`    // number of visits to link
}

Link is a representation of a shortened URL

func (Link) Validate

func (link Link) Validate(maxlength int, serverHost string) error

Validate checks URL and ID to make sure they are valid and conform to standards

Jump to

Keyboard shortcuts

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