Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add query for client #220

Merged
merged 5 commits into from
Aug 15, 2023
Merged

Conversation

panawala
Copy link

No description provided.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


weilong.pwl seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@panawala panawala force-pushed the feature/add_query_for_client branch from b258497 to c828333 Compare August 14, 2023 11:13
log_store.go Outdated
uri += fmt.Sprintf("&end_cursor=%v", plr.EndCursor)
}
if plr.Query != "" {
uri += fmt.Sprintf("&query=%v", plr.Query)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

裸拼字符串query字段可能有问题,建议整体做一下escape
image

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

// PullLogs gets logs from shard specified by shardId according cursor and endCursor.
// The logGroupMaxCount is the max number of logGroup could be returned.
// The nextCursor is the next cursor can be used to read logs at next time.
// @note if you want to pull logs continuous, set endCursor = ""
PullLogs(project, logstore string, shardID int, cursor, endCursor string,
logGroupMaxCount int) (gl *LogGroupList, nextCursor string, err error)
PullLogsWithQuery(plr *PullLogRequest) (gl *LogGroupList, nextCursor string, err error)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我想这个common的方法可以改个名字:PullLogsV2之类的?不要过于突出 Query(一些用户用不到这个功能,反而会多问)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已改为PullLogsV2,PullLogRequest放到了model.go里面

@shabicheng
Copy link
Collaborator

LGTM

@shabicheng shabicheng merged commit 8c55f03 into aliyun:master Aug 15, 2023
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants