Documentation
¶
Index ¶
- type CustomAwsCredentialsProvider
- type CustomConnectionProvider
- func (c *CustomConnectionProvider) AcceptsStrategy(strategy string) bool
- func (c *CustomConnectionProvider) AcceptsUrl(hostInfo host_info_util.HostInfo, props map[string]string) bool
- func (c *CustomConnectionProvider) Connect(hostInfo *host_info_util.HostInfo, props map[string]string, ...) (driver.Conn, error)
- func (c *CustomConnectionProvider) GetHostInfoByStrategy(hosts []*host_info_util.HostInfo, role host_info_util.HostRole, ...) (*host_info_util.HostInfo, error)
- func (c *CustomConnectionProvider) GetHostSelectorStrategy(strategy string) (driver_infrastructure.HostSelector, error)
- type FirstHostSelector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomAwsCredentialsProvider ¶
type CustomAwsCredentialsProvider struct{}
func (CustomAwsCredentialsProvider) GetAwsCredentialsProvider ¶
func (c CustomAwsCredentialsProvider) GetAwsCredentialsProvider(hostInfo host_info_util.HostInfo, props map[string]string) (aws.CredentialsProvider, error)
type CustomConnectionProvider ¶
type CustomConnectionProvider struct {
// contains filtered or unexported fields
}
This is an example implementation of ConnectionProvider.
func (*CustomConnectionProvider) AcceptsStrategy ¶
func (c *CustomConnectionProvider) AcceptsStrategy(strategy string) bool
Adds criteria for which host selection strategies are supported. This implementation returns true if strategy is part of acceptedStrategies.
func (*CustomConnectionProvider) AcceptsUrl ¶
func (c *CustomConnectionProvider) AcceptsUrl(hostInfo host_info_util.HostInfo, props map[string]string) bool
Adds criteria for which hosts and properties are supported by this connection provider. This implementation accepts any values, meaning all connections will connect through this connection provider.
func (*CustomConnectionProvider) Connect ¶
func (c *CustomConnectionProvider) Connect(hostInfo *host_info_util.HostInfo, props map[string]string, pluginService driver_infrastructure.PluginService) (driver.Conn, error)
Creates a connection with the database. This implementation passes a dsn to its targetDriver to connect.
func (*CustomConnectionProvider) GetHostInfoByStrategy ¶
func (c *CustomConnectionProvider) GetHostInfoByStrategy(hosts []*host_info_util.HostInfo, role host_info_util.HostRole, strategy string, props map[string]string) (*host_info_util.HostInfo, error)
Selects a host from hosts using the provided strategy. This implementation passes the task to a HostSelector.
func (*CustomConnectionProvider) GetHostSelectorStrategy ¶
func (c *CustomConnectionProvider) GetHostSelectorStrategy(strategy string) (driver_infrastructure.HostSelector, error)
Returns a HostSelector that will select a preferred host from a list of hosts. This implementation will always return the corresponding HostSelector to strategy from acceptedStrategies.
type FirstHostSelector ¶
type FirstHostSelector struct { }
Additonal customization is possible through a custom HostSelector.
func (*FirstHostSelector) GetHost ¶
func (h *FirstHostSelector) GetHost(hosts []*host_info_util.HostInfo, role host_info_util.HostRole, props map[string]string) (*host_info_util.HostInfo, error)
Implements a strategy to select a host from a list of hosts. This implementation returns the first host in the list regardless of role or props.
Source Files
¶
- adfs_mysql_example.go
- adfs_postgres_example.go
- aws_credentials_provider_handler_example.go
- aws_failover_mysql_example.go
- aws_failover_postgresql_example.go
- aws_internal_connection_pool_password_warning_mysql_example.go
- aws_internal_connection_pool_password_warning_postgresql_example.go
- aws_profile_example.go
- aws_secrets_manager_mysql_example.go
- aws_secrets_manager_postgres_example.go
- aws_simple_connection_mysql_example.go
- aws_simple_connection_postgresql_example.go
- custom_connection_provider_example.go
- iam_mysql_example.go
- iam_postgres_example.go
- limitless_postgres_example.go
- okta_mysql_example.go
- okta_postgres_example.go
- read_write_splitting_mysql_example.go
- read_write_splitting_postgresql_example.go
- telemetry_metrics_otlp_example.go
- telemetry_metrics_xray_example.go