client

package
v2.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: AGPL-3.0 Imports: 8 Imported by: 11

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, prefix types.EndpointPrefix, path *api.URL, in any, out any) error

Query is a helper for initiating a request on any endpoints defined external to microcluster. This function should be used for all client methods defined externally from microcluster.

func (*Client) QueryRaw added in v2.0.3

func (c *Client) QueryRaw(ctx context.Context, method string, prefix types.EndpointPrefix, path *api.URL, in any) (*http.Response, error)

QueryRaw is a helper for initiating a request on any endpoints defined external to microcluster. Unlike Query it returns the raw HTTP response.

func (*Client) UseTarget

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

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

func (*Client) Websocket added in v2.0.3

func (c *Client) Websocket(ctx context.Context, prefix types.EndpointPrefix, path *api.URL) (*websocket.Conn, error)

Websocket is a helper for upgrading a request to websocket on any endpoints defined external to microcluster. This function should be used for all client methods defined externally from microcluster.

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