Versions in this module Expand all Collapse all v0 v0.1.0 Sep 13, 2023 Changes in this version + type Config struct + DatabaseName string + Host string + Password string + Port int + SSLCACert string + SSLCAKey string + SSLMode v1alpha1.PostgresSSLMode + SSLUserCert string + SSLUserKey string + User string + func NewConfig(host string, port int, user, pass, dbname string, ...) *Config + func (c *Config) Close() error + func (c *Config) ConnString() (string, error) + func (c *Config) Copy() *Config + func (c *Config) CreateCerts() bool + type Postgresql struct + func NewPostgresql(c connection.Connection, config *Config, logger logr.Logger) *Postgresql + func (p *Postgresql) ApplyPrivileges(ctx context.Context, username string, privileges []v1alpha1.PrivilegeSpec) error + func (p *Postgresql) Close(ctx context.Context) error + func (p *Postgresql) Connect(ctx context.Context) error + func (p *Postgresql) CreateUser(ctx context.Context, username, password string) (map[string]string, error) + func (p *Postgresql) DeleteUser(ctx context.Context, username string) error + func (p *Postgresql) RevokePrivileges(ctx context.Context, username string, privileges []v1alpha1.PrivilegeSpec) error v0.0.5 Jan 14, 2023 v0.0.4 Nov 2, 2022 v0.0.3 Nov 2, 2022 Changes in this version + const NotAPostgresError + func EscapeLiteral(str string) string + func EscapeLiteralWithoutQuotes(str string) string + func EscapeString(str string) string + func GenPostgresCertFromCA(userName string, secretData map[string][]byte) (map[string][]byte, error) + func IgnoreAlreadyExists(err error) error + func Intersect(set1, set2 []authv1alpha1.Privilege) []authv1alpha1.Privilege + func IntersectDefinedPrivsWithDB(definedPrivs, dbPrivsMap map[authv1alpha1.Privilege]struct{}) ([]authv1alpha1.Privilege, []authv1alpha1.Privilege) + func IsAlreadyExists(err error) bool + func NewPostgresFromConfig(config *authv1alpha1.Config, userResource *authv1alpha1.User, ...) common.DatabaseInterface + func ProcessToPostgressError(err error) string + type DBType = string + const CockroachDB + const PostgreSQL + type Postgres struct + func NewPostgres(config *PostgresConfig, configResource *authv1alpha1.PostgreSQLConfig, ...) *Postgres + func (p *Postgres) Close(ctx context.Context) + func (p *Postgres) Connect(ctx context.Context) error + func (p *Postgres) DeleteUser(ctx context.Context) error + func (p *Postgres) ProcessUser(ctx context.Context) error + type PostgresConfig struct + Dbname string + Host string + Password string + Port int + SSLCACert string + SSLMode database.PostgresSSLMode + SSLUserCert string + SSLUserKey string + User string + func NewPostgresConfig(host string, port int, user, pass, dbname string, ...) *PostgresConfig + func (c *PostgresConfig) GetConfig() string + func (in *PostgresConfig) Copy() *PostgresConfig