public

package
v0.0.0-...-c683906 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2018 License: MIT Imports: 20 Imported by: 5

Documentation

Overview

Package public handles the logic of the public facing website

Package public handles the logic of the public facing website

Package public handles the logic of the public facing website

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	Directory               string
	AccountDirectory        string
	Name                    string
	Port                    int
	GracefulShutdownTimeout time.Duration
	Status                  int
	PublicLogger            *log.Logger
	LoadTimeLogger          *log.Logger
	Server                  http.Server
}

func New

func New(dir, accountDir, name string, port int) (*Controller, error)

New function returns a new PublicWeb type.

func (*Controller) Filter

func (con *Controller) Filter(req *http.Request, ftype string) bool

func (*Controller) Maintenance

func (con *Controller) Maintenance()

func (*Controller) Restart

func (con *Controller) Restart(graceful bool) error

Restart function combines both the start and stop function, using different status codes, as it is restarting.

func (*Controller) ServeHTTP

func (con *Controller) ServeHTTP(res http.ResponseWriter, req *http.Request)

ServeHTTP function routes all requests for the public web server. It is used in the main function inside of the http.ListenAndServe() function for the public host.

func (*Controller) ServePHP

func (con *Controller) ServePHP(res http.ResponseWriter, path string)

func (*Controller) Start

func (con *Controller) Start() error

Start function starts listening on the public server

func (*Controller) Stop

func (con *Controller) Stop(graceful bool) error

Stop function stops the server gracefully or forceful, depending on the boolean input

Jump to

Keyboard shortcuts

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