api

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: Apache-2.0 Imports: 8 Imported by: 1

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.

Directories

Path Synopsis
Package v1 provides HTTP API version 1 of Boruta.
Package v1 provides HTTP API version 1 of Boruta.

Jump to

Keyboard shortcuts

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