Run NodesReferenceutils

rpc

Package rpc

import "github.com/luxfi/node/utils/rpc"

Functions

CleanlyCloseBody

func CleanlyCloseBody(body io.ReadCloser) error

CleanlyCloseBody 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,
) error

Types

EndpointRequester

func NewEndpointRequester(uri string) EndpointRequester

Option

func WithHeader(key, val string) Option
func WithQueryParam(key, val string) Option

Options

func NewOptions(ops []Option) *Options
func (o *Options) Headers() http.Header
func (o *Options) QueryParams() url.Values