fetcher

package
v0.1.1069 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	contract.FetcherOperator
}

func NewClient

func NewClient(d Dependencies, opts ClientOptions) (Client, error)

type ClientOption

type ClientOption = contract.Opt[ClientOptions]

func WithAuthenticationSecret added in v0.1.1061

func WithAuthenticationSecret(x []byte) ClientOption

func WithFetcherBaseURL

func WithFetcherBaseURL(x *url.URL) ClientOption

func WithLoaded

func WithLoaded(x Loaded) ClientOption

func WithTimeout

func WithTimeout(x time.Duration) ClientOption

func WithUserIDHeaderKey

func WithUserIDHeaderKey(x string) ClientOption

type ClientOptions

type ClientOptions struct {
	Loaded
	Timeout time.Duration
}

func ApplyClientOptions

func ApplyClientOptions(opts *ClientOptions, modifiers ...ClientOption) ClientOptions

type DefaultTool

type DefaultTool struct {
	T *contract.Tool[Client]
}

func NewTool

func NewTool(c Client, opts contract.ToolOptions[Client]) *DefaultTool

func (*DefaultTool) FetchMany

func (d *DefaultTool) FetchMany(ctx context.Context, opts contract.FetchManyOptions) ([]any, error)

FetchMany retrieves multiple documents from a remote collection using query parameters.

func (*DefaultTool) FetchOne

func (d *DefaultTool) FetchOne(ctx context.Context, opts contract.FetchOneOptions) (any, error)

FetchOne retrieves a single document from a remote collection by ID.

type Loaded

type Loaded struct {
	FetcherBaseURL       *url.URL
	UserIDHeaderKey      string
	AuthenticationSecret []byte
}

type Tool

type Tool interface {
	Client
}

Jump to

Keyboard shortcuts

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