httpserver

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package httpserver - HTTP API endpoint The httpserver subsystem provides an HTTP interface to Burrow that can be used to fetch information about the clusters and consumers it is monitoring. More documentation on the requests and responses is provided at https://github.com/linkedin/Burrow/wiki/HTTP-Endpoint.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coordinator

type Coordinator struct {
	// App is a pointer to the application context. This stores the channel to the storage subsystem
	App *protocol.ApplicationContext

	// Log is a logger that has been configured for this module to use. Normally, this means it has been set up with
	// fields that are appropriate to identify this coordinator
	Log *zap.Logger
	// contains filtered or unexported fields
}

Coordinator runs the HTTP interface for Burrow, managing all configured listeners.

func (*Coordinator) Configure

func (hc *Coordinator) Configure()

Configure is called to configure the HTTP server. This includes validating all configurations for each configured listener (which are not treated as separate modules, as opposed to other coordinators), as well as setting up the request router. Any configuration failure will cause the func to panic with an appropriate error message.

If no listener has been configured, the coordinator will set up a default listener on a random port greater than 1024, as selected by the net.Listener call. This listener will be logged so that the port chosen will be known.

func (*Coordinator) Start

func (hc *Coordinator) Start() error

Start is responsible for starting the listener on each configured address. If any listener fails to start, the error is logged, and the listeners that have already been started are stopped. The func then returns the error encountered to the caller. Once the listeners are all started, the HTTP server itself is started on each listener to respond to requests.

func (*Coordinator) Stop

func (hc *Coordinator) Stop() error

Stop calls the Close func for each configured HTTP server listener. This stops the underlying HTTP server without waiting for client calls to complete. If there are any errors while shutting down the listeners, this does not stop other listeners from being closed. A generic error will be returned to the caller in this case.

Jump to

Keyboard shortcuts

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