summaryrefslogtreecommitdiff
path: root/src/cmd/mediocre-blog/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/mediocre-blog/main.go')
-rw-r--r--src/cmd/mediocre-blog/main.go47
1 files changed, 0 insertions, 47 deletions
diff --git a/src/cmd/mediocre-blog/main.go b/src/cmd/mediocre-blog/main.go
index ee09f92..71e6e7b 100644
--- a/src/cmd/mediocre-blog/main.go
+++ b/src/cmd/mediocre-blog/main.go
@@ -11,13 +11,10 @@ import (
cfgpkg "github.com/mediocregopher/blog.mediocregopher.com/srv/cfg"
"github.com/mediocregopher/blog.mediocregopher.com/srv/gmi"
"github.com/mediocregopher/blog.mediocregopher.com/srv/http"
- "github.com/mediocregopher/blog.mediocregopher.com/srv/mailinglist"
"github.com/mediocregopher/blog.mediocregopher.com/srv/post"
"github.com/mediocregopher/blog.mediocregopher.com/srv/post/asset"
- "github.com/mediocregopher/blog.mediocregopher.com/srv/pow"
"github.com/mediocregopher/mediocre-go-lib/v2/mctx"
"github.com/mediocregopher/mediocre-go-lib/v2/mlog"
- "github.com/tilinna/clock"
)
func main() {
@@ -31,18 +28,6 @@ func main() {
defer dataDir.Close()
ctx = mctx.WithAnnotator(ctx, &dataDir)
- var powMgrParams pow.ManagerParams
- powMgrParams.SetupCfg(cfg)
- ctx = mctx.WithAnnotator(ctx, &powMgrParams)
-
- var mailerParams mailinglist.MailerParams
- mailerParams.SetupCfg(cfg)
- ctx = mctx.WithAnnotator(ctx, &mailerParams)
-
- var mlParams mailinglist.Params
- mlParams.SetupCfg(cfg)
- ctx = mctx.WithAnnotator(ctx, &mlParams)
-
var httpParams http.Params
httpParams.SetupCfg(cfg)
ctx = mctx.WithAnnotator(ctx, &httpParams)
@@ -64,36 +49,6 @@ func main() {
logger.Fatal(ctx, "initializing", err)
}
- clock := clock.Realtime()
-
- powStore := pow.NewMemoryStore(clock)
- defer powStore.Close()
-
- powMgrParams.Store = powStore
- powMgrParams.Clock = clock
-
- powMgr := pow.NewManager(powMgrParams)
-
- var mailer mailinglist.Mailer
- if mailerParams.SMTPAddr == "" {
- logger.Info(ctx, "-smtp-addr not given, using a fake Mailer")
- mailer = mailinglist.NewLogMailer(logger.WithNamespace("fake-mailer"))
- } else {
- mailer = mailinglist.NewMailer(mailerParams)
- }
-
- mlStore, err := mailinglist.NewStore(dataDir)
- if err != nil {
- logger.Fatal(ctx, "initializing mailing list storage", err)
- }
- defer mlStore.Close()
-
- mlParams.Store = mlStore
- mlParams.Mailer = mailer
- mlParams.Clock = clock
-
- ml := mailinglist.New(mlParams)
-
postSQLDB, err := post.NewSQLDB(dataDir)
if err != nil {
logger.Fatal(ctx, "initializing sql db for post data", err)
@@ -114,12 +69,10 @@ func main() {
httpParams.Logger = logger.WithNamespace("http")
httpParams.Cache = cache
- httpParams.PowManager = powMgr
httpParams.PostStore = postStore
httpParams.PostAssetStore = postAssetStore
httpParams.PostAssetLoader = postAssetLoader
httpParams.PostDraftStore = postDraftStore
- httpParams.MailingList = ml
httpParams.GeminiPublicURL = gmiParams.PublicURL
logger.Info(ctx, "starting http api")