Documentation
¶
Index ¶
- func FormatConfigComment(key, prefix string) string
- type PgBouncerConfigGenerator
- func (g *PgBouncerConfigGenerator) AddCustomSetting(key, value string)
- func (g *PgBouncerConfigGenerator) AddDatabase(name string, config pkg.DatabaseConfig)
- func (g *PgBouncerConfigGenerator) GenerateConfig() *pkg.PgBouncerIni
- func (g *PgBouncerConfigGenerator) GenerateConfigFile() string
- func (g *PgBouncerConfigGenerator) SetDatabaseConfig(name, host string, port int, dbname, user string)
- type PgHBAConfigGenerator
- func (g *PgHBAConfigGenerator) AddApplicationEntries(database, user, network string)
- func (g *PgHBAConfigGenerator) AddDevelopmentEntries()
- func (g *PgHBAConfigGenerator) AddEntry(entry pkg.PostgrestHBA)
- func (g *PgHBAConfigGenerator) AddHostEntry(database, user, address, method string, options map[string]string)
- func (g *PgHBAConfigGenerator) AddLocalEntry(database, user, method string, options map[string]string)
- func (g *PgHBAConfigGenerator) AddNoSSLEntry(database, user, address, method string, options map[string]string)
- func (g *PgHBAConfigGenerator) AddProductionSSLEntries(allowedNetworks []string)
- func (g *PgHBAConfigGenerator) AddSSLEntry(database, user, address, method string, options map[string]string)
- func (g *PgHBAConfigGenerator) ClearEntries()
- func (g *PgHBAConfigGenerator) GenerateConfigFile() string
- func (g *PgHBAConfigGenerator) SetDefaultAuthMethod(method string)
- type PostgRESTConfigGenerator
- func (g *PostgRESTConfigGenerator) AddCustomSetting(key, value string)
- func (g *PostgRESTConfigGenerator) GenerateConfig() (*pkg.PostgrestConf, error)
- func (g *PostgRESTConfigGenerator) GenerateConfigFile() (string, error)
- func (g *PostgRESTConfigGenerator) GenerateEnvFile() (string, error)
- func (g *PostgRESTConfigGenerator) GenerateUserSetupSQL() string
- func (g *PostgRESTConfigGenerator) SetDatabaseConfig(name, host string, port int, user, password string)
- type PostgreSQLConfigGenerator
- func (g *PostgreSQLConfigGenerator) AddCustomSetting(key, value string)
- func (g *PostgreSQLConfigGenerator) GenerateConfig() *pkg.PostgresConf
- func (g *PostgreSQLConfigGenerator) GenerateConfigFile() string
- func (g *PostgreSQLConfigGenerator) SetExtensions(extensions map[string]pkg.ExtensionConfig)
- func (g *PostgreSQLConfigGenerator) SetPGAuditConf(conf *pkg.PGAuditConf)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatConfigComment ¶
Types ¶
type PgBouncerConfigGenerator ¶
type PgBouncerConfigGenerator struct {
SystemInfo *sysinfo.SystemInfo
TunedParams *pgtune.TunedParameters
DatabaseName string
DatabaseHost string
DatabasePort int
DatabaseUser string
CustomSettings map[string]string
DatabaseOverrides map[string]pkg.DatabaseConfig
// contains filtered or unexported fields
}
PgBouncerConfigGenerator generates pgbouncer.ini configuration
func NewPgBouncerConfigGenerator ¶
func NewPgBouncerConfigGenerator(sysInfo *sysinfo.SystemInfo, params *pgtune.TunedParameters) *PgBouncerConfigGenerator
NewPgBouncerConfigGenerator creates a new PgBouncer configuration generator
func (*PgBouncerConfigGenerator) AddCustomSetting ¶
func (g *PgBouncerConfigGenerator) AddCustomSetting(key, value string)
AddCustomSetting adds a custom setting to the configuration
func (*PgBouncerConfigGenerator) AddDatabase ¶
func (g *PgBouncerConfigGenerator) AddDatabase(name string, config pkg.DatabaseConfig)
AddDatabase adds a database configuration
func (*PgBouncerConfigGenerator) GenerateConfig ¶
func (g *PgBouncerConfigGenerator) GenerateConfig() *pkg.PgBouncerIni
GenerateConfig generates a PgBouncer configuration struct
func (*PgBouncerConfigGenerator) GenerateConfigFile ¶
func (g *PgBouncerConfigGenerator) GenerateConfigFile() string
GenerateConfigFile generates the actual pgbouncer.ini file content
func (*PgBouncerConfigGenerator) SetDatabaseConfig ¶
func (g *PgBouncerConfigGenerator) SetDatabaseConfig(name, host string, port int, dbname, user string)
SetDatabaseConfig sets the default database configuration
type PgHBAConfigGenerator ¶
type PgHBAConfigGenerator struct {
SystemInfo *sysinfo.SystemInfo
Entries []pkg.PostgrestHBA
DefaultAuthMethod string
}
PgHBAConfigGenerator generates pg_hba.conf configuration
func NewPgHBAConfigGenerator ¶
func NewPgHBAConfigGenerator(sysInfo *sysinfo.SystemInfo, defaultAuthMethod ...string) *PgHBAConfigGenerator
NewPgHBAConfigGenerator creates a new pg_hba.conf configuration generator
func (*PgHBAConfigGenerator) AddApplicationEntries ¶
func (g *PgHBAConfigGenerator) AddApplicationEntries(database, user, network string)
AddApplicationEntries adds entries for specific applications
func (*PgHBAConfigGenerator) AddDevelopmentEntries ¶
func (g *PgHBAConfigGenerator) AddDevelopmentEntries()
AddDevelopmentEntries adds permissive entries for development environments
func (*PgHBAConfigGenerator) AddEntry ¶
func (g *PgHBAConfigGenerator) AddEntry(entry pkg.PostgrestHBA)
AddEntry adds an authentication entry
func (*PgHBAConfigGenerator) AddHostEntry ¶
func (g *PgHBAConfigGenerator) AddHostEntry(database, user, address, method string, options map[string]string)
AddHostEntry adds a TCP/IP connection entry
func (*PgHBAConfigGenerator) AddLocalEntry ¶
func (g *PgHBAConfigGenerator) AddLocalEntry(database, user, method string, options map[string]string)
AddLocalEntry adds a local (Unix socket) connection entry
func (*PgHBAConfigGenerator) AddNoSSLEntry ¶
func (g *PgHBAConfigGenerator) AddNoSSLEntry(database, user, address, method string, options map[string]string)
AddNoSSLEntry adds a non-SSL connection entry
func (*PgHBAConfigGenerator) AddProductionSSLEntries ¶
func (g *PgHBAConfigGenerator) AddProductionSSLEntries(allowedNetworks []string)
AddProductionSSLEntries adds secure SSL entries for production
func (*PgHBAConfigGenerator) AddSSLEntry ¶
func (g *PgHBAConfigGenerator) AddSSLEntry(database, user, address, method string, options map[string]string)
AddSSLEntry adds an SSL-only connection entry
func (*PgHBAConfigGenerator) ClearEntries ¶
func (g *PgHBAConfigGenerator) ClearEntries()
ClearEntries removes all entries
func (*PgHBAConfigGenerator) GenerateConfigFile ¶
func (g *PgHBAConfigGenerator) GenerateConfigFile() string
GenerateConfigFile generates the actual pg_hba.conf file content
func (*PgHBAConfigGenerator) SetDefaultAuthMethod ¶
func (g *PgHBAConfigGenerator) SetDefaultAuthMethod(method string)
SetDefaultAuthMethod updates the default authentication method
type PostgRESTConfigGenerator ¶
type PostgRESTConfigGenerator struct {
SystemInfo *sysinfo.SystemInfo
TunedParams *pgtune.TunedParameters
DatabaseName string
DatabaseHost string
DatabasePort int
DatabaseUser string
DatabasePass string
CustomSettings map[string]string
// contains filtered or unexported fields
}
PostgRESTConfigGenerator generates PostgREST configuration
func NewPostgRESTConfigGenerator ¶
func NewPostgRESTConfigGenerator(sysInfo *sysinfo.SystemInfo, params *pgtune.TunedParameters) *PostgRESTConfigGenerator
NewPostgRESTConfigGenerator creates a new PostgREST configuration generator
func (*PostgRESTConfigGenerator) AddCustomSetting ¶
func (g *PostgRESTConfigGenerator) AddCustomSetting(key, value string)
AddCustomSetting adds a custom setting to the configuration
func (*PostgRESTConfigGenerator) GenerateConfig ¶
func (g *PostgRESTConfigGenerator) GenerateConfig() (*pkg.PostgrestConf, error)
GenerateConfig generates a PostgREST configuration struct
func (*PostgRESTConfigGenerator) GenerateConfigFile ¶
func (g *PostgRESTConfigGenerator) GenerateConfigFile() (string, error)
GenerateConfigFile generates the actual PostgREST configuration file content
func (*PostgRESTConfigGenerator) GenerateEnvFile ¶
func (g *PostgRESTConfigGenerator) GenerateEnvFile() (string, error)
GenerateEnvFile generates a .env file for PostgREST
func (*PostgRESTConfigGenerator) GenerateUserSetupSQL ¶
func (g *PostgRESTConfigGenerator) GenerateUserSetupSQL() string
GenerateUserSetupSQL generates SQL commands to set up PostgREST users and roles
func (*PostgRESTConfigGenerator) SetDatabaseConfig ¶
func (g *PostgRESTConfigGenerator) SetDatabaseConfig(name, host string, port int, user, password string)
SetDatabaseConfig sets the database connection parameters
type PostgreSQLConfigGenerator ¶
type PostgreSQLConfigGenerator struct {
SystemInfo *sysinfo.SystemInfo
TunedParams *pgtune.TunedParameters
CustomSettings map[string]string
// contains filtered or unexported fields
}
PostgreSQLConfigGenerator generates postgresql.conf configuration
func NewPostgreSQLConfigGenerator ¶
func NewPostgreSQLConfigGenerator(sysInfo *sysinfo.SystemInfo, params *pgtune.TunedParameters) *PostgreSQLConfigGenerator
NewPostgreSQLConfigGenerator creates a new PostgreSQL configuration generator
func (*PostgreSQLConfigGenerator) AddCustomSetting ¶
func (g *PostgreSQLConfigGenerator) AddCustomSetting(key, value string)
AddCustomSetting adds a custom setting to the configuration
func (*PostgreSQLConfigGenerator) GenerateConfig ¶
func (g *PostgreSQLConfigGenerator) GenerateConfig() *pkg.PostgresConf
GenerateConfig generates a PostgreSQL configuration struct
func (*PostgreSQLConfigGenerator) GenerateConfigFile ¶
func (g *PostgreSQLConfigGenerator) GenerateConfigFile() string
GenerateConfigFile generates the actual postgresql.conf file content
func (*PostgreSQLConfigGenerator) SetExtensions ¶
func (g *PostgreSQLConfigGenerator) SetExtensions(extensions map[string]pkg.ExtensionConfig)
SetExtensions sets the extensions configuration
func (*PostgreSQLConfigGenerator) SetPGAuditConf ¶
func (g *PostgreSQLConfigGenerator) SetPGAuditConf(conf *pkg.PGAuditConf)
SetPGAuditConf sets the PGAudit configuration