Documentation
¶
Index ¶
Constants ¶
View Source
const (
ProxyKindName = "sqlproxy"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Driver Driver `json:"driver" yaml:"driver"`
// Host is the hostname required to contact the datasource
Host string `json:"host" yaml:"host"`
// Database is the database for the datasource
Database string `json:"database" yaml:"database"`
// Secret is the name of the secret that should be used for the proxy or discovery configuration
// It will contain any sensitive information such as username, password, token, certificate.
Secret string `json:"secret,omitempty" yaml:"secret,omitempty"`
// MySQL specific driver config
MySQL *MySQLConfig `json:"mysql,omitempty" yaml:"mysql,omitempty"`
// Postgres specific driver config
Postgres *PostgresConfig `json:"postgres,omitempty" yaml:"postgres,omitempty"`
}
func (*Config) UnmarshalJSON ¶
type MySQLConfig ¶
type MySQLConfig struct {
Params map[string]string `json:"params,omitempty" yaml:"params,omitempty"`
MaxAllowedPacket int `json:"maxAllowedPacket,omitempty" yaml:"maxAllowedPacket,omitempty"`
Timeout time.Duration `json:"timeout,omitempty" yaml:"timeout,omitempty"`
ReadTimeout time.Duration `json:"readTimeout,omitempty" yaml:"readTimeout,omitempty"`
WriteTimeout time.Duration `json:"writeTimeout,omitempty" yaml:"writeTimeout,omitempty"`
}
type PostgresConfig ¶
type PostgresConfig struct {
// MaxConns is the maximum size of the pool
MaxConns int32 `json:"maxConns,omitempty" yaml:"maxConns,omitempty"`
// ConnectTimeout the timeout value used for socket connect operations.
ConnectTimeout time.Duration `json:"connectTimeout,omitempty" yaml:"connectTimeout,omitempty"`
// PrepareThreshold specifies the number of PreparedStatement executions that must occur before the driver begins using server-side prepared statements.
PrepareThreshold *int `json:"prepareThreshold,omitempty" yaml:"prepareThreshold,omitempty"`
// SSLMode to use when connecting to postgres
SSLMode SSLMode `json:"sslMode,omitempty" yaml:"sslMode,omitempty"`
// Options specifies command-line options to send to the server at connection start
Options string `json:"options,omitempty" yaml:"options,omitempty"`
}
func (*PostgresConfig) UnmarshalJSON ¶
func (p *PostgresConfig) UnmarshalJSON(data []byte) error
func (*PostgresConfig) UnmarshalYAML ¶
func (p *PostgresConfig) UnmarshalYAML(unmarshal func(any) error) error
Click to show internal directories.
Click to hide internal directories.