Application superstructure (or supersingleton, if you want).
Some checks failed
continuous-integration/drone/push Build is failing

Got rid of context thing which misleads due to existance of stdlib's
context package.

Also fixed golangci-lint configuration.

Fixes #20.
This commit is contained in:
2022-08-19 21:52:49 +05:00
parent b87921c811
commit 5fc6d3a181
35 changed files with 589 additions and 440 deletions

View File

@@ -25,16 +25,16 @@
package dbnotavailable
import (
"go.dev.pztrn.name/fastpastebin/internal/context"
"go.dev.pztrn.name/fastpastebin/internal/application"
)
var ctx *context.Context
var app *application.Application
// New initializes pastes package and adds necessary HTTP and API
// endpoints.
func New(cc *context.Context) {
ctx = cc
func New(cc *application.Application) {
app = cc
ctx.Echo.GET("/database_not_available", dbNotAvailableGet)
ctx.Echo.GET("/database_not_available/raw", dbNotAvailableRawGet)
app.Echo.GET("/database_not_available", dbNotAvailableGet)
app.Echo.GET("/database_not_available/raw", dbNotAvailableRawGet)
}