httputil

package module
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2025 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorRESP

type ErrorRESP struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

type MetricsFromExpr added in v0.0.4

type MetricsFromExpr []MetricsInfo // 一个表达式得到的数据

func ParseModelValue2MetricsData added in v0.0.4

func ParseModelValue2MetricsData(commonModelValue model.Value) (MetricsFromExpr, error)

一个表达式得到的数据

func PromCommonModelValue added in v0.0.4

func PromCommonModelValue(promValues []model.Value) ([]MetricsFromExpr, error)

type MetricsInfo added in v0.0.4

type MetricsInfo struct {
	Metric map[string]string `json:"metric"`
	Values []MetricsValues   `json:"values"` // 时序数值
}

type MetricsValues added in v0.0.4

type MetricsValues struct {
	Value                 float64 `json:"value"`
	Timestamp             int64   `json:"timestamp"`
	Color                 string  `json:"color"`            // 这是panel上设置的
	BandwidthPercent      float64 `json:"bandwidthPercent"` // 所占带宽百分比
	BandwidthPercentColor string  `json:"bandwidthColor"`   // 带宽百分比颜色
}

type RESP

type RESP struct {
	ServiceCode int
	Content     any
	Err         error
	HttpCode    int
}

func (*RESP) Output

func (resp *RESP) Output(ctx *gin.Context)

type SuccessRESP added in v0.0.10

type SuccessRESP struct {
	Msg string `json:"msg"`
}

Jump to

Keyboard shortcuts

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