common

package
v0.39.1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultRetryInterval = 100 * time.Millisecond
View Source
const DefaultTimeout = time.Minute

Variables

This section is empty.

Functions

func FetchDataFromURL

func FetchDataFromURL(url string, target Unmarshaler) error

Types

type Bucket

type Bucket struct {
	BoundaryRule  float64
	LeftBoundary  string
	RightBoundary string
	CountInBucket string
}

func (*Bucket) UnmarshalJSON

func (b *Bucket) UnmarshalJSON(data []byte) error

type HistogramData

type HistogramData struct {
	Count   string   `json:"count"`
	Sum     string   `json:"sum"`
	Buckets []Bucket `json:"buckets"`
}

type HistogramRawData

type HistogramRawData struct {
	Timestamp int64
	Data      HistogramData
}

func (*HistogramRawData) UnmarshalJSON

func (h *HistogramRawData) UnmarshalJSON(b []byte) error

type LogData

type LogData struct {
	Stream map[string]string `json:"stream"`
	Values [][2]string       `json:"values"`
}

type LogResponse

type LogResponse struct {
	Status string `json:"status"`
	Data   struct {
		ResultType string    `json:"resultType"`
		Result     []LogData `json:"result"`
	} `json:"data"`
}

func (*LogResponse) Unmarshal

func (m *LogResponse) Unmarshal(data []byte) error

type Metric

type Metric struct {
	TestName string `json:"test_name"`
	Name     string `json:"__name__"`
}

type MetricData

type MetricData struct {
	ResultType string         `json:"resultType"`
	Result     []MetricResult `json:"result"`
}

type MetricResponse

type MetricResponse struct {
	Status string     `json:"status"`
	Data   MetricData `json:"data"`
}

func (*MetricResponse) Unmarshal

func (m *MetricResponse) Unmarshal(data []byte) error

type MetricResult

type MetricResult struct {
	Metric    Metric            `json:"metric"`
	Value     *Value            `json:"value,omitempty"`
	Histogram *HistogramRawData `json:"histogram,omitempty"`
}

type Unmarshaler

type Unmarshaler interface {
	Unmarshal([]byte) error
}

type Value

type Value struct {
	Timestamp int64
	Value     string
}

func (*Value) UnmarshalJSON

func (v *Value) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳