You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.1 KiB
36 lines
1.1 KiB
package vmts |
|
|
|
import "github.com/govalues/decimal" |
|
|
|
type VMMetricKline struct { |
|
Metric struct { |
|
Name string `json:"__name__"` |
|
Interval string `json:"interval"` |
|
Kind string `json:"kind"` |
|
} `json:"metric"` |
|
Values []decimal.Decimal `json:"values"` |
|
Timestamps []int64 `json:"timestamps"` |
|
} |
|
|
|
const ( |
|
QueryStatusSuccess = "success" |
|
QueryStatusError = "error" |
|
) |
|
|
|
type ResponseQuery struct { |
|
Status string `json:"status"` // success, error |
|
ErrorType string `json:"errorType"` // 422 |
|
Error string `json:"error"` |
|
Stats struct { |
|
SeriesFetched string `json:"seriesFetched"` |
|
ExecutionTimeMsec int `json:"executionTimeMsec"` |
|
} `json:"stats"` |
|
Data struct { |
|
ResultType string `json:"resultType"` // matrix, vector |
|
Result []struct { |
|
Metric map[string]string `json:"metric"` // {__name__: 'BTC_USDT', exchange: 'OKX', interval: '5m', kind: 'close'} |
|
Values [][]any `json:"values"` // data.type = matrix [[1759975200, '122407.82'], [1759975500, '122385.92']] |
|
Value []any `json:"value"` // data.type = vector [1759975200, '122407.82'] |
|
} `json:"result"` |
|
} `json:"data"` |
|
}
|
|
|