mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-23 15:10:15 +00:00
exchanges: Initial context propagation (#744)
* gct: phase one context awareness pass * exchanges: context propagation pass * common/requester: force context requirement * gctcli/exchanges: linter fix * rpcserver: fix test using dummy rpc server * backtester: fix comments * grpc: add correct cancel and timeout for commands * rpcserver_test: add comment on dummy server * common: deprecated SendHTTPGetRequest * linter: fix * linter: turn on no context check * apichecker: fix context linter issue * binance: use param context * common: remove checks as this gets executed before main * common: change mutex to RW as clients can be used by multiple go routines. * common: remove init and JIT default client. Unexport global variables and add protection. * common: Add comments * bithumb: after dinner mints fix
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"flag"
|
||||
@@ -8,6 +9,7 @@ import (
|
||||
"html/template"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
@@ -162,7 +164,7 @@ func main() {
|
||||
if verbose {
|
||||
fmt.Println("Fetching repository contributor list...")
|
||||
}
|
||||
contributors, err = GetContributorList(config.GithubRepo)
|
||||
contributors, err = GetContributorList(config.GithubRepo, verbose)
|
||||
if err != nil {
|
||||
log.Fatalf("Documentation Generation Tool - GetContributorList error %s",
|
||||
err)
|
||||
@@ -432,9 +434,19 @@ func GetTemplateFiles() (*template.Template, error) {
|
||||
|
||||
// GetContributorList fetches a list of contributors from the github api
|
||||
// endpoint
|
||||
func GetContributorList(repo string) ([]Contributor, error) {
|
||||
func GetContributorList(repo string, verbose bool) ([]Contributor, error) {
|
||||
contents, err := common.SendHTTPRequest(context.TODO(),
|
||||
http.MethodGet,
|
||||
repo+GithubAPIEndpoint,
|
||||
nil,
|
||||
nil,
|
||||
verbose)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var resp []Contributor
|
||||
return resp, common.SendHTTPGetRequest(repo+GithubAPIEndpoint, true, false, &resp)
|
||||
return resp, json.Unmarshal(contents, &resp)
|
||||
}
|
||||
|
||||
// GetDocumentationAttributes returns specific attributes for a file template
|
||||
|
||||
Reference in New Issue
Block a user