Documentation ¶
Index ¶
- func Create(id, name string, cfg *Config, workers map[eosc.RequireId]eosc.IWorker) (eosc.IWorker, error)
- func CreateAnonymous(conf *Config) discovery.IDiscovery
- func NewFactory() eosc.IExtenderDriverFactory
- func Register(register eosc.IExtenderDriverRegister)
- type Config
- type HealthConfig
- type HeathCheckHandler
- type Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶ added in v0.9.0
func Create(id, name string, cfg *Config, workers map[eosc.RequireId]eosc.IWorker) (eosc.IWorker, error)
Create 创建静态服务发现驱动的实例
func CreateAnonymous ¶
func CreateAnonymous(conf *Config) discovery.IDiscovery
func NewFactory ¶
func NewFactory() eosc.IExtenderDriverFactory
Types ¶
type Config ¶
type Config struct { HealthOn bool `json:"health_on" label:"是否开启健康检查"` Health *HealthConfig `json:"health" label:"健康检查配置" switch:"health_on===true"` }
Config 静态服务发现配置
type HealthConfig ¶
type HealthConfig struct { Scheme string `json:"scheme" enum:"HTTP,HTTPS" label:"请求协议"` Method string `json:"method" enum:"GET,POST,PUT" label:"请求方式"` URL string `json:"url" label:"请求URL"` SuccessCode int `json:"success_code" label:"成功状态码" minimum:"100" description:"最小值:100"` Period int `json:"period" label:"检查频率" minimum:"1" default:"30" description:"单位:s,最小值:1"` Timeout int `json:"timeout" label:"超时时间" description:"单位:ms"` }
HealthConfig 健康检查配置
type HeathCheckHandler ¶ added in v0.8.0
type HeathCheckHandler struct {
// contains filtered or unexported fields
}
func NewHeathCheckHandler ¶ added in v0.8.0
func NewHeathCheckHandler(nodes discovery.INodes, cfg *Config) *HeathCheckHandler
Click to show internal directories.
Click to hide internal directories.