countries

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/countries

A dalgo2http descriptor for CountriesNow's keyless currency-by-country lookup: https://countriesnow.space/api/v0.1/countries/currency/q?country={name}.

This targets CountriesNow rather than restcountries.com, which the stream brief originally named: restcountries.com's public v3.1 API is now fully deprecated (every route, including /v3.1/name/{name} and /v3.1/alpha/..., 301s to a static payload reporting the deprecation — verified live while building this package). Swapping the concrete public endpoint is within scope: the plan this stream implements says so explicitly ("the concrete public endpoints... are the lead's choice and swap freely").

KeyField is "name" — the same field the name equality parameter targets — so both dal.DB.Get/Exists and ExecuteQueryToRecordsReader work for this collection. Contrast examples/frankfurter, where KeyField is deliberately NOT a declared parameter.

testdata/ holds one fixture, recorded from the live endpoint with dalgo2http.Record (query: country=France). example_test.go runs fully offline against it (Mode: dalgo2http.ModeSnapshot), so it never depends on CountriesNow being reachable from CI.

Documentation

Overview

Package countries is a dalgo2http descriptor for CountriesNow's keyless currency-by-country lookup, one of the two example sources DataTug's demo knowledge project uses to satisfy REQ:http-reference-source (public, keyless, read-only reference data — "some public sources like countries or currency rates", founder ruling 2026-09-09).

The upstream API this originally targeted, restcountries.com's v3.1, is fully deprecated (every route now 301s to a static "deprecated, see v5" error payload — verified live while building this package); CountriesNow is the substitute, which the plan this stream implements explicitly allows ("the concrete public endpoints... are the lead's choice and swap freely").

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://countriesnow.space/api/v0.1/countries/currency/q?country={name}.

KeyField is "name" (not e.g. an ISO code) DELIBERATELY: it is the same field the "name" Param equality condition targets, so both dal.DB.Get/Exists AND ExecuteQueryToRecordsReader work for this collection — see Capabilities.SupportsGet in the root package, which is false whenever KeyField is not also a declared Param.

Types

This section is empty.

Jump to

Keyboard shortcuts

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