Help us shape the future of Go! Take the 2026 Go Developer Survey

ckan

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2026 License: MIT Imports: 11 Imported by: 0

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

func New(params map[string]any) (source.Connector, error)

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, else params "api_key_func"/"api_key_command" — see source.Credential). 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.

Jump to

Keyboard shortcuts

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