Documentation ¶
Overview ¶
Package handler handles or proxies HTTP requests. It calls the underlining services if needs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Func ¶
type Func func(http.ResponseWriter, *http.Request) error
Func is http.HandlerFunc with error return.
type Handler ¶
type Handler interface { // NToken handles get N-token requests. NToken(http.ResponseWriter, *http.Request) error // NTokenProxy handles proxy requests that require a N-token. NTokenProxy(http.ResponseWriter, *http.Request) error // AccessToken handles post access token requests. AccessToken(http.ResponseWriter, *http.Request) error // RoleToken handles post role token requests. RoleToken(http.ResponseWriter, *http.Request) error // RoleTokenProxy handles proxy requests that require a role token. RoleTokenProxy(http.ResponseWriter, *http.Request) error // ServiceCert handles get svccert requests. ServiceCert(http.ResponseWriter, *http.Request) error }
Handler for handling a set of HTTP requests.
func New ¶
func New(cfg config.Proxy, bp httputil.BufferPool, token ntokend.TokenProvider, access service.AccessProvider, role service.RoleProvider, svcCert service.SvcCertProvider) Handler
New creates a handler for handling different HTTP requests based on the given services. It also contains a reverse proxy for handling proxy request.
Click to show internal directories.
Click to hide internal directories.