Skip to content

Commit

Permalink
Release: v1.0.5-alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
amir-the-h committed Sep 28, 2021
1 parent fd51c1e commit e97ae6e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@ Changelog
=========
All notable changes to this project will be documented in this file.

v1.0.5-alpha
------------

### Changed

- Forced destination on creating api client

v1.0.4-alpha
------------

### Changed
- Added github actions badges to README.md

- Added github actions badges to README.md

v1.0.3-alpha
------------
Expand Down
24 changes: 11 additions & 13 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,22 @@ type Client struct {
}

// NewClient returns a pointer to a fresh Client
func NewClient(ctx context.Context, apiKey, secretKey, passphrase string, destination *okex.Destination) (*Client, error) {
func NewClient(ctx context.Context, apiKey, secretKey, passphrase string, destination okex.Destination) (*Client, error) {
restURL := okex.RestUrl
wsPubURL := okex.PublicWsUrl
wsPriURL := okex.PrivateWsUrl
if destination != nil {
switch *destination {
case okex.AwsServer:
restURL = okex.AwsRestUrl
wsPubURL = okex.AwsPublicWsUrl
wsPriURL = okex.AwsPrivateWsUrl
case okex.DemoServer:
restURL = okex.DemoRestUrl
wsPubURL = okex.DemoPublicWsUrl
wsPriURL = okex.DemoPrivateWsUrl
}
switch destination {
case okex.AwsServer:
restURL = okex.AwsRestUrl
wsPubURL = okex.AwsPublicWsUrl
wsPriURL = okex.AwsPrivateWsUrl
case okex.DemoServer:
restURL = okex.DemoRestUrl
wsPubURL = okex.DemoPublicWsUrl
wsPriURL = okex.DemoPrivateWsUrl
}

r := rest.NewClient(apiKey, secretKey, passphrase, restURL, *destination)
r := rest.NewClient(apiKey, secretKey, passphrase, restURL, destination)
c := ws.NewClient(ctx, apiKey, secretKey, passphrase, map[bool]okex.BaseUrl{true: wsPriURL, false: wsPubURL})

return &Client{r, c, ctx}, nil
Expand Down

0 comments on commit e97ae6e

Please sign in to comment.