gae-dispatcher-emulator: github.com/karupanerura/gae-dispatcher-emulator Index | Files

package gaedispemu

import "github.com/karupanerura/gae-dispatcher-emulator"

Index

Package Files

config.go config_loader.go dispatcher.go host_matcher.go host_path_matcher.go http_handler.go path_matcher.go service.go string_matcher.go version.go version_gen.go xml_config_loader.go yaml_config_loader.go

Constants

const Version = "0.3.0"

Version is a current version of the package.

func NewProxyHandler Uses

func NewProxyHandler(dispatcher Dispatcher) http.Handler

NewProxyHandler creates a new proxy handler

func NewProxyHandlerWithReporter Uses

func NewProxyHandlerWithReporter(dispatcher Dispatcher, errorReporter ErrorReporter) http.Handler

NewProxyHandlerWithReporter creates a new proxy handler with error reporter

type Config Uses

type Config struct {
    Rules []ConfigRule
}

Config is an abstruct configuration for GAE dispatch services.

type ConfigLoader Uses

type ConfigLoader interface {
    LoadConfig() (*Config, error)
}

ConfigLoader is an interface to load dispatch.xml or dispatch.yaml

type ConfigRule Uses

type ConfigRule struct {
    ServiceName string
    HostPathMatcher
}

ConfigRule is an abstruct dispatch rule for GAE dispatch services.

type Dispatcher Uses

type Dispatcher interface {
    Dispatch(host, path string) *Service
}

Dispatcher is a service dispatcher

func NewDispatcher Uses

func NewDispatcher(services map[string]*Service, config *Config) (Dispatcher, error)

NewDispatcher is a constructor of Dispatcher

type ErrorReporter Uses

type ErrorReporter interface {
    ReportError(error)
}

ErrorReporter is error reporter interface for proxy handler

type ErrorReporterFunc Uses

type ErrorReporterFunc func(error)

ErrorReporterFunc is function interface for ErrorReporter

func (ErrorReporterFunc) ReportError Uses

func (r ErrorReporterFunc) ReportError(err error)

ReportError calls self as a function

type HostPathMatcher Uses

type HostPathMatcher interface {
    MatchHostPath(host, path string) bool
}

HostPathMatcher is an abstruct matcher

func CompileHostPathMatcher Uses

func CompileHostPathMatcher(pattern string) (HostPathMatcher, error)

CompileHostPathMatcher is constructor for HostPathMatcher

type Service Uses

type Service struct {
    Name   string
    Origin *url.URL
}

Service is a GAE service and backend origin

type XMLConfigLoader Uses

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

XMLConfigLoader is a config loader for dispatch.xml

func NewXMLConfigLoader Uses

func NewXMLConfigLoader(filePath string) *XMLConfigLoader

NewXMLConfigLoader is constructor of XMLConfigLoader

func (*XMLConfigLoader) LoadConfig Uses

func (l *XMLConfigLoader) LoadConfig() (*Config, error)

LoadConfig loads and parse the dispatch.xml

type YAMLConfigLoader Uses

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

YAMLConfigLoader is a config loader for dispatch.yaml

func NewYAMLConfigLoader Uses

func NewYAMLConfigLoader(filePath string) *YAMLConfigLoader

NewYAMLConfigLoader is constructor of YAMLConfigLoader

func (*YAMLConfigLoader) LoadConfig Uses

func (l *YAMLConfigLoader) LoadConfig() (*Config, error)

LoadConfig loads and parse the dispatch.yaml

Package gaedispemu imports 10 packages (graph). Updated 2019-07-07. Refresh now. Tools for package owners.