api

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2018 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package api implements a type used for creating the Benthos HTTP API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Address       string `json:"address" yaml:"address"`
	ReadTimeoutMS int    `json:"read_timeout_ms" yaml:"read_timeout_ms"`
}

Config contains the configuration fields for the Benthos API.

func NewConfig

func NewConfig() Config

NewConfig creates a new API config with default values.

type Type

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

Type implements the Benthos HTTP API.

func New

func New(
	version string,
	dateBuilt string,
	conf Config,
	wholeConf interface{},
	log log.Modular,
	stats metrics.Type,
) *Type

New creates a new Benthos HTTP API.

func (*Type) ListenAndServe

func (t *Type) ListenAndServe() error

ListenAndServe launches the API and blocks until the server closes or fails.

func (*Type) RegisterEndpoint

func (t *Type) RegisterEndpoint(path, desc string, handler http.HandlerFunc)

RegisterEndpoint registers a http.HandlerFunc under a path with a description that will be displayed under the /endpoints path.

func (*Type) Shutdown

func (t *Type) Shutdown(ctx context.Context) error

Shutdown attempts to close the http server.

Jump to

Keyboard shortcuts

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