Documentation ¶
Index ¶
- Constants
- Variables
- type Metric
- func (m *Metric) GetAPIInfo(api string) *base.ApiInfo
- func (m *Metric) GetServiceInfo() *base.ServiceInfo
- func (m *Metric) Send(req *SendDataRequest) (*Response, int, error)
- func (m *Metric) SendHandler(api string, req *SendDataRequest, resp interface{}) (int, error)
- func (m *Metric) SetHost(host string)
- func (m *Metric) SetRegion(region string)
- func (m *Metric) SetSchema(schema string)
- type Response
- type Result
- type SendDataRequest
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 ¶
Metric IAM .
func (*Metric) GetAPIInfo ¶
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
type Response ¶
type Response struct { ResponseMetadata base.ResponseMetadata Result *Result `json:"Result,omitempty"` }
Response .
Click to show internal directories.
Click to hide internal directories.