httpsrv

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: Apache-2.0 Imports: 22 Imported by: 4

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, certPath, keyPath string) (*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.

It also passes in the provided certificate and key paths for TLS. If empty strings, it is run in non-TLS mode.

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()

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