apiserver

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2016 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NetworkTCP  = "tcp"
	NetworkUnix = "unix"
)

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(network, addr string, prod *producer.T, cons consumer.T, admin *admin.T) (*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) AsyncStop

func (as *T) AsyncStop()

AsyncStop triggers HTTP API listener stop. If a caller wants to know when the server terminates it should read from the `Error()` channel that will be closed upon server termination.

func (*T) ErrorCh

func (as *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 (as *T) Start()

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

Jump to

Keyboard shortcuts

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