pdk

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: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Listener

type Listener struct {
	Port    int
	URI     string
	Methods []string // http.Method*
}

type Middleware

type Middleware struct {
	Name           string
	InboundAccess  func(*http.Request)
	Enforcer       func(http.ResponseWriter, *http.Request) bool
	OutboundAccess func(*http.Response) error
}

func NewMiddleware

func NewMiddleware(name string) Middleware

type Proxy

type Proxy struct {
	Listener   Listener
	Middleware []Middleware
	Upstream   Upstream
}

func NewProxy

func NewProxy(listener Listener, upstream Upstream) *Proxy

func (*Proxy) AddMiddleware

func (p *Proxy) AddMiddleware(mw Middleware)

type Upstream

type Upstream struct {
	Protocol string
	Host     string
	Port     int
	Uri      string
}

Jump to

Keyboard shortcuts

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