core

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DebugMode indicates  mode is debug.
	DebugMode = "debug"
	// ReleaseMode indicates  mode is release.
	ReleaseMode = "release"
)
View Source
const EnvMode = "GATEWAY_MODE"

Variables

This section is empty.

Functions

func Mode

func Mode() string

func ReverseProxy

func ReverseProxy(ctx *Context) *httputil.ReverseProxy

NewReverseProxy Creat Reverse Proxy

func SetMode

func SetMode(value string)

Types

type Context

type Context struct {
	Writer http.ResponseWriter
	Req    *http.Request
	// contains filtered or unexported fields
}

type Level

type Level int8

type ProxyEngine

type ProxyEngine struct {
	Cache *cache.Cache
	// contains filtered or unexported fields
}

func New

func New() *ProxyEngine

func (*ProxyEngine) Run

func (e *ProxyEngine) Run(addr string) (err error)

func (*ProxyEngine) RunTLS

func (e *ProxyEngine) RunTLS(addr, certFile, keyFile string) (err error)

func (*ProxyEngine) ServeHTTP

func (e *ProxyEngine) ServeHTTP(w http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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