frankfurter

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: MIT Imports: 2 Imported by: 0

README

examples/frankfurter

A dalgo2http descriptor for the Frankfurter exchange-rate API: https://api.frankfurter.dev/v1/latest?base=USD&symbols={to}.

The stream brief this implements named api.frankfurter.app; that host now 301-redirects to api.frankfurter.dev (verified live while building this package). Go's http.Client follows the redirect transparently, so either host works — this descriptor targets api.frankfurter.dev directly to skip the redirect hop on every request.

KeyField is "base" and is deliberately NOT a declared parameter: base=USD is fixed in the URL template, not something the endpoint can be asked for by equality. So dal.DB.Get/Exists fail closed with dal.ErrNotSupported for this collection (see Capabilities.SupportsGet in the root package); only ExecuteQueryToRecordsReader, pushing an equality condition on to, is supported. RowsPath is empty because the whole response body — a JSON object, not an array — IS the one row.

testdata/ holds one fixture, recorded from the live endpoint with dalgo2http.Record (query: to=EUR). example_test.go runs fully offline against it (Mode: dalgo2http.ModeSnapshot).

Documentation

Overview

Package frankfurter is a dalgo2http descriptor for the Frankfurter exchange-rate API, the second of the two example sources DataTug's demo knowledge project uses to satisfy REQ:http-reference-source ("currency rates", founder ruling 2026-09-09).

The brief this stream implements named api.frankfurter.app; that host now 301-redirects to api.frankfurter.dev (verified live while building this package). This descriptor targets api.frankfurter.dev directly, which now matters for more than avoiding a needless hop: the Phase 1 HTTP bounds disable redirects by default (see the root package's README.md "Design constraints" and security.go's denyRedirect), so a descriptor pointed at api.frankfurter.app would now fail outright with ErrRedirectNotAllowed instead of following the redirect. See example_test.go's TestFrankfurter_NoRedirectNeeded for a fake-server proof this descriptor resolves in one hop.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Collection

func Collection() dalgo2http.Collection

Collection is the dalgo2http descriptor for https://api.frankfurter.dev/v1/latest?base=USD&symbols={to}.

KeyField is "base" and is DELIBERATELY NOT a declared Param — "base=USD" is fixed in the URL template, not something a query can ask for by equality — so dal.DB.Get/Exists fail closed with dal.ErrNotSupported for this collection (see Capabilities.SupportsGet in the root package); only ExecuteQueryToRecordsReader, pushing an equality condition on "to", is supported. RowsPath is empty because the whole response body — a JSON object, not an array — IS the one row.

Types

This section is empty.

Jump to

Keyboard shortcuts

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