http

package
v0.0.0-...-03cc885 Latest Latest
Warning

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

Go to latest
Published: May 25, 2017 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoRender

func AutoRender(w http.ResponseWriter, data interface{}, err error)

func GrafanaApiParser

func GrafanaApiParser(w http.ResponseWriter, req *http.Request)

func ParseDuration

func ParseDuration(param string) (start, end int64)

func RenderDataJson

func RenderDataJson(w http.ResponseWriter, data interface{})

func RenderJson

func RenderJson(w http.ResponseWriter, v interface{})

func RenderMsgJson

func RenderMsgJson(w http.ResponseWriter, msg string)

func Start

func Start()

func StdRender

func StdRender(w http.ResponseWriter, data interface{}, err error)

Types

type City

type City struct {
	Id         int
	City       string
	Province   string
	Count      int
	Updated_at string
}

type Dto

type Dto struct {
	Msg  string      `json:"msg"`
	Data interface{} `json:"data"`
}

type EChartsData

type EChartsData struct {
	Timestamp []interface{}              `json:"timestamp"`
	Data      map[string]([]interface{}) `json:"data"`
}

func (*EChartsData) GetEchartsData

func (this *EChartsData) GetEchartsData(datas []*cmodel.GraphQueryResponse)

如果请求的不同counter的采集周期不一致,或者不同的采集频率,可能出现不准确

type GraphAliveParam

type GraphAliveParam struct {
	Endpoint string `json:"endpoint"`
}

type GraphAliveResponse

type GraphAliveResponse struct {
	Endpoint string `json:"endpoint"`
	Status   int    `json:"status"`
}

type GraphHistoryParam

type GraphHistoryParam struct {
	Start            int                     `json:"start"`
	End              int                     `json:"end"`
	CF               string                  `json:"cf"`
	EndpointCounters []cmodel.GraphInfoParam `json:"endpoint_counters"`
}

type Idc

type Idc struct {
	Id         int
	Pop_id     int
	Name       string
	Count      int
	Area       string
	Province   string
	City       string
	Updated_at string
}

type Province

type Province struct {
	Id         int
	Province   string
	Count      int
	Updated_at string
}

Jump to

Keyboard shortcuts

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