http

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Path HTTP请求的pattern 如/health
	Path string `yaml:"path" json:"path"`
	// Host host to add into the health check request header
	Host string `yaml:"host" json:"host"`
	// RequestHeadersToAdd headers to add into the health check request header
	RequestHeadersToAdd []*RequestHeader `yaml:"requestHeadersToAdd" json:"requestHeadersToAdd"`
	// ExpectedStatuses expected status define the status range to verify http codes
	ExpectedStatuses []*ExpectedStatus `yaml:"expectedStatuses" json:"expectedStatuses"`
}

Config 健康探测的配置

func (*Config) SetDefault

func (r *Config) SetDefault()

SetDefault 设置默认值

func (*Config) Verify

func (r *Config) Verify() error

Verify 检验健康探测配置

type Detector

type Detector struct {
	*plugin.PluginBase
	// contains filtered or unexported fields
}

Detector TCP协议的实例健康探测器

func (*Detector) Destroy

func (g *Detector) Destroy() error

Destroy 销毁插件,可用于释放资源

func (*Detector) DetectInstance

func (g *Detector) DetectInstance(ins model.Instance) (result healthcheck.DetectResult, err error)

DetectInstance 探测服务实例健康

func (*Detector) Init

func (g *Detector) Init(ctx *plugin.InitContext) (err error)

Init 初始化插件

func (*Detector) IsEnable

func (g *Detector) IsEnable(cfg config.Configuration) bool

IsEnable .

func (*Detector) Name

func (g *Detector) Name() string

Name 插件名,一个类型下插件名唯一

func (*Detector) Type

func (g *Detector) Type() common.Type

Type 插件类型

type ExpectedStatus

type ExpectedStatus struct {
	Start int `yaml:"start" json:"start"`
	End   int `yaml:"end" json:"end"`
}

ExpectedStatus status verifier to decide healthy

type RequestHeader

type RequestHeader struct {
	Key   string `yaml:"key" json:"key"`
	Value string `yaml:"value" json:"value"`
}

RequestHeader request header key and value

Jump to

Keyboard shortcuts

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