Documentation ¶
Index ¶
- Constants
- func NewProxyHandler(dispatcher Dispatcher) http.Handler
- func NewProxyHandlerWithReporter(dispatcher Dispatcher, errorReporter ErrorReporter) http.Handler
- type Config
- type ConfigLoader
- type ConfigRule
- type Dispatcher
- type ErrorReporter
- type ErrorReporterFunc
- type HostPathMatcher
- type Service
- type XMLConfigLoader
- type YAMLConfigLoader
Constants ¶
const Version = "0.4.0"
Version is a current version of the package.
Variables ¶
This section is empty.
Functions ¶
func NewProxyHandler ¶
func NewProxyHandler(dispatcher Dispatcher) http.Handler
NewProxyHandler creates a new proxy handler
func NewProxyHandlerWithReporter ¶
func NewProxyHandlerWithReporter(dispatcher Dispatcher, errorReporter ErrorReporter) http.Handler
NewProxyHandlerWithReporter creates a new proxy handler with error reporter
Types ¶
type Config ¶
type Config struct {
Rules []ConfigRule
}
Config is an abstruct configuration for GAE dispatch services.
type ConfigLoader ¶
ConfigLoader is an interface to load dispatch.xml or dispatch.yaml
type ConfigRule ¶
type ConfigRule struct { ServiceName string HostPathMatcher }
ConfigRule is an abstruct dispatch rule for GAE dispatch services.
type Dispatcher ¶
Dispatcher is a service dispatcher
func NewDispatcher ¶
func NewDispatcher(services map[string]*Service, config *Config) (Dispatcher, error)
NewDispatcher is a constructor of Dispatcher
type ErrorReporter ¶
type ErrorReporter interface {
ReportError(error)
}
ErrorReporter is error reporter interface for proxy handler
type ErrorReporterFunc ¶
type ErrorReporterFunc func(error)
ErrorReporterFunc is function interface for ErrorReporter
func (ErrorReporterFunc) ReportError ¶
func (r ErrorReporterFunc) ReportError(err error)
ReportError calls self as a function
type HostPathMatcher ¶
HostPathMatcher is an abstruct matcher
func CompileHostPathMatcher ¶
func CompileHostPathMatcher(pattern string) (HostPathMatcher, error)
CompileHostPathMatcher is constructor for HostPathMatcher
type XMLConfigLoader ¶
type XMLConfigLoader struct {
// contains filtered or unexported fields
}
XMLConfigLoader is a config loader for dispatch.xml
func NewXMLConfigLoader ¶
func NewXMLConfigLoader(filePath string) *XMLConfigLoader
NewXMLConfigLoader is constructor of XMLConfigLoader
func (*XMLConfigLoader) LoadConfig ¶
func (l *XMLConfigLoader) LoadConfig() (*Config, error)
LoadConfig loads and parse the dispatch.xml
type YAMLConfigLoader ¶
type YAMLConfigLoader struct {
// contains filtered or unexported fields
}
YAMLConfigLoader is a config loader for dispatch.yaml
func NewYAMLConfigLoader ¶
func NewYAMLConfigLoader(filePath string) *YAMLConfigLoader
NewYAMLConfigLoader is constructor of YAMLConfigLoader
func (*YAMLConfigLoader) LoadConfig ¶
func (l *YAMLConfigLoader) LoadConfig() (*Config, error)
LoadConfig loads and parse the dispatch.yaml