Documentation ¶
Index ¶
- Constants
- func CORSMiddleware(accessControlAllowOrigin string) gin.HandlerFunc
- func LogAndMetricsMiddleware(metricPublisher MetricPublisher) gin.HandlerFunc
- func NewInvalidRequestError(reason error) error
- func RecoverMiddleware(metricPublisher MetricPublisher) gin.HandlerFunc
- type Handler
- type InvalidRequestError
- type MetricPublisher
- type RequestSigner
- type ReverseProxy
- type Server
Constants ¶
View Source
const (
AccessControlAllowOriginHeader string = "Access-Control-Allow-Origin"
)
Variables ¶
This section is empty.
Functions ¶
func CORSMiddleware ¶ added in v0.2.0
func CORSMiddleware(accessControlAllowOrigin string) gin.HandlerFunc
func LogAndMetricsMiddleware ¶
func LogAndMetricsMiddleware(metricPublisher MetricPublisher) gin.HandlerFunc
func NewInvalidRequestError ¶
func RecoverMiddleware ¶
func RecoverMiddleware(metricPublisher MetricPublisher) gin.HandlerFunc
Types ¶
type Handler ¶
func NewHandler ¶
func NewHandler(proxy *ReverseProxy, reqSigner RequestSigner, metricPublisher MetricPublisher) Handler
type InvalidRequestError ¶
type InvalidRequestError struct {
// contains filtered or unexported fields
}
InvalidRequestError is raised when the contents of the request cause signing to fail.
func (*InvalidRequestError) Error ¶
func (e *InvalidRequestError) Error() string
func (*InvalidRequestError) Unwrap ¶
func (e *InvalidRequestError) Unwrap() error
type MetricPublisher ¶
type MetricPublisher interface { IncrementTotalRequestCount(method string, path string) IncrementSignedRequestCount(method string, path string) IncrementInternalErrorCount(method string, path string) MeasureSigningDuration(method string, path string, duration float64) MeasureTotalDuration(method string, path string, duration float64) }
type RequestSigner ¶
type ReverseProxy ¶
type ReverseProxy struct { *httputil.ReverseProxy TargetHost string }
func NewReverseProxy ¶
func NewReverseProxy(target string) (*ReverseProxy, error)
Click to show internal directories.
Click to hide internal directories.