httpprobe

package
v0.0.0-...-5f760b4 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPlugin

func NewPlugin() api.Plugin

Types

type EndpointConfig

type EndpointConfig struct {
	URL                string                `json:"url"`                // 目标 URL
	Method             string                `json:"method"`             // HTTP 方法
	Headers            map[string]string     `json:"headers"`            // 请求头
	Timeout            int                   `json:"timeout"`            // 超时时间(秒)
	ExpectedStatusCode int                   `json:"expectedStatusCode"` // 预期的 HTTP 状态码
	StorageConfig      store.StorageConfig   `json:"storageConfig"`      // 存储配置
	JSONPathConfig     *store.JSONPathConfig `json:"jsonPathConfig"`     // JSONPath 配置
}

type Executor

type Executor struct {
	store.StorageFactory
	// contains filtered or unexported fields
}

Executor holds the HTTP client and provides methods for probing

func NewExecutor

func NewExecutor(timeout int, factory store.StorageFactory) *Executor

NewExecutor creates a new Prober with the provided timeout

func (*Executor) Probe

func (p *Executor) Probe(config EndpointConfig) error

Probe performs the HTTP request based on the provided configuration

type HttpProbeConfig

type HttpProbeConfig struct {
	Endpoints            []EndpointConfig `json:"endpoints,omitempty"`  // 多个端点的配置
	ProbeIntervalSeconds int              `json:"probeIntervalSeconds"` // 探测间隔时间(秒)
}

type HttpProbeStatus

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

Jump to

Keyboard shortcuts

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