server

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPServer

type HTTPServer struct {
	Mux *http.ServeMux
	// contains filtered or unexported fields
}

HTTPServer is wrapper over http.Server

func NewServer

func NewServer(node *node.Node, host string, port string, ssl *config.SSLOptions) (*HTTPServer, error)

NewServer builds HTTPServer from config params

func (*HTTPServer) Address

func (s *HTTPServer) Address() string

Address returns server host:port

func (*HTTPServer) HealthHandler added in v0.6.1

func (s *HTTPServer) HealthHandler(w http.ResponseWriter, _ *http.Request)

HealthHandler always reponds with 200 status

func (*HTTPServer) Start

func (s *HTTPServer) Start() error

Start server

func (*HTTPServer) Stop

func (s *HTTPServer) Stop() error

Stop shuts down server gracefully.

func (*HTTPServer) Stopped

func (s *HTTPServer) Stopped() bool

Stopped return true iff server has been stopped by user

func (*HTTPServer) WebsocketHandler

func (s *HTTPServer) WebsocketHandler(w http.ResponseWriter, r *http.Request)

WebsocketHandler called when new client connection comes to websocket endpoint.

Jump to

Keyboard shortcuts

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