Documentation
¶
Index ¶
- func ConnectorMySQLProxy(ctx context.Context, connector schema.DatabaseConnector) (host string, port int, err error)
- func ConnectorPGProxy(ctx context.Context, connector schema.DatabaseConnector) (host string, port int, err error)
- func MySQLDBName(connector schema.DatabaseConnector) (string, error)
- func MySQLDSN(dbName string, options ...Option) string
- func PostgresDBName(connector schema.DatabaseConnector) (string, error)
- func PostgresDSN(dbName string, options ...Option) string
- func ResolveMySQLConfig(ctx context.Context, connector schema.DatabaseConnector) (*mysqlauthproxy.Config, error)
- func ResolvePostgresDSN(ctx context.Context, connector schema.DatabaseConnector) (string, error)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectorMySQLProxy ¶ added in v0.460.0
func ConnectorMySQLProxy(ctx context.Context, connector schema.DatabaseConnector) (host string, port int, err error)
ConnectorMySQLProxy creates a MySQL proxy for the given connector. It returns the local address of the proxy and an error if the proxy fails to start. The databse name of the connection to this proxy needs to match the database name in the connector.
The proxy will be automatically closed when the context is cancelled.
func ConnectorPGProxy ¶ added in v0.460.0
func ConnectorPGProxy(ctx context.Context, connector schema.DatabaseConnector) (host string, port int, err error)
ConnectorPGProxy creates a Postgres proxy for the given connector. It returns the local address of the proxy and an error if the proxy fails to start. The proxy redirects all database connections to the databse in the given connector.
The proxy will be automatically closed when the context is cancelled.
func MySQLDBName ¶ added in v0.459.0
func MySQLDBName(connector schema.DatabaseConnector) (string, error)
func PostgresDBName ¶ added in v0.460.0
func PostgresDBName(connector schema.DatabaseConnector) (string, error)
func PostgresDSN ¶
PostgresDSN returns a PostgresDSN string for connecting to a PG database.
func ResolveMySQLConfig ¶ added in v0.455.0
func ResolveMySQLConfig(ctx context.Context, connector schema.DatabaseConnector) (*mysqlauthproxy.Config, error)