Documentation ¶
Overview ¶
Package api provides a RESTful HTTP API, enabling external apps to interact with clair.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHealthRouter ¶
func NewHealthRouter() *httprouter.Router
NewHealthRouter creates a new router that only serve the Health function on /
func NewRouterV1 ¶
func NewRouterV1(to time.Duration) *httprouter.Router
NewRouterV1 creates a new router for the API (Version 1)
Types ¶
type VersionRouter ¶
type VersionRouter map[string]*httprouter.Router
VersionRouter is an HTTP router that forwards requests to the appropriate router depending on the API version specified in the requested URI.
func NewVersionRouter ¶
func NewVersionRouter(to time.Duration) *VersionRouter
NewVersionRouter instantiates a VersionRouter and every sub-routers that are necessary to handle supported API versions.
func (VersionRouter) ServeHTTP ¶
func (vs VersionRouter) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP forwards requests to the appropriate router depending on the API version specified in the requested URI and remove the version information from the request URL.Path, without modifying the request uRequestURI.
Directories ¶
Path | Synopsis |
---|---|
Package jsonhttp provides helper functions to write JSON responses to http.ResponseWriter and read JSON bodies from http.Request.
|
Package jsonhttp provides helper functions to write JSON responses to http.ResponseWriter and read JSON bodies from http.Request. |
Package logic implements all the available API methods.
|
Package logic implements all the available API methods. |
Package wrappers contains httprouter.Handle wrappers that are used in the API.
|
Package wrappers contains httprouter.Handle wrappers that are used in the API. |