Config holds the parameters to connect to a database
Handler handles a database connection
Connect creates a database connection and returns a handler
BeginEndEntityOperations creates a database transaction that locks the endentities table, this should be called before doing any lookup or generation operation with endentities.
This global lock will effectively prevent any sort of concurrent operation, which is exactly what we want in the case of key generation. Being slow and blocking is OK, risking two key generation the happen in parallel is not.
CheckConnectionContext runs a test query against the database and returns an error if it fails
GetLabelOfLatestEE returns the label of the latest end-entity for the specified signer that is no older than a given duration
Monitor queries the database every pollInterval until it gets a quit signal logging an error when the test query fails. It can be used in a goroutine to check when the database becomes unavailable.
Transaction owns a sql transaction
End commits a transaction
InsertEE uses an existing transaction to insert an end-entity in database