client

package
v4.1.23 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: GPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*client.DefaultClient
}

Client denotes a global query client

func New

func New(addr string, opts ...client.Option) *Client

New creates a new client for the global-query API

func (*Client) Query

func (c *Client) Query(ctx context.Context, args *query.Args) (*results.Result, error)

Query performs the global query and returns its result

func (*Client) Run

func (c *Client) Run(ctx context.Context, args *query.Args) (*results.Result, error)

Run implements the query.Runner interface

type SSEClient

type SSEClient struct {
	*client.DefaultClient
	// contains filtered or unexported fields
}

SSEClient is a global query client capable of streaming updates

func NewSSE

func NewSSE(addr string, onUpdate, onFinish StreamingUpdate, onKeepalive StreamingKeepalive, opts ...client.Option) *SSEClient

NewSSE creates a new streaming client for the global-query API

func NewSSEFromConfig

func NewSSEFromConfig(cfg *gpclient.Config, keepaliveChan chan<- struct{}) *SSEClient

NewFromConfig creates the client based on cfg, sending keepalive signals on the provided channel

func (*SSEClient) Query

func (sse *SSEClient) Query(ctx context.Context, args *query.Args) (*results.Result, error)

Query performs the global query and returns its result, while consuming updates to partial results

func (*SSEClient) Run

func (sse *SSEClient) Run(ctx context.Context, args *query.Args) (*results.Result, error)

Run implements the query.Runner interface

type StreamingKeepalive

type StreamingKeepalive func(context.Context) error

StreamingKeepalive is a function which operates on a received keepalive

type StreamingUpdate

type StreamingUpdate func(context.Context, *results.Result) error

StreamingUpdate is a function which operates on a received result

Jump to

Keyboard shortcuts

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