Documentation ¶
Overview ¶
SPDX-License-Identifier: Apache-2.0
Package router defines some interfaces for router adapters
SPDX-License-Identifier: Apache-2.0
Index ¶
Constants ¶
const ( // HeaderCompleteResponseValue is the value of the CompleteResponseHeader // if the response is complete // Deprecated: HeaderCompleteResponseValue is deprecated HeaderCompleteResponseValue = http.HeaderCompleteResponseValue // HeaderIncompleteResponseValue is the value of the CompleteResponseHeader // if the response is not complete // Deprecated: HeaderIncompleteResponseValue is deprecated HeaderIncompleteResponseValue = http.HeaderIncompleteResponseValue )
Variables ¶
var ( // CompleteResponseHeaderName is the header to flag incomplete responses to the client // Deprecated: HeaderIncompleteResponseValue is deprecated CompleteResponseHeaderName = http.CompleteResponseHeaderName // HeadersToSend are the headers to pass from the router request to the proxy // Deprecated: HeadersToSend is deprecated HeadersToSend = http.HeadersToSend // UserAgentHeaderValue is the value of the User-Agent header to add to the proxy request // Deprecated: UserAgentHeaderValue is deprecated UserAgentHeaderValue = http.UserAgentHeaderValue // ErrInternalError is the error returned by the router when something went wrong // Deprecated: ErrInternalError is deprecated ErrInternalError = http.ErrInternalError )
var DefaultToHTTPError = http.DefaultToHTTPError
DefaultToHTTPError is a ToHTTPError transalator that always returns an internal server error Deprecated: DefaultToHTTPError is deprecated
var InitHTTPDefaultTransport = http.InitHTTPDefaultTransport
InitHTTPDefaultTransport ensures the default HTTP transport is configured just once per execution Deprecated: InitHTTPDefaultTransport is deprecated
var RunServer = http.RunServer
RunServer runs a http.Server with the given handler and configuration Deprecated: RunServer is deprecated
Functions ¶
func IsValidSequentialEndpoint ¶ added in v1.4.0
func IsValidSequentialEndpoint(endpoint *config.EndpointConfig) bool
Types ¶
type Router ¶
type Router interface {
Run(config.ServiceConfig)
}
Router sets up the public layer exposed to the users
type RouterFunc ¶
type RouterFunc func(config.ServiceConfig)
RouterFunc type is an adapter to allow the use of ordinary functions as routers. If f is a function with the appropriate signature, RouterFunc(f) is a Router that calls f.
func (RouterFunc) Run ¶
func (f RouterFunc) Run(cfg config.ServiceConfig)
Run implements the Router interface
type ToHTTPError ¶
type ToHTTPError http.ToHTTPError
ToHTTPError translates an error into a HTTP status code Deprecated: ToHTTPError is deprecated
Directories ¶
Path | Synopsis |
---|---|
SPDX-License-Identifier: Apache-2.0 Package chi provides some basic implementations for building routers based on go-chi/chi SPDX-License-Identifier: Apache-2.0
|
SPDX-License-Identifier: Apache-2.0 Package chi provides some basic implementations for building routers based on go-chi/chi SPDX-License-Identifier: Apache-2.0 |
SPDX-License-Identifier: Apache-2.0 SPDX-License-Identifier: Apache-2.0 SPDX-License-Identifier: Apache-2.0 Package gin provides some basic implementations for building routers based on gin-gonic/gin SPDX-License-Identifier: Apache-2.0
|
SPDX-License-Identifier: Apache-2.0 SPDX-License-Identifier: Apache-2.0 SPDX-License-Identifier: Apache-2.0 Package gin provides some basic implementations for building routers based on gin-gonic/gin SPDX-License-Identifier: Apache-2.0 |
Package gorilla provides some basic implementations for building routers based on gorilla/mux SPDX-License-Identifier: Apache-2.0
|
Package gorilla provides some basic implementations for building routers based on gorilla/mux SPDX-License-Identifier: Apache-2.0 |
Package httptreemux provides some basic implementations for building routers based on dimfeld/httptreemux SPDX-License-Identifier: Apache-2.0
|
Package httptreemux provides some basic implementations for building routers based on dimfeld/httptreemux SPDX-License-Identifier: Apache-2.0 |
SPDX-License-Identifier: Apache-2.0 SPDX-License-Identifier: Apache-2.0 Package mux provides some basic implementations for building routers based on net/http mux SPDX-License-Identifier: Apache-2.0 SPDX-License-Identifier: Apache-2.0 Package mux provides some basic implementations for building routers based on net/http mux SPDX-License-Identifier: Apache-2.0
|
SPDX-License-Identifier: Apache-2.0 SPDX-License-Identifier: Apache-2.0 Package mux provides some basic implementations for building routers based on net/http mux SPDX-License-Identifier: Apache-2.0 SPDX-License-Identifier: Apache-2.0 Package mux provides some basic implementations for building routers based on net/http mux SPDX-License-Identifier: Apache-2.0 |
Package negroni provides some basic implementations for building routers based on urfave/negroni SPDX-License-Identifier: Apache-2.0
|
Package negroni provides some basic implementations for building routers based on urfave/negroni SPDX-License-Identifier: Apache-2.0 |