handlers

package
v0.0.0-...-4d8001c Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Handlers = []Handler{
	{
		Handles: "/about",
		Handler: makeBasicHandler("about"),
	},
	{
		Handles: "/projects",
		Handler: makeLinksHandler("projects"),
	},
	{
		Handles: "/apps",
		Handler: makeLinksHandler("apps"),
	},
}

The actual handlers

Functions

func HomeHandler

func HomeHandler(writer http.ResponseWriter, request *http.Request)

HomeHandler handles /, generating data from Handlers

func Initialise

func Initialise(a *config.AppConfig)

Initialise the handlers package.

func RobotHandler

func RobotHandler(writer http.ResponseWriter, request *http.Request)

RobotHandler creates a handler for robots.txt out of existing Handlers

Types

type Handler

type Handler struct {
	Handles string
	Handler func(writer http.ResponseWriter, request *http.Request)
}

Handler holds data required for handlers.

Jump to

Keyboard shortcuts

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