Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProxyHandler ¶
func ProxyHandler(rules ...ItfProxyMode) gin.HandlerFunc
Types ¶
type ItfProxyMode ¶
type ItfProxyMode interface {
Match(req *http.Request) bool
ServeHTTP(rw http.ResponseWriter, req *http.Request)
}
func NewProxy ¶
func NewProxy(rule configstc.ProxyRule) ItfProxyMode
func NewProxyGroup ¶
func NewProxyGroup(rules ...configstc.ProxyRule) []ItfProxyMode
type ProxyByFixed ¶
type ProxyByFixed struct {
// contains filtered or unexported fields
}
ProxyByFixed 固定匹配转发
func NewProxyByFixed ¶
func NewProxyByFixed(rule configstc.ProxyRule) *ProxyByFixed
func (*ProxyByFixed) ServeHTTP ¶
func (p *ProxyByFixed) ServeHTTP(rw http.ResponseWriter, req *http.Request)
type ProxyByPrefix ¶
type ProxyByPrefix struct {
// contains filtered or unexported fields
}
ProxyByPrefix 根据前缀转发的代理
func NewProxyByPrefix ¶
func NewProxyByPrefix(rule configstc.ProxyRule) *ProxyByPrefix
func (*ProxyByPrefix) ServeHTTP ¶
func (p *ProxyByPrefix) ServeHTTP(rw http.ResponseWriter, req *http.Request)
Click to show internal directories.
Click to hide internal directories.