Documentation
¶
Overview ¶
Package ckan is a dfetch Connector backed by a CKAN portal's Action API (https://docs.ckan.org/en/latest/api/). CKAN powers catalog.data.gov and many other open-data portals, all sharing one read-only JSON API, so a single connector pointed at a configurable base_url covers any of them; the default host is data.gov's catalog. It is registered as the builtin schema "datagov" and exposes the datasets, resources, organizations, and groups tables, pushing down the Solr-backed filters, ordering, and LIMIT/OFFSET that package_search understands.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New builds a CKAN connector. Supported params: "base_url" (override the portal host; defaults to https://catalog-old.data.gov, also used by tests), "action_path" (the Action API prefix; defaults to "/api/3/action", set to "/v3/action" for the api.gsa.gov gateway), and "api_key" (sent as the api_key query parameter the gateway requires; falls back to $CKAN_API_KEY). Public CKAN reads need no key.
Types ¶
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
Connector talks to a CKAN Action API.
func (*Connector) Scan ¶
func (c *Connector) Scan(ctx context.Context, req source.ScanRequest, emit func(*source.Rows) error) error
Scan dispatches to the per-table fetchers, which emit one chunk per API page.
func (*Connector) Tables ¶
func (c *Connector) Tables() []source.TableSchema
Tables returns the schemas of the datagov.* tables.