_routers

package
v1.3.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ServerNameRegex = localCompile("[a-zA-Z0-9.:\\-_]+")

Functions

func ForceSetParam

func ForceSetParam(name string, val string, r *http.Request) *http.Request

func GetActionName

func GetActionName(r *http.Request) string

func GetDomainConfig

func GetDomainConfig(r *http.Request) *config.DomainRepoConfig

func GetLogger

func GetLogger(r *http.Request) *logrus.Entry

func GetParam

func GetParam(name string, r *http.Request) string

func GetRequestDuration

func GetRequestDuration(r *http.Request) float64

func GetStatusCode

func GetStatusCode(r *http.Request) int

func ShouldIgnoreHost

func ShouldIgnoreHost(r *http.Request) bool

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 GeneratorWithUserFn = func(r *http.Request, ctx rcontext.RequestContext, user _apimeta.UserInfo) interface{}

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

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL