rpc
Package rpc
import "github.com/luxfi/node/utils/rpc"Functions
CleanlyCloseBody
func CleanlyCloseBody(body io.ReadCloser) errorCleanlyCloseBody drains and closes an HTTP response body to prevent HTTP/2 GOAWAY errors caused by closing bodies with unread data. See: https://github.com/golang/go/issues/46071
SendJSONRequest
func SendJSONRequest(
ctx context.Context,
uri *url.URL,
method string,
params interface{},
reply interface{},
options ...Option,
) errorTypes
EndpointRequester
func NewEndpointRequester(uri string) EndpointRequesterOption
func WithHeader(key, val string) Optionfunc WithQueryParam(key, val string) OptionOptions
func NewOptions(ops []Option) *Optionsfunc (o *Options) Headers() http.Headerfunc (o *Options) QueryParams() url.Values