routes

package
v0.0.0-...-29e63d5 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteHandler

func DeleteHandler(db database.ShortenBackend) func(http.ResponseWriter, *http.Request)

DeleteHandler generates a HTTP handler for deleting URL's given a datastore backend.

func ListHandler

func ListHandler(db database.ShortenBackend) func(http.ResponseWriter, *http.Request)

ListHandler generates a HTTP handler for listing URL's given a datastore backend.

func MetaHandler

func MetaHandler(protocol, domain string) func(http.ResponseWriter, *http.Request)

MetaHandler returns info on the protocol and the domain for our short URLs Seems a little weird, but follows react patterns

func ReadOnlyHandler

func ReadOnlyHandler() func(http.ResponseWriter, *http.Request)

ReadOnlyHandler returns a message to the user saying that they need to find the write-domain to modify things. This shouldn't be hit too often as the admin interface itself will hide the user-facing input

func RedirectHandler

func RedirectHandler(db database.ShortenBackend, domain, slugSeparator string) func(http.ResponseWriter, *http.Request)

RedirectHandler redirects users to their desired location. Not accessed via Ajax, just by end users

func ShortenHandler

func ShortenHandler(db database.ShortenBackend) func(http.ResponseWriter, *http.Request)

ShortenHandler generates a HTTP handler for a shortening URLs given a datastore backend.

Types

This section is empty.

Jump to

Keyboard shortcuts

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