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 ¶
- type Controller
- func (con *Controller) Filter(req *http.Request, ftype string) bool
- func (con *Controller) Maintenance()
- func (con *Controller) Restart(graceful bool) error
- func (con *Controller) ServeHTTP(res http.ResponseWriter, req *http.Request)
- func (con *Controller) ServePHP(res http.ResponseWriter, path string)
- func (con *Controller) Start() error
- func (con *Controller) Stop(graceful bool) error
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) 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
Click to show internal directories.
Click to hide internal directories.