rpc

package
v1.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: May 26, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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