diff options
author | salaaad2 <arthurdurant263@gmail.com> | 2022-04-17 17:52:29 +0200 |
---|---|---|
committer | salaaad2 <arthurdurant263@gmail.com> | 2022-04-17 17:52:29 +0200 |
commit | fd79b09ad0e7d0e3165c70ca0908ec1ac0a7116c (patch) | |
tree | 523c531f52d68ecd5bceabf3f950fe21c11391f9 /gosrc/requests.go | |
parent | cool ui and functioning requests, what can a man ask for (v0.0.1) (diff) | |
download | smith-fd79b09ad0e7d0e3165c70ca0908ec1ac0a7116c.tar.gz smith-fd79b09ad0e7d0e3165c70ca0908ec1ac0a7116c.tar.bz2 smith-fd79b09ad0e7d0e3165c70ca0908ec1ac0a7116c.tar.xz smith-fd79b09ad0e7d0e3165c70ca0908ec1ac0a7116c.tar.zst smith-fd79b09ad0e7d0e3165c70ca0908ec1ac0a7116c.zip |
smith is cool
Diffstat (limited to 'gosrc/requests.go')
-rw-r--r-- | gosrc/requests.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gosrc/requests.go b/gosrc/requests.go index 0a939c0..6c36f02 100644 --- a/gosrc/requests.go +++ b/gosrc/requests.go @@ -7,7 +7,6 @@ package main import ( - "fmt" "log" "net/http" "strings" @@ -25,6 +24,14 @@ import "C" func send_request(body string, signature string, endpoint string, config Config) (*http.Response, error) { // new client to allow defering of requests client := &http.Client{} + switch (endpoint) { + case "Account Status": + endpoint = Endpoints.status + case "Available Coins": + endpoint = Endpoints.getall + case "Buy X coin ": + return nil, nil + } url := "https://" + config.Mirror + "/" + endpoint + "?" + body + "&signature=" + signature // add some ifs here @@ -40,13 +47,11 @@ func send_request(body string, signature string, endpoint string, config Config) log.Fatal("error: making http request ", err) } - defer response.Body.Close() return response, nil } // sign request with given private key func sign_request(body string, key string) string { - fmt.Println("signing request : ", body) // run pipeline out2, err := RunStrings("/usr/bin/echo", "-n", body, "|", "/usr/bin/openssl", "dgst", "-sha256", "-hmac", key) |