substrate

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommandHTTP = "proxy-http"

	BodyHost   = "host"
	BodyPath   = "path"
	BodyMethod = "method"
)

Variables

View Source
var (
	DefaultTimeOut   = 10 * time.Millisecond
	DefaultThreshold = 3
)

Functions

func New

func New(ctx context.Context, node peer.Node, ops ...Option) (client substrate.ProxyClient, err error)

Types

type Client

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

func (*Client) Close

func (c *Client) Close() error

func (*Client) Peers added in v1.1.5

func (c *Client) Peers(pids ...peerCore.ID) *Client

func (*Client) ProxyHTTP

func (c *Client) ProxyHTTP(host, path, method string, ops ...client.Option[client.Request]) (<-chan *client.Response, error)

type Option

type Option func(c *Client) error

func CallBack

func CallBack(callback func() Parameters) Option

func Threshold

func Threshold(threshold int) Option

func Timeout

func Timeout(timeout time.Duration) Option

type Parameters

type Parameters struct {
	Threshold int
	Timeout   time.Duration
}

Jump to

Keyboard shortcuts

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