Documentation ¶
Index ¶
Constants ¶
const ( DBUser = "DB_USER" DBPassword = "DB_PASSWORD" DBHost = "DB_HOST" DBPort = "DB_PORT" DBSvc = "DB_SVC" )
Variables ¶
var ErrRetryCount = errors.New("Retry count must be greater than 1")
ErrRetryCount is used to indicate invalid retry count values passed to OpenAndConnect.
Functions ¶
func BuildConnectString ¶
BuildConnectString builds an Oracle connect string from its constituent parts.
func IsConnectionError ¶
IsConnectionError returns error if the argument is a connection error
Types ¶
type EnvConfig ¶
func NewEnvConfig ¶
func (*EnvConfig) ConnectString ¶
func (*EnvConfig) MaskedConnectString ¶
type OracleDB ¶
OracleDB embeds sql.DB and extends it with the ability to retry connecting to the database when errors occur, detecting certain disconnections, and reconnecting to the database.
func OpenAndConnect ¶
OpenAndConnect attempts to open a connection to Oracle as specified in the provided connection string. The connection is considered open when Ping returns with a nil error. The connection Ping is is tried the number of times indicated by the retry count, with a sleep delay of the current attempt in seconds, i.e. 1s, 2s, 3s ... retryCount