http

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ScRestApiUrl represents base URL path to execute smart contract rest points.
	ScRestApiUrl = "v1/screst/"
)

Variables

This section is empty.

Functions

func CreateServer

func CreateServer(setupHandlers setupHandlers, cfg config.Handler, port int, development bool) *http.Server

CreateServer creates http.Server and setups handlers.

func MakeSCRestAPICall

func MakeSCRestAPICall(scAddress string, relativePath string, params map[string]string) ([]byte, error)

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(retryMax int) *retryablehttp.Client

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

func StartServer

func StartServer(server *http.Server, appCtxCancel func())

StartServer calls http.Server.ListenAndServe and calls app context cancel if error occurs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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