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.
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.