upstream_http

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorStructType = errors.New("error struct type")

	ErrorUpstreamNotInit = errors.New("upstream not init")
)

Functions

func NewFactory

func NewFactory() eosc.IExtenderDriverFactory

NewFactory 创建http_proxy驱动工厂

func Register

func Register(register eosc.IExtenderDriverRegister)

Register 注册http_proxy驱动工厂

Types

type Config

type Config struct {
	Desc      string                    `json:"desc"`
	Scheme    string                    `json:"scheme"`
	Type      string                    `json:"type"`
	Config    string                    `json:"config"`
	Discovery eosc.RequireId            `json:"discovery" skill:"github.com/eolinker/apinto/discovery.discovery.IDiscovery"`
	Plugins   map[string]*plugin.Config `json:"plugins"`
}

Config http-service-proxy驱动配置结构体

type SendAddr

type SendAddr struct {
	// contains filtered or unexported fields
}

func NewSendAddr

func NewSendAddr(addr string, timeout time.Duration) *SendAddr

func (*SendAddr) Destroy

func (s *SendAddr) Destroy()

func (*SendAddr) DoFilter

func (s *SendAddr) DoFilter(ctx http_service.IHttpContext, next http_service.IChain) (err error)

type Upstream

type Upstream struct {
	// contains filtered or unexported fields
}

func NewUpstream

func NewUpstream(scheme string, app discovery.IApp, handler balance.IBalanceHandler, pluginConf map[string]*plugin.Config) *Upstream

func (*Upstream) Create

func (up *Upstream) Create(id string, configs map[string]*plugin.Config, retry int, timeout time.Duration) (upstream.IUpstreamHandler, error)

func (*Upstream) Merge

func (up *Upstream) Merge(configs map[string]*plugin.Config) map[string]*plugin.Config

func (*Upstream) Reset

func (up *Upstream) Reset(scheme string, app discovery.IApp, handler balance.IBalanceHandler, pluginConf map[string]*plugin.Config)

Reset reset

type UpstreamHandler

type UpstreamHandler struct {
	// contains filtered or unexported fields
}

func NewUpstreamHandler

func NewUpstreamHandler(id string, upstream *Upstream, retry int, timeout time.Duration, pluginsSource map[string]*plugin.Config) *UpstreamHandler

func (*UpstreamHandler) Destroy

func (u *UpstreamHandler) Destroy()

func (*UpstreamHandler) DoChain

DoChain 请求发送

Jump to

Keyboard shortcuts

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