forked from buildkite/agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader_times.go
More file actions
34 lines (27 loc) · 734 Bytes
/
header_times.go
File metadata and controls
34 lines (27 loc) · 734 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package api
import (
"fmt"
)
// HeaderTimesService handles communication with the meta data related methods
// of the Buildkite Agent API.
type HeaderTimesService struct {
client *Client
}
// HeaderTimes represents a set of header times that are associated with a job
// log.
type HeaderTimes struct {
Times map[string]string `json:"header_times"`
}
// Saves the header times to the job
func (hs *HeaderTimesService) Save(jobId string, headerTimes *HeaderTimes) (*Response, error) {
u := fmt.Sprintf("jobs/%s/header_times", jobId)
req, err := hs.client.NewRequest("POST", u, headerTimes)
if err != nil {
return nil, err
}
resp, err := hs.client.Do(req, nil)
if err != nil {
return resp, err
}
return resp, err
}