redirect

package
v0.0.0-...-c7833f4 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2021 License: GPL-3.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIDTaken = fmt.Errorf("id already taken")
)

Functions

func FromShort

func FromShort(id string) (redirect model.Redirect, err error)

FromShort gets a redirect from the database given a ID.

func FromURL

func FromURL(url string) (redirect model.Redirect, err error)

FromLong gets a redirect from the database given a URL.

func Handle

func Handle(w http.ResponseWriter, r *http.Request)

func Insert

func Insert(url string) (redirect model.Redirect, err error)

Insert a redirect into the database.

func InsertWithShort

func InsertWithShort(redirect model.Redirect) (err error)

func JSON

func JSON(w http.ResponseWriter, r *http.Request)

func New

func New(w http.ResponseWriter, r *http.Request)

New creates a new redirect.

Types

This section is empty.

Jump to

Keyboard shortcuts

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