httpserver

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: Apache-2.0 Imports: 7 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 FSM's HTTP server class

func NewHTTPServer

func NewHTTPServer(port uint16) *HTTPServer

NewHTTPServer creates a new API server

func (*HTTPServer) AddHandler

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

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

Jump to

Keyboard shortcuts

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