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

source

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package source defines the Source abstraction and a registry of source implementations keyed by connection type. Each source connects to a database, extracts a source-neutral model.Service tree (already filtered), and closes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(connType string, f Factory)

Register associates a connection type (case-insensitive, e.g. "postgres") with a factory. It is intended to be called from source package init functions.

Types

type Factory

type Factory func(src config.Source) (Source, error)

Factory builds a Source from the parsed source section of a workflow config.

type Source

type Source interface {
	// Prepare opens connections and validates that extraction can proceed.
	Prepare(ctx context.Context) error
	// Extract pulls the full, filtered metadata hierarchy.
	Extract(ctx context.Context) (*model.Service, error)
	// Close releases any open resources.
	Close() error
}

Source extracts metadata from a single database service.

func New

func New(src config.Source) (Source, error)

New constructs the Source for the given config, dispatching on the connection type reported by the parsed serviceConnection.config.

Directories

Path Synopsis
Package clickhouse extracts schema metadata from a ClickHouse service.
Package clickhouse extracts schema metadata from a ClickHouse service.
Package mysql extracts schema metadata from a MySQL service.
Package mysql extracts schema metadata from a MySQL service.
Package postgres extracts schema metadata from a PostgreSQL service.
Package postgres extracts schema metadata from a PostgreSQL service.

Jump to

Keyboard shortcuts

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