httpserver

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package httpserver implements an HTTP server and utility routines to manage its lifecycle.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPServer

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

HTTPServer is the object wrapper for OSM's HTTP server class

func NewHTTPServer

func NewHTTPServer(port uint16) *HTTPServer

NewHTTPServer creates a new API server

func (*HTTPServer) AddHandler added in v0.7.0

func (s *HTTPServer) AddHandler(url string, handler http.Handler)

AddHandler adds an HTTP handlers for the given path on the HTTPServer For changes to be effective, server requires restart

func (*HTTPServer) AddHandlers added in v0.7.0

func (s *HTTPServer) AddHandlers(handlers map[string]http.Handler)

AddHandlers convenience, multi-value AddHandler

func (*HTTPServer) Start

func (s *HTTPServer) Start() error

Start starts ListenAndServe on the http server. If already started, does nothing

func (*HTTPServer) Stop

func (s *HTTPServer) Stop() error

Stop halts and resets the http server If server is already stopped, does nothing

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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