httphandler

package
v0.0.0-...-c3b309f Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package httphandler is used to render webpages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FaviconHandler

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

FaviconHandler serves the favicon.ico image for browsers. e.g. r.HandleFunc("/favicon.ico", FaviconHandler).Methods("GET")

func GenerateLinkHandler

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

GenerateLinkHandler renders the page when a Byte-Link is generated. e.g. r.HandleFunc("/", GenerateLinkHandler).Methods("POST")

func HomePageHandler

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

HomePageHandler renders the home page. e.g. r.HandleFunc("/", HomePageHandler).Methods("GET")

func RedirectByteLinkHandler

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

RedirectByteLinkHandler attempts to re-route the request using a provided byte-link. e.g. r.HandleFunc("/{byteLink}", HomePageHandler).Methods("GET")

Types

type ErrorPage

type ErrorPage struct {
	Message string
}

ErrorPage defines values used for display on the error page

type HomePage

type HomePage struct {
	WebsiteURL       string
	GeneratedURL     string
	Message          string
	GeneratedMessage bool
	ErrorMessage     bool
}

HomePage defines values used for display on the home page

Jump to

Keyboard shortcuts

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