Documentation
¶
Overview ¶
Package api aggregates all availabe Boruta HTTP API versions. It also takes care of CORS headers. When API version is omitted in HTTP request, server will redirect user to default API version (latest stable).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct { // Router is ready to go router that should be used as http.Handler in http.ListenAndServe(). Router http.Handler // contains filtered or unexported fields }
API provides HTTP API handlers.
func NewAPI ¶
func NewAPI(requestsAPI boruta.Requests, workersAPI boruta.Workers, origins []string, age int) (api *API)
NewAPI creates router and registers all available Boruta HTTP APIs on it. It also sets panicHandler for all panics that may occur in any API and enables CORS support for provided origins. It sets default API version to which requests that miss API version are redirected.
Click to show internal directories.
Click to hide internal directories.