Documentation
¶
Overview ¶
Package ingestruri resolves connection names into ingestr URIs.
It lives outside pkg/ingestr because pkg/ingestr imports pkg/python, and pkg/python needs this resolution too.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CDC ¶
CDC rewrites uri onto its change-data-capture scheme, and fails when the scheme has no CDC counterpart.
func CDCScheme ¶
CDCScheme maps scheme onto ingestr's change-data-capture scheme and reports whether the scheme supports CDC at all.
This is not a plain "+cdc" suffix: PostgreSQL's ingestr URI uses the "postgresql" scheme but its CDC scheme is "postgres+cdc".
Supported today: PostgreSQL, the MySQL family (mysql, mariadb), Vitess, PlanetScale (ps_mysql), MongoDB (mongodb, mongodb+srv), and SQL Server (mssql).
MongoDB and SQL Server both follow the plain "+cdc" suffix rule, which yields exactly what ingestr expects: "mongodb+cdc", "mongodb+srv+cdc", "mssql+cdc". SQL Server Change Tracking ("mssql+ct") is not selected here because it depends on an asset parameter rather than the scheme alone; the ingestr operator swaps the suffix for that mode.
func ForConnection ¶
func ForConnection(ctx context.Context, conn config.ConnectionGetter, role, name string) (string, error)
ForConnection resolves name through conn and returns its ingestr URI.
role describes the connection's part in the transfer ("source", "destination") and is only used to build error messages. It may be empty.
The returned URI is not normalized; call Normalize when the URI is handed to ingestr as a source.
func Normalize ¶
Normalize ensures the URI carries the "//" authority separator after its scheme. Some source configs build URIs without a Host, which makes Go's url.URL.String() emit "scheme:?params" rather than "scheme://?params".
Types ¶
type Connection ¶
Connection is implemented by every connection type that ingestr can talk to.