golang-sdk/

directory
v0.0.0-...-2d984c1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2020 License: MIT

README

  1. Navigate to trending-historical-cryptocurrency-news/golang-sdk/examples folder
  2. Run go install
  3. Executable will show up in the bin folder of GOPATH
Interchanging endpoints

Please consult the README for information regarding the endpoints. In the examples/main.go file you are provided the following are which you should modify:


endpoint := "public/trending-public-news"
input := make(map[string]interface{})
input["date"] = "2020-07-04"

Beyond the above section of code, you do not need to modify any other code for simple working reasons.

For example, if you wanted to get the endpoint public/trending-news-statistics you would make the main() function as follows:


func main() {
        obj := src.New(key, secret)
        endpoint := "public/trending-news-statistics"

        input := make(map[string]interface{})

        result, err := obj.Send(endpoint, input, map[string]interface{}{})
        if err != nil {
                fmt.Println(err)
        }

        fmt.Printf("%#v\n", result)
}   

As you can see, the input is declared but no additional input is required.

Nonce

A special mention regarding the nonce. The nonce must be between 17 to 20 characters in length. The prefix is the current unix timestamp. If you are to modify the interface in src then please beaware that an expected format is expected.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL