hosthandler

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewImmutable

func NewImmutable(m map[string]http.Handler, h http.Handler) http.Handler

Types

type HostHandler

type HostHandler struct {
	HostHandlers    *sync.Map
	NotFoundHandler http.Handler
}

func New

func New() *HostHandler

func (*HostHandler) Add

func (d *HostHandler) Add(host string, h http.Handler)

func (*HostHandler) Get

func (d *HostHandler) Get(host string) http.Handler

func (*HostHandler) Immutable

func (d *HostHandler) Immutable() http.Handler

Immutable creates a immutable copy of this router config.

func (*HostHandler) Remove

func (d *HostHandler) Remove(host string)

func (*HostHandler) ServeHTTP

func (d *HostHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ImmutableHostHandler

type ImmutableHostHandler struct {
	HostHandlers    map[string]http.Handler
	NotFoundHandler http.Handler
}

func (*ImmutableHostHandler) ServeHTTP

func (d *ImmutableHostHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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