rest

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	MeshName    string `json:"mesh"`
	ClusterName string `json:"cluster"`
	Role        string `json:"role,omitempty"`
	Region      string `json:"region,omitempty"`
}

type Condition

type Condition []interface{}

type Edge

type Edge struct {
	Did  string `json:"did"`
	Sid  string `json:"sid"`
	Type string `json:"type"`
}

type HTTPMetric

type HTTPMetric struct {
	Count        float32 `json:"count"`
	DurationAvg  float32 `json:"durationAvg"`
	Rps          float32 `json:"rps"`
	SuccessCount float32 `json:"successCount"`
	FailedCount  float32 `json:"failedCount"`
}

type MetricData

type MetricData struct {
	Columns []string        `json:"columns"`
	Data    [][]interface{} `json:"data"`
}

type MetricQuery

type MetricQuery struct {
	Table string
	// +optional
	StartTime *int64
	// +optional
	EndTime    *int64
	Fields     []string
	Conditions []MetricQueryCondition
	// +optional
	OrderBy string
	// +optional
	Order   string
	GroupBy []string
	Limit   int32
	Offset  int32
}

type MetricQueryCondition

type MetricQueryCondition struct {
	Key   string
	Expr  string
	Value interface{}
}

type MetricRequest

type MetricRequest struct {
	Table      string      `json:"table"`
	StartTime  int64       `json:"startTime"`
	EndTime    int64       `json:"endTime"`
	Fields     []string    `json:"fields"`
	Conditions []Condition `json:"conditions"`
	OrderBy    string      `json:"orderBy"`
	GroupBy    []string    `json:"groupBy"`
	Order      string      `json:"order"`
	Limit      int         `json:"limit"`
}

type MicroService

type MicroService struct {
	Cluster          Cluster                           `json:"cluster"`
	Service          corev1.Service                    `json:"service"`
	Endpoints        corev1.Endpoints                  `json:"endpoints"`
	Workloads        []Workload                        `json:"workloads"`
	VirtualServices  []istionetworking.VirtualService  `json:"virtualServices"`
	DestinationRules []istionetworking.DestinationRule `json:"destinationRules"`
	Pods             []corev1.Pod                      `json:"pods"`
}

type Node

type Node struct {
	Name           string      `json:"name"`
	Type           string      `json:"type"`
	ServiceNodeID  string      `json:"serviceNodeId,omitempty"`
	WorkloadNodeID string      `json:"workloadNodeId,omitempty"`
	HTTPMetric     *HTTPMetric `json:"http_metric,omitempty"`
	TCPMetric      *TCPMetric  `json:"tcp_metric,omitempty"`
}

type Request

type Request struct {
	Data string `json:"data,omitempty"`
}

Request defines the structure of http request

func (*Request) Decode

func (r *Request) Decode(reader io.Reader) error

Decode decodes the reader content to request object

type Response

type Response struct {
	Result bool        `json:"result"`
	Err    string      `json:"err,omitempty"`
	Rev    int         `json:"rev,omitempty"`
	Data   interface{} `json:"data,omitempty"`
}

Response defines the structure of http response of

func NewResult

func NewResult(result bool, errMsg string) *Response

NewResult returns a response for http response

func (*Response) Decode

func (r *Response) Decode(reader io.Reader) error

Decode decodes the reader content to response object

type ResponseForTest

type ResponseForTest struct {
	Result bool            `json:"result"`
	Err    string          `json:"err,omitempty"`
	Rev    int             `json:"rev,omitempty"`
	Data   json.RawMessage `json:"data,omitempty"`
}

ResponseForTest leaves data as json.RawMessage to unmarshal to struct we want, just for unit test

func (*ResponseForTest) Decode

func (r *ResponseForTest) Decode(reader io.Reader) error

Decode decodes the reader content to ResponseForTest object

type TCPMetric

type TCPMetric struct {
	ConnectionReceivedBytesTotal float32 `json:"connectionReceivedBytesTotal"`
	ConnectionSentBytesTotal     float32 `json:"connectionSentBytesTotal"`
}

type TopoData

type TopoData struct {
	Edges []Edge          `json:"edges"`
	Nodes map[string]Node `json:"nodes"`
}

type TopoQuery

type TopoQuery struct {
	AppID       string   `json:"appId"`
	StartTime   *int64   `json:"startTime"`
	EndTime     *int64   `json:"endTime"`
	MeshID      string   `json:"meshId"`
	TopoType    string   `json:"topoType"`
	Namespaces  []string `json:"namespaces"`
	MeshVersion string   `json:"meshVersion"`
	App         string   `json:"app"`
}

type Workload

type Workload struct {
	runtime.Object `json:",inline"`
	HPA            autoscaling.HorizontalPodAutoscaler `json:"hpa,omitempty"`
}

Jump to

Keyboard shortcuts

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