server

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2018 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileServer

func FileServer(r chi.Router, path string)

FileServer conveniently sets up a http.FileServer handler to serve static files from a http.FileSystem.

Types

type Server

type Server struct {
	Logger  *log.Logger
	Config  *config.Config
	Router  *chi.Mux
	Manager *search.Manager
	// contains filtered or unexported fields
}

Server holds all the data the App needs

func New

func New(log *log.Logger, config *config.Config, fresh *bool) *Server

New returns a pointer to the main server struct

func (*Server) LoadData

func (s *Server) LoadData(fresh *bool)

LoadData loads all existing DB and Index data

func (*Server) Setup

func (s *Server) Setup()

Setup starts the HTTP Server

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context)

Shutdown will release resources and stop the server.

Jump to

Keyboard shortcuts

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