client

package
v0.0.0-...-b0bf924 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNotification

func IsNotification(r *http.Request) bool

IsNotification determines if this request is to be considered a cluster-wide notification.

Types

type Client

type Client struct {
	client.Client
}

Client is a rest client for the MicroCluster daemon.

func (*Client) Query

func (c *Client) Query(ctx context.Context, method string, path *api.URL, in any, out any) error

Query is a helper for initiating a request on the /1.0 endpoint. This function should be used for all client methods defined externally from MicroCluster.

func (*Client) UseTarget

func (c *Client) UseTarget(name string) *Client

UseTarget returns a new client with the query "?target=name" set.

type Cluster

type Cluster []Client

Cluster is a list of clients belonging to a cluster.

func (Cluster) Query

func (c Cluster) Query(ctx context.Context, concurrent bool, query func(context.Context, *Client) error) error

Query executes the given hook across all members of the cluster.

func (Cluster) SelectRandom

func (c Cluster) SelectRandom() Client

SelectRandom returns a randomly selected client.

Jump to

Keyboard shortcuts

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