Skip to content

Commit

Permalink
add GetLogByNano interface
Browse files Browse the repository at this point in the history
add GetLogByNano interface
  • Loading branch information
shabicheng authored Jun 30, 2023
2 parents f039ee4 + 449bc9d commit da8250f
Show file tree
Hide file tree
Showing 7 changed files with 735 additions and 330 deletions.
5 changes: 5 additions & 0 deletions client_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ type ClientInterface interface {
maxLineNum int64, offset int64, reverse bool) (*GetLogsResponse, error)
GetLogLines(project, logstore string, topic string, from int64, to int64, queryExp string,
maxLineNum int64, offset int64, reverse bool) (*GetLogLinesResponse, error)
// GetLogsByNano query logs with [fromInNs, toInNs) nano time range
GetLogsByNano(project, logstore string, topic string, fromInNs int64, toInNs int64, queryExp string,
maxLineNum int64, offset int64, reverse bool) (*GetLogsResponse, error)
GetLogLinesByNano(project, logstore string, topic string, fromInNs int64, toInNs int64, queryExp string,
maxLineNum int64, offset int64, reverse bool) (*GetLogLinesResponse, error)

GetLogsV2(project, logstore string, req *GetLogRequest) (*GetLogsResponse, error)
GetLogLinesV2(project, logstore string, req *GetLogRequest) (*GetLogLinesResponse, error)
Expand Down
12 changes: 12 additions & 0 deletions client_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,12 @@ func (c *Client) GetLogs(project, logstore string, topic string, from int64, to
return ls.GetLogs(topic, from, to, queryExp, maxLineNum, offset, reverse)
}

func (c *Client) GetLogsByNano(project, logstore string, topic string, fromInNs int64, toInNs int64, queryExp string,
maxLineNum int64, offset int64, reverse bool) (*GetLogsResponse, error) {
ls := convertLogstore(c, project, logstore)
return ls.GetLogsByNano(topic, fromInNs, toInNs, queryExp, maxLineNum, offset, reverse)
}

// GetLogsToCompleted query logs with [from, to) time range to completed
func (c *Client) GetLogsToCompleted(project, logstore string, topic string, from int64, to int64, queryExp string,
maxLineNum int64, offset int64, reverse bool) (*GetLogsResponse, error) {
Expand All @@ -224,6 +230,12 @@ func (c *Client) GetLogLines(project, logstore string, topic string, from int64,
return ls.GetLogLines(topic, from, to, queryExp, maxLineNum, offset, reverse)
}

func (c *Client) GetLogLinesByNano(project, logstore string, topic string, fromInNs int64, toInNs int64, queryExp string,
maxLineNum int64, offset int64, reverse bool) (*GetLogLinesResponse, error) {
ls := convertLogstore(c, project, logstore)
return ls.GetLogLinesByNano(topic, fromInNs, toInNs, queryExp, maxLineNum, offset, reverse)
}

// GetLogsV2 ...
func (c *Client) GetLogsV2(project, logstore string, req *GetLogRequest) (*GetLogsResponse, error) {
ls := convertLogstore(c, project, logstore)
Expand Down
Loading

0 comments on commit da8250f

Please sign in to comment.