postgres

package
v0.0.0-...-7b34d14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresStoreConfig

type PostgresStoreConfig struct {
	// Host of the Postgres DB
	Host string `yaml:"host" envconfig:"kuma_store_postgres_host"`
	// Port of the Postgres DB
	Port int `yaml:"port" envconfig:"kuma_store_postgres_port"`
	// User of the Postgres DB
	User string `yaml:"user" envconfig:"kuma_store_postgres_user"`
	// Password of the Postgres DB
	Password string `yaml:"password" envconfig:"kuma_store_postgres_password"`
	// Database name of the Postgres DB
	DbName string `yaml:"dbName" envconfig:"kuma_store_postgres_db_name"`
	// Connection Timeout to the DB in seconds
	ConnectionTimeout int `yaml:"connectionTimeout" envconfig:"kuma_store_postgres_connection_timeout"`
	// Maximum number of open connections to the database
	// `0` value means number of open connections is unlimited
	MaxOpenConnections int `yaml:"maxOpenConnections" envconfig:"kuma_store_postgres_max_open_connections"`
	// TLS settings
	TLS TLSPostgresStoreConfig `yaml:"tls"`
}

Postgres store configuration

func DefaultPostgresStoreConfig

func DefaultPostgresStoreConfig() *PostgresStoreConfig

func (*PostgresStoreConfig) Sanitize

func (p *PostgresStoreConfig) Sanitize()

func (*PostgresStoreConfig) Validate

func (p *PostgresStoreConfig) Validate() error

type TLSMode

type TLSMode string

Modes available here https://godoc.org/github.com/lib/pq

const (
	Disable TLSMode = "disable"
	// Always TLS (skip verification)
	VerifyNone TLSMode = "verifyNone"
	// Always TLS (verify that the certificate presented by the server was signed by a trusted CA)
	VerifyCa TLSMode = "verifyCa"
	// Always TLS (verify that the certification presented by the server was signed by a trusted CA and the server host name matches the one in the certificate)
	VerifyFull TLSMode = "verifyFull"
)

type TLSPostgresStoreConfig

type TLSPostgresStoreConfig struct {
	// Mode of TLS connection. Available values (disable, verifyNone, verifyCa, verifyFull)
	Mode TLSMode `yaml:"mode" envconfig:"kuma_store_postgres_tls_mode"`
	// Path to TLS Certificate of the client. Used in require, verifyCa and verifyFull modes
	CertPath string `yaml:"certPath" envconfig:"kuma_store_postgres_tls_cert_path"`
	// Path to TLS Key of the client. Used in verifyNone, verifyCa and verifyFull modes
	KeyPath string `yaml:"keyPath" envconfig:"kuma_store_postgres_tls_key_path"`
	// Path to the root certificate. Used in verifyCa and verifyFull modes.
	CAPath string `yaml:"caPath" envconfig:"kuma_store_postgres_tls_ca_path"`
}

func DefaultTLSPostgresStoreConfig

func DefaultTLSPostgresStoreConfig() TLSPostgresStoreConfig

func (TLSPostgresStoreConfig) Sanitize

func (s TLSPostgresStoreConfig) Sanitize()

func (TLSPostgresStoreConfig) Validate

func (s TLSPostgresStoreConfig) Validate() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL