goweb

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: MIT Imports: 11 Imported by: 0

README

This just packages up some boilerplate I use in go web projects.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Http400

func Http400(w http.ResponseWriter)

func Http405

func Http405(w http.ResponseWriter, allowed ...string)

func Http500

func Http500(ctx context.Context, w http.ResponseWriter, err error, logMsg string)

func HttpXXX

func HttpXXX(w http.ResponseWriter, status int)

Types

type Server

type Server struct {
	ListenAddr  string
	ProfileAddr string
	Mux         *http.ServeMux
	Logger      *slog.Logger // may be omitted safely
}

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Jump to

Keyboard shortcuts

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