prefixrouter

package
v0.0.0-...-fd23dd1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2019 License: OSL-3.0 Imports: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FrontRouter

type FrontRouter struct {
	// contains filtered or unexported fields
}

FrontRouter is a http.handler which serves multiple sites based on the host/path prefix

func NewFrontRouter

func NewFrontRouter() *FrontRouter

NewFrontRouter creates new FrontRouter

func (*FrontRouter) Add

func (fr *FrontRouter) Add(prefix string, handler routerHandler)

Add appends new Handler to Frontrouter

func (*FrontRouter) ServeHTTP

func (fr *FrontRouter) ServeHTTP(w http.ResponseWriter, req *http.Request)

ServeHTTP gets Router for Request and lets it handle it

func (*FrontRouter) SetFallbackHandlers

func (fr *FrontRouter) SetFallbackHandlers(handlers []OptionalHandler)

SetFallbackHandlers sets list of optional fallback Handlers

func (*FrontRouter) SetFinalFallbackHandler

func (fr *FrontRouter) SetFinalFallbackHandler(handler http.Handler)

SetFinalFallbackHandler sets Fallback for undefined Handler

func (*FrontRouter) SetPrimaryHandlers

func (fr *FrontRouter) SetPrimaryHandlers(handlers []OptionalHandler)

SetPrimaryHandlers sets list of optional fallback Handlers

type Module

type Module struct {
	// contains filtered or unexported fields
}

Module for core/prefix_router

func (*Module) Configure

func (m *Module) Configure(injector *dingo.Injector)

Configure DI

func (*Module) Inject

func (m *Module) Inject(l flamingo.Logger)

Inject dependencies

func (*Module) Notify

func (m *Module) Notify(event event.Event)

Notify handles the app shutdown event

type OptionalHandler

type OptionalHandler interface {
	TryServeHTTP(rw http.ResponseWriter, req *http.Request) (proceed bool, err error)
}

OptionalHandler tries to handle a request

Jump to

Keyboard shortcuts

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