Skip to content

Commit

Permalink
Merge pull request #8 from avarabyeu/savel-log
Browse files Browse the repository at this point in the history
add save log model
  • Loading branch information
avarabyeu authored Jan 29, 2019
2 parents 5740a87 + cf05ff4 commit f8536a0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
13 changes: 13 additions & 0 deletions gorp/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,19 @@ func (c *Client) FinishTest(id string, launch *FinishTestRQ) (*MsgRS, error) {
return &rs, err
}

//SaveLog attaches log in RP
func (c *Client) SaveLog(log *SaveLogRQ) (*EntryCreatedRS, error) {
var rs EntryCreatedRS
_, err := c.http.R().
SetPathParams(map[string]string{
"project": c.project,
}).
SetBody(log).
SetResult(&rs).
Post("/api/v1/{project}/log")
return &rs, err
}

//GetLaunches retrieves latest launches
func (c *Client) GetLaunches() (*LaunchPage, error) {
var launches LaunchPage
Expand Down
8 changes: 8 additions & 0 deletions gorp/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@ type (
Retry bool `json:"retry,omitempty"`
}

//SaveLogRQ payload representation. Without attaches.
SaveLogRQ struct {
ItemID string `json:"item_id,omitempty"`
LogTime Timestamp `json:"time,omitempty"`
Message string `json:"message,omitempty"`
Level string `json:"level,omitempty"`
}

//StartTestRQ payload representation
StartTestRQ struct {
StartRQ
Expand Down

0 comments on commit f8536a0

Please sign in to comment.