Documentation ¶
Index ¶
- Variables
- func ForceSetParam(name string, val string, r *http.Request) *http.Request
- func GetActionName(r *http.Request) string
- func GetDomainConfig(r *http.Request) *config.DomainRepoConfig
- func GetLogger(r *http.Request) *logrus.Entry
- func GetParam(name string, r *http.Request) string
- func GetRequestDuration(r *http.Request) float64
- func GetStatusCode(r *http.Request) int
- func ShouldIgnoreHost(r *http.Request) bool
- type GeneratorFn
- type GeneratorWithServerFn
- type GeneratorWithUserFn
- type HostRouter
- type InstallHeadersRouter
- type InstallMetadataRouter
- type MetricsRequestRouter
- type MetricsResponseRouter
- type RContextRouter
- type RequestCounter
Constants ¶
This section is empty.
Variables ¶
View Source
var ServerNameRegex = localCompile("[a-zA-Z0-9.:\\-_]+")
Functions ¶
func GetActionName ¶
func GetDomainConfig ¶
func GetDomainConfig(r *http.Request) *config.DomainRepoConfig
func GetRequestDuration ¶
func GetStatusCode ¶
func ShouldIgnoreHost ¶
Types ¶
type GeneratorFn ¶
type GeneratorFn = func(r *http.Request, ctx rcontext.RequestContext) interface{}
func OptionalAccessToken ¶
func OptionalAccessToken(generator GeneratorWithUserFn) GeneratorFn
func RequireAccessToken ¶
func RequireAccessToken(generator GeneratorWithUserFn) GeneratorFn
func RequireRepoAdmin ¶
func RequireRepoAdmin(generator GeneratorWithUserFn) GeneratorFn
func RequireServerAuth ¶ added in v1.3.5
func RequireServerAuth(generator GeneratorWithServerFn) GeneratorFn
type GeneratorWithServerFn ¶ added in v1.3.5
type GeneratorWithServerFn = func(r *http.Request, ctx rcontext.RequestContext, server _apimeta.ServerInfo) interface{}
type GeneratorWithUserFn ¶
type HostRouter ¶
type HostRouter struct {
// contains filtered or unexported fields
}
func NewHostRouter ¶
func NewHostRouter(next http.Handler) *HostRouter
func (*HostRouter) ServeHTTP ¶
func (h *HostRouter) ServeHTTP(w http.ResponseWriter, r *http.Request)
type InstallHeadersRouter ¶
type InstallHeadersRouter struct {
// contains filtered or unexported fields
}
func NewInstallHeadersRouter ¶
func NewInstallHeadersRouter(next http.Handler) *InstallHeadersRouter
func (*InstallHeadersRouter) ServeHTTP ¶
func (i *InstallHeadersRouter) ServeHTTP(w http.ResponseWriter, r *http.Request)
type InstallMetadataRouter ¶
type InstallMetadataRouter struct {
// contains filtered or unexported fields
}
func NewInstallMetadataRouter ¶
func NewInstallMetadataRouter(ignoreHost bool, actionName string, counter *RequestCounter, next http.Handler) *InstallMetadataRouter
func (*InstallMetadataRouter) ServeHTTP ¶
func (i *InstallMetadataRouter) ServeHTTP(w http.ResponseWriter, r *http.Request)
type MetricsRequestRouter ¶
type MetricsRequestRouter struct {
// contains filtered or unexported fields
}
func NewMetricsRequestRouter ¶
func NewMetricsRequestRouter(next http.Handler) *MetricsRequestRouter
func (*MetricsRequestRouter) ServeHTTP ¶
func (m *MetricsRequestRouter) ServeHTTP(w http.ResponseWriter, r *http.Request)
type MetricsResponseRouter ¶
type MetricsResponseRouter struct {
// contains filtered or unexported fields
}
func NewMetricsResponseRouter ¶
func NewMetricsResponseRouter(next http.Handler) *MetricsResponseRouter
func (*MetricsResponseRouter) ServeHTTP ¶
func (m *MetricsResponseRouter) ServeHTTP(w http.ResponseWriter, r *http.Request)
type RContextRouter ¶
type RContextRouter struct {
// contains filtered or unexported fields
}
func NewRContextRouter ¶
func NewRContextRouter(generatorFn GeneratorFn, next http.Handler) *RContextRouter
func (*RContextRouter) ServeHTTP ¶
func (c *RContextRouter) ServeHTTP(w http.ResponseWriter, r *http.Request)
type RequestCounter ¶
type RequestCounter struct {
// contains filtered or unexported fields
}
func (*RequestCounter) NextId ¶
func (c *RequestCounter) NextId() string
Click to show internal directories.
Click to hide internal directories.