Documentation
¶
Overview ¶
Package polign implements Recall's context-aware Backend over the Polign HTTP API. It uses typed metadata and exact, internally paginated vector listings.
Index ¶
- type Backend
- func (b *Backend) List(ctx context.Context, collection string, filter map[string]any, limit int) ([]recall.StoredVector, int, error)
- func (b *Backend) Put(ctx context.Context, collection, id string, values []float32, ...) error
- func (b *Backend) Search(ctx context.Context, collection string, values []float32, k int, ...) ([]recall.Hit, error)
- func (b *Backend) Watermark(ctx context.Context, collection string) (string, error)
- type Config
- type StatusError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend is a reusable Polign client, safe for concurrent calls.
func (*Backend) List ¶
func (b *Backend) List(ctx context.Context, collection string, filter map[string]any, limit int) ([]recall.StoredVector, int, error)
List returns up to limit exact matches and the exact total, paging internally. Limits up to MaxHistoryEvents+1 support every bounded Recall read, including its overflow probe. Changing totals, duplicate/reordered IDs, or incomplete pages return errors without exposing a partial history.
func (*Backend) Put ¶
func (b *Backend) Put(ctx context.Context, collection, id string, values []float32, metadata map[string]any) error
Put upserts one immutable event ID. It does not automatically retry writes.
func (*Backend) Search ¶
func (b *Backend) Search(ctx context.Context, collection string, values []float32, k int, filter map[string]any) ([]recall.Hit, error)
Search retrieves semantic candidates using the supplied query vector.
func (*Backend) Watermark ¶
Watermark returns the serving node's opaque visible-log revision. Servers without the endpoint fall back to uncached Recall reads.
501 belongs with 404 and 405: it is the conventional answer from a proxy or an older gateway in front of a server that predates the endpoint. A 200 whose body carries no watermark is the same case, and reporting it as unsupported keeps a server that answers the route without implementing it from failing every read.
type Config ¶
type Config struct {
BaseURL string
APIKey string
HTTPClient *http.Client
// MaxResponseBytes bounds each response; zero defaults to 64 MiB. Large
// vector dimensions may require a larger bound even for metadata-only uses.
MaxResponseBytes int64
}
Config selects a Polign endpoint and credential. The default HTTP client has a 30-second timeout and does not follow redirects. A supplied HTTPClient keeps its own timeout/redirect policy and must be safe for concurrent use.
type StatusError ¶
StatusError reports an HTTP error without losing its machine-readable status.
func (*StatusError) Error ¶
func (e *StatusError) Error() string