Documentation ¶
Index ¶
- func AddDefaultHeaders(h http.Header)
- func AddDefaultHeadersWithCache(h http.Header)
- func CreateHttpServer(shutdown chan<- error) *http.Server
- func NotFoundHandler(w http.ResponseWriter, pr *ParsedRequest)
- func OnExit(messages ...string)
- func OptionsHandler(w http.ResponseWriter)
- func RedirectInfoHandler(w http.ResponseWriter, pr *ParsedRequest)
- func Run() error
- func ServerHandler(w http.ResponseWriter, r *http.Request)
- func Setup()
- func SetupEnvironment()
- func SetupLogging()
- func StartBackgroundUpdates(targetChannel chan<- state.RedirectMap, lastErrorChannel chan<- error, ...)
- func StatusHealthHandler(w http.ResponseWriter, r *http.Request)
- func StatusInfoHandler(w http.ResponseWriter, r *http.Request)
- func UpdateRedirectMapping(target chan<- state.RedirectMap, lastError chan<- error, force bool)
- type AdminCredentials
- type AppConfig
- type FallbackFileEntry
- type NotFoundTemplateData
- type ParsedRequest
- type RedirectInfoTemplateData
- type StatusHealthcheck
- type StatusInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDefaultHeaders ¶
func CreateHttpServer ¶
func NotFoundHandler ¶
func NotFoundHandler(w http.ResponseWriter, pr *ParsedRequest)
func OptionsHandler ¶
func OptionsHandler(w http.ResponseWriter)
func RedirectInfoHandler ¶
func RedirectInfoHandler(w http.ResponseWriter, pr *ParsedRequest)
func ServerHandler ¶
func ServerHandler(w http.ResponseWriter, r *http.Request)
func SetupEnvironment ¶
func SetupEnvironment()
func SetupLogging ¶
func SetupLogging()
func StartBackgroundUpdates ¶
func StartBackgroundUpdates(targetChannel chan<- state.RedirectMap, lastErrorChannel chan<- error, quitChannel <-chan bool)
func StatusHealthHandler ¶
func StatusHealthHandler(w http.ResponseWriter, r *http.Request)
func StatusInfoHandler ¶
func StatusInfoHandler(w http.ResponseWriter, r *http.Request)
func UpdateRedirectMapping ¶
func UpdateRedirectMapping(target chan<- state.RedirectMap, lastError chan<- error, force bool)
Types ¶
type AdminCredentials ¶
type AppConfig ¶
type AppConfig struct { IgnoreCaseInPath bool ShowServerHeader bool Port uint16 UpdatePeriod uint32 HttpCacheMaxAge uint32 CacheControlHeader string StatusEndpointEnabled bool UseETag bool UseRedirectBody bool AdminCredentials *AdminCredentials Favicon string AllowRootRedirect bool FallbackFile string ShowRepositoryLink bool }
func CreateAppConfig ¶
func CreateAppConfig() *AppConfig
func (*AppConfig) UseFallbackFile ¶
type FallbackFileEntry ¶
type NotFoundTemplateData ¶
type NotFoundTemplateData struct {
RedirectName string
}
type ParsedRequest ¶
type ParsedRequest struct { Original *http.Request Target string NormalizedPath string Found bool InfoRequest bool NoBodyRequest bool }
func RedirectTargetForRequest ¶
func RedirectTargetForRequest(r *http.Request) *ParsedRequest
type StatusHealthcheck ¶
type StatusInfo ¶
Click to show internal directories.
Click to hide internal directories.