rpc

package
v1.7.10 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2022 License: BSD-3-Clause Imports: 7 Imported by: 80

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EndpointRequester

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

func NewEndpointRequester

func NewEndpointRequester(uri, endpoint, base string) EndpointRequester

type Option added in v1.7.10

type Option func(*Options)

func WithHeader added in v1.7.10

func WithHeader(key, val string) Option

func WithQueryParam added in v1.7.10

func WithQueryParam(key, val string) Option

type Options added in v1.7.10

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

func NewOptions added in v1.7.10

func NewOptions(ops []Option) *Options

func (*Options) Headers added in v1.7.10

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

func (*Options) QueryParams added in v1.7.10

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

type Requester

type Requester interface {
	SendJSONRPCRequest(
		ctx context.Context,
		endpoint string,
		headers http.Header,
		queryParams url.Values,
		method string,
		params interface{},
		reply interface{},
	) error
}

func NewRPCRequester

func NewRPCRequester(uri string) Requester

Jump to

Keyboard shortcuts

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