server

package
v0.0.0-...-5a221c6 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidIP = errors.New("invalid ip address")

ErrInvalidIP indicates a given IP address is invalid

Functions

func PushFiles

func PushFiles(w http.ResponseWriter, files ...string) error

PushFiles takes a http.ResponseWriter and a variadic amount of file strings the function will iterate through each file and performs an HTTP/2 Push if HTTP/2 is supported AND if the files are valid. Otherwise, will return error

func RedirectHTTPS

func RedirectHTTPS(httpsHost string) func(http.ResponseWriter, *http.Request)

RedirectHTTPS can redirect all http traffic to corresponding https addresses

Types

type Server

type Server struct {
	http.Server
	// contains filtered or unexported fields
}

Server ...

func NewServer

func NewServer(secure bool, ip string, port string, certFile string, keyFile string, rootCA string,
	hostname string, shutdownCode int, cmdEnable bool, r *mux.Router) (*Server, error)

NewServer ...

func (*Server) Quit

func (srv *Server) Quit() error

Quit sends closes the server quit channel if the server is running signaling the server to begin shutting down if the server is not running, Quit will return an error

func (*Server) Run

func (srv *Server) Run(running chan struct{})

Run starts the running loop of the server and will fire a message to running once running has "fully begun"

Jump to

Keyboard shortcuts

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