server

package
v0.0.0-...-e3a8e75 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheControl

func CacheControl(h http.Handler) http.Handler

CacheControl ...

func Logging

func Logging(h http.Handler) http.Handler

Logging ...

Types

type Server

type Server struct {
	Templates *template.Template
	DB        db.Database
}

Server contains all dependencies for the application.

func NewServer

func NewServer(DB db.Database) Server

NewServer creates a new Server type.

func (*Server) IndexHandler

func (s *Server) IndexHandler(w http.ResponseWriter, r *http.Request)

IndexHandler renders the index page.

func (*Server) Routes

func (s *Server) Routes() http.Handler

Routes returns the routes for the application.

type StatusRecorder

type StatusRecorder struct {
	http.ResponseWriter
	Status int
}

StatusRecorder allows us to capture the response status code.

func (*StatusRecorder) WriteHeader

func (r *StatusRecorder) WriteHeader(status int)

WriteHeader ...

Jump to

Keyboard shortcuts

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