server

package
v0.0.0-...-f1dd9c7 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

server package - HTTP server functionality within application routes.go - all routes within server

The server package contains all code relating to the HTTP server used within the application

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resources

type Resources struct {
	DB db.DB // The database instance to use
}

Struct representing the various internal resources request handlers may need to access

type Server

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

Struct representing the actual http.Server and helper data

func NewServer

func NewServer() *Server

NewServer creates and returns a new instance of a server

func (*Server) GetInstance

func (s *Server) GetInstance() *http.Server

GetInstance returns the internal http.Server instance of the server

func (*Server) IsRunning

func (s *Server) IsRunning() bool

IsRunning returns a boolean indicating if the server is running or not

func (*Server) SetRoutes

func (s *Server) SetRoutes()

SetRoute is used to set available routes used by the server

func (*Server) Start

func (s *Server) Start() error

Start is used to start a non-running server

func (*Server) Stop

func (s *Server) Stop() error

Stop is used to stop a running server

Directories

Path Synopsis
middleware of the HTTP server The logger middleware adds logging support to every request middleware of the HTTP server middleware of the HTTP server The pre-flight middleware adds common response headers to requests middleware of the HTTP server The recovery middleware attempts to recover from panics that occur within the request execution chain middleware of the HTTP server Checks for and normalizes an API version for each request
middleware of the HTTP server The logger middleware adds logging support to every request middleware of the HTTP server middleware of the HTTP server The pre-flight middleware adds common response headers to requests middleware of the HTTP server The recovery middleware attempts to recover from panics that occur within the request execution chain middleware of the HTTP server Checks for and normalizes an API version for each request

Jump to

Keyboard shortcuts

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