From d20b7fc653944372646f1165e07702cbc12788c0 Mon Sep 17 00:00:00 2001 From: syaning Date: Fri, 11 Nov 2022 10:43:10 +0800 Subject: [PATCH] feature: getLogs response with headers --- config.go | 2 +- log_store.go | 1 + model.go | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/config.go b/config.go index 5dc62eaa..7bc21983 100644 --- a/config.go +++ b/config.go @@ -22,7 +22,7 @@ const ( GetLogsQueryInfo = "X-Log-Query-Info" HasSQLHeader = "x-log-has-sql" - ETLVersion = 2 + ETLVersion = 2 ETLType = "ETL" ETLSinksType = "AliyunLOG" ) diff --git a/log_store.go b/log_store.go index ceea12c8..468f6215 100644 --- a/log_store.go +++ b/log_store.go @@ -582,6 +582,7 @@ func (s *LogStore) getLogs(req *GetLogRequest) (*http.Response, []byte, *GetLogs Count: count, Contents: contents, HasSQL: hasSQL, + Header: r.Header, }, nil } diff --git a/model.go b/model.go index 21628eb3..7eea4ff4 100644 --- a/model.go +++ b/model.go @@ -2,6 +2,7 @@ package sls import ( "encoding/json" + "net/http" "net/url" "strconv" "strings" @@ -58,6 +59,7 @@ type GetLogsResponse struct { Logs []map[string]string `json:"logs"` Contents string `json:"contents"` HasSQL bool `json:"hasSQL"` + Header http.Header `json:"header"` } // GetLogLinesResponse defines response from GetLogLines call