Documentation ¶
Overview ¶
Example (MergeLogSearch) ¶
limit := 10 results := []*LogQueryResponse{ { Total: 11, Data: []*logs.Log{ { Content: "1", Timestamp: 1, }, { Content: "3", Timestamp: 3, Offset: 1, }, { Content: "3", Timestamp: 3, Offset: 2, }, { Content: "5", Timestamp: 5, Offset: 1, }, { Content: "5", Timestamp: 5, Offset: 2, }, { Content: "6", Timestamp: 6, }, { Content: "7", Timestamp: 7, }, { Content: "8", Timestamp: 8, }, { Content: "9", Timestamp: 9, }, { Content: "10", Timestamp: 10, }, { Content: "11", Timestamp: 11, }, }, }, { Total: 10, Data: []*logs.Log{ { Content: "2", Timestamp: 2, }, { Content: "3", Timestamp: 3, Offset: 3, }, { Content: "4", Timestamp: 4, Offset: 1, }, { Content: "4", Timestamp: 4, Offset: 2, }, { Content: "4", Timestamp: 4, Offset: 3, }, { Content: "4", Timestamp: 4, Offset: 4, }, { Content: "4", Timestamp: 4, Offset: 5, }, { Content: "4", Timestamp: 4, Offset: 6, }, { Content: "4", Timestamp: 4, Offset: 7, }, { Content: "4", Timestamp: 4, Offset: 7, }, }, }, } result := mergeLogSearch(limit, results) fmt.Println(jsonx.MarshalAndIndent(result), len(result.Data))
Output:
Index ¶
Examples ¶
Constants ¶
View Source
const ( LogVersion1 = "1.0.0" LogVersion2 = "2.0.0" )
log versions
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArrayAgg ¶
type ArrayAgg struct { UnitType string `json:"unitType"` Unit string `json:"unit"` ChartType string `json:"chartType"` AxisIndex int64 `json:"axisIndex"` Name string `json:"name"` Tag string `json:"tag"` Data []float64 `json:"data"` }
ArrayAgg .
type LogQueryResponse ¶
type LogQueryResponse struct { Expends map[string]interface{} `json:"expends"` Total int64 `json:"total"` Data []*logs.Log `json:"data"` }
LogQueryResponse .
type LogRequest ¶
type LogRequest struct { OrgID int64 ClusterName string Addon string Start int64 End int64 Filters []*Tag Query string Debug bool Lang i18n.LanguageCodes }
LogRequest .
type LogSearchRequest ¶
type LogSearchRequest struct { LogRequest Size int64 Sort string }
LogSearchRequest .
type LogStatisticRequest ¶
type LogStatisticRequest struct { LogRequest Interval int64 Points int64 }
LogStatisticRequest .
type LogStatisticResponse ¶
type LogStatisticResponse struct { Expends map[string]interface{} `json:"expends"` Title string `json:"title"` Total int64 `json:"total"` Interval int64 `json:"interval"` Time []int64 `json:"time"` Results []*LogStatisticResult `json:"results"` }
LogStatisticResponse .
type LogStatisticResult ¶
type LogStatisticResult struct { Name string `json:"name"` Data []*CountHistogram `json:"data"` }
LogStatisticResult .
Source Files ¶
Click to show internal directories.
Click to hide internal directories.