http

package
v1.13.14 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const (
	RetryWaitMax = 120 * time.Second
	RetryMax     = 60
)
View Source
const (
	// SCRestAPIPrefix represents base URL path to execute smart contract rest points.
	SCRestAPIPrefix        = "v1/screst/"
	RestPrefix             = SCRestAPIPrefix + zcncore.ZCNSCSmartContractAddress
	PathGetAuthorizerNodes = "/getAuthorizerNodes?active=%t"
	PathGetGlobalConfig    = "/getGlobalConfig"
	PathGetAuthorizer      = "/getAuthorizer"
)

Variables

Functions

func CleanClient added in v1.8.6

func CleanClient() *http.Client

func MakeSCRestAPICall

func MakeSCRestAPICall(opCode int, relativePath string, params Params, cb zcncore.GetInfoCallback)

MakeSCRestAPICall calls smart contract with provided address and makes retryable request to smart contract resource with provided relative path using params.

func NewClient

func NewClient() *http.Client

NewClient creates default http.Client with timeouts.

func NewRetryableClient

func NewRetryableClient(verbose bool) *retryablehttp.Client

NewRetryableClient creates default retryablehttp.Client with timeouts and embedded NewClient result.

func SetLogFile added in v1.11.0

func SetLogFile(logFile string, verbose bool)

Types

type Params added in v1.7.1

type Params map[string]string

Jump to

Keyboard shortcuts

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