configmw

package
v0.0.0-...-83625b3 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MiddlewareDependencyConfig = "*configmw.ConfigMiddleware"
	CategoryConfigNotFound     = "config not found"
)

Variables

This section is empty.

Functions

func GetConfig

func GetConfig(r *http.Request) config.Config

func GetWritableConfig

func GetWritableConfig(r *http.Request) config.WritableConfig

func WrapMiddleware

func WrapMiddleware(key string, t reflect.Type) middleware.Middleware

Types

type ChainedNamespaceNegotiator

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

func NewChainedNamespaceNegotiator

func NewChainedNamespaceNegotiator(negotiators ...NamespaceNegotiator) *ChainedNamespaceNegotiator

func (*ChainedNamespaceNegotiator) AddNegotiator

func (n *ChainedNamespaceNegotiator) AddNegotiator(negotiator NamespaceNegotiator)

func (*ChainedNamespaceNegotiator) NegotiateNamespace

func (n *ChainedNamespaceNegotiator) NegotiateNamespace(r *http.Request) (string, error)

type ConfigMiddleware

type ConfigMiddleware struct {
	middleware.NoDependencies
	// contains filtered or unexported fields
}

func NewConfigMiddleware

func NewConfigMiddleware(store *config.Store, negotiator NamespaceNegotiator) *ConfigMiddleware

func (*ConfigMiddleware) Wrap

func (c *ConfigMiddleware) Wrap(next http.Handler) http.Handler

type HostMapNamespaceNegotiator

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

func NewHostMapNamespaceNegotiator

func NewHostMapNamespaceNegotiator() *HostMapNamespaceNegotiator

func (*HostMapNamespaceNegotiator) Add

func (h *HostMapNamespaceNegotiator) Add(host, namespace string)

func (*HostMapNamespaceNegotiator) NegotiateNamespace

func (h *HostMapNamespaceNegotiator) NegotiateNamespace(r *http.Request) (string, error)

func (*HostMapNamespaceNegotiator) Remove

func (h *HostMapNamespaceNegotiator) Remove(host string)

type HostNamespaceNegotiator

type HostNamespaceNegotiator struct {
	SkipPort bool
}

func NewHostNamespaceNegotiator

func NewHostNamespaceNegotiator() *HostNamespaceNegotiator

func (*HostNamespaceNegotiator) NegotiateNamespace

func (h *HostNamespaceNegotiator) NegotiateNamespace(r *http.Request) (string, error)

type NamespaceNegotiator

type NamespaceNegotiator interface {
	NegotiateNamespace(r *http.Request) (string, error)
}

Jump to

Keyboard shortcuts

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