Documentation ¶
Index ¶
- Constants
- Variables
- func DoRequest(req *http.Request, v interface{}, timeout int) error
- func GetUrl(urlHead, method string, param map[string]interface{}) (string, error)
- func Marshal(d interface{}) (starlark.Value, error)
- func New(thread *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error)
- func NewRequest(method, url string, token string, body interface{}) (*http.Request, error)
- type ExemplarsData
- type ExemplarsItem
- type Label
- type LabelName
- type Matrix
- type MatrixItem
- type Metric
- func (metric *Metric) GetMetaData(thread *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error)
- func (metric *Metric) GetQueriesByInstant(thread *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error)
- func (metric *Metric) GetQueriesByRange(thread *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error)
- func (metric *Metric) GetRules(thread *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error)
- func (metric *Metric) GetTarget(thread *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error)
- func (t *Metric) Struct() *starlarkstruct.Struct
- type Resp
- type Scalars
- type Series
- type UNIXTime
- type Vector
- type VectorItem
Constants ¶
View Source
const ModuleName = "metric.star"
View Source
const Name = "metric"
View Source
const StarlarkTimeFormat = "2006-01-02 15:04:05.999999999 -0700 MST"
Variables ¶
View Source
var ( ErrQueryArgs = fmt.Errorf("usage metric.get_queries_by_instant(url,query,time)") ErrQueryRangeArgs = fmt.Errorf("usage metric.get_queries_by_range(url,query,start_time,end_time,step)") ErrMetaArgs = fmt.Errorf("usage metric.get_metadata(url,type,match/label_name)") ErrData = fmt.Errorf("can't parse data in response") ErrToken = fmt.Errorf("token must set") )
View Source
var Module = &starlarkstruct.Module{ Name: "metric", Members: starlark.StringDict{ "new": context.AddBuiltin("metric.new", New), }, }
Functions ¶
Types ¶
type ExemplarsData ¶
type ExemplarsData struct { Data []ExemplarsItem `json:"data"` // contains filtered or unexported fields }
type ExemplarsItem ¶
type Label ¶
type Label struct { Data []string `json:"data"` // contains filtered or unexported fields }
type LabelName ¶
type LabelName struct { Data []string `json:"data"` // contains filtered or unexported fields }
type Matrix ¶
type Matrix struct { ResultList []MatrixItem `json:"result"` // contains filtered or unexported fields }
type MatrixItem ¶
type MatrixItem struct { Metric map[string]interface{} `json:"metric"` Values []interface{} `json:"values"` }
type Metric ¶
type Metric struct {
// contains filtered or unexported fields
}
func (*Metric) GetMetaData ¶
func (*Metric) GetQueriesByInstant ¶
func (*Metric) GetQueriesByRange ¶
func (*Metric) Struct ¶
func (t *Metric) Struct() *starlarkstruct.Struct
type Series ¶
type Series struct { Data []map[string]interface{} `json:"data"` // contains filtered or unexported fields }
type Vector ¶
type Vector struct { ResultList []VectorItem `json:"result"` // contains filtered or unexported fields }
type VectorItem ¶
type VectorItem struct { Metric map[string]interface{} `json:"metric"` Value interface{} `json:"value"` }
Click to show internal directories.
Click to hide internal directories.