example

package
v0.0.0-...-051c767 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//AWSREGION is the aws region where your postgres credentials are stored
	AWSREGION = "us-west-2"
	//SECRETENTRY is the entry name where credentials are stored
	SECRETENTRY = "mysecretmanagerentry"
	//DEFAULTSETMAXOPENCONNS - default for max open connections
	DEFAULTSETMAXOPENCONNS = 5
	//DEFAULTSETMAXIDLECONNS - default for max idle connections in the pool
	DEFAULTSETMAXIDLECONNS = 2
	//DEFAULTSETCONNMAXLIFETIMEINHOURS - default for max lifetime of each connection.
	//After the expiry of this window is when the rotation of the active credential happens
	DEFAULTSETCONNMAXLIFETIMEINHOURS = 24
	//DEFAULTSSLMODE - default for SSL Mode setting
	DEFAULTSSLMODE = "require"

	//DBNAME - change this to your db's name
	DBNAME = "mypostgres"
	//DBADDR - change this to your db's address
	DBADDR = "localhost"
)

Variables

This section is empty.

Functions

func NewRotatingCredentialsDB

func NewRotatingCredentialsDB(logger *log.Logger) (*sqlx.DB, error)

NewRotatingCredentialsDB returns the rotating credentials postgres connection.

Types

This section is empty.

Jump to

Keyboard shortcuts

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