Documentation ¶
Index ¶
- func Execute()
- type TwelveFactorConnections
- func (t *TwelveFactorConnections) GetConnectionDetails(connectionName string) (*shared.ConnectionDetails, error)
- func (t *TwelveFactorConnections) GetConnectionType(connectionName string) (connectionType string, err error)
- func (t *TwelveFactorConnections) LoadConnection(connectionName string) (shared.ConnectionDetails, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type TwelveFactorConnections ¶
type TwelveFactorConnections struct{} // implements interfaces in module, actions.
func (*TwelveFactorConnections) GetConnectionDetails ¶
func (t *TwelveFactorConnections) GetConnectionDetails(connectionName string) (*shared.ConnectionDetails, error)
GetConnectionDetails expects outConnectionDetails to be a pointer to a connection-specific struct, which it fills with connection details fetched from env variables by using the connectionName to do the lookup, where the connectionName is either source or target. The connection type is picked up from the environment using variable whose name matches constant envVarSourceType and envVarTargetType respectively. If the type of outConnectionDetails does not match the type found inside the connection then an error is produced, otherwise the config keys and values are put into outConnectionDetails. TODO: add tests for GetConnectionDetails
func (*TwelveFactorConnections) GetConnectionType ¶
func (t *TwelveFactorConnections) GetConnectionType(connectionName string) (connectionType string, err error)
GetConnectionType is for use when running in twelveFactorMode. It returns the value of envVarSourceType or envVarTargetType based on the supplied connectionName,
where connectionName is expected to bee either defaultConnectionNameSource or defaultConnectionNameTarget.
It reads the global map twelveFactorVars[] which should have been setup using environment variables.
func (*TwelveFactorConnections) LoadConnection ¶
func (t *TwelveFactorConnections) LoadConnection(connectionName string) (shared.ConnectionDetails, error)
Load connection DSN from the environment, parse it based on type set in the environment and return the shared.ConnectionDetails. This mimics functionality whereby connection details are loaded from JSON config file, but reads info from the environment instead. This is used by the pipe action since the full connection details may not be saved out to the pipe config file. TODO: add test for LoadConnection
Source Files ¶
- 12factor.go
- config-conn-add-netezza.go
- config-conn-add-odbc.go
- config-conn-add-oracle.go
- config-conn-add-s3.go
- config-conn-add-snowflake.go
- config-conn-add-sqlserver.go
- config-conn-add.go
- config-conn-list.go
- config-conn-remove.go
- config-conn.go
- config-default-add.go
- config-default-list.go
- config-default-remove.go
- config-default.go
- config.go
- cp.go
- create-demo-install.go
- create-demo-uninstall.go
- create-demo.go
- create-stage.go
- create.go
- diff.go
- flags.go
- help-only-12factor.go
- pipe.go
- query.go
- root.go
- serve.go
- sync.go
- version.go