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

connectors

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package connectors is the single source of truth for the Airflow connector types Dexaflow knows about. The catalog is GENERATED, not hand-written: an offline step (scripts/gen_connectors.py) asks a real Apache Airflow install for the exact connection-form metadata its UI renders (via the same HookMetaService the /ui/connections/hook_meta endpoint uses) plus the pip package each conn_type ships in, and embeds it as catalog.json. Three consumers read it so they never drift: the admin connection form (internal/api), the `connectors:` sugar expansion at compile, and compile-time dependency validation (ADR 0038). Regenerate by installing more providers and re-running the script — never edit catalog.json by hand.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PackageFor

func PackageFor(name string) (pkg string, ok bool)

PackageFor returns the pip package for a connector name — its canonical ConnectionType or any of its sugar Aliases (e.g. "gcp"). ok=false when the name is unknown OR maps to a core type with no package (nothing for `connectors:` to install), so the caller can fall back to dependencies:.

func Resolve

func Resolve(types []string) (packages, unknown []string)

Resolve expands `connectors:` short names into their pip packages, preserving order. Unknown names are returned separately so the caller can fail compile with an actionable message rather than letting a typo slip to a runtime ModuleNotFoundError. ADR 0038.

func Types

func Types() []string

Types returns the sugar-resolvable connector names (those backed by a pip package), for building error messages ("known: postgres, mysql, …").

Types

type Connector

type Connector struct {
	// ConnectionType is the Airflow conn_type, e.g. "postgres".
	ConnectionType string `json:"connection_type"`
	// HookName is the human label shown in the admin form, e.g. "Postgres".
	HookName string `json:"hook_name"`
	// HookClassName is the dotted Airflow hook class.
	HookClassName string `json:"hook_class_name"`
	// DefaultConnName is Airflow's conventional default connection id; empty for
	// core types that declare none.
	DefaultConnName string `json:"default_conn_name"`
	// PipPackage is the PyPI package that provides the hook, e.g.
	// "apache-airflow-providers-postgres". Empty for core conn types (generic,
	// email): they appear in the form but are not resolvable by the `connectors:`
	// sugar (nothing to install).
	PipPackage string `json:"pip_package"`
	// StandardFields is the per-field behavior for the built-in fields
	// (host/login/password/port/schema/description): hidden flag, relabel title,
	// and placeholder.
	StandardFields map[string]any `json:"standard_fields"`
	// ExtraFields is the provider-specific custom fields (the credential fields
	// that live in Connection.extra), each a FlexibleForm param spec.
	ExtraFields map[string]any `json:"extra_fields"`
	// Aliases are extra short names the `connectors:` sugar accepts on top of
	// ConnectionType. They are a Dexaflow overlay (see aliasOverlay), not part of
	// Airflow's metadata, and exist only to smooth Airflow's asymmetric conn_type
	// vocabulary (e.g. "gcp" for the verbose "google_cloud_platform").
	Aliases []string `json:"-"`
}

Connector is one curated connector type, mirroring a catalog.json entry. The field metadata (StandardFields/ExtraFields) is the precise shape the Airflow 3.2 SPA renders via its FlexibleForm component, so the admin form can serve it verbatim.

func Catalog

func Catalog() []Connector

Catalog returns every connector entry, including core types with no pip package — the admin form's connection-type dropdown needs the full set.

Jump to

Keyboard shortcuts

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