server

package
v0.0.0-...-b76ee76 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package server is a wrapper around the net/http package that starts listeners for HTTP and HTTPS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(httpHandlers http.Handler, httpsHandlers http.Handler, info Info)

Run starts the HTTP and/or HTTPS listener.

Types

type Info

type Info struct {
	Hostname        string `json:"Hostname"`        // Server name
	UseHTTP         bool   `json:"UseHTTP"`         // Listen on HTTP
	UseHTTPS        bool   `json:"UseHTTPS"`        // Listen on HTTPS
	HTTPPort        int    `json:"HTTPPort"`        // HTTP port
	HTTPSPort       int    `json:"HTTPSPort"`       // HTTPS port
	RedirectToHTTPS bool   `json:"RedirectToHTTPS"` // Redirect to HTTPS
	CertFile        string `json:"CertFile"`        // HTTPS certificate
	KeyFile         string `json:"KeyFile"`         // HTTPS private key
}

Info stores the hostname and port number.

Jump to

Keyboard shortcuts

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