server

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2018 License: AGPL-3.0 Imports: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PulseHandler

func PulseHandler(db *postgres.DB) http.Handler

PulseHandler is a function that closes over our DB instance returning an http.Handler that attempts to connect to the DB, returning either 200 OKk with an ok response if successful, or an error message with a 500 status if the DB connection failed.

Types

type Config added in v0.0.9

type Config struct {
	Addr     string
	ConnStr  string
	Verbose  bool
	CertFile string
	KeyFile  string
}

Config is a struct used to pass in configuration from the calling task

type Server

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

Server is our top level type, contains all other components, is responsible for starting and stopping them in the correct order.

func NewServer

func NewServer(config *Config, logger kitlog.Logger) *Server

NewServer returns a new simple HTTP server.

func (*Server) Start

func (s *Server) Start() error

Start starts the server running. We also create a channel listening for interrupt signals before gracefully shutting down.

func (*Server) Stop

func (s *Server) Stop() error

Stop stops the server running.

Jump to

Keyboard shortcuts

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