github.com/0chain/gosdk@v1.17.11/core/resty/client.go (about)

     1  //go:build !js && !wasm
     2  // +build !js,!wasm
     3  
     4  package resty
     5  
     6  import (
     7  	"net/http"
     8  	"time"
     9  )
    10  
    11  // CreateClient a function that create a client instance
    12  var CreateClient = func(t *http.Transport, timeout time.Duration) Client {
    13  	client := &http.Client{
    14  		Transport: t,
    15  	}
    16  	if timeout > 0 {
    17  		client.Timeout = timeout
    18  	}
    19  
    20  	return client
    21  }