Skip to content

Commit a41026f

Browse files
committed
Bumped v0.15.0
Signed-off-by: Vishal Rana <[email protected]>
1 parent 81d3644 commit a41026f

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

currency.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package labstack
2+
3+
import "time"
4+
5+
type (
6+
CurrencyExchangeRequest struct {
7+
Base string `json:"base"`
8+
}
9+
10+
CurrencyExchangeResponse struct {
11+
Rates map[string]float64 `json:"rates"`
12+
UpdatedAt time.Time `json:"updated_at"`
13+
}
14+
)
15+
16+
func (c *Client) CurrencyExchange(req *CurrencyExchangeRequest) (res *CurrencyExchangeResponse, err *APIError) {
17+
res = new(CurrencyExchangeResponse)
18+
_, e := c.resty.R().
19+
SetBody(req).
20+
SetResult(res).
21+
SetError(err).
22+
Post("/currency/exchange")
23+
if e != nil {
24+
err = new(APIError)
25+
err.Message = e.Error()
26+
}
27+
return
28+
}

0 commit comments

Comments
 (0)