rpc

package
v1.22.58 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: BSD-3-Clause Imports: 7 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanlyCloseBody added in v1.16.56

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

func SendJSONRequest

func SendJSONRequest(
	ctx context.Context,
	uri *url.URL,
	method string,
	params interface{},
	reply interface{},
	options ...Option,
) error

Types

type EndpointRequester

type EndpointRequester interface {
	SendRequest(ctx context.Context, method string, params interface{}, reply interface{}, options ...Option) error
}

func NewEndpointRequester

func NewEndpointRequester(uri string) EndpointRequester

type Option

type Option func(*Options)

func WithHeader

func WithHeader(key, val string) Option

func WithQueryParam

func WithQueryParam(key, val string) Option

type Options

type Options struct {
	// contains filtered or unexported fields
}

func NewOptions

func NewOptions(ops []Option) *Options

func (*Options) Headers

func (o *Options) Headers() http.Header

func (*Options) QueryParams

func (o *Options) QueryParams() url.Values

Jump to

Keyboard shortcuts

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