Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions sls/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,26 @@ func (client *Client) PutLogs(putLogRequest *PutLogsRequest) error {
return newClient.requestWithClose(req)

}

type ProjectList struct {
Projects []Project `json:"projects"`
Count int `json:"count"`
Total int `json:"total"`
}

//获取全部项目
func (client *Client) ListProject() (ProjectList, error) {
req := &request{
method: METHOD_GET,
path: "/",
params: map[string]string{
"offset": "0",
"size": "999",
},
}
var projectList ProjectList
if err := client.requestWithJsonResponse(req, &projectList); err != nil {
return projectList, err
}
return projectList, nil
}