@@ -33,16 +33,10 @@ import (
3333
3434const logsPath = "/system/logs"
3535
36- type JobsResponse struct {
37- Jobs map [string ]* types.JobInfo `json:"jobs"`
38- NextPage string `json:"next_page,omitempty"`
39- RemainingJob * int64 `json:"remaining_jobs,omitempty"`
40- }
41-
4236var ErrNoLogsFound = errors .New ("service has no logs" )
4337
4438// ListLogs returns a map with all the available logs from the given service
45- func ListLogs (c * cluster.Cluster , name string , page string ) (logMap JobsResponse , err error ) {
39+ func ListLogs (c * cluster.Cluster , name string , page string ) (logMap types. JobsResponse , err error ) {
4640 listLogsURL , err := url .Parse (c .Endpoint )
4741 if err != nil {
4842 return logMap , cluster .ErrParsingEndpoint
@@ -76,7 +70,7 @@ func ListLogs(c *cluster.Cluster, name string, page string) (logMap JobsResponse
7670 return logMap , err
7771 }
7872 jobs := map [string ]* types.JobInfo {}
79- jobsResponse := JobsResponse {}
73+ jobsResponse := types. JobsResponse {}
8074 // Try to decode the response body into the jobsResponse
8175 err = json .NewDecoder (bytes .NewReader (body )).Decode (& jobsResponse )
8276 if err != nil {
@@ -91,7 +85,7 @@ func ListLogs(c *cluster.Cluster, name string, page string) (logMap JobsResponse
9185 if _ , ok := jobs ["jobs" ]; ok {
9286 return jobsResponse , err
9387 } else {
94- jobsResponse = JobsResponse {Jobs : jobs , NextPage : "" , RemainingJob : nil }
88+ jobsResponse = types. JobsResponse {Jobs : jobs , NextPage : "" , RemainingJob : nil }
9589 return jobsResponse , err
9690 }
9791
0 commit comments