gonet

package
v1.0.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(hosts []string, handlers []Handler, port int, authenticated func(*http.Request) bool) error

Serve starts a new TLS 1.3 server on the specified host addresses/names and handles each handler on the specified port. The server will only respond to requests that are authenticated by the provided function.

Types

type Handler

type Handler struct {
	Func HandlerFunc
	Path string
}

func NewHandler

func NewHandler(p string, f HandlerFunc) Handler

NewHandler creates a handler object which forces a relationship between a handler and a path

type HandlerFunc

type HandlerFunc func(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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