upstream_http

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: Apache-2.0 Imports: 17 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 {
	Discovery eosc.RequireId `json:"discovery" required:"true" label:"服务发现" skill:"github.com/eolinker/apinto/discovery.discovery.IDiscovery"`
	Config    string         `json:"config" label:"配置"`
	Scheme    string         `json:"scheme" enum:"HTTP,HTTPS" label:"请求协议"`
	Type      string         `json:"type" enum:"round-robin" label:"负载算法"`
}

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

type Upstream

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

func NewUpstream

func NewUpstream(scheme string, app discovery.IApp, handler balance.IBalanceHandler) *Upstream

func (*Upstream) Create

func (up *Upstream) Create(id string, retry int, timeout time.Duration) (upstream.IUpstreamHandler, error)

func (*Upstream) Reset

func (up *Upstream) Reset(scheme string, app discovery.IApp, handler balance.IBalanceHandler)

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) *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