Skip to content

Commit

Permalink
Add test_response.go
Browse files Browse the repository at this point in the history
  • Loading branch information
f0cii committed Jul 25, 2019
1 parent 89e37df commit ab53f48
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
12 changes: 2 additions & 10 deletions api_supporting.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@ package deribit

import "github.com/sumorf/deribit-api/models"

func (c *Client) GetTime() (timestamp int64, err error) {
var result int64
func (c *Client) GetTime() (result int64, err error) {
err = c.Call("public/get_time", nil, &result)
if err != nil {
return
}
timestamp = result
return
}

Expand All @@ -17,10 +12,7 @@ func (c *Client) Hello(params *models.HelloParams) (result models.HelloResponse,
return
}

func (c *Client) Test() (err error) {
var result = struct {
Version string `json:"version"`
}{}
func (c *Client) Test() (result models.TestResponse, err error) {
err = c.Call("public/test", nil, &result)
return
}
5 changes: 5 additions & 0 deletions models/test_response.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package models

type TestResponse struct {
Version string `json:"version"`
}

0 comments on commit ab53f48

Please sign in to comment.