xgin

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

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

Go to latest
Published: Mar 18, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InterceptorOpenTracing

func InterceptorOpenTracing() gin.HandlerFunc

InterceptorOpenTracing opentracing

Types

type Locations

type Locations []*Rule

func (Locations) Len

func (a Locations) Len() int

Len 长度计算

func (Locations) Less

func (a Locations) Less(i, j int) bool

Less 比较

func (*Locations) Matching

func (h *Locations) Matching(r *http.Request) *Rule

func (Locations) Swap

func (a Locations) Swap(i, j int)

Swap 交换

type Rule

type Rule struct {
	IsRuning     int               `json:"IsRuning,omitempty" yaml:"IsRuning"` //0:有效 1:无效
	Location     string            `json:"Location",omitempty yaml:"Location"`
	Rewrite      string            `json:"Rewrite,omitempty"yaml:"Rewrite"`
	ProxyWeigth  int               `json:"ProxyWeigth,omitempty" yaml:"ProxyWeigth"`
	ProxyPass    string            `json:"ProxyPass,omitempty" yaml:"ProxyPass"`
	ProxyRewrite string            `json:"ProxyRewrite,omitempty"yaml:"ProxyRewrite"`
	ProxyHost    string            `json:"ProxyHost,omitempty" yaml:"ProxyHost"`
	Params       map[string]string `json:"Params,omitempty" yaml:"Params"` // 和 Location 一起进行匹配g
	// contains filtered or unexported fields
}

func (*Rule) GetLocationVal

func (h *Rule) GetLocationVal() string

func (*Rule) IsProxy

func (h *Rule) IsProxy() bool

type XEngine

type XEngine struct {
	*gin.Engine
	// contains filtered or unexported fields
}

func NewXGin

func NewXGin() *XEngine

NewXGin new enginx

func (*XEngine) Run

func (h *XEngine) Run(addr string) error

Run start

func (*XEngine) RunTLS

func (h *XEngine) RunTLS(addr, certFile, keyFile string) (err error)

RunTLS start

func (*XEngine) ServeHTTP

func (h *XEngine) ServeHTTP(w http.ResponseWriter, req *http.Request)

ServeHTTP conforms to the http.Handler interface.

func (*XEngine) SetLoction

func (h *XEngine) SetLoction(locations *Locations)

SetLoction set loction field

Jump to

Keyboard shortcuts

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