Initial work marking communications
And a bunch of lint fixes
This commit is contained in:
parent
67c99436d1
commit
3153e8bf13
36 changed files with 1958 additions and 487 deletions
|
|
@ -5,6 +5,8 @@ import (
|
|||
"fmt"
|
||||
"net/url"
|
||||
"time"
|
||||
|
||||
"github.com/Gleipnir-Technology/nidus-sync/lint"
|
||||
)
|
||||
|
||||
// TasksListResponse represents the response from the /api/tasks endpoint
|
||||
|
|
@ -131,7 +133,7 @@ func (c *Client) ListTasks(options *TasksListOptions) (*TasksListResponse, error
|
|||
if err != nil {
|
||||
return nil, fmt.Errorf("Failed to request %s: %v", path, err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
defer lint.LogOnErr(resp.Body.Close, "close response body")
|
||||
|
||||
// Parse response
|
||||
var tasksResponse TasksListResponse
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/Gleipnir-Technology/nidus-sync/lint"
|
||||
)
|
||||
|
||||
// ProjectsResponse represents the response from the /api/projects endpoint
|
||||
|
|
@ -114,7 +116,7 @@ func (c *Client) Projects() (*ProjectsResponse, error) {
|
|||
if err != nil {
|
||||
return nil, fmt.Errorf("Failed to GET /api/projects: %w", err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
defer lint.LogOnErr(resp.Body.Close, "resp.Body.Close")
|
||||
|
||||
// Parse response
|
||||
var projects ProjectsResponse
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/Gleipnir-Technology/nidus-sync/lint"
|
||||
)
|
||||
|
||||
// AnnotationRequest represents the request body for creating a draft
|
||||
|
|
@ -63,7 +65,7 @@ func (c *Client) CreateAnnotation(taskID int, annotation *AnnotationRequest) (*A
|
|||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create request: %w", err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
defer lint.LogOnErr(resp.Body.Close, "close resp body")
|
||||
|
||||
// Parse response
|
||||
var createdAnnotation Annotation
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue