Documentation
¶
Index ¶
- func IsNotification(r *http.Request) bool
- type Client
- func (c *Client) Query(ctx context.Context, method string, prefix types.EndpointPrefix, path *api.URL, ...) error
- func (c *Client) QueryRaw(ctx context.Context, method string, prefix types.EndpointPrefix, path *api.URL, ...) (*http.Response, error)
- func (c *Client) UseTarget(name string) *Client
- func (c *Client) Websocket(ctx context.Context, prefix types.EndpointPrefix, path *api.URL) (*websocket.Conn, error)
- type Cluster
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNotification ¶
IsNotification determines if this request is to be considered a cluster-wide notification.
Types ¶
type 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) 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 ¶
SelectRandom returns a randomly selected client.