cloudmonitor

package
v0.0.0-...-1b07703 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultRegion default region of instance
	DefaultRegion = "x"
	// ServiceVersion20180801 .
	ServiceVersion20180801 = "x"
	// ServiceName .
	ServiceName = utils.CloudMonitorService
)

Variables

View Source
var (
	// ServiceInfo .
	ServiceInfo = &base.ServiceInfo{
		Timeout: 7 * time.Second,
		Host:    "x",
		Header: http.Header{
			"Accept":           []string{"application/json"},
			"X-Tsdb-Namespace": []string{"ecs"},
			"X-Tsdb-Region":    []string{config.GetMonitorConfig().Region},
		},
	}
	// APIInfoList .
	APIInfoList = map[string]*base.ApiInfo{
		"SendMetricData": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"Write"},
				"Version": []string{ServiceVersion20180801},
			},
		},
	}
)
View Source
var DefaultInstance = NewInstance()

DefaultInstance .

Functions

This section is empty.

Types

type Metric

type Metric struct {
	Client *base.Client
}

Metric IAM .

func NewInstance

func NewInstance() *Metric

NewInstance 创建一个实例

func (*Metric) GetAPIInfo

func (m *Metric) GetAPIInfo(api string) *base.ApiInfo

GetAPIInfo interface

func (*Metric) GetServiceInfo

func (m *Metric) GetServiceInfo() *base.ServiceInfo

GetServiceInfo interface

func (*Metric) Send

func (m *Metric) Send(req *SendDataRequest) (*Response, int, error)

Send data to server

func (*Metric) SendHandler

func (m *Metric) SendHandler(api string, req *SendDataRequest, resp interface{}) (int, error)

SendHandler deal with send req

func (*Metric) SetHost

func (m *Metric) SetHost(host string)

SetHost .

func (*Metric) SetRegion

func (m *Metric) SetRegion(region string)

SetRegion SetHost .

func (*Metric) SetSchema

func (m *Metric) SetSchema(schema string)

SetSchema .

type Response

type Response struct {
	ResponseMetadata base.ResponseMetadata
	Result           *Result `json:"Result,omitempty"`
}

Response .

type Result

type Result struct {
	Code string `json:"Code,omitempty"`
}

Result .

type SendDataRequest

type SendDataRequest struct {
	DataLines string
}

SendDataRequest .

Jump to

Keyboard shortcuts

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