internals

package
v0.0.0-...-258042a Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	GatewayPort int    `yaml:"gateway_port"`
	AdminPort   int    `yaml:"admin_port"`
	PluginsDir  string `yaml:"plugins_dir"`
}

func LoadConfig

func LoadConfig(configPath string) (*Config, error)

type Route

type Route struct {
	Uri            string
	Upstream       *url.URL
	Proxy          *httputil.ReverseProxy
	AllowedMethods []string
	Middleware     []pdk.Middleware
}

func NewRoute

func NewRoute(
	listener pdk.Listener,
	dest pdk.Upstream,
	middleware []pdk.Middleware,
) *Route

func NewRouteFromPlugin

func NewRouteFromPlugin(p *plugin.Plugin) *Route

func (*Route) MethodIsAllowed

func (r *Route) MethodIsAllowed(method string) bool

func (*Route) ServeHTTP

func (r *Route) ServeHTTP(res http.ResponseWriter, req *http.Request)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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