client

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package client provides an IPC client for the Hugr query engine. It communicates via the Hugr IPC multipart/mixed protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(url string, opts ...Option) *Client

func (*Client) DataSourceStatus

func (c *Client) DataSourceStatus(ctx context.Context, name string) (string, error)

func (*Client) DescribeDataSource

func (c *Client) DescribeDataSource(ctx context.Context, name string, self bool) (string, error)

DescribeDataSource returns the description of the data source.

func (*Client) LoadDataSource

func (c *Client) LoadDataSource(ctx context.Context, name string) error

func (*Client) Ping

func (c *Client) Ping(ctx context.Context) (string, error)

func (*Client) Query

func (c *Client) Query(ctx context.Context, query string, vars map[string]any) (*types.Response, error)

func (*Client) QueryJSON

func (c *Client) QueryJSON(ctx context.Context, req types.JQRequest) (*db.JsonValue, error)

func (*Client) RegisterDataSource

func (c *Client) RegisterDataSource(ctx context.Context, ds types.DataSource) error

func (*Client) UnloadDataSource

func (c *Client) UnloadDataSource(ctx context.Context, name string) error

func (*Client) ValidateQuery

func (c *Client) ValidateQuery(ctx context.Context, query string, vars map[string]any) error

func (*Client) ValidateQueryJSON

func (c *Client) ValidateQueryJSON(ctx context.Context, req types.JQRequest) error

type ClientConfig

type ClientConfig struct {
	Timeout    time.Duration
	HttpUrl    string
	JQQueryUrl string
	Transport  http.RoundTripper
}

type Option

type Option func(*ClientConfig)

func WithApiKey

func WithApiKey(apiKey string) Option

func WithApiKeyCustomHeader

func WithApiKeyCustomHeader(apiKey, header string) Option

func WithHttpUrl

func WithHttpUrl(httpUrl string) Option

func WithJQQueryUrl

func WithJQQueryUrl(jq string) Option

func WithTimeout

func WithTimeout(timeout time.Duration) Option

func WithToken

func WithToken(token string) Option

func WithTransport

func WithTransport(transport http.RoundTripper) Option

func WithUserInfo

func WithUserInfo(id, name string) Option

func WithUserInfoCustomHeader

func WithUserInfoCustomHeader(id, name, idHeader, nameHeader string) Option

func WithUserRole

func WithUserRole(role string) Option

func WithUserRoleCustomHeader

func WithUserRoleCustomHeader(role, header string) Option

Jump to

Keyboard shortcuts

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