static

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

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

func Register

func Register(register eosc.IExtenderDriverRegister)

Register 注册静态服务发现的驱动工厂

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

type Node

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

Node 静态服务发现的节点类型

Jump to

Keyboard shortcuts

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