httpsrv

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2017 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EmptyResponse = map[string]interface{}{}
)

Functions

This section is empty.

Types

type T

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

func New

func New(addr string, proxySet *proxy.Set) (*T, error)

New creates an HTTP server instance that will accept API requests at the specified `network`/`address` and execute them with the specified `producer`, `consumer`, or `admin`, depending on the request type.

func (*T) ErrorCh

func (s *T) ErrorCh() <-chan error

ErrorCh returns an output channel that HTTP server running in another goroutine will use if it stops with error if one occurs. The channel will be closed when the server is fully stopped due to an error or otherwise..

func (*T) Start

func (s *T) Start()

Starts triggers asynchronous HTTP server start. If it fails then the error will be sent down to `ErrorCh()`.

func (*T) Stop

func (s *T) Stop()

Stop gracefully stops the HTTP API server. It stops listening on the socket for incoming requests first, and then blocks waiting for pending requests to complete.

Jump to

Keyboard shortcuts

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