Database dialects, proper database shutdown, pagination in configuration.

Added possibility to use different database (storage) backends. Currently
supported: flatfiles and mysql. Fixes #2.

Added database shutdown call. This call will properly shutdown database
connections (in case of RDBMS) or flush pastes index cache on disk (in
case of flatfiles).

De-hardcoded pagination count. Fixes #12.
This commit is contained in:
2018-05-27 12:25:01 +05:00
parent 296e2771d6
commit 0cca0f453f
22 changed files with 854 additions and 175 deletions

View File

@@ -146,4 +146,6 @@ func (c *Context) RegisterEcho(e *echo.Echo) {
// Shutdown shutdowns entire application.
func (c *Context) Shutdown() {
c.Logger.Info().Msg("Shutting down Fast Pastebin...")
c.Database.Shutdown()
}

View File

@@ -26,7 +26,7 @@ package context
const (
// Version .
Version = "0.1.1"
Version = "0.1.2-dev"
)
// New creates new context.